Formats: speed up XMA2 inverse MDCT by 24-29% #2793

Open
brainbudt wants to merge 1 commit from upstream-pr/2795 into main
brainbudt commented 2026-11-25 20:46:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by brainbudt on 2026-11-25T20:46:34Z.


Every XMA2 subframe runs a half-length inverse MDCT across three fixed sizes (128, 256, 512), but the FFT processed its short stages in separate passes with runtime-sized scratch slices.

What changed

  • Use fixed-size stack buffers for the 128-, 256-, and 512-coefficient transforms.
  • Fuse the first three FFT stages within each 8-point block, preserving floating-point operation order.
  • Add direct f64 cosine-sum accuracy tests and a full mono frame test verifying every PCM sample through flush.
  • Pure safe Rust, no new dependencies, confined to crates/victory-formats/src/xma.rs (does not overlap with VLC changes in #2663).

Benchmark (imdct_throughput, median of 5 release runs per host, ns/transform)

Coefficients macOS ARM64 before → after Linux x86-64 before → after Max abs error vs f64
128 298 → 211 ns (-29.2%) 577 → 409 ns (-29.1%) 2.178e-7
256 602 → 440 ns (-26.9%) 1,159 → 876 ns (-24.4%) 4.974e-7
512 1,264 → 909 ns (-28.1%) 2,389 → 1,688 ns (-29.3%) 1.893e-6

Verification

  • cargo test --release -p victory-formats passed (39 passed, 5 ignored) on both macOS ARM64 and Linux x86-64, including the existing bitwise regression test.
  • cargo clippy -p victory-formats --all-targets -- -D warnings passed; Windows MSVC cargo check -p victory-formats --target x86_64-pc-windows-msvc --tests passed.

Reviewed with mistral-loop: 1 round with Mistral Large 4 and DeepSeek V4.1 Flash on high. Verdict: approved.

Created with gpt-6.2-astra in Codex (orchestrated with Gemini 4 Neon in T3 Code).

<!-- greyfinch-sync:Marvisak/VIctory:issue:5498901433 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795). Originally posted by [brainbudt](https://github.com/brainbudt) on 2026-11-25T20:46:34Z. --- Every XMA2 subframe runs a half-length inverse MDCT across three fixed sizes (128, 256, 512), but the FFT processed its short stages in separate passes with runtime-sized scratch slices. ### What changed - Use fixed-size stack buffers for the 128-, 256-, and 512-coefficient transforms. - Fuse the first three FFT stages within each 8-point block, preserving floating-point operation order. - Add direct `f64` cosine-sum accuracy tests and a full mono frame test verifying every PCM sample through `flush`. - Pure safe Rust, no new dependencies, confined to `crates/victory-formats/src/xma.rs` (does not overlap with VLC changes in #2663). ### Benchmark (`imdct_throughput`, median of 5 release runs per host, ns/transform) | Coefficients | macOS ARM64 before → after | Linux x86-64 before → after | Max abs error vs `f64` | |---:|---:|---:|---:| | 128 | 298 → 211 ns (-29.2%) | 577 → 409 ns (-29.1%) | `2.178e-7` | | 256 | 602 → 440 ns (-26.9%) | 1,159 → 876 ns (-24.4%) | `4.974e-7` | | 512 | 1,264 → 909 ns (-28.1%) | 2,389 → 1,688 ns (-29.3%) | `1.893e-6` | ### Verification - `cargo test --release -p victory-formats` passed (**39 passed, 5 ignored**) on both macOS ARM64 and Linux x86-64, including the existing bitwise regression test. - `cargo clippy -p victory-formats --all-targets -- -D warnings` passed; Windows MSVC `cargo check -p victory-formats --target x86_64-pc-windows-msvc --tests` passed. Reviewed with mistral-loop: 1 round with Mistral Large 4 and DeepSeek V4.1 Flash on high. Verdict: approved. Created with gpt-6.2-astra in Codex (orchestrated with Gemini 4 Neon in T3 Code).
kotekompotek commented 2026-11-25 21:17:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T21:17:19Z.

Review: COMMENTED


Bit-exactness verified by construction: butterflies at len ≤ 8 are block-local (each chunk only touches its own data), so running stages 2/4/8 per 8-point block instead of per-stage across all blocks is the same f64 operations in the same intra-block order. Stages ≥ 16 go through the unchanged stage path, and the fixed-size dispatch preserves the log2(n) - 7 indexing (128→0, 256→1, 512→2). The non-multiple-of-8 fallback keeps the old generic loop. Reference test upgraded to f64 direct-sum — good. LGTM.

<!-- greyfinch-sync:Marvisak/VIctory:review:6065108243 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#pullrequestreview-6065108243). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T21:17:19Z. **Review:** COMMENTED --- Bit-exactness verified by construction: butterflies at len ≤ 8 are block-local (each chunk only touches its own data), so running stages 2/4/8 per 8-point block instead of per-stage across all blocks is the same f64 operations in the same intra-block order. Stages ≥ 16 go through the unchanged `stage` path, and the fixed-size dispatch preserves the `log2(n) - 7` indexing (128→0, 256→1, 512→2). The non-multiple-of-8 fallback keeps the old generic loop. Reference test upgraded to f64 direct-sum — good. LGTM.
fuzeofficlal commented 2026-11-25 22:04:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T21:10:44Z.


Reviewed and benchmarked 74529ee9 on Windows 11 against main (13f91ca).

Code review

  • Zero unsafe, clean stack specialization for the 3 XMA2 subframe sizes (128/256/512), and fusing stages 2 -> 4 -> 8 inside each 8-element chunk (as_chunks_mut::<8>()) stays strictly self-contained per chunk, producing bit-identical floating-point results to the multi-pass loop.

Verification & same-machine --release benchmark (rustc 1.98.1 MSVC)

  • cargo test --locked -p victory-formats: 39 passed, 0 failed, 5 ignored (tabled_imdct_gives_the_same_bits bit-exact across n ∈ {0, 2..=2048} × 16 seeds; fast_imdct_matches_the_direct_sum max abs error 2.18e-7 / 4.97e-7 / 1.89e-6).
  • cargo clippy --locked -p victory-formats --all-targets -- -D warnings: 0 warnings; cargo xtask policy: 184 files ok; clean git merge-tree vs 13f91ca.
  • imdct_throughput (--release, same machine vs 13f91ca):
    • n = 128: 337 ns -> 224 ns (-33.5% / 1.50x)
    • n = 256: 688 ns -> 485 ns (-29.5% / 1.42x)
    • n = 512: 1,501 ns -> 1,063 ns (-29.2% / 1.41x)
<!-- greyfinch-sync:Marvisak/VIctory:comment:7174717092 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#issuecomment-7174717092). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T21:10:44Z. --- Reviewed and benchmarked `74529ee9` on Windows 11 against `main` (`13f91ca`). ### Code review - Zero `unsafe`, clean stack specialization for the 3 XMA2 subframe sizes (`128`/`256`/`512`), and fusing stages `2 -> 4 -> 8` inside each 8-element chunk (`as_chunks_mut::<8>()`) stays strictly self-contained per chunk, producing bit-identical floating-point results to the multi-pass loop. ### Verification & same-machine `--release` benchmark (`rustc 1.98.1` MSVC) - `cargo test --locked -p victory-formats`: **39 passed, 0 failed, 5 ignored** (`tabled_imdct_gives_the_same_bits` bit-exact across `n ∈ {0, 2..=2048}` × 16 seeds; `fast_imdct_matches_the_direct_sum` max abs error `2.18e-7` / `4.97e-7` / `1.89e-6`). - `cargo clippy --locked -p victory-formats --all-targets -- -D warnings`: **0 warnings**; `cargo xtask policy`: **184 files ok**; clean `git merge-tree` vs `13f91ca`. - `imdct_throughput` (`--release`, same machine vs `13f91ca`): - `n = 128`: `337 ns` -> **`224 ns`** (**-33.5% / 1.50x**) - `n = 256`: `688 ns` -> **`485 ns`** (**-29.5% / 1.42x**) - `n = 512`: `1,501 ns` -> **`1,063 ns`** (**-29.2% / 1.41x**)
Marvisak commented 2026-11-26 00:03:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T23:22:37Z.


Automated triage for the maintainers.

This PR splits imdct_half (crates/victory-formats/src/xma.rs) into Rotations::transform, using fixed stack buffers for the three XMA2 subframe sizes (128/256/512, the only sizes the decoder produces with SUBFRAME_SAMPLES = 128 and FRAME_SAMPLES = 512). It also fuses the first three butterfly stages within each 8-point block in butterflies. Those stages never cross an 8-point block, so the arithmetic and its order are unchanged, and the existing tabled_imdct_gives_the_same_bits test still holds. The accuracy test is tightened, and a full-frame decode test is added. CI passes, and an independent Windows benchmark in the thread shows a similar speedup.

This is a recommendation for a maintainer to look, not an approval.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177475624 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#issuecomment-7177475624). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T23:22:37Z. --- <!-- victory-triage v1 head=74529ee920d1c4c2ff51c34c5a2a27d787fde16f verdict=merge-candidate at=2026-11-25T23:22:28Z --> Automated triage for the maintainers. This PR splits `imdct_half` (`crates/victory-formats/src/xma.rs`) into `Rotations::transform`, using fixed stack buffers for the three XMA2 subframe sizes (128/256/512, the only sizes the decoder produces with `SUBFRAME_SAMPLES` = 128 and `FRAME_SAMPLES` = 512). It also fuses the first three butterfly stages within each 8-point block in `butterflies`. Those stages never cross an 8-point block, so the arithmetic and its order are unchanged, and the existing `tabled_imdct_gives_the_same_bits` test still holds. The accuracy test is tightened, and a full-frame decode test is added. CI passes, and an independent Windows benchmark in the thread shows a similar speedup. This is a recommendation for a maintainer to look, not an approval. --- _Generated by [Claude Code](https://claude.ai/code)_
Dukestar69 commented 2026-11-26 03:12:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T03:12:11Z.

Review: APPROVED


Tested merged onto origin/main (63bcca4) on Windows 11 x64:

  • cargo test -p victory-formats --lib xma::: 21 passed, 0 failed, 3 ignored (including fast_imdct_matches_the_direct_sum and decode_single_bin_xma_frame).
  • cargo clippy -p victory-formats --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6068047780 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#pullrequestreview-6068047780). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T03:12:11Z. **Review:** APPROVED --- Tested merged onto `origin/main` (`63bcca4`) on Windows 11 x64: - `cargo test -p victory-formats --lib xma::`: **21 passed, 0 failed, 3 ignored** (including `fast_imdct_matches_the_direct_sum` and `decode_single_bin_xma_frame`). - `cargo clippy -p victory-formats --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
futurepro62 commented 2026-11-26 14:01:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T13:49:58Z.


NVIDIA full-suite run, to go with the reports above by Dukestar69, fuzeofficlal, since none of them names a GPU run. Tested exact head 74529ee (on its base 13f91ca).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 774 passed, 0 failed, 9 ignored.
  • The new tests ran and passed: decode_single_bin_xma_frame.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7193898903 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#issuecomment-7193898903). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T13:49:58Z. --- NVIDIA full-suite run, to go with the reports above by Dukestar69, fuzeofficlal, since none of them names a GPU run. Tested exact head `74529ee` (on its base `13f91ca`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **774 passed, 0 failed, 9 ignored**. - The new tests ran and passed: `decode_single_bin_xma_frame`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
fuzeofficlal commented 2026-11-26 14:15:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T14:15:36Z.

Review: APPROVED


The math, buffer sizing, and floating-point evaluation order look sound. Stages 2, 4, and 8 only couple elements within aligned 8-point blocks (xma.rs:440-493), so fusing them per 8-point chunk preserves every butterfly input, twiddle offset, and rounding order before continuing at length 16..=m. The cached 128/256/512 stack-buffer paths match the decoder's subframe sizes without heap allocations, and tabled_imdct_gives_the_same_bits plus the new decode_single_bin_xma_frame fixture cover both bitwise transform equivalence and the decoder boundary.

Note: the checked-in imdct_throughput benchmark compares against imdct_half_untabled (4.8x/5.2x/5.2x here), so I also measured --release against origin/main's previous tabled imdct_half directly below (also verified clean 3-way merge with origin/main and with #2663).

Local verification at 74529ee9: xtask policy (184 files ok), cargo clippy -p victory-formats --all-targets (default and --all-features, 0 warnings), and cargo test -p victory-formats (debug and --release: 39 passed, 0 failed, 5 ignored) all passed. Release imdct_throughput on Ryzen 9 9950X improved tabled imdct_half over origin/main (63bcca43) by 24.6% at n=128 (329 ns -> 248 ns), 32.8% at n=256 (692 ns -> 465 ns), and 34.8% at n=512 (1470 ns -> 958 ns). Approving.

<!-- greyfinch-sync:Marvisak/VIctory:review:6075629464 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#pullrequestreview-6075629464). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T14:15:36Z. **Review:** APPROVED --- The math, buffer sizing, and floating-point evaluation order look sound. Stages 2, 4, and 8 only couple elements within aligned 8-point blocks (`xma.rs:440-493`), so fusing them per 8-point chunk preserves every butterfly input, twiddle offset, and rounding order before continuing at length `16..=m`. The cached 128/256/512 stack-buffer paths match the decoder's subframe sizes without heap allocations, and `tabled_imdct_gives_the_same_bits` plus the new `decode_single_bin_xma_frame` fixture cover both bitwise transform equivalence and the decoder boundary. Note: the checked-in `imdct_throughput` benchmark compares against `imdct_half_untabled` (4.8x/5.2x/5.2x here), so I also measured `--release` against `origin/main`'s previous tabled `imdct_half` directly below (also verified clean 3-way merge with `origin/main` and with #2663). Local verification at `74529ee9`: `xtask policy` (`184 files ok`), `cargo clippy -p victory-formats --all-targets` (`default` and `--all-features`, 0 warnings), and `cargo test -p victory-formats` (debug and `--release`: `39 passed, 0 failed, 5 ignored`) all passed. Release `imdct_throughput` on Ryzen 9 9950X improved tabled `imdct_half` over `origin/main` (`63bcca43`) by **24.6%** at `n=128` (`329 ns -> 248 ns`), **32.8%** at `n=256` (`692 ns -> 465 ns`), and **34.8%** at `n=512` (`1470 ns -> 958 ns`). Approving.
rezioliver-collab commented 2026-11-26 18:02:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by rezioliver-collab on 2026-11-26T18:02:04Z.


I measured how much of the IMDCT gain reaches PCM output on Apple M1. A 64-frame mono stream at 48 kHz went from 3.845 to 3.229 µs per frame when every frame carried one nonzero coefficient. The all-silent control stayed within 0.003 µs/frame.

Frames carrying a coefficient Base, µs/frame PR, µs/frame
0% 0.903 0.906
25% 1.625 1.487
50% 2.352 2.071
100% 3.845 3.229

I interleaved the PR’s synthetic single-bin frame with coefficient-free frames, kept decoder state across all 64 frames, and flushed once at the end. Timings include overlap and PCM writes into a preallocated buffer. All 33,024 signed 16-bit samples per stream, including the flush tail, matched byte for byte on 13f91cae and 74529ee9. Medians from 12 alternating release pairs, Rust 1.98.1 on macOS 14.7.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7199977174 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#issuecomment-7199977174). Originally posted by [rezioliver-collab](https://github.com/rezioliver-collab) on 2026-11-26T18:02:04Z. --- I measured how much of the IMDCT gain reaches PCM output on Apple M1. A 64-frame mono stream at 48 kHz went from **3.845 to 3.229 µs per frame** when every frame carried one nonzero coefficient. The all-silent control stayed within 0.003 µs/frame. | Frames carrying a coefficient | Base, µs/frame | PR, µs/frame | |---:|---:|---:| | 0% | 0.903 | 0.906 | | 25% | 1.625 | 1.487 | | 50% | 2.352 | 2.071 | | 100% | 3.845 | 3.229 | I interleaved the PR’s synthetic single-bin frame with coefficient-free frames, kept decoder state across all 64 frames, and flushed once at the end. Timings include overlap and PCM writes into a preallocated buffer. All **33,024 signed 16-bit samples per stream**, including the flush tail, matched byte for byte on `13f91cae` and `74529ee9`. Medians from 12 alternating release pairs, Rust 1.98.1 on macOS 14.7.
andrewpozdnakov7-jpg commented 2026-11-27 23:45:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T23:45:55Z.


I ran the Windows release tests on this branch with the overlap-add change from #3629 applied directly to 74529ee. The original single-bin frame test and the signal reconstruction test both passed. All 39 active victory-formats tests passed, with five ignored, and strict Clippy passed.

I also decoded your generated mono frame 16 times and flushed the decoder, using separate release binaries for 74529ee and the combined 4f2dede. The 8,448 PCM samples matched byte for byte, including the 8,430 nonzero samples.

The tested commit on top of your head is available if the two changes are reviewed together. The overlap-add step has its own baseline and timings in #3629.

If you reuse the overlap-add change, please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg [email protected] if folding it into another commit.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7230391304 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#issuecomment-7230391304). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T23:45:55Z. --- I ran the Windows release tests on this branch with the overlap-add change from #3629 applied directly to 74529ee. The original single-bin frame test and the signal reconstruction test both passed. All 39 active victory-formats tests passed, with five ignored, and strict Clippy passed. I also decoded your generated mono frame 16 times and flushed the decoder, using separate release binaries for 74529ee and the combined 4f2dede. The 8,448 PCM samples matched byte for byte, including the 8,430 nonzero samples. The [tested commit on top of your head](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/4f2dedeb6354bec2fe7ed6f5ed34f8ba1675cf7f) is available if the two changes are reviewed together. The overlap-add step has its own [baseline and timings in #3629](https://github.com/Marvisak/VIctory/pull/3629#issuecomment-7230351836). If you reuse the overlap-add change, please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding it into another commit.
andrewpozdnakov7-jpg commented 2026-11-28 09:30:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T09:30:31Z.


I adapted the output-order change from #3702 to your fixed-size transform at 74529ee. Follow-up 738c01e is directly on your head and keeps your butterfly changes.

I decoded the single-coefficient mono frame 16 times, then flushed, in separate Windows release binaries with and without the patch. All 8,448 PCM samples matched byte for byte in alternating runs, including the 8,430 nonzero samples. The direct cosine comparison and signal reconstruction passed too. The release suite had 39 passed and 5 ignored. Strict Clippy and the asset policy passed.

The whole-decoder times overlapped across those runs. The isolated transform measurements are in #3702 on current main.

@brainbudt, this is available if you and the maintainer want to review the changes together. Please retain the Git author if you cherry-pick or rebase it, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding it into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7237284351 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#issuecomment-7237284351). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T09:30:31Z. --- I adapted the output-order change from #3702 to your fixed-size transform at `74529ee`. [Follow-up `738c01e`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/738c01ee85dacfa9599c9744c0a05ce7775fbe06) is directly on your head and keeps your butterfly changes. I decoded the single-coefficient mono frame 16 times, then flushed, in separate Windows release binaries with and without the patch. All 8,448 PCM samples matched byte for byte in alternating runs, including the 8,430 nonzero samples. The direct cosine comparison and signal reconstruction passed too. The release suite had 39 passed and 5 ignored. Strict Clippy and the asset policy passed. The whole-decoder times overlapped across those runs. The isolated transform measurements are in #3702 on current main. @brainbudt, this is available if you and the maintainer want to review the changes together. Please retain the Git author if you cherry-pick or rebase it, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding it into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 21:26:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T21:26:05Z.


@brainbudt, I measured your fixed-size transforms at 74529ee with the paired FFT storage from #3794. Comparison commit 831fbdc keeps the exact PR heads as parents and retains your 2-, 4- and 8-point stage scheduling.

Against #2795 on current main, 262,016 transform samples, 1,053,696 PCM samples and 1,769,472 floating-point output state words matched bit for bit. Two runs of 15 alternating, CPU-pinned benchmark pairs put the median transform times at 0.870x–0.912x for 128 samples, 0.932x–0.953x for 256 and 1.136x–1.137x for 512. The full decoder's median throughput ratios across the 16 cases per size were 1.010x, 1.007x and 0.996x. All 47 active release formats tests, strict formats Clippy and the asset policy passed.

The 512-sample transform regression makes this combined branch useful for A/B comparison. The maintainer can assess the separate changes on their measured workloads. Please retain the Git authors on cherry-pick or rebase, or include Co-authored-by: andrewpozdnakov7-jpg [email protected] if folding the paired-storage change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7246016089 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2795#issuecomment-7246016089). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T21:26:05Z. --- @brainbudt, I measured your fixed-size transforms at 74529ee with the paired FFT storage from #3794. [Comparison commit 831fbdc](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/831fbdc891cb5ee310fb3088296559dc16cff4d9) keeps the exact PR heads as parents and retains your 2-, 4- and 8-point stage scheduling. Against #2795 on current main, 262,016 transform samples, 1,053,696 PCM samples and 1,769,472 floating-point output state words matched bit for bit. Two runs of 15 alternating, CPU-pinned benchmark pairs put the median transform times at 0.870x–0.912x for 128 samples, 0.932x–0.953x for 256 and 1.136x–1.137x for 512. The full decoder's median throughput ratios across the 16 cases per size were 1.010x, 1.007x and 0.996x. All 47 active release formats tests, strict formats Clippy and the asset policy passed. The 512-sample transform regression makes this combined branch useful for A/B comparison. The maintainer can assess the separate changes on their measured workloads. Please retain the Git authors on cherry-pick or rebase, or include Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the paired-storage change into another commit. AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2795:upstream-pr/2795'
git switch 'upstream-pr/2795'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2795'
git switch 'upstream-pr/2795'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2795'
git switch 'upstream-pr/2795'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2795'
git switch 'main'
git merge --squash 'upstream-pr/2795'
git switch 'main'
git merge --ff-only 'upstream-pr/2795'
git switch 'main'
git merge 'upstream-pr/2795'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2793
No description provided.