kernelx: the finest system timer for the title (choppy audio, #260) #300

Manually merged
github merged 1 commit from gh-pr/300/head into gh-pr/300/base 2026-11-26 04:19:19 +00:00
Owner

@⁠AAigars on GitHub · 2026-11-23 22:42 UTC · original
AAigars:kernelx-timer-resolution → main · +47 −0 · 2 files · 1 commits · merged 2026-11-24 02:19 UTC

Fixes #260.

The choppy sound in the retail title is not the audio processor: the game mixes on the CPU and plays through Windows spatial audio (ISpatialAudioClient, two static objects, 48 kHz float), and that stream was fed on time but with sound in only 34 % of its 10 ms passes. The mixer sleeps between 5.33 ms chunks, and without a finer timer Windows wakes it on its 15.6 ms tick, so it made a third of real time (5.33 / 15.6 = 34 %). XCL now asks for the finest timer Windows offers (0.5 ms) at start, and opts out of the Windows 11 power throttling that drops it while the window is hidden. With it every pass has sound.

What is in it

  • kernelx::fine_timer (crates/xcl/src/hle/kernelx.rs): NtSetTimerResolution to the finest resolution NtQueryTimerResolution reports, SetProcessInformation(ProcessPowerThrottling, IGNORE_TIMER_RESOLUTION), one timer: log line; test fine_timer_makes_short_sleeps_short (20 × Windows Sleep(1), average under 5 ms: 15.4 ms without the fix, fails; passes with it)
  • called from host_main after hle::init (crates/xcl/src/host.rs)

Tested

  • NVIDIA GeForce RTX 4070, driver 32.0.16.2101; AMD Ryzen 7 9800X3D, 32 GB; Windows 11 Pro build 26200; Rust 1.96.1; release
  • cargo test --workspace --release -- --test-threads=4: 652 passed, 0 failed, 40 ignored (SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware – no wave64)
  • Retail title (<package id> 1.0.2.1), XCL_NETWORK=0: the menu's sound is continuous instead of choppy. Measured with temporary logging on the game's spatial audio stream (not in this PR): before, sound in 172 of 500 passes per 5 s, evenly spread; after, 500 of 500 once the sound starts.

Regression run

main:

xcl-smoke v1
commit: 9ab7d763197c7f420bff10cd9bf1310f07e2a9aa
gpu: NVIDIA GeForce RTX 4070
title: 83d1f0b1
seconds: 60
exit: 0x0
frames shown: 1487 (PresentX 1487)
presents per 2 s (last 3): 60 61 59
device removals: 0
crashes: 0
peak commit: 14673 MB

PR:

xcl-smoke v1
commit: 9507d05496be7bd87ca769d95cdfec705a3bd6cf
gpu: NVIDIA GeForce RTX 4070
title: 83d1f0b1
seconds: 60
exit: 0x0
frames shown: 1482 (PresentX 1482)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14667 MB

5 frames fewer over 60 s (0.3 %) at the same rate at the end; one run each, so within run-to-run noise.

Not tested

  • AMD GPUs; Windows 10 (where the power-throttling opt-out does not exist and the call fails harmlessly)
  • other titles (Minecraft, Unicorn Overlord, Fortnite, XDefiant)
  • debug build
  • power use with the finer timer (laptops)

AI use

  • Claude Code, Claude Opus 5.5: found the cause (temporary logging on the game's audio calls), wrote the code, the test and this description; I read the diff, ran the tests and the regression runs, and listened to the game before and after.
**@⁠AAigars** on GitHub · 2026-11-23 22:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/300) `AAigars:kernelx-timer-resolution` → `main` · +47 −0 · 2 files · 1 commits · merged 2026-11-24 02:19 UTC Fixes #260. The choppy sound in the retail title is not the audio processor: the game mixes on the CPU and plays through Windows spatial audio (`ISpatialAudioClient`, two static objects, 48 kHz float), and that stream was fed on time but with sound in only 34 % of its 10 ms passes. The mixer sleeps between 5.33 ms chunks, and without a finer timer Windows wakes it on its 15.6 ms tick, so it made a third of real time (5.33 / 15.6 = 34 %). XCL now asks for the finest timer Windows offers (0.5 ms) at start, and opts out of the Windows 11 power throttling that drops it while the window is hidden. With it every pass has sound. **What is in it** - `kernelx::fine_timer` (`crates/xcl/src/hle/kernelx.rs`): `NtSetTimerResolution` to the finest resolution `NtQueryTimerResolution` reports, `SetProcessInformation(ProcessPowerThrottling, IGNORE_TIMER_RESOLUTION)`, one `timer:` log line; test `fine_timer_makes_short_sleeps_short` (20 × Windows `Sleep(1)`, average under 5 ms: 15.4 ms without the fix, fails; passes with it) - called from `host_main` after `hle::init` (`crates/xcl/src/host.rs`) **Tested** - NVIDIA GeForce RTX 4070, driver 32.0.16.2101; AMD Ryzen 7 9800X3D, 32 GB; Windows 11 Pro build 26200; Rust 1.96.1; release - `cargo test --workspace --release -- --test-threads=4`: 652 passed, 0 failed, 40 ignored (SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` – no wave64) - Retail title (`<package id>` 1.0.2.1), `XCL_NETWORK=0`: the menu's sound is continuous instead of choppy. Measured with temporary logging on the game's spatial audio stream (not in this PR): before, sound in 172 of 500 passes per 5 s, evenly spread; after, 500 of 500 once the sound starts. **Regression run** main: ``` xcl-smoke v1 commit: 9ab7d763197c7f420bff10cd9bf1310f07e2a9aa gpu: NVIDIA GeForce RTX 4070 title: 83d1f0b1 seconds: 60 exit: 0x0 frames shown: 1487 (PresentX 1487) presents per 2 s (last 3): 60 61 59 device removals: 0 crashes: 0 peak commit: 14673 MB ``` PR: ``` xcl-smoke v1 commit: 9507d05496be7bd87ca769d95cdfec705a3bd6cf gpu: NVIDIA GeForce RTX 4070 title: 83d1f0b1 seconds: 60 exit: 0x0 frames shown: 1482 (PresentX 1482) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14667 MB ``` 5 frames fewer over 60 s (0.3 %) at the same rate at the end; one run each, so within run-to-run noise. **Not tested** - AMD GPUs; Windows 10 (where the power-throttling opt-out does not exist and the call fails harmlessly) - other titles (Minecraft, Unicorn Overlord, Fortnite, XDefiant) - debug build - power use with the finer timer (laptops) **AI use** - Claude Code, Claude Opus 5.5: found the cause (temporary logging on the game's audio calls), wrote the code, the test and this description; I read the diff, ran the tests and the regression runs, and listened to the game before and after.
Windows wakes a sleeping thread on its 15.6 ms tick unless the process
asks for a finer timer. The retail game's audio mixer sleeps between
5.33 ms chunks, so it made one chunk per tick, a third of real time:
measured on its spatial audio stream, sound in 34 % of the device's
10 ms passes and silence in the rest. With the finest timer (0.5 ms),
every pass has sound. Windows 11 keeps it while the window is hidden
only when the process opts out of power throttling.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:19:17 +00:00
github manually merged commit 9507d05496 into gh-pr/300/base 2026-11-26 04:19:19 +00:00
Author
Owner

@⁠likecrank-dotcom on GitHub · 2026-11-23 22:49 UTC · original

Independent native Windows/NVIDIA validation of #300 at 9507d05496be7bd87ca769d95cdfec705a3bd6cf (clean checkout).

Tested

  • Ryzen 5 3600, RTX 5060 Ti (NVIDIA 621.14 / 32.0.16.2114), 32 GB RAM; Windows 11 Pro 10.0.26300; Rust 1.100.0 MSVC, MSVC 19.44, SDK 10.0.26100.0, DXC 1.9.2602.17. Debug build, an environment listed as not tested in the PR description.
  • cargo build --workspace: exit 0; one pre-existing fetch_update deprecation warning.
  • cargo test --workspace -- --test-threads=4 --nocapture: exit 0; 652 passed, 0 failed, 40 ignored over 17 result blocks (lib: 612 passed, 0 failed, 20 ignored). The synthetic-title end-to-end test passes.
  • fine_timer_makes_short_sleeps_short passes. Log: was 15.62 ms, now 0.50 ms; kept while the window is hidden: yes.

Separate before/after probe, using the actual PR function
A small local Rust executable depends on this checkout's xcl library. In one fresh process, it measures three batches of 20 calls to Windows Sleep(1), calls xcl::hle::kernelx::fine_timer() once, and measures three more batches. Instant measures each batch; no std::thread::sleep, no title is loaded. It was run after the workspace tests ended, using cargo run --offline --manifest-path <local-probe>/Cargo.toml.

batch mean Sleep(1), before mean Sleep(1), after
1 8.279205 ms 1.476785 ms
2 7.283230 ms 1.541250 ms
3 7.638460 ms 1.572365 ms

This reproduces a shorter wait after the timer request on this host. The before values are the measured 7-8 ms, not assumed to equal the queried 15.62 ms system resolution. This does not measure audio quality, mixer continuity, or game performance.

SKIPPED / Not tested
Four explicit skips: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64); test_title_draws_with_a_root_signature_under_the_debug_layer (no d3d12SDKLayers.dll); uploads_start_from_each_subresources_state (no D3D12 debug layer, 0x887A002D). No XCL_SAMPLE variables were set. No retail title/smoke blocks, no listening test, no verification with an occluded/minimized title window, no power-use measurement, AMD, Wine or Windows 10. The opt-out API's reported success is not an independent check of hidden-window behavior.

AI use
Codex wrote the local probe, executed the build/tests/probe and summarized the actual logs. Exact deployed model identifier is not exposed in this session. No runtime changes or game data published.

**@⁠likecrank-dotcom** on GitHub · 2026-11-23 22:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/300#issuecomment-7116217395) Independent native Windows/NVIDIA validation of #300 at `9507d05496be7bd87ca769d95cdfec705a3bd6cf` (clean checkout). **Tested** - Ryzen 5 3600, RTX 5060 Ti (NVIDIA 621.14 / 32.0.16.2114), 32 GB RAM; Windows 11 Pro 10.0.26300; Rust 1.100.0 MSVC, MSVC 19.44, SDK 10.0.26100.0, DXC 1.9.2602.17. **Debug build**, an environment listed as not tested in the PR description. - `cargo build --workspace`: exit 0; one pre-existing `fetch_update` deprecation warning. - `cargo test --workspace -- --test-threads=4 --nocapture`: exit 0; **652 passed, 0 failed, 40 ignored** over 17 result blocks (lib: 612 passed, 0 failed, 20 ignored). The synthetic-title end-to-end test passes. - `fine_timer_makes_short_sleeps_short` passes. Log: `was 15.62 ms, now 0.50 ms; kept while the window is hidden: yes`. **Separate before/after probe, using the actual PR function** A small local Rust executable depends on this checkout's `xcl` library. In one fresh process, it measures three batches of 20 calls to Windows `Sleep(1)`, calls `xcl::hle::kernelx::fine_timer()` once, and measures three more batches. `Instant` measures each batch; no `std::thread::sleep`, no title is loaded. It was run after the workspace tests ended, using `cargo run --offline --manifest-path <local-probe>/Cargo.toml`. | batch | mean Sleep(1), before | mean Sleep(1), after | |---:|---:|---:| | 1 | 8.279205 ms | 1.476785 ms | | 2 | 7.283230 ms | 1.541250 ms | | 3 | 7.638460 ms | 1.572365 ms | This reproduces a shorter wait after the timer request on this host. The before values are the measured 7-8 ms, not assumed to equal the queried 15.62 ms system resolution. This does not measure audio quality, mixer continuity, or game performance. **SKIPPED / Not tested** Four explicit skips: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64); `test_title_draws_with_a_root_signature_under_the_debug_layer` (no d3d12SDKLayers.dll); `uploads_start_from_each_subresources_state` (no D3D12 debug layer, 0x887A002D). No XCL_SAMPLE variables were set. No retail title/smoke blocks, no listening test, no verification with an occluded/minimized title window, no power-use measurement, AMD, Wine or Windows 10. The opt-out API's reported success is not an independent check of hidden-window behavior. **AI use** Codex wrote the local probe, executed the build/tests/probe and summarized the actual logs. Exact deployed model identifier is not exposed in this session. No runtime changes or game data published.
Author
Owner

@⁠mosin311aa on GitHub · 2026-11-23 23:07 UTC · original

Can confirm this fixes the choppy audio problem on my RTX 4070 Super system, no idea if this is the best solution though

**@⁠mosin311aa** on GitHub · 2026-11-23 23:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/300#issuecomment-7116571545) Can confirm this fixes the choppy audio problem on my RTX 4070 Super system, no idea if this is the best solution though
Author
Owner

@⁠ryosen0 on GitHub · 2026-11-23 23:52 UTC · original

Data point on the intro slow stretch (our machine: RTX 3060 Ti 8 GB, Ryzen 7 9800X3D, driver 32.0.16.1742): the retail title's artwork intro runs at ~4.4-8.6 fps for roughly t=45-165 s, then a steady 30 fps. We measured the same dip with and without this PR + #294 in the stack (same graphics PRs otherwise, XCL_NETWORK=0, XCL_ACTIVITY=1):

  • main + #304 + #236 + #273, no audio PRs, 180 s: 22.5 -> 4.9 -> 6.8 -> 19.7 -> 30.0 fps, 2244 frames, clean timer exit.
  • same + #300 + #294, 240 s: 23.0 -> 6.4 -> 4.9 -> 19.5 -> 30.0 fps, 3987 frames, clean exit.

So the dip is not the audio path on this hardware - noting it so nobody chases the timer / Opus work for it. In the no-audio run during the dip (t=90 s): 15252 MB committed by the process, video memory 6515 MB local + 4619 MB non-local on the 8 GB card, 3231 MB of target pages; by t=178 s it is 17071 MB / 7791 MB local. DXC compiles are all cache hits there (dxil_cache 25 hits, 0 misses). It looks like memory pressure and streaming, not compilation.

Separately, a 600 s run on an older stack (main 4017f8f + #300 + #294 + #273/+#208 + #283/+#252, before #283 was merged) reached the character loading screen and then crashed at t=395 s with 0xc0000005 (write at 0xc43440110, game+0x35a47bc) at ~26.6 GB of commit - past the loading screen, so probably unrelated to this PR.

AI use: GPT-6.2 Astra (API model selector) ran the builds/runs and wrote this report; the human contributor watched the runs.

**@⁠ryosen0** on GitHub · 2026-11-23 23:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/300#issuecomment-7117451040) Data point on the intro slow stretch (our machine: RTX 3060 Ti 8 GB, Ryzen 7 9800X3D, driver 32.0.16.1742): the retail title's artwork intro runs at ~4.4-8.6 fps for roughly t=45-165 s, then a steady 30 fps. We measured the same dip with and without this PR + #294 in the stack (same graphics PRs otherwise, XCL_NETWORK=0, XCL_ACTIVITY=1): - main + #304 + #236 + #273, no audio PRs, 180 s: 22.5 -> 4.9 -> 6.8 -> 19.7 -> 30.0 fps, 2244 frames, clean timer exit. - same + #300 + #294, 240 s: 23.0 -> 6.4 -> 4.9 -> 19.5 -> 30.0 fps, 3987 frames, clean exit. So the dip is not the audio path on this hardware - noting it so nobody chases the timer / Opus work for it. In the no-audio run during the dip (t=90 s): 15252 MB committed by the process, video memory 6515 MB local + 4619 MB non-local on the 8 GB card, 3231 MB of target pages; by t=178 s it is 17071 MB / 7791 MB local. DXC compiles are all cache hits there (dxil_cache 25 hits, 0 misses). It looks like memory pressure and streaming, not compilation. Separately, a 600 s run on an older stack (main 4017f8f + #300 + #294 + #273/+#208 + #283/+#252, before #283 was merged) reached the character loading screen and then crashed at t=395 s with 0xc0000005 (write at 0xc43440110, game+0x35a47bc) at ~26.6 GB of commit - past the loading screen, so probably unrelated to this PR. AI use: GPT-6.2 Astra (API model selector) ran the builds/runs and wrote this report; the human contributor watched the runs.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-23 23:10 UTC · original · edited 2026-11-24 00:23 UTC

Independent static code & Win32 API audit of 9507d0549 (code inspection only — cargo test not run on macOS; no game files):

Summary: Clean and matches Windows API semantics

  • PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION (kernelx.rs:1293-1299): Setting ControlMask = PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION with StateMask = 0 matches Microsoft Learn for opting out of Windows 11's occluded/background timer-resolution throttling, and ignoring a FALSE return on Windows 10/Wine degrades gracefully.
  • NtQueryTimerResolution / NtSetTimerResolution (kernelx.rs:1272-1273, 1301-1307): Signatures ((u32, u8, *mut u32) -> i32) and parameter ordering (coarsest, finest, current) match ntdll, and the Windows kernel automatically releases per-process NtSetTimerResolution requests on process exit/crash.

Two small notes

  1. Closing keyword (Fixes #260): Since #260 was updated to track both the 15.6 ms timer tick and xapu returning silence for Opus packets (#294), changing Fixes #260. to Part of #260. avoids auto-closing #260 before #294 lands.
  2. Connection to #294 (ISpatialAudioClient): Your finding that the title mixes on the CPU and outputs through ISpatialAudioClient directly answers #294's open question ("Where the title's final mix goes is not found yet") — worth checking whether #294's xaudio2::console_pcm direct playback double-plays decoded xapu audio on Windows once xapu writes real PCM into the title's buffer.

(AI-assisted — Gemini 4 Neon)


Update: Windows 11 / RTX 5080 test run on 9507d0549

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), rustc 1.100.0 (MSVC), debug build in a clean worktree at 9507d05496be7bd87ca769d95cdfec705a3bd6cf.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 652 passed, 0 failed, 40 ignored (xcl lib: 612 passed, 0 failed, 20 ignored; all e2e/GPU suites passed).
  • SKIPPED GPU tests (2, wave32-only adapter): gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64.
  • hle::kernelx::tests::fine_timer_makes_short_sleeps_short passed.

Not tested

  • Retail title / scripts/smoke.ps1 run on this machine (test suite only).
  • AMD / Intel GPUs.

AI use: test run orchestrated and reported with Antigravity (Gemini 4 Neon) on the hardware listed above.

**@⁠mastrr9** on GitHub · 2026-11-23 23:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/300#issuecomment-7116643811) · edited 2026-11-24 00:23 UTC Independent static code & Win32 API audit of `9507d0549` (code inspection only — `cargo test` not run on macOS; no game files): ### Summary: Clean and matches Windows API semantics - **`PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION` (`kernelx.rs:1293-1299`):** Setting `ControlMask = PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION` with `StateMask = 0` matches Microsoft Learn for opting out of Windows 11's occluded/background timer-resolution throttling, and ignoring a `FALSE` return on Windows 10/Wine degrades gracefully. - **`NtQueryTimerResolution` / `NtSetTimerResolution` (`kernelx.rs:1272-1273`, `1301-1307`):** Signatures (`(u32, u8, *mut u32) -> i32`) and parameter ordering (`coarsest`, `finest`, `current`) match `ntdll`, and the Windows kernel automatically releases per-process `NtSetTimerResolution` requests on process exit/crash. ### Two small notes 1. **Closing keyword (`Fixes #260`):** Since #260 was updated to track *both* the 15.6 ms timer tick and `xapu` returning silence for Opus packets (#294), changing `Fixes #260.` to `Part of #260.` avoids auto-closing #260 before #294 lands. 2. **Connection to #294 (`ISpatialAudioClient`):** Your finding that the title mixes on the CPU and outputs through `ISpatialAudioClient` directly answers #294's open question ("Where the title's final mix goes is not found yet") — worth checking whether #294's `xaudio2::console_pcm` direct playback double-plays decoded `xapu` audio on Windows once `xapu` writes real PCM into the title's buffer. *(AI-assisted — Gemini 4 Neon)* --- ### Update: Windows 11 / RTX 5080 test run on `9507d0549` **Tested** - Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), `rustc 1.100.0` (MSVC), debug build in a clean worktree at `9507d05496be7bd87ca769d95cdfec705a3bd6cf`. - `cargo build --workspace && cargo test --workspace -- --test-threads=4`: **652 passed, 0 failed, 40 ignored** (`xcl` lib: 612 passed, 0 failed, 20 ignored; all e2e/GPU suites passed). - `SKIPPED` GPU tests (2, wave32-only adapter): `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64`. - `hle::kernelx::tests::fine_timer_makes_short_sleeps_short` passed. **Not tested** - Retail title / `scripts/smoke.ps1` run on this machine (test suite only). - AMD / Intel GPUs. *AI use: test run orchestrated and reported with Antigravity (Gemini 4 Neon) on the hardware listed above.*
Author
Owner

@⁠emirduran707 on GitHub · 2026-11-24 00:32 UTC · original

First AMD run: the sound plays cleanly with this PR.

Setup: AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.31044.16; Ryzen 5 5600, 32 GB; Windows 11 Pro 26300; release. Build: main a6f5f7a + this PR (9507d05) + #440 (be722a7, so the intro video runs at speed) + #435 (a94e151), merged locally. Same retail title as #260, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=60, A pressed by hand on the first menu, a person listening.

  • Log: timer: finest resolution for the title (was 1.00 ms, now 0.50 ms; kept while the window is hidden: yes).
  • Heard: the sound is continuous through the intro video and the loading screen (it was choppy on the same machine without this PR).
  • Measured from the xapu: … Opus packets decoded lines: 50 packets a second from the video on (960 frames each, so real time at 48 kHz), 100 a second once a second stream starts. Without this PR, on main + #440 only, the same stretch decoded about 17 packets a second (~0.34 of real time).

Not tested / not attributed: the run ended at 161 s with 0xc0000005 in title code (+0x23cf683, write at address 0) while the world streamed in, at 27 GB of process commit, with no E_OUTOFMEMORY logged. With three PRs in the build and no longer baseline run on this machine I cannot tie it to any of them. NVIDIA, other titles.

AI use: Claude Code with Claude Opus 5.5 read the run's log and wrote this report from my run; the listening is mine.

**@⁠emirduran707** on GitHub · 2026-11-24 00:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/300#issuecomment-7118182054) First AMD run: the sound plays cleanly with this PR. **Setup:** AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.31044.16; Ryzen 5 5600, 32 GB; Windows 11 Pro 26300; release. Build: `main` a6f5f7a + this PR (9507d05) + #440 (be722a7, so the intro video runs at speed) + #435 (a94e151), merged locally. Same retail title as #260, `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=60`, A pressed by hand on the first menu, a person listening. - Log: `timer: finest resolution for the title (was 1.00 ms, now 0.50 ms; kept while the window is hidden: yes)`. - **Heard:** the sound is continuous through the intro video and the loading screen (it was choppy on the same machine without this PR). - **Measured** from the `xapu: … Opus packets decoded` lines: 50 packets a second from the video on (960 frames each, so real time at 48 kHz), 100 a second once a second stream starts. Without this PR, on `main` + #440 only, the same stretch decoded about 17 packets a second (~0.34 of real time). **Not tested / not attributed:** the run ended at 161 s with `0xc0000005` in title code (`+0x23cf683`, write at address 0) while the world streamed in, at 27 GB of process commit, with no `E_OUTOFMEMORY` logged. With three PRs in the build and no longer baseline run on this machine I cannot tie it to any of them. NVIDIA, other titles. AI use: Claude Code with Claude Opus 5.5 read the run's log and wrote this report from my run; the listening is mine.
Author
Owner

@⁠Chrysana on GitHub · 2026-11-24 01:40 UTC · original

Test report for #300 at 9507d05 on AMD RX 9070 XT, merged onto current main 508a0c7 (local merge 1a47cac, clean, not pushed). A person listened to each run.

Setup: AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0 x86_64-pc-windows-msvc, release builds. Retail title 1.0.2.1. XCL_NETWORK=0 XCL_RUN_SECONDS=60 XCL_ACTIVITY=1 XCL_PRESS_A_AT=14,17,21 xcl run <folder>, one run per build.

build what was heard
main 508a0c7 slow, crackly sound throughout
main + #300 the "screen narration" prompt plays at full speed and clean; no game sound after it while the intro video plays at ~5 fps (542 → 555 frames in 60 s)
main + #300 + #451 (1f282c7, local merge e6daa0e) the intro video and its sound play together at full speed; one short stutter in the middle (1507 frames)
  • The log line from this PR: timer: finest resolution for the title (was 1.00 ms, now 0.50 ms; kept while the window is hidden: yes). Another program had already set the system timer to 1 ms; the title's audio was choppy anyway.
  • report.json's xapu counters are the same in all three runs (23 Opus packets, 21768 frames, about 0.45 s). So the intro's sound doesn't go through xapu. It comes from the title's CPU mix, and it seems to need the video running at speed.
  • So, on its own, this PR fixes the speed of the sound, but the intro stays silent until the video runs at speed. With #451 (or another video speed-up) the two together give continuous sound. That may matter for Fixes #260 if this merges first.

Not tested: the test suite and smoke.ps1 on this PR (none of the above is a regression run); gameplay past the intro; the cause of the single stutter; Windows 10.

AI use: Claude Code with Claude Opus 5.5 built the merges, ran the title and read the logs and report.json, and wrote this report. The listening was done by me.

**@⁠Chrysana** on GitHub · 2026-11-24 01:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/300#issuecomment-7119338469) Test report for #300 at `9507d05` on **AMD RX 9070 XT**, merged onto current `main` `508a0c7` (local merge `1a47cac`, clean, not pushed). A person listened to each run. **Setup:** AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0 `x86_64-pc-windows-msvc`, release builds. Retail title 1.0.2.1. `XCL_NETWORK=0 XCL_RUN_SECONDS=60 XCL_ACTIVITY=1 XCL_PRESS_A_AT=14,17,21 xcl run <folder>`, one run per build. | build | what was heard | |---|---| | `main` `508a0c7` | slow, crackly sound throughout | | `main` + #300 | the "screen narration" prompt plays at full speed and clean; **no game sound after it** while the intro video plays at ~5 fps (542 → 555 frames in 60 s) | | `main` + #300 + #451 (`1f282c7`, local merge `e6daa0e`) | **the intro video and its sound play together at full speed**; one short stutter in the middle (1507 frames) | - The log line from this PR: `timer: finest resolution for the title (was 1.00 ms, now 0.50 ms; kept while the window is hidden: yes)`. Another program had already set the system timer to 1 ms; the title's audio was choppy anyway. - `report.json`'s xapu counters are the same in all three runs (23 Opus packets, 21768 frames, about 0.45 s). So the intro's sound doesn't go through xapu. It comes from the title's CPU mix, and it seems to need the video running at speed. - **So, on its own, this PR fixes the speed of the sound, but the intro stays silent until the video runs at speed.** With #451 (or another video speed-up) the two together give continuous sound. That may matter for `Fixes #260` if this merges first. **Not tested:** the test suite and `smoke.ps1` on this PR (none of the above is a regression run); gameplay past the intro; the cause of the single stutter; Windows 10. **AI use:** Claude Code with Claude Opus 5.5 built the merges, ran the title and read the logs and `report.json`, and wrote this report. The listening was done by me.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 02:17 UTC · original · edited 2026-11-24 02:23 UTC

Regression run for this PR's head on Windows.

Tested

  • Windows 11 Pro 25H2 (build 26200), AMD Ryzen 9 9950X, 32 GB RAM, NVIDIA GeForce RTX 5070 Ti (driver 610.74), Rust 1.99.0, release builds (cargo build --release -p xcl) from clean checkouts
  • main: 0e946cfc68244edee1fba6e0425371f687a05ccd (a commit on main with no code change from this PR's base 9ab7d76); PR head: 9507d05496be7bd87ca769d95cdfec705a3bd6cf, no uncommitted changes
  • scripts/smoke.ps1 -Game <title folder> -Seconds 60 on a retail title, main first, after one 60 s warm-up run of main; both sides start from the same learned coherent-window size
  • PR 1534 frames vs main 1420 (108 %), peak commit 14728 vs 14728 MB (100 %); 0 crashes and 0 device removals on both sides, both exited 0x0
  • The change is reached: the PR's run logged timer: finest resolution for the title (was 1.00 ms, now 0.50 ms; kept while the window is hidden: yes); main's run has no timer line
  • By ear: earlier runs of main on this machine crackled; this PR sounded normal in both of its runs (the pair above and one more 60 s run). One listener, no measurement.

Regression run

main:

xcl-smoke v1
commit: 0e946cfc68244edee1fba6e0425371f687a05ccd
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1420 (PresentX 1420)
presents per 2 s (last 3): 53 50 48
device removals: 0
crashes: 0
peak commit: 14728 MB

PR:

xcl-smoke v1
commit: 9507d05496be7bd87ca769d95cdfec705a3bd6cf
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1534 (PresentX 1535)
presents per 2 s (last 3): 61 59 60
device removals: 0
crashes: 0
peak commit: 14728 MB

Not tested

  • Audio measured: no capture or analysis of the output stream, only the impression above
  • A run with the window hidden
  • cargo test --workspace (not run for this report)
  • AMD GPUs, other titles

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-24 02:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/300#issuecomment-7119967081) · edited 2026-11-24 02:23 UTC Regression run for this PR's head on Windows. **Tested** - Windows 11 Pro 25H2 (build 26200), AMD Ryzen 9 9950X, 32 GB RAM, NVIDIA GeForce RTX 5070 Ti (driver 610.74), Rust 1.99.0, release builds (`cargo build --release -p xcl`) from clean checkouts - main: `0e946cfc68244edee1fba6e0425371f687a05ccd` (a commit on main with no code change from this PR's base 9ab7d76); PR head: `9507d05496be7bd87ca769d95cdfec705a3bd6cf`, no uncommitted changes - `scripts/smoke.ps1 -Game <title folder> -Seconds 60` on a retail title, main first, after one 60 s warm-up run of main; both sides start from the same learned coherent-window size - PR 1534 frames vs main 1420 (108 %), peak commit 14728 vs 14728 MB (100 %); 0 crashes and 0 device removals on both sides, both exited 0x0 - The change is reached: the PR's run logged `timer: finest resolution for the title (was 1.00 ms, now 0.50 ms; kept while the window is hidden: yes)`; main's run has no timer line - By ear: earlier runs of main on this machine crackled; this PR sounded normal in both of its runs (the pair above and one more 60 s run). One listener, no measurement. **Regression run** main: ``` xcl-smoke v1 commit: 0e946cfc68244edee1fba6e0425371f687a05ccd gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1420 (PresentX 1420) presents per 2 s (last 3): 53 50 48 device removals: 0 crashes: 0 peak commit: 14728 MB ``` PR: ``` xcl-smoke v1 commit: 9507d05496be7bd87ca769d95cdfec705a3bd6cf gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1534 (PresentX 1535) presents per 2 s (last 3): 61 59 60 device removals: 0 crashes: 0 peak commit: 14728 MB ``` **Not tested** - Audio measured: no capture or analysis of the output stream, only the impression above - A run with the window hidden - `cargo test --workspace` (not run for this report) - AMD GPUs, other titles 🤖 Claude Opus 5.5
This discussion has been locked. Commenting is limited to contributors.
No description provided.