Repository navigation
Conversation
Replaces relative tolerance comparisons in the test suite with `@stdlib/assert/is-almost-same-value` ULP difference assertions, mirroring the already migrated sibling package `simulate/iter/cosine-wave`. All seven comparison sites were tightened to the measured minimum of `0` ULP (i.e., the generated waveform values match the expected values exactly), and the suite was run twice to confirm determinism. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ph1q1qvMPF9P3enTZvGwaT
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This branch has not been deployed
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/sine-wavefrom relative tolerance testing to ULP difference testing using@stdlib/assert/is-almost-same-value.if ( actual.value === expected[ i ].value ) { ... } else { delta/tol ... }comparison with a singlet.strictEqual( isAlmostSameValue( actual.value, expected[ i ].value, 0 ), true, 'returns expected value' );.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires, along with the now unuseddeltaandtollocal variables.ULP bound
All 7 comparison sites use a ULP bound of
0, which is the measured minimum.To determine the bound, each comparison was instrumented to compute the smallest
maxULPfor whichisAlmostSameValuereturnstrue(via exponential growth followed by a binary search), and the maximum such value was taken across the full set of expected values at each site. Every site reported a minimum of0; i.e., the generated waveform values match the expected values exactly, so no non-zero accuracy budget is required. The suite was then run twice at the final bound to confirm determinism.This matches the bound already used by the previously migrated sibling package
simulate/iter/cosine-wave, whose test suite has the same structure.Verification
make test TESTS_FILTER=".*/simulate/iter/sine-wave/.*"→ 231 passing, 0 failing (run twice, identical results).etc/eslint/.eslintrc.tests.js.Related Issues
No.
Questions
No.
Other
The expected values in this suite were already matched exactly by the implementation, so the previous relative tolerance branch was never exercised. Migrating to a
0ULP bound therefore preserves the existing test behavior while expressing the accuracy requirement in ULPs.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by Claude Code running as an unattended scheduled task. It studied #11352 and the already migrated sibling package
simulate/iter/cosine-waveto match the established idiom, applied the migration, determined the minimum ULP bound empirically by instrumenting the comparisons, and verified the result with the package test suite and ESLint.@stdlib-js/reviewers
Generated by Claude Code