Tests: fine_timer_makes_short_sleeps_short takes the fastest Sleep(1), not the mean (#1487) #1628
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1628
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1628"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@upipibi on GitHub · 2026-11-24 18:24 UTC · original
upipibi:tests/coherent-virtualfree→main· +19 −7 · 1 files · 1 commits · openRefs #1487:
fine_timer_makes_short_sleeps_short, one of the failures left after #1523 (the access violation), #1600 (the XAudio2 tests) and #1590 (theVirtualFreeincoherent_buffer_sanitizes_console_flags_and_state, by Bullet18x: opened first and with the cause, so this PR no longer touches it). Test-only: the change is inside#[cfg(test)].What is in it
hle/kernelx.rs,fine_timer_makes_short_sleeps_short. It took the mean of 20Sleep(1), which a busy PC (more test threads than processors) moves past 5 ms (Sleep(1)taking the 15.6 ms tick in marquezinii's report). It now checks two things:fine_timersets (at most 1 ms);Tested
NVIDIA GeForce RTX 3070, driver 616.56; Windows 11 Pro 26100 (32 logical processors); Rust 1.100.0 MSVC; debug;
main9e3831e.main's test failed 4 of 5 (mean 9.2–11.6 ms);fine_timer()call (negative control, idle PC): fails 3 of 3, fastest sleep 14.7–15.0 ms. The resolution check alone doesn't catch that here, as other processes keep the system resolution fine.820d235(this change plus aVirtualFreeretry, now dropped for #1590),<lib test exe> --test-threads=32, 3 runs onmainwithout #1523: two ended with0xc0000005, #1487's access violation, which #1523 fixes. The third gave 727 passed, 0 failed, 21 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Regression run
From eizispark's run (#1628), thanks (AMD RX 9070 XT; this PR's diff is test-only, so it shows only that nothing else changed):
main:
PR:
Not tested
fine_timer_makes_short_sleeps_shortincluded.AI use
🤖 Generated with Claude Code
@pickles976 on GitHub · 2026-11-24 18:26 UTC · original
Approve — both are the right shape of flake fix, which is rarer than flake fixing itself. The timer test moved from "every sample < 5 ms" to "the fastest sample < 5 ms": that asserts the invariant the test actually exists for (the 15.6 ms tick was escaped; the fine timer is live) without pretending a busy CI runner schedules anything instantly — the threshold stays 3× below the tick it rules out, so the discrimination is untouched, only the optimism. The VirtualFree retry pairs the two halves correctly too: bound the wait (<2 s) and keep the error message carrying the elapsed time, so a future machine where this legitimately exceeds 2 s produces a measurement in the failure text, not just "timeout". Two small notes: ① if the retry loop exits by budget exhaustion, the assert message should distinguish "failed for 2 s" from "failed once" (the elapsed timer already in the string does this if the loop is structured to fall through — worth one glance); ② test-only is verified from the diff itself, not just the description — everything added sits inside
#[cfg(test)], so zero production surface, matching the #1487 lane rules. LGTM from the side that reviews CI flakes as a tax on every other PR in the queue.@upipibi on GitHub · 2026-11-24 18:37 UTC · original
Thanks for the review. One change since: I dropped the
VirtualFreeretry from this PR. #1590 (Bullet18x) fixes the same failure, was opened earlier and has the cause (late_release::holdkeeps the buffer while another test's queue has work). So your note ① now applies to #1590's loop. This PR is thefine_timer_makes_short_sleeps_shortchange only (d8f9224).AI use: Claude Code (Claude Opus 5.5) wrote this.
@eizispark on GitHub · 2026-11-24 18:54 UTC · original
Hardware test report — commit
d8f9224Verified
d8f92247f9bbea16b9ecf54fcdfc86ce05cbb4ae(clean merge withmainc160d86ef2efe3a07e4dfb473e4fa72eafb413c0): pass.Tested
32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64,rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smokecargo test --workspace --no-fail-fast -- --test-threads=4:776 passed, 0 failed, 41 ignored(1 skipped:heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)hle::kernelx::tests::fine_timer_makes_short_sleeps_shortpassed; both wave64 GPU tests skipped on NVIDIA (gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, plusconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back) ran natively and passed on RDNA4Regression run
main(c160d86ef2efe3a07e4dfb473e4fa72eafb413c0):PR (
d8f92247f9bbea16b9ecf54fcdfc86ce05cbb4ae):Not tested
Sleep(1)sample stalls past 5 ms, NVIDIA/Intel GPUs, Wine/vkd3d-proton, gameplay past the menusAI use
@DavidM1911 on GitHub · 2026-11-24 20:46 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 unmodifiedmain.)Thanks!
@JJAutoCompare on GitHub · 2026-11-25 04:55 UTC · original
PR #1628 verification
Head
d8f92247f9bbea16b9ecf54fcdfc86ce05cbb4aein a clean detached worktree. The sole change is the timer test incrates/xcl/src/hle/kernelx.rs.STOR-WINLAB ran Windows x64 build 26200.9974 on an AMD Ryzen 7 3800X with an Intel Arc A770 (driver 32.0.101.9175). DXC reported 1.9.2609.5. Rust was 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), using unoptimized dev/test profiles with debug info and incremental compilation disabled.
Tested
cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the Arc lock. The second command built 19 test executables.cargo test -p xcl --lib fine_timer_makes_short_sleeps_short -- --test-threads=1withXCL_ADAPTER=NONE_CPU_ONLYpassed 5/5 outside the Arc lock (0 failed, 0 ignored, 0 explicit skips).cargo test --workspace --no-fail-fast -- --test-threads=4ran once throughInvoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1. The log confirms Arc A770 selection. Cargo exited 101. All 20 result lines (19 binaries and one doctest target) sum to 760 passed, 16 failed, and 41 ignored, with six explicit skip lines.fine_timer()and a minimum below 5 ms across 20 WindowsSleep(1)calls following a warm-up sleep. The focused runs logged 0.50 ms before and afterfine_timer(). The workspace run logged 15.62 ms before and 0.50 ms after.Workspace failures and skips
CreateComputePipelineStateerror0x80070057. Four failed assertions involving FMA, sampled LOD, f16 VALU, or wave64 reduction.RSSetDepthBiasXcheck. The top-right pixel was blue instead of green.SKIPPED: two required wave64, two required the D3D12 debug layer, one required tiled resources tier 2, and one required heap windows. These skips provide no coverage.Not tested
Matched
mainbaseline, retail-title smoke runs, other GPU vendors, and controlled scheduler saturation.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
pr1628-suite.logand published.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.