Tests: the XAudio2 voice tests wait 30 s for playback and skip a slow audio device (#1487) #1600

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

@⁠upipibi on GitHub · 2026-11-24 18:07 UTC · original
upipibi:tests/xaudio2-start-wait → main · +40 −2 · 1 files · 1 commits · open

Refs #1487: the XAudio2 part.

hle::xaudio2::tests::opus_source_voice_decodes_and_manages_lifetime and xma2_source_voice_decodes_and_manages_lifetime play their buffers on the real audio device and give them 3 s to start and end. Two ways that fails without anything being wrong in XCL:

  • A busy PC. On a parallel test run or during a build, the 3 s ran out. That is the XAudio2 failure in #1487, and in #1523's runs here.
  • A slow default output. On a PC whose default playback device is slow to open, it always failed. Here (an RTX 3070 box with Bluetooth and virtual audio outputs) the mastering voice takes 56 s to create, and the first buffers as long again to play.

Test-only: everything is inside xaudio2.rs's #[cfg(test)] mod tests.

What is in it

  • PLAYBACK_WAIT: the two tests wait up to 30 s for their buffers instead of 3 s. An idle PC still finishes in well under a second, so only a slow run waits longer.
  • slow_audio_device: when creating the mastering voice took more than 10 s, the test destroys it, releases the engine and is skipped with a SKIPPED <test>: the default audio device took N s to open line (runner::skip_test), instead of failing. That measures the device, not XCL's shims.
  • slow_audio_devices_are_skipped_not_failed: unit test of the threshold and the message.

Tested
NVIDIA GeForce RTX 3070, driver 616.56; Windows 11 Pro 26100; Rust 1.100.0 MSVC; debug; main 9e3831e.

  • main, each of the two tests alone: fail (STARTED: left 0, right 12291). With only the wait raised to 60 s, both pass in 113 s: the mastering voice took 56.0 s and the buffers 56.2 s.
  • This head, cargo test -p xcl --lib hle::xaudio2: 10 passed, 0 failed. Both voice tests print SKIPPED …: the default audio device took 56.5 s to open (168.9 s for the one running next to clamped_and_silenced_buffers_accepted_by_windows_xaudio2).
  • cargo test -p xcl --lib (default threads), twice on this head without #1523. The first run ended with 0xc0000005: #1487's access violation, which #1523 fixes. The second gave 728 passed, 0 failed, 21 ignored. SKIPPED: the two voice tests (device took 168.5 s / 56.2 s to open), gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64).

Regression run

From eizispark's run (#1600), thanks (AMD RX 9070 XT; the diff is test-only, so it shows only that nothing else changed):

main:

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14728 MB

PR:

xcl-smoke v1
commit: 5b59db2db544e491f8c8b7fc3fd621cf28968e80
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14728 MB

Not tested

  • Under load on a PC with a fast audio device, where only the 30 s wait matters. eizispark's RX 9070 XT run shows the other half: there the two voice tests ran and passed (777 passed, 0 failed) instead of being skipped.
  • Wine. #1557 changes the XMA2 test next to the wait loop, so whichever lands second needs a small rebase.

AI use

  • Claude Code (Claude Opus 5.5) measured the device times, wrote the change and ran the tests.

🤖 Generated with Claude Code

**@⁠upipibi** on GitHub · 2026-11-24 18:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/1600) `upipibi:tests/xaudio2-start-wait` → `main` · +40 −2 · 1 files · 1 commits · open Refs #1487: the XAudio2 part. `hle::xaudio2::tests::opus_source_voice_decodes_and_manages_lifetime` and `xma2_source_voice_decodes_and_manages_lifetime` play their buffers on the real audio device and give them 3 s to start and end. Two ways that fails without anything being wrong in XCL: - **A busy PC.** On a parallel test run or during a build, the 3 s ran out. That is the XAudio2 failure in #1487, and in #1523's runs here. - **A slow default output.** On a PC whose default playback device is slow to open, it always failed. Here (an RTX 3070 box with Bluetooth and virtual audio outputs) the mastering voice takes 56 s to create, and the first buffers as long again to play. Test-only: everything is inside `xaudio2.rs`'s `#[cfg(test)] mod tests`. **What is in it** - `PLAYBACK_WAIT`: the two tests wait up to 30 s for their buffers instead of 3 s. An idle PC still finishes in well under a second, so only a slow run waits longer. - `slow_audio_device`: when creating the mastering voice took more than 10 s, the test destroys it, releases the engine and is skipped with a `SKIPPED <test>: the default audio device took N s to open` line (`runner::skip_test`), instead of failing. That measures the device, not XCL's shims. - `slow_audio_devices_are_skipped_not_failed`: unit test of the threshold and the message. **Tested** NVIDIA GeForce RTX 3070, driver 616.56; Windows 11 Pro 26100; Rust 1.100.0 MSVC; debug; `main` `9e3831e`. - `main`, each of the two tests alone: fail (`STARTED`: left 0, right 12291). With only the wait raised to 60 s, both pass in 113 s: the mastering voice took 56.0 s and the buffers 56.2 s. - This head, `cargo test -p xcl --lib hle::xaudio2`: 10 passed, 0 failed. Both voice tests print `SKIPPED …: the default audio device took 56.5 s to open` (168.9 s for the one running next to `clamped_and_silenced_buffers_accepted_by_windows_xaudio2`). - `cargo test -p xcl --lib` (default threads), twice on this head without #1523. The first run ended with `0xc0000005`: #1487's access violation, which #1523 fixes. The second gave 728 passed, 0 failed, 21 ignored. SKIPPED: the two voice tests (device took 168.5 s / 56.2 s to open), `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64). **Regression run** From eizispark's run (https://git.gtahub.st/github/xcl-dev--xcl/pulls/1600), thanks (AMD RX 9070 XT; the diff is test-only, so it shows only that nothing else changed): main: ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1677 (PresentX 1677) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14728 MB ``` PR: ``` xcl-smoke v1 commit: 5b59db2db544e491f8c8b7fc3fd621cf28968e80 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1678 (PresentX 1678) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14728 MB ``` **Not tested** - Under load on a PC with a fast audio device, where only the 30 s wait matters. eizispark's RX 9070 XT run shows the other half: there the two voice tests ran and passed (777 passed, 0 failed) instead of being skipped. - Wine. #1557 changes the XMA2 test next to the wait loop, so whichever lands second needs a small rebase. **AI use** - Claude Code (Claude Opus 5.5) measured the device times, wrote the change and ran the tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
opus_ / xma2_source_voice_decodes_and_manages_lifetime gave their
buffers 3 s to start and end on the real audio device. On a busy PC (a
parallel test run, a build) that was not always enough (#1487). On a PC
whose default output is slow to open (a sleeping Bluetooth or virtual
device) it never was: the mastering voice took 56 s to create there, and
the first buffers as long again to play.

They now wait up to 30 s (an idle PC still finishes in well under a
second), and skip with a SKIPPED line, instead of failing, when the
mastering voice took more than 10 s to create: that measures the audio
device, not XCL's XAudio2 shims.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:58:55 +00:00
Author
Owner

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

Hardware test report — commit 5b59db2

Checked 5b59db2db544e491f8c8b7fc3fd621cf28968e80 (based on main 9e3831e1f570d3646e53ab753b19ec07eb8f1485): pass.

Tested

  • Hardware: Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver 32.0.32015.16001), 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 777 passed, 0 failed, 41 ignored (1 skipped: heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows), including hle::xaudio2::tests::slow_audio_devices_are_skipped_not_failed, hle::xaudio2::tests::opus_source_voice_decodes_and_manages_lifetime, and hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime

