Skip to content

Add scheduled inverse-residue execution and AVX2 fused d4 inverse codelet#35

Closed
falseywinchnet wants to merge 2 commits into
mainfrom
v5nmln-main/update-local-repo-and-optimize-inverse-performance
Closed

Add scheduled inverse-residue execution and AVX2 fused d4 inverse codelet#35
falseywinchnet wants to merge 2 commits into
mainfrom
v5nmln-main/update-local-repo-and-optimize-inverse-performance

Conversation

@falseywinchnet

Copy link
Copy Markdown
Owner

Motivation

  • Reduce call/stack overhead in the inverse residue traversal by reusing the forward residue schedule and exposing a linear switch-based dispatch for small-ISA builds.
  • Enable predictable control flow for SSE/NEON builds to gain a near-free scheduling win while preparing the ground for ISA-specific fused inverse kernels on AVX2/AVX-512.

Description

  • Add INV_RES_SCHEDULE storage and implement build_inverse_residue_schedule() to reverse FWD_RES_SCHEDULE and append the final inverse FWD_OP_BINOMIAL, and call it from build_forward_schedules() by adding if (!build_inverse_residue_schedule()) return false;.
  • Implement scheduled executors run_inv_residue_schedule_f32 and run_inv_residue_schedule that iterate INV_RES_SCHEDULE with prefetch hints and a switch-based dispatch, and use them in inverse_residues_recursive_f32 and inverse_residues_recursive when BRUUN_LEVEL == 1.
  • Factor the AVX2 inverse depth-3 leaf into a register-returning core codelet_d3_tw_res_inv_avx2_core, add a fused codelet_d4_inv_avx2 that merges two child leaves and applies the q==8 inverse before stores, and adapt codelet_d3_tw_res_inv to call the new core on AVX2 builds.
  • Add inverse_acceleration_notes.txt documenting the design decisions, gating strategy, and follow-up tasks.

Testing

  • Ran the repository unit test suite including inverse/forward round-trip correctness tests for double and float across a range of transform sizes, and the tests passed.
  • Performed automated build-and-test runs for x86 ISA variants (SSE and AVX2) with BRUUN_LEVEL variants to validate both scheduled and fused-inverse paths, and the builds/tests completed successfully.

Codex Task

@falseywinchnet falseywinchnet deleted the v5nmln-main/update-local-repo-and-optimize-inverse-performance branch June 21, 2026 09:30
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