Skip to content

Add vec5+cubic vectoring phase path and benchmark comparisons#64

Merged
falseywinchnet merged 2 commits into
mainfrom
cdq5hs-main/add-new-atan_vectoring_network_experiment
Jun 27, 2026
Merged

Add vec5+cubic vectoring phase path and benchmark comparisons#64
falseywinchnet merged 2 commits into
mainfrom
cdq5hs-main/add-new-atan_vectoring_network_experiment

Conversation

@falseywinchnet

Copy link
Copy Markdown
Owner

Motivation

  • Introduce a faster vec5+cubic vectoring-first-octant phase approximation as an alternative to the existing tree32/degree7 path for polar phase extraction in the mag/phase kernel.
  • Keep the original tree32 path available so both codepaths can be benchmarked and compared in-kernel.

Description

  • Added bruun_atan_leaf_cubic residual helper and preserved the original tree32/degree7 function as bruun_phase_first_octant_tree32_degree7.
  • Implemented bruun_phase_vec_step and bruun_phase_first_octant_vec5_cubic implementing the vec5+cubic vectoring network, and routed the default bruun_phase_first_octant to the vec5 path.
  • Added a generic bruun_phase_atan2_core template to call a chosen first-octant implementation so the tree32 and vec5 paths can both be exercised without removing either.
  • Expanded examples/atan2_benchmark.cpp to time and report std::atan2, the old tree32 path, the new vec5 path, and sin/cos vs table sin/cos timings.

Testing

  • Configured the tree and benchmark build with cmake -S . -B build -DBFFT_BUILD_SHARED=OFF -DBFFT_BUILD_PROBES=OFF which completed successfully.
  • Built targets with cmake --build build --target correctness atan2_benchmark -j2 and the build completed successfully.
  • Ran unit/check correctness with ./build/correctness which printed correctness ok backend=avx2-fma-256 (success).
  • Ran the benchmark ./build/atan2_benchmark 1024 which executed and reported timings for std::atan2, bfft tree32, bfft vec5, and sin/cos variants (successful run).

Codex Task

@falseywinchnet falseywinchnet merged commit fbcf972 into main Jun 27, 2026
4 checks passed
@falseywinchnet falseywinchnet deleted the cdq5hs-main/add-new-atan_vectoring_network_experiment branch June 27, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant