Skip to content

feat: add fft/base/fftpack/rffti#11467

Merged
kgryte merged 26 commits into
stdlib-js:developfrom
gunjjoshi:rffti-v2
Jun 1, 2026
Merged

feat: add fft/base/fftpack/rffti#11467
kgryte merged 26 commits into
stdlib-js:developfrom
gunjjoshi:rffti-v2

Conversation

@gunjjoshi
Copy link
Copy Markdown
Member

@gunjjoshi gunjjoshi commented Apr 15, 2026

Resolves None.

Description

What is the purpose of this pull request?

This pull request:

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

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.

No.

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.".

Used AI to understand how we generate C fixtures using FFTPACK.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 15, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Apr 15, 2026

Coverage Report

Package Statements Branches Functions Lines
fft/base/fftpack/rffti $\color{green}412/412$
$\color{green}+0.00\%$
$\color{green}12/12$
$\color{green}+0.00\%$
$\color{green}2/2$
$\color{green}+0.00\%$
$\color{green}412/412$
$\color{green}+0.00\%$

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

Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/test/test.js Outdated
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/README.md Outdated
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/docs/repl.txt Outdated
---
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: passed
  - 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
---
@gunjjoshi gunjjoshi requested a review from a team April 17, 2026 16:46
gunjjoshi and others added 4 commits April 17, 2026 22:18
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Gunj Joshi <gunjjoshi8372@gmail.com>
---
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: passed
  - 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: passed
  - task: lint_javascript_tests
    status: na
  - 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
---
---
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: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - 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
---
@kgryte kgryte added Feature Issue or pull request for adding a new feature. and removed Needs Review A pull request which needs code review. labels Apr 17, 2026
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/docs/types/test.ts
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/docs/types/index.d.ts Outdated
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/docs/types/test.ts Outdated
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/docs/types/test.ts Outdated
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/examples/index.js
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/lib/main.js Outdated
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/lib/main.js Outdated
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/lib/main.js
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not fully understanding why this file differs from what we did in https://github.com/gunjjoshi/stdlib/blob/20edeac7d326443708e922a8aa99dc6a93baa3ef/lib/node_modules/%40stdlib/fft/base/fftpack/rffti/lib/rffti1.js. What is the reason for the various discrepancies?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The major reasons for these included our discussion to change the signature of the decompose function to include more parameters:
Before:

decompose( N, initial, out, stride, offset );

After:

decompose( N, M, initial, strideInitial, offsetInitial, out, strideOut, offsetOut );

Reference: #10354 (comment)

And, while comparing the older implementation with the test fixtures generated by FFTPACK, we were getting the results being stored off by one place.

I have restored the older implementation as given here: https://github.com/stdlib-js/stdlib/pull/4121/changes#diff-50a196b71ed9215f6c0559fab1caf4289f1d0c4b8cd17e50c0503caf39605ea9, and it now has only the following changes, as compared to the older implementation:

  1. Update in the FFTPACK reference implementation link in the license header. (Link)
  2. Update in the function call of decompose, given the change in its signature. (Link)
  3. Adjustment in the index while calculating it, where we change im+2 to im+1, after which the tests pass. (Link)

@gunjjoshi
Copy link
Copy Markdown
Member Author

The fixtures are correctly regenerated after merging with the develop branch (to pick the changes from #11819). I deleted the fixtures locally and then regenerated them after doing a make install-deps-fftpack, which generated the same fixtures upon invoking runner.c. Shouldn't the generated fixtures be different in this case, and should changed after each invocation of the runner script, given that we have random number generation functions in runner.c? Or is this an expected behavior?

If this is expected, this PR would be ready for a review.

@gunjjoshi gunjjoshi requested a review from kgryte May 19, 2026 22:06
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 19, 2026
---
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: passed
  - 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: na
  - 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: missing_dependencies
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/docs/types/test.ts Outdated
Signed-off-by: Gunj Joshi <gunjjoshi8372@gmail.com>
@kgryte kgryte removed Needs Changes Pull request which needs changes before being merged. Needs Review A pull request which needs code review. labels Jun 1, 2026
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/docs/repl.txt Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/docs/repl.txt Outdated
kgryte added 2 commits May 31, 2026 19:35
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/README.md Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/lib/rffti1.js Outdated
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/lib/rffti1.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/examples/index.js Outdated
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/README.md Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/fft/base/fftpack/rffti/README.md Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte kgryte merged commit 62ee5f8 into stdlib-js:develop Jun 1, 2026
13 checks passed
@kgryte kgryte deleted the rffti-v2 branch June 1, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Issue or pull request for adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants