test: migrate stats/base/dists/chisquare/cdf to ULP-based assertions - #13868
test: migrate stats/base/dists/chisquare/cdf to ULP-based assertions#13868Planeshifter wants to merge 1 commit into
stats/base/dists/chisquare/cdf to ULP-based assertions#13868Conversation
|
Hello! Thank you for your contribution to stdlib. We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:
This acknowledgment confirms that you've read the guidelines, which include:
We can't review or accept contributions without this acknowledgment. Thank you for your understanding and cooperation. We look forward to reviewing your contribution! |
Coverage Report
The above coverage report was generated for the changes in this PR. |
|
You need to update the OP above according to #13868 (comment). |
Description
Migrates the
stats/base/dists/chisquare/cdftest suite from the old computed-tolerance idiom (delta/tolderived fromEPS) to ULP-based assertions using@stdlib/assert/is-almost-same-value, per #11352.Converted files:
test/test.cdf.jstest/test.factory.jstest/test.native.jstest/test.jswas left untouched (it only contains the exports smoke test; no tolerance comparisons).ULP bound
All three files share the same fixture set (
test/fixtures/julia/decimal_decimal.json) and the same underlying computation, so a single ULP constant was used across all of them:isAlmostSameValue( y, expected[i], 76 )The bound of
76was found by computing the exact ULP difference between actual and expected values across the full fixture (5015 cases) using@stdlib/number/float64/base/ulp-difference; the maximum observed difference was76ULPs. The full test suite was run twice at this bound to confirm deterministic results (no FMA/arch flakiness).Verification
test/test.cdf.js: 5015/5015 passing (run twice)test/test.factory.js: 5015/5015 passing (run twice)test/test.js: 3/3 passingtest/test.native.js: no native binding available in this environment, so the (skip-gated) tests did not execute; the conversion mirrors the JS test files exactly.package.jsondid not need updates since@stdlib/assert/is-almost-same-valueresolves via the existing monorepo module resolution (no explicitdevDependenciesentries are used elsewhere in this package either).eslintcould not be run to completion in this sandboxed session due to an unrelated dependency-resolution issue in the reconstructed lint toolchain (reproduces identically on an already-merged, unmodified test file, so it is an environment/tooling issue, not something introduced by this diff). The diff was manually checked against the exact conventions used in prior merged conversions (e.g. test: migratemath/base/special/cscto ULP-based assertions #13828, test: migratemath/base/special/roundnto ULP-based assertions #13857, test: migratestats/base/dists/t/quantileto ULP-based assertions #13847) — require ordering, removal of now-unusedabs/EPS/delta/tol, and thet.strictEqual( isAlmostSameValue( actual, expected, N ), true, 'returns expected value' )shape.Ref: #11352
Generated by Claude Code