test: migrate stats/base/dists/pareto-type1/median to ULP-based assertions - #14155
Draft
kgryte wants to merge 1 commit into
Draft
test: migrate stats/base/dists/pareto-type1/median to ULP-based assertions#14155kgryte wants to merge 1 commit into
stats/base/dists/pareto-type1/median to ULP-based assertions#14155kgryte wants to merge 1 commit into
Conversation
…ertions Replaces the relative tolerance (`EPS`/`delta`/`tol`) comparison in the fixture loop with an ULP-based assertion using `@stdlib/assert/is-almost-same-value`. The ULP bound was tightened to the measured minimum (0), as every returned value is bit-identical to the Julia reference value. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XyseKi76BWSB497twpHsGa
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/pareto-type1/mediantests from relative tolerance (EPS/delta/tol) comparisons to ULP-based assertions using@stdlib/assert/is-almost-same-value, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.Converted files:
test/test.jsThe package has no
test/test.native.js(no C implementation is currently present indevelop), sotest/test.jsis the only test file in the package.ULP bounds
The single fixture loop (
fixtures/julia/data.json, 1000 cases) uses:test.js1.0 * EPS * abs( expected[i] )00The bound was determined empirically. Starting from
64, the constant was lowered until the suite no longer passed; it passed at every step down to and including0. Independently, the ULP distance was computed via@stdlib/number/float64/base/ulp-differencefor all 1000 fixture cases, and the maximum observed distance was0— i.e., every returned value is bit-identical to the Julia reference value, so0is the tightest possible bound. The suite was run twice at the final value to confirm determinism (1014/1014 assertions passing on both runs).Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Resolves a part of #11352.
Questions
No.
Other
make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/pareto-type1/median/.*"(clean).editorconfig-checkerpre-commit step could not download its binary in this environment; EditorConfig compliance (LF line endings, tab indentation, no trailing whitespace, final newline) was verified manually instead.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code, which studied the prior ULP migrations in this family (e.g.
stats/base/dists/pareto-type1/quantile,stats/base/dists/pareto-type1/kurtosis,stats/base/dists/signrank/quantile), applied the same idiom, and measured the minimum ULP bound over the full fixture set.@stdlib-js/reviewers
Generated by Claude Code