Formats: process XMA stereo bands through paired slices #3649

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3649 into main
andrewpozdnakov7-jpg commented 2026-11-28 02:15:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T02:15:43Z.


The stereo inverse transform in the XMA decoder can walk each coefficient band as a pair of mutable slices. The channel equations and their evaluation order are preserved.

On a Windows Core i7-870 with Rust 1.98.1 -O, three repeated 17-pair runs gave paired median improvements of 14–18% for 512 coefficients per channel, 22–25% for 256, and 27–29% for 128. This measures the inverse transform on prepared stereo bands.

Coefficient outputs were bit-identical across 288 configurations. Decoding and flushing 288 valid generated stereo frames at four sample rates produced 301,056 identical PCM samples across all-band, alternating-band, and scaling-only cases. The audited scope is the stereo coefficient transform.

41 format tests passed in release mode. Five ignored tests and five randomized-noise tests were outside that run. Strict Clippy and asset policy (191 files) passed. Git merges cleanly with #3629, #3631, and #3383.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5535726992 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3649). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T02:15:43Z. --- The stereo inverse transform in the XMA decoder can walk each coefficient band as a pair of mutable slices. The channel equations and their evaluation order are preserved. On a Windows Core i7-870 with Rust 1.98.1 `-O`, three repeated 17-pair runs gave paired median improvements of 14–18% for 512 coefficients per channel, 22–25% for 256, and 27–29% for 128. This measures the inverse transform on prepared stereo bands. Coefficient outputs were bit-identical across 288 configurations. Decoding and flushing 288 valid generated stereo frames at four sample rates produced 301,056 identical PCM samples across all-band, alternating-band, and scaling-only cases. The audited scope is the stereo coefficient transform. 41 format tests passed in release mode. Five ignored tests and five randomized-noise tests were outside that run. Strict Clippy and asset policy (191 files) passed. Git merges cleanly with #3629, #3631, and #3383. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 02:16:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T02:16:06Z.


Matched the stereo transform in 03b1d25f14e3dfceb0dc29b30fc91a1b1671f804 against 63bcca43c6a00a758510398fa43096ce7e4f7df0. Across 288 coefficient configurations, both channels matched bit for bit, including signed zero and the mono/no-transform controls. Decoding and flushing 288 generated stereo frames gave the same 301,056 PCM samples. The SHA-256 was 0958d6798e188d8404ffe853d7cb671ae348e9d7ba25b07a40598ff0251f0a4c.

Three repeated Windows measurements with Rust 1.98.1 -O gave paired median reductions of 14–18%, 22–25%, and 27–29% on 512-, 256-, and 128-coefficient stereo bands. The fixture times the transform itself. The release format suite passed 41 tests, with five noisy-input tests filtered and five ignored. Strict Clippy and asset policy passed.

Please preserve the Git author if cherry-picking or rebasing, or include this trailer if folding the change into another commit.

Co-authored-by: andrewpozdnakov7-jpg <[email protected]>

<!-- greyfinch-sync:Marvisak/VIctory:comment:7232247213 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3649#issuecomment-7232247213). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T02:16:06Z. --- Matched the stereo transform in `03b1d25f14e3dfceb0dc29b30fc91a1b1671f804` against `63bcca43c6a00a758510398fa43096ce7e4f7df0`. Across 288 coefficient configurations, both channels matched bit for bit, including signed zero and the mono/no-transform controls. Decoding and flushing 288 generated stereo frames gave the same 301,056 PCM samples. The SHA-256 was `0958d6798e188d8404ffe853d7cb671ae348e9d7ba25b07a40598ff0251f0a4c`. Three repeated Windows measurements with Rust 1.98.1 `-O` gave paired median reductions of 14–18%, 22–25%, and 27–29% on 512-, 256-, and 128-coefficient stereo bands. The fixture times the transform itself. The release format suite passed 41 tests, with five noisy-input tests filtered and five ignored. Strict Clippy and asset policy passed. Please preserve the Git author if cherry-picking or rebasing, or include this trailer if folding the change into another commit. `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`
Dukestar69 commented 2026-11-28 02:45:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-28T02:45:16Z.

Review: APPROVED


LGTM — verified on Windows:

  • cargo test -p victory-formats --lib xma:: passed (20/20)
  • cargo clippy -p victory-formats --all-targets -- -D warnings passed with 0 warnings
  • cargo xtask policy passed (191 files ok)

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

<!-- greyfinch-sync:Marvisak/VIctory:review:6095247282 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3649#pullrequestreview-6095247282). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-28T02:45:16Z. **Review:** APPROVED --- LGTM — verified on Windows: - `cargo test -p victory-formats --lib xma::` passed (20/20) - `cargo clippy -p victory-formats --all-targets -- -D warnings` passed with 0 warnings - `cargo xtask policy` passed (`191 files ok`) Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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/3649:upstream-pr/3649'
git switch 'upstream-pr/3649'

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/3649'
git switch 'upstream-pr/3649'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3649'
git switch 'upstream-pr/3649'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3649'
git switch 'main'
git merge --squash 'upstream-pr/3649'
git switch 'main'
git merge --ff-only 'upstream-pr/3649'
git switch 'main'
git merge 'upstream-pr/3649'
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!3649
No description provided.