test: migrate math/base/special/ellipk to ULP-based assertions - #13943
Draft
kgryte wants to merge 1 commit into
Draft
test: migrate math/base/special/ellipk to ULP-based assertions#13943kgryte wants to merge 1 commit into
math/base/special/ellipk to ULP-based assertions#13943kgryte wants to merge 1 commit into
Conversation
Migrate the fixture-based tests from relative tolerance testing to ULP difference testing using `@stdlib/assert/is-almost-same-value`. The ULP bounds are the measured minimum over each full fixture set and are identical for the JavaScript and native implementations. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014DdacVDaTqzaNwnp2NRFn7
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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:
math/base/special/ellipkfrom relative tolerance testing (delta <= tol, wheretol = C * EPS * abs( expected[ i ] )) to ULP difference testing using@stdlib/assert/is-almost-same-value.test/test.jsandtest/test.native.js.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires from both test files.Each assertion uses the
t.strictEqual( isAlmostSameValue( y, expected[ i ], N ), true, 'returns expected value' )shape, whereNis inlined per test body, matching the idiom used in previously merged conversions.The ULP bounds are the measured minimum over each full fixture set (4000 cases per fixture):
fixtures/cpp/medium_positive.json25.0 * EPS25fixtures/cpp/close_to_unity.json8000.0 * EPS12065fixtures/cpp/medium_negative.json1.5 * EPS2fixtures/cpp/large_negative.json1e9 * EPS204773163Notes on how the bounds were determined:
@stdlib/number/float64/base/ulp-difference, taking the per-fixture maximum.lib/main.js) and the native implementation (lib/native.js, built viamake install-node-addons). Both implementations yield identical maxima, sotest.jsandtest.native.jsuse the same values.medium_positive,close_to_unity, andlarge_negative, and three failing cases formedium_negative.test.jsandtest.native.jseach report 16007/16007 passing on both runs, and the native add-on was built locally so thattest.native.jswas exercised rather than skipped.large_negativereflects the pre-existing1e9 * EPSrelative tolerance for that fixture; the measured maximum is roughly a factor of five tighter.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
Only the two test files are changed; no
package.jsonor source changes were required.One environment note: the
lint-editorconfig-filesstep could not run locally, as downloading theeditorconfig-checkerbinary is blocked in this environment. The relevant EditorConfig rules (LF line endings, UTF-8, tab indentation, no trailing whitespace, final newline) were instead verified manually, andmake lint-javascript-tests TESTS_FILTER=".*/math/base/special/ellipk/.*"passes cleanly.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running as an unattended scheduled task. It studied the migration idiom from previously merged conversions, applied the migration, measured the minimum ULP bounds for both the JavaScript and native implementations, and verified tightness and determinism locally.
@stdlib-js/reviewers