Skip to content

test: migrate simulate/iter/sawtooth-wave to ULP-based assertions - #15109

Draft
kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-sawtooth-wave
Draft

test: migrate simulate/iter/sawtooth-wave to ULP-based assertions#15109
kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-sawtooth-wave

Conversation

@kgryte

@kgryte kgryte commented Sep 8, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

ULP bounds used, tightened to the measured minimum for each test case:

Test ULP
generates a sawtooth wave (default) 0
supports specifying the waveform period 0
supports specifying the wave amplitude 0
supports specifying the phase offset (left shift) 0
supports specifying the phase offset (left shift; mod) 0
supports specifying the phase offset (right shift) 0
supports specifying the phase offset (right shift; mod) 0
supports limiting the number of iterations 1

All values except one are bit-for-bit exact, and thus use a bound of 0 ULP. The iter test case requires 1 ULP, as the returned value -0.5000000000000001 differs from the expected literal -0.5 by exactly one ULP; lowering that bound to 0 causes the assertion to fail, confirming 1 is the minimum. The suite (240 assertions) was run twice at the final bounds with identical results.

The package has no test/test.native.js, so no native test file required updating.

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.

Only lib/node_modules/@stdlib/simulate/iter/sawtooth-wave/test/test.js is modified. make test TESTS_FILTER=".*/simulate/iter/sawtooth-wave/.*" passes (240/240), and ESLint reports no problems for the modified file.

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 as part of an automated, unattended migration task. The ULP bounds were measured empirically by running the test suite rather than estimated.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01WqqdPYJ7b95CKX13XpdtDH


Generated by Claude Code

@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Sep 8, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
simulate/iter/sawtooth-wave $\\color{green}305/305$
$\\color{green}+100.00\\%$
$\\color{green}32/32$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}305/305$
$\\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

Good First PR A pull request resolving a Good First Issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants