FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: migrate `math/base/special/bessely1` to ULP-based assertions by kgryte · Pull Request #14344 · stdlib-js/stdlib · GitHub

test: migrate math/base/special/bessely1 to ULP-based assertions - #14344

Merged
kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-o0dtuj
Aug 17, 2026
Merged

test: migrate math/base/special/bessely1 to ULP-based assertions#14344
kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-o0dtuj

Conversation

kgryte commented Aug 17, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates the tests for math/base/special/bessely1 from relative tolerance testing to ULP difference testing, per [RFC]: Migrate math/base/special packages from relative tolerance testing to ULP difference testing (tracking issue) #11352.
  • replaces the delta/tol computation and the y === expected special case in test/test.js and test/test.native.js with a single t.strictEqual( isAlmostSameValue( y, expected[ i ], N ), true, 'returns expected value' ); assertion.
  • removes the now-unused @stdlib/math/base/special/abs require and adds @stdlib/assert/is-almost-same-value. The @stdlib/constants/float64/eps require is retained, as EPS is still used when generating negative inputs.

ULP bounds (per fixture set, identical for test/test.js and test/test.native.js):

Fixture set Previous tolerance ULP bound Next largest ULP difference in set
very_large_positive 300.0 * EPS * abs( expected ) 254 251
large_positive 600.0 * EPS * abs( expected ) 689 494
medium_positive 300.0 * EPS * abs( expected ) 395 288
small_positive 1800.0 * EPS * abs( expected ) 2338 1774
smaller 4.5 * EPS * abs( expected ) 5 4
tiny_positive 8.0 * EPS * abs( expected ) 1 0
huge_positive 4500.0 * EPS * abs( expected ) 1200 248
positive_gamut 16.0 * EPS * abs( expected ) 27 25

These are the measured minima. Starting from a high bound and tightening, each value above is the smallest integer for which the corresponding fixture set passes in full: decrementing every bound by one fails 1934 of 41646 assertions (exactly one point per set, except tiny_positive, where a bound of 0 degrades to exact equality and fails 1927 points). The JavaScript and native (C) implementations agree exactly on every fixture point, so the same bounds apply to both test files.

Only the two test files are changed; no source, documentation, or package.json changes are included.

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?

The small_positive (2338) and huge_positive (1200) bounds are large in absolute terms, but they are strictly tighter than the relative tolerances they replace and reflect the accuracy of the current implementation near the zeros of Y_1. Happy to instead round these to the nearest convenient value if reviewers prefer some headroom over the measured minimum.

Other

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

Verification performed locally:

  • make test TESTS_FILTER=".*/math/base/special/bessely1/.*" — test/test.js 41646 passing, 0 failing; test/test.native.js 41646 passing, 0 failing. Run twice at the final bounds with identical results, so the bounds are not sensitive to FMA/arch variation on this machine.
  • test/test.native.js was exercised against a locally built addon (make install-node-addons NODE_ADDONS_PATTERN="bessely1"), so the native assertions ran rather than being skipped.
  • Tightness check: lowering every bound by one produced 39712 passing / 1934 failing, confirming the reported minima.
  • make lint-javascript-tests TESTS_FILTER=".*/math/base/special/bessely1/.*" — clean.

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. The test migration and the ULP bound search (start high, tighten to the minimum that still passes, then re-run to confirm determinism) were performed by the agent, following the idiom established in already-migrated packages in math/base/special.


@stdlib-js/reviewers


Generated by Claude Code

Migrates the tests for `math/base/special/bessely1` from relative
tolerance testing to ULP difference testing.

Ref: #11352

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

---
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 added Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. labels Aug 17, 2026

Copy link
Copy Markdown
Contributor

Hello! 👋

We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm!

Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks.

Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀

For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers!

kgryte added the Tests Pull requests specifically adding tests. label Aug 17, 2026
kgryte marked this pull request as ready for review August 17, 2026 06:49
kgryte requested a review from a team August 17, 2026 06:49
stdlib-bot added the Needs Review A pull request which needs code review. label Aug 17, 2026
kgryte removed the Needs Review A pull request which needs code review. label Aug 17, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/bessely1 $\\color{red}527/535$
$\\color{green}+98.50\\%$
$\\color{red}41/47$
$\\color{green}+87.23\\%$
$\\color{green}6/6$
$\\color{green}+100.00\\%$
$\\color{red}527/535$
$\\color{green}+98.50\\%$

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

kgryte merged commit cc14b30 into develop Aug 17, 2026
83 checks passed
kgryte deleted the claude/great-brahmagupta-o0dtuj branch August 17, 2026 06:56
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

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.

3 participants


Back | FazBrowse Home | New Git URL