XAudio2: reject streams wider than two channels #1886

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

@⁠mokkamokacaffe on GitHub · 2026-11-24 22:34 UTC · original
mokkamokacaffe:xma2/validate-stream-channels → main · +17 −1 · 1 files · 1 commits · open

StreamConfig is public, but Decoder::new only checked the number of streams and the total channel count. Manually constructed configurations could therefore contain a zero-channel or three-channel stream. XMA streams support one or two channels, and decoder storage is fixed to two.

What is in it

  • Enforce one or two channels for every stream before constructing stream decoders and FIFOs.
  • Keep the aggregate channel-count check after the per-stream invariant.
  • Add regression cases for zero-channel and three-channel configurations and a valid 2 + 1 configuration.

Tested

  • Exact head 91deb1b989d74934b158f99af23cf3d039908677, NVIDIA GeForce RTX 5080, Windows 11, rustc 1.100.0, DXC 1.8.2502.11.
  • cargo build --workspace: passed.
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 972 passed, 4 failed, 45 ignored. The same four Direct-DXIL fuzz failures occur on base 689f2db; this PR introduced no new failure.
  • decoder_rejects_streams_outside_the_one_or_two_channel_xma_limit: passed.
  • git diff --check: passed.

Regression run

main:

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1657 (PresentX 1657)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14602 MB

PR:

xcl-smoke v1
commit: 91deb1b989d74934b158f99af23cf3d039908677
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1654 (PresentX 1654)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14599 MB

Not tested

  • World loading; the smoke runs stop at the start screen.
  • AMD.
  • XMA1/XMA2 playback through XAudio2 on Windows or Wine.

AI use

  • OpenAI Codex audited and implemented the constructor invariant and regression test.
  • Claude Code ran the independent Windows/NVIDIA suite and smoke pair and drafted the posted report; the contributor checked it.
**@⁠mokkamokacaffe** on GitHub · 2026-11-24 22:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/1886) `mokkamokacaffe:xma2/validate-stream-channels` → `main` · +17 −1 · 1 files · 1 commits · open `StreamConfig` is public, but `Decoder::new` only checked the number of streams and the total channel count. Manually constructed configurations could therefore contain a zero-channel or three-channel stream. XMA streams support one or two channels, and decoder storage is fixed to two. **What is in it** - Enforce one or two channels for every stream before constructing stream decoders and FIFOs. - Keep the aggregate channel-count check after the per-stream invariant. - Add regression cases for zero-channel and three-channel configurations and a valid `2 + 1` configuration. **Tested** - Exact head `91deb1b989d74934b158f99af23cf3d039908677`, NVIDIA GeForce RTX 5080, Windows 11, rustc 1.100.0, DXC 1.8.2502.11. - `cargo build --workspace`: passed. - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 972 passed, 4 failed, 45 ignored. The same four Direct-DXIL fuzz failures occur on base `689f2db`; this PR introduced no new failure. - `decoder_rejects_streams_outside_the_one_or_two_channel_xma_limit`: passed. - `git diff --check`: passed. **Regression run** main: ```xcl-smoke xcl-smoke v1 commit: 689f2db477c3c062cf162649781640ef8a977c18 gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1657 (PresentX 1657) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14602 MB ``` PR: ```xcl-smoke xcl-smoke v1 commit: 91deb1b989d74934b158f99af23cf3d039908677 gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1654 (PresentX 1654) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14599 MB ``` **Not tested** - World loading; the smoke runs stop at the start screen. - AMD. - XMA1/XMA2 playback through XAudio2 on Windows or Wine. **AI use** - OpenAI Codex audited and implemented the constructor invariant and regression test. - Claude Code ran the independent Windows/NVIDIA suite and smoke pair and drafted the posted report; the contributor checked it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:08:33 +00:00
Author
Owner

@⁠frenziedcoder on GitHub · 2026-11-24 23:24 UTC · original

