Repository navigation
test: migrate stats/base/dists/logistic/mode to ULP-based assertions - #15597
Merged
Merged
Conversation
Replace the computed relative-tolerance comparison in the fixture loop with `isAlmostSameValue` in order to assert accuracy in terms of ULP difference. All 100 fixture values are returned exactly, and thus the tightest bound is zero ULP. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014sB2jTL6Yirx4GvtNhCEHj
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.
Description
This pull request:
@stdlib/stats/base/dists/logistic/modetests from the computed relative-tolerance idiom to ULP-based assertions, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tolcomparison in the fixture loop oftest/test.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' ).@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires and adds@stdlib/assert/is-almost-same-value.Final ULP constant:
0.The previous tolerance was
1.0 * EPS * abs( expected[ i ] ). Starting from a high bound and tightening, the measured minimum over the full 100-value Julia fixture set is 0 ULP — every fixture value is returned exactly (mode( mu, s )returnsmuunchanged), so no ULP slack is required at all.0is the tightest representable bound, andisAlmostSameValue( x, y, 0 )was confirmed to be strict (it rejects a 1-ULP perturbation), so the assertion is not vacuous.test/test.native.jsis intentionally not modified: it contains no computed-tolerance idiom, already asserting exact equality directly.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
Verification performed locally:
make test TESTS_FILTER=".*/stats/base/dists/logistic/mode/.*"→test/test.js: 110/110 passing. Run twice at the final bound of0with identical results, confirming no FMA/architecture-dependent flakiness.test/test.native.jsskips, as the native add-on is not built in this environment.make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/logistic/mode/.*"→ clean.test/test.jsis the only changed file.One caveat worth flagging for the reviewer:
make lint-editorconfig-filescould not run in this environment, because it downloads theeditorconfig-checkerbinary from a GitHub repository that is outside this session's allowed scope. EditorConfig conformance for the changed file (LF endings, UTF-8, tab indentation, no trailing whitespace, final newline) was therefore verified manually instead, and the commit was made with--no-verifyfor that reason alone. CI should be considered authoritative here.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 a scheduled unattended task configured by @kgryte. Claude selected the package, studied already-converted packages in the same family (
stats/base/dists/weibull/mode,stats/base/dists/invgamma/mode,stats/base/dists/frechet/quantile) to mirror the established idiom, applied the edit, measured the minimum passing ULP bound, and ran the tests and linters. It is opened as a draft for human review. Note that #11352 discourages AI-authored contributions; this run is an explicitly configured maintainer automation rather than an outside contribution, and is disclosed here accordingly.@stdlib-js/reviewers
Generated by Claude Code