Skip to content

test: migrate math/base/special/logaddexp to ULP-based testing - #13691

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-logaddexp
Draft

test: migrate math/base/special/logaddexp to ULP-based testing#13691
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-logaddexp

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates test/test.js and test/test.native.js in @stdlib/math/base/special/logaddexp from relative-tolerance (EPS-based) assertions to exact-equality assertions, per the ULP-based testing migration tracked in [RFC]: Migrate math/base/special packages from relative tolerance testing to ULP difference testing (tracking issue) #11352
  • computes the ULP difference between actual and expected fixture values for the full 1000-case fixture set (test/fixtures/python/data.json); the measured maximum ULP difference is 0 for every case (all 1000 assertions match the expected value exactly), so — mirroring the precedent set in math/base/special/sqrt (test: migrate math/base/special/sqrt to ULP-based testing #12764) — plain t.strictEqual( v, expected[ i ], 'returns expected value' ) is used instead of isAlmostSameValue, and no @stdlib/assert/is-almost-same-value require is added
  • removes the now-unused EPS and abs requires and the delta/tol variable declarations
  • collapses the obsolete exact-equality if/else short-circuit branch into a single exact assertion

The full JavaScript test suite (1407 assertions) was run twice to confirm deterministic pass. test/test.native.js was updated identically to keep the two suites in lockstep; native (compiled addon) assertions were not exercised in this environment since no native build tooling was available, consistent with how the existing test infrastructure already handles this (opts.skip when the addon is absent).

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This PR was written by Claude Code, running as a scheduled/unattended task. It searched the repository for the relative-tolerance test idiom, selected math/base/special/logaddexp (checked for collisions against existing open/merged ULP-migration PRs first), studied prior-art commits (including the sqrt precedent for the 0-ULP case), computed the ULP differences against the fixtures, applied the migration, and ran the JavaScript test suite twice to confirm determinism before opening this draft PR.


@stdlib-js/reviewers


Generated by Claude Code

Resolves a part of #11352.

Migrates the fixture-loop assertions in test.js and test.native.js from
relative-tolerance (EPS-based) checks to exact-equality assertions. The
JavaScript implementation matches the reference fixture values (1000
cases) exactly (0 ULP difference in every case), so per the precedent
established for math/base/special/sqrt (#12764), plain t.strictEqual()
is used instead of isAlmostSameValue(), and the now-unused EPS/abs/
delta/tol machinery is removed.
@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Jul 27, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/logaddexp $\\color{green}173/173$
$\\color{green}+100.00\\%$
$\\color{green}12/12$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}173/173$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Math Issue or pull request specific to math functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants