Formats: append XMA PCM by channel layout #3631
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3631"
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-28T00:22:17Z.
Choose the mono or stereo PCM append path once per output block. Both paths use the existing sample conversion. Decode and flush share the append routine, and stereo samples remain interleaved left then right.
On Windows x86-64, 15 alternating A/B pairs of an isolated release benchmark with preallocated output gave these median microseconds per block.
The same 62 generated mono frames plus the final flush produced byte-identical PCM on main and this head's production code. The included regression checks the output prefix, stereo order, clipping, rounding and reset through the actual flush path. All 47 active victory-formats release tests, strict Clippy and the asset policy check passed.
Coordination claim
AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T00:22:54Z.
On Windows, the isolated PCM append benchmark took 5–16% less time across the mono and stereo block sizes. This is the median of 15 alternating A/B pairs per size with preallocated output. The complete synthetic mono decode timings overlapped, so the measured speedup is for the append step.
Every sample from 62 generated mono frames and the final flush matched main byte for byte. The committed test also checks the flush path with distinct left and right samples, a pre-existing output prefix, clipping, rounding and a second flush after reset. All 47 active release tests and strict Clippy passed.
If you reuse the code or test, 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:26:41Z.
I resolved the overlap with #3383 in the
decodeandflushoutput loops. This integration uses #3631's sharedappend_pcmand moves #3383's reservation into that helper, so each append reserves the whole interleaved block once. It also carries the verified #3629 overlap-add change. The branch keeps all three exact heads on63bcca4. Integration branch7713c9aI repeated the 48 kHz generated-stream check from #3629 in a separate Windows x64 release binary. It decoded 16 frames each of mono and stereo, alternated the active stereo channel, and flushed both streams. All 8,448 mono samples and 16,896 interleaved stereo samples matched #3383 byte for byte, including the flush tail. The output prefix and the reusable input buffer's pointer and capacity were preserved. Fixture results for #3383 + #3629
The combined formats release suite passed 49 tests, including the new clipping, interleave and flush-reset regression, with five ignored. Strict formats Clippy passed. This was a decoder check on generated audio. AI-assisted with Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T03:27:45Z.
I checked the rounding change from #3656 with the current
92ba3fbhead. Combined commit3aa473cpreserves both PR heads. The merge keeps this PR's shared channel-specific append routine and both regression tests. The rounding patch changes only the sample conversion and its test relative to this head.The exact sources produced the same 301,056 interleaved PCM samples for 288 generated stereo frames with 96 nonzero coefficients per channel and the final flush. The combined formats suite passed 43 tests, with five ignored and five unrelated noise tests filtered from the local run. Strict formats Clippy and asset policy passed.
Please retain the Git authors 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.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T10:00:15Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
92ba3fb135bfa9e2182046a77727a81d4c8399bd, base/parent63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-formats --lib -- xma::tests::flush_appends_mono_or_interleaved_stereo_and_resets --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 51 filtered, exit 0.git grep -Ffor the test name on the base returned no match (test is new on this PR);git diff --check 63bcca4 HEADclean (1 file, +41/-10).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2.AI-assisted (Hy4 flash).
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.