NVIDIA test report for 91deb1b: no new test failures (the 4 that fail also fail on 689f2db), its own test decoder_rejects_streams_outside_the_one_or_two_channel_xma_limit passes, and a clean smoke pair on the retail title (1654 vs 1657 frames).

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head 91deb1b989d74934b158f99af23cf3d039908677, no local changes.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 (debug): 972 passed, 4 failed, 45 ignored; the PR's own test decoder_rejects_streams_outside_the_one_or_two_channel_xma_limit passes. SKIPPED: gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu (no wave64), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 packed, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 compares, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 conversions, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 rounding, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 three-source, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 transcendentals, wave64: no wave64), gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu (f64, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer carries, wave64: no wave64), gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • The 4 failures are fuzz_validate_and_gpu_0, fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_2, fuzz_validate_and_gpu_3 in gpu::dxil::fuzz_tests. They fail the same way on the base 689f2db here (0x8007000E from CreateComputePipelineState on seeds 70, 545, 1019 and 1507, the NVIDIA refusal @⁠PHeitor1 reported on #1679), so this PR adds no failure.
  • test_title_draws_with_a_root_signature_under_the_debug_layer reports ok, but this machine has no D3D12 debug layer (debug layer requested but unavailable … (0x887A002D)), so it ran without the layer and is no evidence either way.

