Apply outstanding XMA sample skips to the final overlap #2710

Open
github-bot wants to merge 1 commit from github-bot/gh-2710 into main AGit
Owner

@⁠VlREX on GitHub · 2026-11-25 18:37 UTC · original
VlREX:fix/xma-tail-skip → main · +65 −21 · 1 files · 1 commits · open

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.

**@⁠VlREX** on GitHub · 2026-11-25 18:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/2710) `VlREX:fix/xma-tail-skip` → `main` · +65 −21 · 1 files · 1 commits · open 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:12:32 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 18:51 UTC · original

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.

**@⁠kotekompotek** on GitHub · 2026-11-25 18:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/2710#issuecomment-7171487940) 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.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 18:54 UTC · original

Independent WARP/CPU verification

PR head: fdfd7c25fdf2882507d051382fe6cb8b6e5d04c3
Environment: Windows 11 Pro 10.0.26200, rustc/cargo 1.98.1, WARP only (VICTORY_WARP=1 + VICTORY_D3D12_WARP=1), dxil.dll 1.8.2502.11 (Windows SDK 10.0.26100.0), no physical GPU touched, no game files/dumps/retail hashes. CARGO_TARGET_DIR on D:, --locked throughout. origin/main = 13f91caee25f2fdf2c062be5f7a27f058e51cbca; merges cleanly (git merge-tree); open, non-draft, no oni-swr comment on this head.

Commands / results (cargo test --locked -p victory-formats -p victory-hle):

  • Baseline: victory-formats 38/0/5 ignored; victory-hle 146 passed / 0 failed.
  • PR: victory-formats 38/0/5 ignored; victory-hle 147 passed / 0 failed (+a_start_skip_can_reach_into_the_final_overlap).
  • cargo clippy --locked -p victory-formats -p victory-hle --all-targets -- -D warnings → clean.
  • Negative control: reverting only the tail flush to 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-hle run, dstorage::tests::a_page_list_filled_after_its_request_starts failed 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_samples is the old skip logic factored out (min clamps, whole-sample accounting by channels) 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). The test_voice helper also dedups the loop test. channels is taken before flush — fine.

Not tested: physical hardware GPU, retail game run, release build.
AI use: Claude Code (Claude Sonnet 5.5). Claim: #1633

**@⁠oni-swr** on GitHub · 2026-11-25 18:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2710#issuecomment-7171559525) ## Independent WARP/CPU verification **PR head:** `fdfd7c25fdf2882507d051382fe6cb8b6e5d04c3` **Environment:** Windows 11 Pro 10.0.26200, rustc/cargo 1.98.1, WARP only (`VICTORY_WARP=1` + `VICTORY_D3D12_WARP=1`), `dxil.dll` 1.8.2502.11 (Windows SDK 10.0.26100.0), no physical GPU touched, no game files/dumps/retail hashes. `CARGO_TARGET_DIR` on D:, `--locked` throughout. `origin/main` = `13f91caee25f2fdf2c062be5f7a27f058e51cbca`; merges cleanly (`git merge-tree`); open, non-draft, no `oni-swr` comment on this head. **Commands / results** (`cargo test --locked -p victory-formats -p victory-hle`): - Baseline: victory-formats 38/0/5 ignored; victory-hle 146 passed / 0 failed. - PR: victory-formats 38/0/5 ignored; victory-hle **147 passed** / 0 failed (+`a_start_skip_can_reach_into_the_final_overlap`). - `cargo clippy --locked -p victory-formats -p victory-hle --all-targets -- -D warnings` → clean. - **Negative control:** reverting only the tail flush to `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-hle` run, `dstorage::tests::a_page_list_filled_after_its_request_starts` failed 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_samples` is the old skip logic factored out (`min` clamps, whole-sample accounting by `channels`) 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). The `test_voice` helper also dedups the loop test. `channels` is taken before `flush` — fine. **Not tested:** physical hardware GPU, retail game run, release build. **AI use:** Claude Code (Claude Sonnet 5.5). Claim: https://git.gtahub.st/github/Marvisak--VIctory/issues/1633
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 19:38 UTC · original

