Skip to content

test: migrate simulate/iter/bartlett-pulse to ULP-based assertions - #15903

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-bartlett-pulse
Oct 12, 2026
Merged

kgryte merged 1 commit into
developfrom
kgryte/ulp-bartlett-pulse

Conversation

@kgryte

@kgryte kgryte commented Oct 5, 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 simulate/iter/bartlett-pulse from relative tolerance testing to ULP difference testing, following the idiom established in [RFC]: Migrate math/base/special packages from relative tolerance testing to ULP difference testing (tracking issue) #11352.
  • replaces the delta/tol comparisons with t.strictEqual( isAlmostSameValue( actual.value, expected[ i ].value, 0 ), true, 'returns expected value' );, adds the @stdlib/assert/is-almost-same-value require, and removes the now unused @stdlib/constants/float64/eps require. The @stdlib/math/base/special/abs require is retained, as abs is still used by the bartlett test helper.

Notes on the ULP bound:

  • Final ULP constant: 0 (used for all nine converted assertions).
  • The bound was tightened by starting at 64 and lowering to the minimum integer which still passes over the full set of generated expected values; 0 is the measured minimum, i.e., the generated waveform values agree with the expected values bit-for-bit.
  • The suite was run twice at the final bound to confirm determinism; both runs reported 3281/3281 passing.
  • This matches the bound used for the sibling package in the same family, simulate/iter/bartlett-hann-pulse (test: migrate simulate/iter/bartlett-hann-pulse to ULP-based assertions #14614).

Only the test file is changed; no implementation or fixture changes.

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.

Verification performed locally:

  • make test TESTS_FILTER=".*/simulate/iter/bartlett-pulse/.*" → 3281 passing (run twice, identical results).
  • make lint-javascript-tests TESTS_FILTER=".*/simulate/iter/bartlett-pulse/.*" → 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. It studied the prior art in #11352 and the merged conversions for sibling packages, applied the mechanical conversion, and measured the minimum passing ULP bound empirically.


@stdlib-js/reviewers


Generated by Claude Code

Replace the relative tolerance assertions in the `simulate/iter/bartlett-pulse`
tests with ULP difference assertions using
`@stdlib/assert/is-almost-same-value`. The returned waveform values agree
exactly with the expected values, so the minimum required ULP bound is `0`.

Ref: #11352

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwLQg4yZrZHGzfeFS4zRSG
@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Oct 5, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
simulate/iter/bartlett-pulse $\\color{green}320/320$
$\\color{green}+100.00\\%$
$\\color{green}43/43$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}320/320$
$\\color{green}+100.00\\%$

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

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Oct 12, 2026
@kgryte
kgryte marked this pull request as ready for review October 12, 2026 12:59
@kgryte
kgryte requested a review from a team October 12, 2026 12:59
@kgryte
kgryte merged commit 677455a into develop Oct 12, 2026
50 checks passed
@kgryte
kgryte deleted the kgryte/ulp-bartlett-pulse branch October 12, 2026 13:00
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Oct 12, 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. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants