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

Open
upipibi wants to merge 1 commit from upstream-pr/1600 into main
upipibi commented 2026-11-24 18:07:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T18:07:44Z.


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://github.com/xcl-dev/xcl/pull/1600#issuecomment-7140463609), 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

<!-- greyfinch-sync:ivall/xcl:issue:5477690457 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1600). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T18:07:44Z. --- 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://github.com/xcl-dev/xcl/pull/1600#issuecomment-7140463609), 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)
eizispark commented 2026-11-24 19:07:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T18:18:41Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7140463609 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1600#issuecomment-7140463609). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-24T18:18:41Z. --- ### 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.
DavidM1911 commented 2026-11-24 21:09:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T20:21:56Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7143433319 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1600#issuecomment-7143433319). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T20:21:56Z. --- 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!
Decodere commented 2026-11-27 11:58:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T11:58:48Z.


Independent desktop NVIDIA verification of PR #1600 at head 5b59db2db544e491f8c8b7fc3fd621cf28968e80 (1 commit; exact parent & merge-base: 9e3831e1f570d3646e53ab753b19ec07eb8f1485, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (5b59db2d)

Command Result
cargo test --release -p xcl --lib hle::xaudio2:: -- --nocapture (3 consecutive runs) 10 passed; 0 failed; 0 ignored; 739 filtered out × 3 (0.16s, 0.14s, 0.14s, 0 skipped; includes the new slow_audio_devices_are_skipped_not_failed unit test plus live Windows 11 system XAudio2 2.9 Opus MSOpusDecoder and XMA2 voice playback tests)
cargo build --release -p xcl Clean build (1m 04s, exit 0, 0 new warnings in xaudio2.rs)

Paired quiet 60 s retail smoke (title: 29640639)

(Note: scripts/smoke.ps1 at 9e3831e1 predates 9683e7a6 and printed the local folder basename on title:; replaced below with the standard 9683e7a6 title hash 29640639, with all measured fields verbatim.)

Exact parent & merge-base (9e3831e1f570d3646e53ab753b19ec07eb8f1485):

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1549 (PresentX 1549)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14715 MB

PR #1600 (5b59db2db544e491f8c8b7fc3fd621cf28968e80):

xcl-smoke v1
commit: 5b59db2db544e491f8c8b7fc3fd621cf28968e80
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1547 (PresentX 1547)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14713 MB

Limits of coverage

  • This PR is test-only (crates/xcl/src/hle/xaudio2.rs #[cfg(test)], 0 production-code changes); all 10/10 hle::xaudio2:: tests executed cleanly against Windows 11 system XAudio2 2.9 (0 skipped) in 0.14s–0.16s, with the slow-device skip threshold covered by slow_audio_devices_are_skipped_not_failed (this host's audio device opened fast and did not trigger a live slow-device skip).
  • The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. parent reflects normal startup variance).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7217695544 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1600#issuecomment-7217695544). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T11:58:48Z. --- Independent desktop NVIDIA verification of **PR #1600** at head `5b59db2db544e491f8c8b7fc3fd621cf28968e80` (`1` commit; exact parent & merge-base: `9e3831e1f570d3646e53ab753b19ec07eb8f1485`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted tests & build (`5b59db2d`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib hle::xaudio2:: -- --nocapture` (3 consecutive runs) | `10 passed; 0 failed; 0 ignored; 739 filtered out` × 3 (`0.16s`, `0.14s`, `0.14s`, `0` skipped; includes the new `slow_audio_devices_are_skipped_not_failed` unit test plus live Windows 11 system `XAudio2 2.9` Opus `MSOpusDecoder` and `XMA2` voice playback tests) | | `cargo build --release -p xcl` | Clean build (`1m 04s`, exit `0`, `0` new warnings in `xaudio2.rs`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) *(Note: `scripts/smoke.ps1` at `9e3831e1` predates `9683e7a6` and printed the local folder basename on `title:`; replaced below with the standard `9683e7a6` title hash `29640639`, with all measured fields verbatim.)* Exact parent & merge-base (`9e3831e1f570d3646e53ab753b19ec07eb8f1485`): ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1549 (PresentX 1549) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14715 MB ``` PR #1600 (`5b59db2db544e491f8c8b7fc3fd621cf28968e80`): ``` xcl-smoke v1 commit: 5b59db2db544e491f8c8b7fc3fd621cf28968e80 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1547 (PresentX 1547) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14713 MB ``` ### Limits of coverage - This PR is test-only (`crates/xcl/src/hle/xaudio2.rs` `#[cfg(test)]`, `0` production-code changes); all `10/10` `hle::xaudio2::` tests executed cleanly against Windows 11 system `XAudio2 2.9` (`0` skipped) in `0.14s–0.16s`, with the slow-device skip threshold covered by `slow_audio_devices_are_skipped_not_failed` (this host's audio device opened fast and did not trigger a live slow-device skip). - The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. parent reflects normal startup variance). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
Foniass commented 2026-12-01 06:14:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:14:06Z.


Triage (#1607) – head 5b59db2

No open or merged PR makes the same change: main's XAudio2 voice tests still wait 3 s for playback. #3551 also edits these tests but only serialises the XMA counters with a lock; it does not touch the wait or the slow-device skip. #1520, #1628 and #1671 (same issue #1487) change other tests.
No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7302642043 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1600#issuecomment-7302642043). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:14:06Z. --- **Triage (#1607)** – head 5b59db2 No open or merged PR makes the same change: main's XAudio2 voice tests still wait 3 s for playback. #3551 also edits these tests but only serialises the XMA counters with a lock; it does not touch the wait or the slow-device skip. #1520, #1628 and #1671 (same issue #1487) change other tests. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1600:upstream-pr/1600'
git switch 'upstream-pr/1600'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/1600'
git switch 'upstream-pr/1600'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1600'
git switch 'upstream-pr/1600'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1600'
git switch 'main'
git merge --squash 'upstream-pr/1600'
git switch 'main'
git merge --ff-only 'upstream-pr/1600'
git switch 'main'
git merge 'upstream-pr/1600'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
xcl-dev/xcl!1590
No description provided.