Repository navigation
test: migrate simulate/iter/hann-pulse to ULP-based assertions - #15398
Merged
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VEteurLjXqZToc9rcqJLbv
Contributor
Coverage ReportNo coverage information available. |
Member
|
/stdlib merge |
…ate-iter-hann-pulse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves a part of #11352.
Description
This pull request:
simulate/iter/hann-pulse'stest/test.jsfrom relative-tolerance (EPS-based) floating-point assertions to ULP-based assertions using@stdlib/assert/is-almost-same-value.delta/tolcomputations, along with the surroundingif ( actual.value === expected[ i ].value ) { ... } else { ... }guard, in favor of a singlet.strictEqual( isAlmostSameValue( actual.value, expected[ i ].value, N ), true, 'returns expected value' ), mirroring the idiom used in previously merged conversions for sibling packages in the same family (e.g.,simulate/iter/bartlett-hann-pulse,simulate/iter/flat-top-pulse,simulate/iter/sawtooth-wave).absandEPSrequires, and adds the@stdlib/assert/is-almost-same-valuerequire in the same position used by the already-converted sibling packages.Measured minimum
The bounds were not guessed. Each assertion site was instrumented to record the actual
@stdlib/number/float64/base/ulp-differencebetween the returned and expected value across every iteration, together with whether every pair was bit-identical underis-same-value:Every comparison is exactly bit-identical, so 0 is the tightest attainable bound for all 9 sites (
isAlmostSameValuedispatches toisSameValuewhenmaxULP === 0, which also distinguishes-0from+0, so this is the strictest form of the assertion and cannot be lowered further). This matches the bound used by the already-converted sibling packages in this family.The suite was run twice at the final bounds with identical, fully passing results, confirming there is no FMA/arch-dependent variation.
Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
No.
Other
Verified via:
3281/3281 assertions pass, both before and after the change — the assertion count is unchanged, since the previous
if/elseguard contributed exactly one assertion per iteration, as does the new single assertion.eslintrun against the changed file usingetc/eslint/.eslintrc.tests.jsreports no issues. Onlytest/test.jswas changed; this package has notest.native.js.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code (an autonomous coding agent), which searched for a qualifying candidate package, studied prior merged conversions for the same idiom (preferring sibling packages in the same family), performed the migration, and empirically determined the minimum ULP bounds described above by measuring actual ULP differences and confirming determinism through repeated test runs.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01VEteurLjXqZToc9rcqJLbv
Generated by Claude Code