Skip to content

test: migrate blas/base/wasm/zdrot to ULP-based assertions - #16159

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-blas-base-wasm-zdrot
Oct 14, 2026
Merged

kgryte merged 1 commit into
developfrom
kgryte/ulp-blas-base-wasm-zdrot

Conversation

@kgryte

@kgryte kgryte commented Oct 14, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

The isApprox helper now accepts a maximum allowed ULP difference instead of a relative tolerance:

function isApprox( t, actual, expected, ulp ) {
	var i;

	t.strictEqual( actual.length, expected.length, 'returns expected value' );
	for ( i = 0; i < expected.length; i++ ) {
		t.strictEqual( isAlmostSameValue( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' );
	}
}

ULP bound: 1 ULP, applied uniformly at all 50 isApprox call sites (12 in test.main.js, 14 in test.ndarray.js, 10 in test.module.main.js, 14 in test.module.ndarray.js), replacing the previous 2.0 relative tolerance factor.

This is the measured minimum. The maximum observed ULP difference at every individual call site is exactly 1, so no call site can be tightened further: the full suite fails (16 failing assertions) at 0 ULP and passes at 1 ULP. The suite was run twice at the final bound to confirm determinism; all 536 assertions across the package's seven test files pass in both runs.

Only test files are modified; no implementation, documentation, or benchmark 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?

No.

Other

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

The lint-editorconfig-files step could not run in the authoring environment, as it requires downloading the editorconfig-checker binary from GitHub releases, which was not reachable. EditorConfig conformance (tab indentation, LF line endings, no trailing whitespace, final newline) was verified manually instead. ESLint, using etc/eslint/.eslintrc.tests.js, passes cleanly on all four changed files.

Checklist

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

  • Read, understood, and followed the [contributing guidelines][contributing].

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. The test migration mirrors the idiom established in the already merged blas/base/wasm/csrot migration, and the 1 ULP bound was determined empirically by instrumenting every assertion to record its minimum passing ULP difference, then verifying the full suite twice at that bound.


@stdlib-js/reviewers


Generated by Claude Code

@stdlib-bot stdlib-bot added BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). Good First PR A pull request resolving a Good First Issue. labels Oct 14, 2026
@stdlib-bot

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!

@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/base/wasm/zdrot $\\color{green}706/706$
$\\color{green}+100.00\\%$
$\\color{green}17/17$
$\\color{green}+100.00\\%$
$\\color{green}6/6$
$\\color{green}+100.00\\%$
$\\color{green}706/706$
$\\color{green}+100.00\\%$

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

@kgryte
kgryte marked this pull request as ready for review October 14, 2026 23:56
@kgryte
kgryte requested a review from a team October 14, 2026 23:56
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 14, 2026
@kgryte
kgryte merged commit f9aa9fb into develop Oct 14, 2026
66 checks passed
@kgryte kgryte added Tests Pull requests specifically adding tests. and removed Needs Review A pull request which needs code review. labels Oct 14, 2026
@kgryte
kgryte deleted the kgryte/ulp-blas-base-wasm-zdrot branch October 14, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). Good First PR A pull request resolving a Good First Issue. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants