Formats: walk the two XMA overlap halves directly #3721

Closed
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3721 into main
andrewpozdnakov7-jpg commented 2026-11-28 11:28:11 +00:00 (Migrated from github.com)

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


Split the samples and sine weights into their two active halves, then walk the second half of each in reverse. Each output pair keeps the same multiply/add order. This removes repeated index arithmetic and lets the compiler work with disjoint slices.

The exact old and new functions matched bit for bit in 1,120 generated cases, including signed zero, subnormal inputs, and empty or odd blocks. Four sequences of 64 subframes compared the production inverse transform plus overlap with the old and new routines. All 74,752 float values and their PCM conversions matched.

Generated sequence Main median Proposed median
128-sample subframes 113.35 µs 110.65 µs
256-sample subframes 223.82 µs 218.88 µs
512-sample subframes 429.55 µs 425.14 µs
Mixed sizes 209.82 µs 207.99 µs

These are 24 balanced Windows release samples per sequence for the transform and overlap stages. In isolation, the overlap improved at 128 and 512 samples and was within 0.4% at 256. Whole-title audio performance remains unmeasured.

The formats suite passed 46 tests with five ignored. Strict Clippy and the asset policy passed.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5539643374 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3721). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T11:28:11Z. --- Split the samples and sine weights into their two active halves, then walk the second half of each in reverse. Each output pair keeps the same multiply/add order. This removes repeated index arithmetic and lets the compiler work with disjoint slices. The exact old and new functions matched bit for bit in 1,120 generated cases, including signed zero, subnormal inputs, and empty or odd blocks. Four sequences of 64 subframes compared the production inverse transform plus overlap with the old and new routines. All 74,752 float values and their PCM conversions matched. | Generated sequence | Main median | Proposed median | | --- | ---: | ---: | | 128-sample subframes | 113.35 µs | 110.65 µs | | 256-sample subframes | 223.82 µs | 218.88 µs | | 512-sample subframes | 429.55 µs | 425.14 µs | | Mixed sizes | 209.82 µs | 207.99 µs | These are 24 balanced Windows release samples per sequence for the transform and overlap stages. In isolation, the overlap improved at 128 and 512 samples and was within 0.4% at 256. Whole-title audio performance remains unmeasured. The formats suite passed 46 tests with five ignored. Strict Clippy and the asset policy passed. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 11:32:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T11:32:00Z.


The exact 6b686ba head passed Windows CI, including the workspace tests and both Clippy configurations. The generated XMA test produced bit-identical float outputs and PCM across all four subframe sequences. The transform and overlap stages improved by 0.9–2.4% in those Windows release measurements. End-to-end title audio remains unmeasured.

Next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7238614178 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3721#issuecomment-7238614178). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T11:32:00Z. --- The exact `6b686ba` head passed [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46140026214/job/140963699690), including the workspace tests and both Clippy configurations. The generated XMA test produced bit-identical float outputs and PCM across all four subframe sequences. The transform and overlap stages improved by 0.9–2.4% in those Windows release measurements. End-to-end title audio remains unmeasured. Next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 11:41:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T11:41:53Z.


Closing this duplicate in favor of #3629. Both changes use the same paired slices and floating-point expressions. I will attach the additional transform-and-overlap measurements to #3629 after replaying its exact head.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7238722788 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3721#issuecomment-7238722788). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T11:41:53Z. --- Closing this duplicate in favor of #3629. Both changes use the same paired slices and floating-point expressions. I will attach the additional transform-and-overlap measurements to #3629 after replaying its exact head.

Pull request closed

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!3721
No description provided.