Tests: the XMA2 voice test accepts no context before Start under Wine #1557

Closed
github-bot wants to merge 1 commit from gh-pr/1557/head into gh-pr/1557/base
Owner

@⁠pablogonz12 on GitHub · 2026-11-24 17:39 UTC · original
pablogonz12:tests-xma2-voice-wine-context → main · +11 −1 · 1 files · 1 commits · closed without merging

xma2_source_voice_decodes_and_manages_lifetime fails under Wine: right after the two buffers are submitted, GetState returns buffers_queued 2 but a null pCurrentBufferContext, and the test asserted the head buffer's context (left: 0, right: 12291). The null comes from Wine's own XAudio2 (FAudio): I printed the value get_state receives from the original function, before XCL maps the token back, and it is already 0 there. So XCL's mapping is not the cause; the test expected the Windows behaviour. Under Wine the test now only requires that the context is never XCL's internal token, before Start and while the voice plays.

What is in it

  • crates/xcl/src/hle/xaudio2.rs (test only): before Start the context must be the head buffer's on Windows; under Wine (util::under_wine()) it may also be 0. A GetState sample in the existing playback wait loop checks it is 0 or one of the two contexts.

Tested

  • AMD Radeon RX 9070 XT (RDNA4, RADV / Mesa 26.3.1), Ryzen 9 9900X, CachyOS (Linux 7.3), Wine (GE-Proton11-14), vkd3d-proton v3.1 + the #257 patch with subprojects/dxil-spirv at master 7c048638, DXC 1.9.2609.5, Rust stable, release, x86_64-pc-windows-gnu (llvm-mingw). No Windows build.
  • The test alone: fails on main 9e3831e, passes on this branch.
  • cargo test -p xcl --lib --release --target x86_64-pc-windows-gnu, run under Wine with --test-threads=4, 0 SKIPPED:
    • this branch (f21f0e9): 722 passed, 5 failed, 21 ignored on one run; 720 passed, 7 failed on another (the extra two, placed_title_textures_share_vram_and_preserve_pixels and d32s8_targets_take_their_own_size_of_video_memory, are the cross-test interference of #343 and pass alone);
    • main (9e3831e): 721 passed, 6 failed, 21 ignored.
    • The five that fail on both: gpu_f64_roots, gpu_f64_math_random (#530), gpu_nonfused_mad_and_mac_prevent_fma_contraction (#472, #676), gpu_depth_buffer_created_for_unordered_access_is_placed (#1475), pe::tests::parses_own_test_binary_tls (#464). main also fails this test.

Regression run

  • The PR description check treats crates/xcl/src/hle/xaudio2.rs as runtime, so it asks for a scripts/smoke.ps1 pair. Both blocks below were run by @⁠Toons29 and posted at #1557 (retail title, 60 s, main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time); I did not run them myself. Pasted unedited:
xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: f21f0e9c25ff1375050734b4c61fcb25c01ff60e
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1633 (PresentX 1633)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14813 MB
  • Windows 11 build 26300, Ryzen 7 7800X3D, driver 32.0.32029.2010: 101 % of main's frames, 100 % of its peak commit, no crash, no device removal.

Not tested

  • Windows: the assertion that Windows' XAudio2 reports the head buffer's context before Start is kept as it was; I did not run it there.
  • Other Wine builds (other FAudio versions may report the context).

AI use

  • Claude Code (Claude Sonnet 5.5): found the cause, wrote the change and this description, and ran the tests above on my machine.
**@⁠pablogonz12** on GitHub · 2026-11-24 17:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1557) `pablogonz12:tests-xma2-voice-wine-context` → `main` · +11 −1 · 1 files · 1 commits · closed without merging `xma2_source_voice_decodes_and_manages_lifetime` fails under Wine: right after the two buffers are submitted, `GetState` returns `buffers_queued` 2 but a null `pCurrentBufferContext`, and the test asserted the head buffer's context (`left: 0, right: 12291`). The null comes from Wine's own XAudio2 (FAudio): I printed the value `get_state` receives from the original function, before XCL maps the token back, and it is already 0 there. So XCL's mapping is not the cause; the test expected the Windows behaviour. Under Wine the test now only requires that the context is never XCL's internal token, before Start and while the voice plays. **What is in it** - `crates/xcl/src/hle/xaudio2.rs` (test only): before Start the context must be the head buffer's on Windows; under Wine (`util::under_wine()`) it may also be 0. A `GetState` sample in the existing playback wait loop checks it is 0 or one of the two contexts. **Tested** - AMD Radeon RX 9070 XT (RDNA4, RADV / Mesa 26.3.1), Ryzen 9 9900X, CachyOS (Linux 7.3), Wine (GE-Proton11-14), vkd3d-proton v3.1 + the #257 patch with `subprojects/dxil-spirv` at master `7c048638`, DXC 1.9.2609.5, Rust stable, release, `x86_64-pc-windows-gnu` (llvm-mingw). No Windows build. - The test alone: fails on `main` `9e3831e`, passes on this branch. - `cargo test -p xcl --lib --release --target x86_64-pc-windows-gnu`, run under Wine with `--test-threads=4`, 0 `SKIPPED`: - this branch (`f21f0e9`): 722 passed, 5 failed, 21 ignored on one run; 720 passed, 7 failed on another (the extra two, `placed_title_textures_share_vram_and_preserve_pixels` and `d32s8_targets_take_their_own_size_of_video_memory`, are the cross-test interference of #343 and pass alone); - `main` (`9e3831e`): 721 passed, 6 failed, 21 ignored. - The five that fail on both: `gpu_f64_roots`, `gpu_f64_math_random` (#530), `gpu_nonfused_mad_and_mac_prevent_fma_contraction` (#472, #676), `gpu_depth_buffer_created_for_unordered_access_is_placed` (#1475), `pe::tests::parses_own_test_binary_tls` (#464). `main` also fails this test. **Regression run** - The `PR description` check treats `crates/xcl/src/hle/xaudio2.rs` as runtime, so it asks for a `scripts/smoke.ps1` pair. Both blocks below were run by @⁠Toons29 and posted at https://git.gtahub.st/github/xcl-dev--xcl/pulls/1557 (retail title, 60 s, `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time); I did not run them myself. Pasted unedited: ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: f21f0e9c25ff1375050734b4c61fcb25c01ff60e gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1633 (PresentX 1633) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14813 MB ``` - Windows 11 build 26300, Ryzen 7 7800X3D, driver 32.0.32029.2010: 101 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. **Not tested** - Windows: the assertion that Windows' XAudio2 reports the head buffer's context before Start is kept as it was; I did not run it there. - Other Wine builds (other FAudio versions may report the context). **AI use** - Claude Code (Claude Sonnet 5.5): found the cause, wrote the change and this description, and ran the tests above on my machine.
Windows' XAudio2 reports the head buffer's context before Start; Wine's
(FAudio) reports none until the voice runs. Under Wine the test now only
requires that GetState never returns XCL's internal token, before Start and
while the voice plays.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:57:27 +00:00
github-bot closed this pull request 2026-11-26 04:57:27 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 18:50 UTC · original

Full-suite run, since this PR has no test report yet. Tested exact head f21f0e9 (on its base 9e3831e).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form: 775 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 776 passed, 0 failed, 41 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • heap_window_out_of_memory_falls_back_to_the_switch_form was skipped with --skip. It fails on main 9e3831e too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWS unset). Reported as #1651.