Regression run (scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen; XCL_PSO_PRELOAD=0 for both builds, because this machine's preload list holds the program of #1307)

base (689f2db, this PR's merge base with main):

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1657 (PresentX 1657)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14602 MB

this PR:

xcl-smoke v1
commit: 91deb1b989d74934b158f99af23cf3d039908677
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1654 (PresentX 1654)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14599 MB

Not tested: the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD.

AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.

**@⁠frenziedcoder** on GitHub · 2026-11-24 23:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/1886#issuecomment-7147361809) **NVIDIA test report for `91deb1b`: no new test failures (the 4 that fail also fail on `689f2db`), its own test `decoder_rejects_streams_outside_the_one_or_two_channel_xma_limit` passes, and a clean smoke pair on the retail title (1654 vs 1657 frames).** **Tested** - NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 `stable-x86_64-pc-windows-msvc`, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head `91deb1b989d74934b158f99af23cf3d039908677`, no local changes. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): **972 passed, 4 failed, 45 ignored**; the PR's own test `decoder_rejects_streams_outside_the_one_or_two_channel_xma_limit` passes. SKIPPED: `gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu` (no wave64), `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 arithmetic, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 packed, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 arithmetic, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 compares, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 conversions, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 rounding, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 three-source, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 transcendentals, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu` (f64, wave64: no wave64), `gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu` (integer arithmetic, wave64: no wave64), `gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu` (integer carries, wave64: no wave64), `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - The 4 failures are `fuzz_validate_and_gpu_0`, `fuzz_validate_and_gpu_1`, `fuzz_validate_and_gpu_2`, `fuzz_validate_and_gpu_3` in `gpu::dxil::fuzz_tests`. They fail the same way on the base `689f2db` here (`0x8007000E` from `CreateComputePipelineState` on seeds 70, 545, 1019 and 1507, the NVIDIA refusal @⁠PHeitor1 reported on #1679), so this PR adds no failure. - `test_title_draws_with_a_root_signature_under_the_debug_layer` reports ok, but this machine has no D3D12 debug layer (`debug layer requested but unavailable … (0x887A002D)`), so it ran without the layer and is no evidence either way. **Regression run** (`scripts/smoke.ps1 -Seconds 60`, release, the retail title of #505 at its start screen; `XCL_PSO_PRELOAD=0` for both builds, because this machine's preload list holds the program of #1307) base (`689f2db`, this PR's merge base with `main`): ``` xcl-smoke v1 commit: 689f2db477c3c062cf162649781640ef8a977c18 gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1657 (PresentX 1657) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14602 MB ``` this PR: ``` xcl-smoke v1 commit: 91deb1b989d74934b158f99af23cf3d039908677 gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1654 (PresentX 1654) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14599 MB ``` **Not tested:** the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD. *AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.*
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 02:07 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 02:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/1886#issuecomment-7150341663) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 02:56 UTC · original

PR #1886 compatibility verification

Tested detached head 91deb1b989d74934b158f99af23cf3d039908677 on STOR-WINLAB (Windows 11 Enterprise Evaluation build 26200.9974, Ryzen 7 3800X). Intel Arc A770 16 GiB, driver 32.0.101.9175, wave range 8–32, DoublePrecisionFloatShaderOps=0. DXC/DXIL 1.9.2609.5. Rust 1.100.0 (0ef1bc386, 2026-11-09), unoptimized profiles with debug info disabled.

Tested

  • cargo build --workspace and cargo test --workspace --no-run both succeeded outside the GPU lock.
  • cargo test -p xcl hle::xma2::tests:: -- --nocapture reported 8 passed, 0 failed, 0 ignored. The new Decoder::new test passed for rejection of zero- and three-channel streams and acceptance of a three-channel configuration split into stereo and mono. XMA1/XMA2 decode fixtures and 5.1 interleaving also passed.
  • cargo test -p xcl hle::xaudio2::tests:: -- --nocapture reported 9 passed, 0 failed, 0 ignored. The system XAudio2 engine test passed. Three tests returned early when CreateMasteringVoice failed with 0x80070490 (no audio endpoint), including the XMA2 source-voice test.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once under the shared Arc lock with RUST_TEST_NOCAPTURE=1. Cargo exited 101. Summed across 20 harness summaries, including doctests, 951 passed, 25 failed, 45 ignored. The XMA2 regression test passed again.

Of the 25 failures, 20 GPU tests hit CreateComputePipelineState error 0x80070057. Four GPU assertions failed (FMA overflow, implicit-LOD sampling, packed f16 high-half preservation, and wave64 pixel reduction). The test title failed its RSSetDepthBiasX check, drawing blue where green was expected.

The log has 25 SKIPPED lines covering 17 wave64 cases, three unsupported per-lane forms, two debug-layer cases, and one each for tiled tier, heap windows, and driver-cache control. These markers include subcases and confer no coverage.

Not tested

Audio-endpoint playback, D3D12 debug-layer paths, optional game samples, other GPU vendors, and retail-title smoke or comparison against main.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1886-suite.log and published this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 02:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/1886#issuecomment-7151377556) # PR #1886 compatibility verification Tested detached head `91deb1b989d74934b158f99af23cf3d039908677` on STOR-WINLAB (Windows 11 Enterprise Evaluation build 26200.9974, Ryzen 7 3800X). Intel Arc A770 16 GiB, driver 32.0.101.9175, wave range 8–32, `DoublePrecisionFloatShaderOps=0`. DXC/DXIL 1.9.2609.5. Rust 1.100.0 (0ef1bc386, 2026-11-09), unoptimized profiles with debug info disabled. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` both succeeded outside the GPU lock. - `cargo test -p xcl hle::xma2::tests:: -- --nocapture` reported 8 passed, 0 failed, 0 ignored. The new `Decoder::new` test passed for rejection of zero- and three-channel streams and acceptance of a three-channel configuration split into stereo and mono. XMA1/XMA2 decode fixtures and 5.1 interleaving also passed. - `cargo test -p xcl hle::xaudio2::tests:: -- --nocapture` reported 9 passed, 0 failed, 0 ignored. The system XAudio2 engine test passed. Three tests returned early when `CreateMasteringVoice` failed with `0x80070490` (no audio endpoint), including the XMA2 source-voice test. - `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once under the shared Arc lock with `RUST_TEST_NOCAPTURE=1`. Cargo exited 101. Summed across 20 harness summaries, including doctests, **951 passed, 25 failed, 45 ignored**. The XMA2 regression test passed again. Of the 25 failures, 20 GPU tests hit `CreateComputePipelineState` error `0x80070057`. Four GPU assertions failed (FMA overflow, implicit-LOD sampling, packed f16 high-half preservation, and wave64 pixel reduction). The test title failed its `RSSetDepthBiasX` check, drawing blue where green was expected. The log has 25 `SKIPPED ` lines covering 17 wave64 cases, three unsupported per-lane forms, two debug-layer cases, and one each for tiled tier, heap windows, and driver-cache control. These markers include subcases and confer no coverage. **Not tested** Audio-endpoint playback, D3D12 debug-layer paths, optional game samples, other GPU vendors, and retail-title smoke or comparison against `main`. **AI use** T3 Code / Codex (`gpt-6.2-sol`, `reasoningEffort: high`) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, `gemini-4-neon`) verified counts against `pr1886-suite.log` and published this report.
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/1886/head:github-bot/gh-1886'
git switch 'github-bot/gh-1886'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1886'
git switch 'github-bot/gh-1886'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1886'
git switch 'github-bot/gh-1886'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1886'
git switch 'main'
git merge --squash 'github-bot/gh-1886'
git switch 'main'
git merge --ff-only 'github-bot/gh-1886'
git switch 'main'
git merge 'github-bot/gh-1886'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.