Skip to content

test: migrate math/base/special/asech to ULP-based assertions - #13961

Merged
kgryte merged 3 commits into
developfrom
claude/beautiful-babbage-jf3t82
Aug 6, 2026
Merged

kgryte merged 3 commits into
developfrom
claude/beautiful-babbage-jf3t82

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 the test suite for math/base/special/asech from relative tolerance testing to ULP (unit in the last place) difference testing, per the tracking issue.
  • replaces the delta/tol-based tolerance checks in test/test.js and test/test.native.js with t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ), using @stdlib/assert/is-almost-same-value.
  • removes the now-unused abs import from both test files (the EPS import is retained, as it is still used elsewhere in the tests for domain-boundary checks).
  • the ULP bound (1) was determined empirically: starting from a high bound (64) and lowering it until the minimum integer value that still passes over the full fixture set (2003 assertions) was found. A bound of 0 (exact equality) fails 155 of 4008 total assertions, confirming 1 ULP is the tightest passing bound. The test suite was run twice at this bound to confirm deterministic results.

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

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was authored by Claude Code, running as an unattended scheduled task. It searched the repository for a candidate package not yet converted and without a colliding PR, studied several already-merged conversions in the same tracking issue to mirror the exact idiom used, and empirically determined the minimum ULP bound by running the test suite locally.


@stdlib-js/reviewers


Generated by Claude Code

Replace the EPS-scaled tolerance comparison in the fixture-based test
with `isAlmostSameValue`, tightened to a measured 1 ULP bound.

Ref: #11352

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GJNm47UayTwgvhS8FigYFp

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: skipped
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Good First PR A pull request resolving a Good First Issue. labels Aug 5, 2026
@stdlib-bot

stdlib-bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

No coverage information available.

Comment thread lib/node_modules/@stdlib/math/base/special/asech/test/test.js Outdated
@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 6, 2026
kgryte added 2 commits August 5, 2026 23:55
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte
kgryte marked this pull request as ready for review August 6, 2026 06:56
@kgryte
kgryte requested a review from a team August 6, 2026 06:56
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 6, 2026
@kgryte
kgryte merged commit 375d007 into develop Aug 6, 2026
31 checks passed
@kgryte
kgryte deleted the claude/beautiful-babbage-jf3t82 branch August 6, 2026 07:03
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants