Replace tree/vector atan2 kernels with slope-linear tables, add generated tables and new benchmarks#69
Merged
falseywinchnet merged 2 commits intoJun 27, 2026
Conversation
…ope-linear-extraction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
src/atan_vectoring_network_experiment.cppthat delegates to the updated example source.Description
src/detail/bruun_kernel.hppto use templatedbruun_phase_slope_leafand generated slope->leaf tables, introducedbruun_phase_first_octant*andbruun_phase_atan2_mag*entry points, and replaced many previous tree/vector implementations with table-driven code and small inline helpers; added float and double fused helpers and inlining hints.src/detail/generated/bruun_phase_slope_tables.hppandsrc/detail/generated/bruun_sincos_table256.hppand a generator scripttools/gen_phase_slope_tables.pythat usesmpmathfor regeneration (mpmath is not a build dependency).examples/atan2_benchmark.cppto use the slope-linear path and sample-phase bookkeeping, addedexamples/audio_magphase_roundtrip_benchmark.cpp, and registered new example executables inCMakeLists.txt; replacedsrc/atan_vectoring_network_experiment.cppwith a tiny shim that includes the example for backward-compatibility.tests/api_c.c, and addedcheck_slope_phase_accuracyand inclusion ofbruun_kernel.hppintests/correctness.cpp.Testing
cmake -B build -S . && cmake --build build -j) and confirmed the build succeeds.ctest --test-dir build) and thecorrectnessandapi_ctests completed successfully.examples/atan2_benchmarkandexamples/audio_magphase_roundtrip_benchmark) and observed expected runtime output (benchmarks run to completion).Codex Task