Independent Windows 11 verification and review of fdfd7c2 (on 13f91ca):

Verification (rustc 1.98.1 MSVC)

  • 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, including a_start_skip_can_reach_into_the_final_overlap), plus fidelityfx (1) and no_dll_planting (1) clean.
  • 5-way XMA merge compatibility: verified clean zero-conflict sequential git merge-tree across the entire 5-PR stack #2694 + #2708 + #2709 + #2710 + #2714.

Review Notes

  • Reusing Voice::append_samples on decoder.flush(&mut tail) cleanly applies any remaining voice.skip into the 256-sample overlap tail without breaking channel interleaving (tail.len() == 256 * channels), and pairs directly with #2709 for skips >= 5 subframes. Clean and ready to merge.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 19:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2710#issuecomment-7172581216) Independent Windows 11 verification and review of `fdfd7c2` (on `13f91ca`): ### Verification (`rustc 1.98.1` MSVC) - `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`, including `a_start_skip_can_reach_into_the_final_overlap`), plus `fidelityfx` (1) and `no_dll_planting` (1) clean. - **5-way XMA merge compatibility:** verified clean zero-conflict sequential `git merge-tree` across the entire 5-PR stack **#2694 + #2708 + #2709 + #2710 + #2714**. ### Review Notes - Reusing `Voice::append_samples` on `decoder.flush(&mut tail)` cleanly applies any remaining `voice.skip` into the 256-sample overlap tail without breaking channel interleaving (`tail.len() == 256 * channels`), and pairs directly with #2709 for skips `>= 5` subframes. Clean and ready to merge.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:23 UTC · original

Automated triage for the maintainers.

Merge candidate (recommend a look). The outstanding start skip in crates/victory-hle/src/modules/audio.rs was applied to decoded frames but not to the overlap tail that decode flushes 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 into Voice::append_samples and 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_voice also removes a duplicated struct literal from the loop test.

CI: check passing on this head. Merges cleanly with #2708, #2709 and #2714.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/2710#issuecomment-7176293325) <!-- victory-triage v1 head=fdfd7c25fdf2882507d051382fe6cb8b6e5d04c3 verdict=merge-candidate at=2026-11-25T22:23:30Z --> Automated triage for the maintainers. **Merge candidate (recommend a look).** The outstanding start skip in `crates/victory-hle/src/modules/audio.rs` was applied to decoded frames but not to the overlap tail that `decode` flushes 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 into `Voice::append_samples` and 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_voice` also removes a duplicated struct literal from the loop test. CI: `check` passing on this head. Merges cleanly with #2708, #2709 and #2714. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 05:11 UTC · original · approved these changes

Tested merged onto origin/main (63bcca4) on Windows 11 x64:

  • cargo test -p victory-hle --lib modules::audio::: 9 passed, 0 failed (including new a_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).

**@⁠Dukestar69** on GitHub · 2026-11-26 05:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/2710#pullrequestreview-6068863741) · **approved these changes** Tested merged onto `origin/main` (`63bcca4`) on Windows 11 x64: - `cargo test -p victory-hle --lib modules::audio::`: **9 passed, 0 failed** (including new `a_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).
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 12:09 UTC · original

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 base 13f91ca).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo 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.
  • The new tests ran and passed: a_start_skip_can_reach_into_the_final_overlap.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#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_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-26 12:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/2710#issuecomment-7191649785) 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 base `13f91ca`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo 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**. - The new tests ran and passed: `a_start_skip_can_reach_into_the_final_overlap`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#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_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2710/head:github-bot/gh-2710'
git switch 'github-bot/gh-2710'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2710'
git switch 'github-bot/gh-2710'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2710'
git switch 'github-bot/gh-2710'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2710'
git switch 'main'
git merge --squash 'github-bot/gh-2710'
git switch 'main'
git merge --ff-only 'github-bot/gh-2710'
git switch 'main'
git merge 'github-bot/gh-2710'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2710
No description provided.