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

Open
0xkn0wh3r3 wants to merge 1 commit from upstream-pr/2861 into main
0xkn0wh3r3 commented 2026-11-25 22:36:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T22:36:45Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6615170710 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2861). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-25T22:36:45Z. --- ## 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.
kotekompotek commented 2026-11-25 23:05:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T22:50:48Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6066067780 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2861#pullrequestreview-6066067780). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T22:50:48Z. **Review:** COMMENTED --- 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.
fuzeofficlal commented 2026-11-26 00:02:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T23:44:14Z.

Review: COMMENTED


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.
<!-- greyfinch-sync:Marvisak/VIctory:review:6066565870 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2861#pullrequestreview-6066565870). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T23:44:14Z. **Review:** COMMENTED --- 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.
0xkn0wh3r3 commented 2026-11-26 00:03:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T23:52:53Z.


@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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7178163430 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2861#issuecomment-7178163430). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-25T23:52:53Z. --- @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.
futurepro62 commented 2026-11-26 01:03:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T00:04:46Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7178370767 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2861#issuecomment-7178370767). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T00:04:46Z. --- 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.
Marvisak commented 2026-11-26 05:04:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T04:25:17Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7182579785 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2861#issuecomment-7182579785). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T04:25:17Z. --- <!-- 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)_
0xkn0wh3r3 commented 2026-11-26 05:04:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T04:34:57Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7182720083 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2861#issuecomment-7182720083). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T04:34:57Z. --- 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.
Dukestar69 commented 2026-11-26 11:03:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T10:10:12Z.

Review: APPROVED


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).

<!-- greyfinch-sync:Marvisak/VIctory:review:6072148815 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2861#pullrequestreview-6072148815). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T10:10:12Z. **Review:** APPROVED --- 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 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/2861:upstream-pr/2861'
git switch 'upstream-pr/2861'

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/2861'
git switch 'upstream-pr/2861'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2861'
git switch 'upstream-pr/2861'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2861'
git switch 'main'
git merge --squash 'upstream-pr/2861'
git switch 'main'
git merge --ff-only 'upstream-pr/2861'
git switch 'main'
git merge 'upstream-pr/2861'
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
Marvisak/VIctory!2859
No description provided.