Not tested

  • a release build, a game (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-24 18:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/1557#issuecomment-7141230883) Full-suite run, since this PR has no test report yet. Tested exact head `f21f0e9` (on its base `9e3831e`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form`: **775 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - No new `#[test]` functions in the diff. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **776 passed, 0 failed, 41 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `heap_window_out_of_memory_falls_back_to_the_switch_form` was skipped with `--skip`. It fails on main `9e3831e` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (`XCL_HEAP_WINDOWS` unset). Reported as #1651. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 19:32 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 19:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/1557#issuecomment-7142243938) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠Toons29 on GitHub · 2026-11-24 21:43 UTC · original

Regression run of f21f0e9c on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: f21f0e9c25ff1375050734b4c61fcb25c01ff60e
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1633 (PresentX 1633)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14813 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-24 21:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/1557#issuecomment-7145300293) Regression run of `f21f0e9c` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: f21f0e9c25ff1375050734b4c61fcb25c01ff60e gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1633 (PresentX 1633) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14813 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 05:20 UTC · original

Empirical test report (f21f0e9c)

Commit f21f0e9c25ff1375050734b4c61fcb25c01ff60e in PR #1557.

Hardware / environment

  • STOR-WINLAB, native Windows x64 build 26200, AMD64 Family 23 Model 113.
  • Rust 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5 (01b62ad47). Cargo used the unoptimized test profile with incremental compilation and debug info disabled.
  • Both commands ran outside Invoke-ArcTest.ps1 with zero Arc GPU mutex hold. The focused test uses XAudio2 and requires no D3D12 device.

Commands and results

  • cargo test --workspace --no-run built the workspace test executables and exited 0.
  • With XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1, cargo test -p xcl --lib hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime -- --nocapture exited 0. Rust reported 1 passed, 0 failed, 0 ignored, and 747 filtered out. The log contained 0 uppercase SKIPPED markers and 1 explicit audio skip. The focused run provided coverage of the changed assertions in 0 tests.

Observed behavior

System XAudio2 2.9 created its engine. CreateMasteringVoice returned 0x80070490 on the initial attempt and again after retrying with defaults. The test printed skipping: no audio device and returned before creating the XMA2 source voice. Rust counted the early return as a pass.

Not tested

The run had no available audio output endpoint. The pre-Start and playback context assertions were unexercised on Windows, and Wine/FAudio behavior remains unverified. The full GPU workspace suite and game smoke runs were omitted.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1557-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 05:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1557#issuecomment-7153672726) ### Empirical test report (f21f0e9c) Commit `f21f0e9c25ff1375050734b4c61fcb25c01ff60e` in PR #1557. **Hardware / environment** - STOR-WINLAB, native Windows x64 build 26200, AMD64 Family 23 Model 113. - Rust `1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.9.2609.5 (01b62ad47)`. Cargo used the unoptimized test profile with incremental compilation and debug info disabled. - Both commands ran outside `Invoke-ArcTest.ps1` with zero Arc GPU mutex hold. The focused test uses XAudio2 and requires no D3D12 device. **Commands and results** - `cargo test --workspace --no-run` built the workspace test executables and exited 0. - With `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1`, `cargo test -p xcl --lib hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime -- --nocapture` exited 0. Rust reported 1 passed, 0 failed, 0 ignored, and 747 filtered out. The log contained 0 uppercase `SKIPPED` markers and 1 explicit audio skip. The focused run provided coverage of the changed assertions in 0 tests. **Observed behavior** System XAudio2 2.9 created its engine. `CreateMasteringVoice` returned `0x80070490` on the initial attempt and again after retrying with defaults. The test printed `skipping: no audio device` and returned before creating the XMA2 source voice. Rust counted the early return as a pass. **Not tested** The run had no available audio output endpoint. The pre-Start and playback context assertions were unexercised on Windows, and Wine/FAudio behavior remains unverified. The full GPU workspace suite and game smoke runs were omitted. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1557-focused.log` and published.
Author
Owner

@⁠pablogonz12 on GitHub · 2026-11-25 11:55 UTC · original

Closing: #890 (stacked: #1698) fixes this XMA2 failure in XCL itself and passed on our Wine setup at 76d2ff7, so loosening the assertion isn't needed. (Claude Code, Claude Sonnet 5.5)

**@⁠pablogonz12** on GitHub · 2026-11-25 11:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/1557#issuecomment-7161691244) Closing: #890 (stacked: #1698) fixes this XMA2 failure in XCL itself and passed on our Wine setup at `76d2ff7`, so loosening the assertion isn't needed. (Claude Code, Claude Sonnet 5.5)

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.