Formats: walk paired XMA overlap samples directly #3629
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3629"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T23:42:23Z.
XMA joins each decoded block to the previous one with a windowed overlap. Split each slice once and iterate the matching sample and window pairs directly. Each pair uses the same floating-point expressions in the same order.
On Windows x86-64, the median time for the isolated step across 15 alternating A/B measurements was 216 to 143 ns for 128 samples, 416 to 323 ns for 256, and 831 to 675 ns for 512. Each timing includes copying the same generated input into the working buffer.
The same 16 generated mono frames and final flush produced byte-identical PCM on main and this head. That check uses the single-bin synthetic frame from #2795. The 46 active release tests in victory-formats passed, along with strict Clippy and the asset policy check.
Coordination claim
AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T23:42:51Z.
The Windows comparison used two distinct release test binaries at
63bcca4anda5142ae. All four outputs from decoding 16 generated mono frames plus the final flush matched byte for byte, with 8,430 nonzero samples out of 8,448. The isolated 128-, 256-, and 512-sample checks also matched bit for bit, including signed zero and very small finite samples.The isolated overlap-add step took roughly 19–34% less time on this host. The timings are for the synthetic operation in this PR. The 46 active victory-formats release tests and strict Clippy passed.
If you reuse the code, 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.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T00:23:33Z.
I checked
a5142aetogether with #3383 at23e62b7on63bcca4. The merge preserves both heads. Integration branch9df74ddI compared Windows x64 release binaries for #3383 alone and the merge. Each ran a 16-frame mono stream and a 16-frame stereo stream at 48 kHz. I used #2795's generated single-bin fixture and alternated the active channel in its stereo version. Both builds decoded every frame and appended the flush tail. The PCM matched byte for byte across the two builds for all 8,448 mono samples and all 16,896 interleaved stereo samples. The first stereo frame's right channel was zero, and both channels produced nonzero output over the stream.
The reusable encoded-frame buffer kept the same pointer and capacity through each stream. The allocating and reusable frame paths produced identical PCM within each build, including the flush, and both preserved the two samples already in the output vector.
The combined
victory-formatsrelease suite passed 48 tests with five ignored. Strict formats Clippy passed. The fixture exercises the decoder and packet-buffer path. The HLE worker is outside this run. AI-assisted with Codex.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T11:43:52Z.
I closed my duplicate #3721 and replayed the extra fixture on this exact
a5142aehead against63bcca4. The production inverse transform and each version of the overlap ran through four 64-subframe sequences. All 74,752 float values and PCM conversions matched in each run.Across four Windows release processes, with 24 balanced timing pairs per process and sequence, run-level medians were 1.3–3.8% faster for 128-sample sequences, 0.9% slower to 1.3% faster for 256, and 0.1–2.1% faster for 512. The mixed sequence ranged from 3.4% slower to 2.9% faster. These measurements cover the transform and overlap together. The original PR discussion has the isolated overlap results.
The next step is maintainer review of #3629.
AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T23:25:58Z.
I replayed the complete XMA decoder on exact
a5142aeand63bcca4with a wider generated fixture. It covers 128-, 256-, and 512-sample subframes at 24, 32, 44.1, and 48 kHz, with mono and three stereo configurations at each size and rate.Both Windows x64 release processes matched all 1,053,696 PCM samples through the final flush and all 1,769,472 intermediate floating-point state words across 1,152 generated frames. Each stream produced nonzero audio. A parallel fixed-width experiment matched the same data and ran faster in the isolated overlap loop. Full-decoder timings stayed within the run-to-run spread of this PR's paired loop. The next step is maintainer review.
AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by javi12olivar on 2026-11-29T12:36:32Z.
Independent Windows verification at
a5142ae(parent63bcca4):cargo test -p victory-formatspassed (46 passed, 0 failed, 5 ignored);git diff --checkis clean. I also compared the old and new overlap loops using deterministic synthetic buffers (32 each at window sizes 128, 256, and 512); outputs were bit-identical. This verifies the overlap change, but not decoding a full real PCM corpus or the reported performance gain.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.