Regression run
main (9e3831e):

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14728 MB

PR (5b59db2):

xcl-smoke v1
commit: 5b59db2db544e491f8c8b7fc3fd621cf28968e80
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14728 MB

Not tested

  • a host whose default audio endpoint takes >10 s to open CreateMasteringVoice, Wine/vkd3d-proton, NVIDIA/Intel GPUs, XCL_SAMPLE_*

AI use

  • Antigravity (Google DeepMind, Gemini 4 Carbon) — ran the workspace test suite and 60 s retail smoke run on this commit and formatted the report.
**@⁠eizispark** on GitHub · 2026-11-24 18:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/1600#issuecomment-7140463609) ### Hardware test report — commit `5b59db2` Checked `5b59db2db544e491f8c8b7fc3fd621cf28968e80` (based on `main` `9e3831e1f570d3646e53ab753b19ec07eb8f1485`): **pass**. **Tested** - Hardware: Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver 32.0.32015.16001), 32 GB RAM, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release + test profile - `cargo test --workspace --no-fail-fast -- --test-threads=4`: `777 passed, 0 failed, 41 ignored` (`1` skipped: `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`), including `hle::xaudio2::tests::slow_audio_devices_are_skipped_not_failed`, `hle::xaudio2::tests::opus_source_voice_decodes_and_manages_lifetime`, and `hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime` **Regression run** `main` (`9e3831e`): ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1677 (PresentX 1677) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14728 MB ``` PR (`5b59db2`): ``` xcl-smoke v1 commit: 5b59db2db544e491f8c8b7fc3fd621cf28968e80 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1678 (PresentX 1678) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14728 MB ``` **Not tested** - a host whose default audio endpoint takes >10 s to open `CreateMasteringVoice`, Wine/vkd3d-proton, NVIDIA/Intel GPUs, `XCL_SAMPLE_*` **AI use** - Antigravity (Google DeepMind, Gemini 4 Carbon) — ran the workspace test suite and 60 s retail smoke run on this commit and formatted the report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 20:21 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 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 20:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/1600#issuecomment-7143433319) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. (Intermittent 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
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/1600/head:github-bot/gh-1600'
git switch 'github-bot/gh-1600'

Merge

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