Apply outstanding XMA sample skips to the final overlap #2708
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2710"
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 VlREX on 2026-11-25T18:37:12Z.
A one-frame XMA voice emits 512 samples plus a 256-sample overlap per channel. With a start skip of five subframes (640 samples), the decoder previously queued 256 samples instead of the remaining 128 because flushing bypassed the skip counter. Route flushed samples through the same skip handling as ordinary frame data. A synthetic one-frame test covers skips of four through seven subframes, including an empty tail. Confirmed the five-subframe case failed before the fix. All nine audio module tests pass in an isolated Windows GNU run using the real XMA decoder. This concerns PCM queued by the voice, complementary to the ring-writer fix in #2709.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T18:51:00Z.
Clean unification - routing the flush tail through append_samples applies the outstanding skip in the same units (skip in subframes, pcm in samples x channels, decrement by skip/channels). The 4..=7 sweep covers the case where the tail is entirely consumed by the skip.
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T18:54:14Z.
Independent WARP/CPU verification
PR head:
fdfd7c25fdf2882507d051382fe6cb8b6e5d04c3Environment: Windows 11 Pro 10.0.26200, rustc/cargo 1.98.1, WARP only (
VICTORY_WARP=1+VICTORY_D3D12_WARP=1),dxil.dll1.8.2502.11 (Windows SDK 10.0.26100.0), no physical GPU touched, no game files/dumps/retail hashes.CARGO_TARGET_DIRon D:,--lockedthroughout.origin/main=13f91caee25f2fdf2c062be5f7a27f058e51cbca; merges cleanly (git merge-tree); open, non-draft, nooni-swrcomment on this head.Commands / results (
cargo test --locked -p victory-formats -p victory-hle):a_start_skip_can_reach_into_the_final_overlap).cargo clippy --locked -p victory-formats -p victory-hle --all-targets -- -D warnings→ clean.voice.pcm.extend(tail)makes the new test FAIL at "skip 5 subframes" (audio.rs:1310); the other 146 pass.Baseline note: on the very first baseline
victory-hlerun,dstorage::tests::a_page_list_filled_after_its_request_startsfailed once (assertion left==right); it passed 3/3 reruns in isolation and in a full rerun (146/146), so it looks like a flaky pre-existing test unrelated to this PR.Review: no bugs found.
append_samplesis the old skip logic factored out (minclamps, whole-sample accounting bychannels) and now also applies to the flushed overlap; the loop path's behavior is unchanged. The test sweeps skip = 4..7 subframes across the frame/overlap boundary including a fully-consumed tail (expected 0). Thetest_voicehelper also dedups the loop test.channelsis taken beforeflush— fine.Not tested: physical hardware GPU, retail game run, release build.
AI use: Claude Code (Claude Sonnet 5.5). Claim: https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7171257593
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T19:38:49Z.
Independent Windows 11 verification and review of
fdfd7c2(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo xtask policy: 184 files ok.cargo clippy --locked -p victory-formats -p victory-hle --all-targets -- -D warnings: 0 warnings.cargo test --locked -p victory-formats: 38 passed, 0 failed, 5 ignored.cargo test --locked -p victory-hle: 147 passed, 0 failed (lib, includinga_start_skip_can_reach_into_the_final_overlap), plusfidelityfx(1) andno_dll_planting(1) clean.git merge-treeacross the entire 5-PR stack #2694 + #2708 + #2709 + #2710 + #2714.Review Notes
Voice::append_samplesondecoder.flush(&mut tail)cleanly applies any remainingvoice.skipinto the 256-sample overlap tail without breaking channel interleaving (tail.len() == 256 * channels), and pairs directly with #2709 for skips>= 5subframes. Clean and ready to merge.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:23:01Z.
Automated triage for the maintainers.
Merge candidate (recommend a look). The outstanding start skip in
crates/victory-hle/src/modules/audio.rswas applied to decoded frames but not to the overlap tail thatdecodeflushes when input runs out. A one-frame voice with a skip of five subframes therefore queued 256 tail samples instead of 128. The skip logic moves unchanged intoVoice::append_samplesand is used for both, so the loop path behaves exactly as before. The test sweeps skips of four to seven subframes across the frame/tail boundary, including a tail consumed entirely, and fails on main at five.test_voicealso removes a duplicated struct literal from the loop test.CI:
checkpassing on this head. Merges cleanly with #2708, #2709 and #2714.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T05:11:37Z.
Review: APPROVED
Tested merged onto
origin/main(63bcca4) on Windows 11 x64:cargo test -p victory-hle --lib modules::audio::: 9 passed, 0 failed (including newa_start_skip_can_reach_into_the_final_overlap).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T12:09:57Z.
NVIDIA full-suite run, to go with the reports above by Dukestar69, fuzeofficlal, oni-swr, since none of them names a GPU run. Tested exact head
fdfd7c2(on its base13f91ca).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo 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.a_start_skip_can_reach_into_the_final_overlap.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#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_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T02:23:27Z.
Review: APPROVED
Looks good to me — clean helper extraction that ensures outstanding start/loop sample skips are also applied to the flushed overlap tail at end-of-stream.
Review & Verification Notes
crates/victory-hle/src/modules/audio.rs:Voice::append_samplesshares the exact same clamping and underflow-free skip accounting across normal decoded frames anddecoder.flush(&mut tail), usingdecoder.channels()(always1or2pervictory_formats::xma::Decoder) and returning!voice.pcm.is_empty()accurately when the tail is partially or completely skipped.origin/main(63bcca43):cargo xtask policypasses (191 files ok).cargo clippy -p victory-hle(--lib,--tests, and--features diagnostics--lib/--tests,-D warnings) is clean.victory-hlemodules::audiopasses (9/9, includinga_start_skip_can_reach_into_the_final_overlap) under both default and--features diagnosticsbuilds.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T16:34:43Z.
I checked this final-overlap fix together with #3631's channel-aware PCM output on current main (
63bcca4). The tested branch 64100a0 preserves both original heads,fdfd7c2and92ba3fb.The original one-frame test passes for start skips of four through seven subframes, including the empty tail. The extra stereo regression starts with a three-frame skip: an initial block consumes two whole left/right pairs, and the next block discards one more pair. The two remaining pairs read back in the expected order with both channels intact.
On Windows, 10 audio-module tests and all 14 active XMA tests passed, including the PCM flush and decoder-reset test. Strict Clippy and the asset policy passed. These checks use generated data.
The next step is author or maintainer review. Please retain the Git author on cherry-pick or rebase, or add a Co-authored-by trailer for andrewpozdnakov7-jpg [email protected] if folding the stereo regression into another commit.
AI-assisted with OpenAI Codex.
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.