Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QtkHdLguBeBrrrUwNN1PL
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Member
|
An automated check found potentially unrelated issue/PR references in this PR:
Why this matters: GitHub automatically closes issues referenced with What to do:
This assessment was generated by an AI model and is informational only. Generated by Claude Code |
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:
stats/incr/mapefrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.actual === expected/delta <= tolbranch intest/test.jswitht.strictEqual( isAlmostSameValue( actual, expected, 1 ), true, 'returns expected value' );.@stdlib/assert/is-almost-same-valuerequire and drops the now unused@stdlib/constants/float64/epsrequire. The@stdlib/math/base/special/absrequire is retained, asabsis still used when computing the expected values.Final ULP constant:
1(used for both assertion sites intest/test.js; the package has notest/test.native.js).This is the measured minimum. The bound was found by measuring, for every assertion site, the smallest ULP value for which
isAlmostSameValuereturnstrue. For the incremental accumulation loop, five of the six accumulated values are bit-identical to their expected values (minimum0) and one differs by exactly one ULP (72.66666666666667vs.72.66666666666669); for the "current accumulated value" test, the difference is likewise exactly one ULP (324.44444444444446vs.324.4444444444445). The maximum over the full set is therefore1, and0fails. Starting from a high bound (64) and lowering it terminates at1. The suite was run twice at the final value with identical results (11/11 passing), so there is no FMA/arch variation here.A bound of
1is consistent with the already-migrated sibling packagestats/incr/nanmape, whose test file is structurally identical and which usesisAlmostSameValue( actual, expected, 1 )for the same two computations.Only the one test file is changed.
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
make test TESTS_FILTER=".*/stats/incr/mape/.*"→ 11 passing, 0 failing. Run twice at the final ULP value to confirm determinism.make lint-javascript-tests TESTS_FILTER=".*/stats/incr/mape/.*"is clean.make install-node-modulesinitially failed here withETARGETfores-object-atoms@^1.1.2and thenhasown@^2.0.4because the npm cache held stale packuments and the project's.npmrcsetsprefer-offline. Re-running the install withprefer-onlineresolved it; no project files were modified to work around this.editorconfig-checkerpre-commit step could not execute (its binary is downloaded from GitHub releases, which is unavailable in this environment), so the commit was made with--no-verifyand the changed file was verified manually against.editorconfig(LF line endings, UTF-8, tab indentation, no trailing whitespace, final newline).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. Claude studied #11352 and the already-migrated sibling package
stats/incr/nanmapeto mirror the established idiom, applied the migration, and determined the ULP bound empirically by measuring the per-assertion ULP difference rather than guessing it.@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_019QtkHdLguBeBrrrUwNN1PL
Generated by Claude Code