Skip to content

test: read integer factors via Uint32Array view - #16523

Open
Planeshifter wants to merge 1 commit into
developfrom
philipp/ci-fix-linux-test-fftpack-rffti-2026-11-06
Open

Planeshifter wants to merge 1 commit into
developfrom
philipp/ci-fix-linux-test-fftpack-rffti-2026-11-06

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

Symptom: assertions such as within 1 ULPs. N: 8. y: 1.1210387714598537e-44. E: 8.

Root cause: rffti1 stores the integer factorization results through a Uint32Array view over the Float32Array workspace. The tests read those entries as floats and thus compared a float reinterpretation of the integer bit pattern against the expected integers. The tests now read the factors through a Uint32Array view. Locally, the test file goes from 81 passing / 16 failing to 97 passing.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • None.

Reference Packages

Did the content of this pull request follow one or more existing packages? Answering is optional.

This pull request followed these packages:

  • fft/base/fftpack/float32/rffti

What carried over from the reference(s)?

  • The Uint32Array view used by the strided tests to read the factors.

What differed, or what did you have to work out yourself?

  • None.

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.

Reviewer notes: the ndarray/float32/rffti README, JSDoc, REPL, and TypeScript examples show slice(w, ...) returning [ 8, 2, 2, 4 ], which is not what a float32 slice yields. That is a separate docs change and is not addressed here.

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

This PR was written by Claude Code as part of an automated CI failure triage routine. The change was reviewed by three independent AI reviewers (correctness, regression scope, style); a human has not yet reviewed it.


@stdlib-js/reviewers


Generated by Claude Code

…ctors via `Uint32Array` view

The scheduled `linux_test` workflow on develop failed on Node.js v12,
v14, and v16 with 16 assertion failures in the tests for
`fft/base/fftpack/ndarray/float32/rffti` (e.g., expected `8`, actual
`1.1210387714598537e-44`).

Root cause: `rffti1` stores the integer factorization results through a
`Uint32Array` view over the `Float32Array` workspace, but the tests read
those entries as single-precision floats and thus compared a float
reinterpretation of the integer bit pattern against the expected
integers. This commit reads the factors through a `Uint32Array` view so
that the stored integers are compared directly.

Ref: https://github.com/stdlib-js/stdlib/actions/runs/42192965802

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD78CMnshS838f6RDHji
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
fft/base/fftpack/ndarray/float32/rffti $\\color{green}143/143$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}143/143$
$\\color{green}+100.00\\%$

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

@kgryte
kgryte requested a review from gunjjoshi November 6, 2026 21:58
@kgryte kgryte added the Tests Pull requests specifically adding tests. label Nov 6, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Nov 6, 2026
@kgryte kgryte changed the title test(@stdlib/fft/base/fftpack/ndarray/float32/rffti): read integer factors via Uint32Array view test: read integer factors via Uint32Array view Nov 6, 2026
@kgryte
kgryte marked this pull request as ready for review November 6, 2026 21:58
@kgryte
kgryte requested a review from a team November 6, 2026 21:58
@kgryte

kgryte commented Nov 6, 2026

Copy link
Copy Markdown
Member

@gunjjoshi Mind taking a first at this and determining whether there is anything else we need to update in the package?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants