GPU tests: two tests CI runners failed hold on a loaded host #2861

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

@⁠0xkn0wh3r3 on GitHub · 2026-11-25 22:36 UTC · original
0xkn0wh3r3:tests/flaky-gpu-tests-on-loaded-runners → main · +17 −10 · 2 files · 1 commits · open

Problem

Two GPU tests fail on CI runners now and then, on changes that don't touch them:

  • frame::tests::waits_end_on_ticks_and_count_frames (frame.rs:231, failed on #2085's run). Its first part runs 2 ms ticks and expects a wait with a zero time-out to time out right after a wait returned on a tick. A runner woken a little late finds the next tick has already passed and gets S_OK.
  • descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait (descriptor/host.rs:2011, failed on #2051's run). It and a_slot_rewritten_while_its_view_is_prepared_views_the_new_record hand the next view prepared some work through WHILE_PREPARING, a static every test shares. Another test preparing a view of its own at the same time takes the work, so the test's own view is made without it.

Change

  • The frame test's first part uses 50 ms ticks, as its second part already does for the same reason ("a thread woken 15-30 ms late on a busy host ... still makes its tick"). The bound on the second wait goes from 50 ms to 250 ms to fit one tick plus slack. What it checks is unchanged.
  • WHILE_PREPARING is per thread (thread_local!). Both tests call mirror on their own thread, which is where prepare runs the work, and the thread each one spawns can't take it.

Tests only; no runtime code changes.

Testing

On an RTX 5070 Ti: cargo test -p victory-gpu --lib 8 times in a row, plus the three tests alone 10 times. None of them failed. The only failures were dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views, which fail on main on NVIDIA (#1835's heap cap). Clippy, with and without diagnostics, and cargo xtask policy are clean.

**@⁠0xkn0wh3r3** on GitHub · 2026-11-25 22:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/2861) `0xkn0wh3r3:tests/flaky-gpu-tests-on-loaded-runners` → `main` · +17 −10 · 2 files · 1 commits · open ## Problem Two GPU tests fail on CI runners now and then, on changes that don't touch them: - `frame::tests::waits_end_on_ticks_and_count_frames` (`frame.rs:231`, failed on #2085's run). Its first part runs 2 ms ticks and expects a wait with a zero time-out to time out right after a wait returned on a tick. A runner woken a little late finds the next tick has already passed and gets `S_OK`. - `descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait` (`descriptor/host.rs:2011`, failed on #2051's run). It and `a_slot_rewritten_while_its_view_is_prepared_views_the_new_record` hand the next view prepared some work through `WHILE_PREPARING`, a static every test shares. Another test preparing a view of its own at the same time takes the work, so the test's own view is made without it. ## Change - The frame test's first part uses 50 ms ticks, as its second part already does for the same reason ("a thread woken 15-30 ms late on a busy host ... still makes its tick"). The bound on the second wait goes from 50 ms to 250 ms to fit one tick plus slack. What it checks is unchanged. - `WHILE_PREPARING` is per thread (`thread_local!`). Both tests call `mirror` on their own thread, which is where `prepare` runs the work, and the thread each one spawns can't take it. Tests only; no runtime code changes. ## Testing On an RTX 5070 Ti: `cargo test -p victory-gpu --lib` 8 times in a row, plus the three tests alone 10 times. None of them failed. The only failures were `dynamic_slots_are_held_until_released` and `lists_share_a_table_and_copies_keep_their_views`, which fail on `main` on NVIDIA (#1835's heap cap). Clippy, with and without `diagnostics`, and `cargo xtask policy` are clean.
`frame::tests::waits_end_on_ticks_and_count_frames` ran 2 ms ticks and
expected a wait with no time to wait to time out right after a tick: a
runner woken a tick late found the next tick passed (CI, #2085). It uses
50 ms ticks, as the test's second part already does for the same reason.

`views_bound_while_another_slot_gets_its_texture_do_not_wait` and
`a_slot_rewritten_while_its_view_is_prepared_views_the_new_record` set
work for the next view prepared, in a static every test shares: another
test preparing a view of its own meanwhile took it (CI, #2051). The work
is now per thread; both tests prepare on their own thread.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:16:09 +00:00
Author
Owner

@⁠0xkn0wh3r3 on GitHub · 2026-11-25 23:52 UTC · original

@⁠fuzeofficlal thanks for the five rounds on both adapters. Agreed on #2877: if its virtual clock lands first, the frame.rs part here is superseded and I'll drop it, keeping only the per-thread WHILE_PREPARING, which is independent.

**@⁠0xkn0wh3r3** on GitHub · 2026-11-25 23:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/2861#issuecomment-7178163430) @⁠fuzeofficlal thanks for the five rounds on both adapters. Agreed on #2877: if its virtual clock lands first, the `frame.rs` part here is superseded and I'll drop it, keeping only the per-thread `WHILE_PREPARING`, which is independent.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 00:04 UTC · original

Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head b670296 (on its base f3578e3).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 863 passed, 0 failed, 10 ignored.
  • No new #[test] functions in the diff.
  • --skip leaves out tests that fail on main 842b0cb on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (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-26 00:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/2861#issuecomment-7178370767) Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `b670296` (on its base `f3578e3`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **863 passed, 0 failed, 10 ignored**. - No new `#[test]` functions in the diff. - `--skip` leaves out tests that fail on main `842b0cb` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (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

@⁠Marvisak on GitHub · 2026-11-26 04:25 UTC · original · edited 2026-11-26 07:23 UTC

Automated triage for the maintainers.

Thanks. Nothing has changed since the last review (same head). It stays a merge candidate, and the frame.rs half drops out if #2877 lands first.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 04:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/2861#issuecomment-7182579785) · edited 2026-11-26 07:23 UTC <!-- victory-triage v1 head=b670296363e75838cbfdee5f2f4b1108699bf73f verdict=merge-candidate at=2026-11-26T07:23:09Z --> Automated triage for the maintainers. Thanks. Nothing has changed since the last review (same head). It stays a merge candidate, and the `frame.rs` half drops out if #2877 lands first. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠0xkn0wh3r3 on GitHub · 2026-11-26 04:34 UTC · original

Thanks for the runs. On the overlap with #2877: its virtual clock is the better fix for waits_end_on_ticks_and_count_frames. If #2877 lands first I'll drop the frame.rs change from this PR and keep only the thread_local! hook in descriptor/host.rs, which fixes the other flake (views_bound_while_another_slot_gets_its_texture_do_not_wait) on its own.

**@⁠0xkn0wh3r3** on GitHub · 2026-11-26 04:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/2861#issuecomment-7182720083) Thanks for the runs. On the overlap with #2877: its virtual clock is the better fix for `waits_end_on_ticks_and_count_frames`. If #2877 lands first I'll drop the `frame.rs` change from this PR and keep only the `thread_local!` hook in `descriptor/host.rs`, which fixes the other flake (`views_bound_while_another_slot_gets_its_texture_do_not_wait`) on its own.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 22:50 UTC · original · reviewed

Right fix for the CI flake: WHILE_PREPARING as a global Mutex meant whichever parallel test hit prepare first consumed the injected work — a test preparing its own view ran another's closure and both misbehaved. thread_local makes the hook per-test-thread, matching how cargo test parallelizes. LGTM.

**@⁠kotekompotek** on GitHub · 2026-11-25 22:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/2861#pullrequestreview-6066067780) · **reviewed** Right fix for the CI flake: WHILE_PREPARING as a global Mutex meant whichever parallel test hit prepare first consumed the injected work — a test preparing its own view ran another's closure and both misbehaved. thread_local makes the hook per-test-thread, matching how cargo test parallelizes. LGTM.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 23:44 UTC · original · reviewed

Verified head b6702963 cleanly merged onto origin/main (63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP + VICTORY_D3D12_DEBUG=1).

Code Review & Cross-PR Note

  • crates/victory-gpu/src/descriptor/host.rs: Moving the test hook WHILE_PREPARING from a process-wide Mutex<Option<Work>> to thread_local! { RefCell<Option<Work>> } eliminates a genuine cross-test concurrency race when parallel GPU tests invoke HostHeap::mirror.
  • crates/victory-gpu/src/frame.rs overlap with #2877: Widening the 2 ms / 50 ms tolerances to 50 ms / 250 ms touches the same test that #2877 refactors onto a deterministic virtual clock (struct Pacer). If #2877 lands first, the frame.rs portion here is superseded, while the descriptor/host.rs thread_local! fix remains independently valuable.

Local Verification (VICTORY_D3D12_DEBUG=1, 5 consecutive rounds)

  • RTX 5090: descriptor::host::tests (skipping pre-existing 1M cap baseline dynamic_slots_are_held_until_released) 14/14 x 5 rounds, frame::tests 2/2 x 5 rounds.
  • WARP: descriptor::host::tests 15/15 x 5 rounds, frame::tests 2/2 x 5 rounds.
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --features diagnostics) & cargo xtask policy (191 files ok): clean.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 23:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/2861#pullrequestreview-6066565870) · **reviewed** Verified head `b6702963` cleanly merged onto `origin/main` (`63bcca43`) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP + `VICTORY_D3D12_DEBUG=1`). ### Code Review & Cross-PR Note - **`crates/victory-gpu/src/descriptor/host.rs`**: Moving the test hook `WHILE_PREPARING` from a process-wide `Mutex<Option<Work>>` to `thread_local! { RefCell<Option<Work>> }` eliminates a genuine cross-test concurrency race when parallel GPU tests invoke `HostHeap::mirror`. - **`crates/victory-gpu/src/frame.rs` overlap with `#2877`**: Widening the `2 ms` / `50 ms` tolerances to `50 ms` / `250 ms` touches the same test that `#2877` refactors onto a deterministic virtual clock (`struct Pacer`). If `#2877` lands first, the `frame.rs` portion here is superseded, while the `descriptor/host.rs` `thread_local!` fix remains independently valuable. ### Local Verification (`VICTORY_D3D12_DEBUG=1`, 5 consecutive rounds) - **RTX 5090**: `descriptor::host::tests` (skipping pre-existing 1M cap baseline `dynamic_slots_are_held_until_released`) **14/14 x 5 rounds**, `frame::tests` **2/2 x 5 rounds**. - **WARP**: `descriptor::host::tests` **15/15 x 5 rounds**, `frame::tests` **2/2 x 5 rounds**. - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--features diagnostics`) & `cargo xtask policy` (`191 files ok`): clean.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 10:10 UTC · original · approved these changes

Verified on RTX 5090 against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib descriptor::host::tests::views_ -- --test-threads=1: 2/2 passed.
  • cargo test -p victory-gpu --lib frame:: -- --test-threads=1: 2/2 passed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly hardens both timing-sensitive CI tests against loaded host scheduling jitter.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 10:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/2861#pullrequestreview-6072148815) · **approved these changes** Verified on RTX 5090 against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib descriptor::host::tests::views_ -- --test-threads=1`: 2/2 passed. - `cargo test -p victory-gpu --lib frame:: -- --test-threads=1`: 2/2 passed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly hardens both timing-sensitive CI tests against loaded host scheduling jitter. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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/2861/head:github-bot/gh-2861'
git switch 'github-bot/gh-2861'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2861'
git switch 'github-bot/gh-2861'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2861'
git switch 'github-bot/gh-2861'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2861'
git switch 'main'
git merge --squash 'github-bot/gh-2861'
git switch 'main'
git merge --ff-only 'github-bot/gh-2861'
git switch 'main'
git merge 'github-bot/gh-2861'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2861
No description provided.