Shader tests: serialize remaining Host::new tests with ONE_AT_A_TIME (#1882) #2962

Open
Dukestar69 wants to merge 1 commit from upstream-pr/2964 into main
Dukestar69 commented 2026-11-26 01:44:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T01:44:22Z.


Summary

Serialize the remaining Host::new call sites in victory-shader tests (diff_tests.rs, rect.rs, and mod.rs::stub_pipeline_is_created) with ONE_AT_A_TIME, extending the rationale in #1882 / #1892 (credit to @fiestorra).

Related to #1882.

Testing

  • cargo test -p victory-shader emit::rect::tests: 1/1 passed.
  • cargo test -p victory-shader stub_pipeline_is_created: 1/1 passed.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 192 files ok.

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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6617615463 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2964). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T01:44:22Z. --- ## Summary Serialize the remaining `Host::new` call sites in `victory-shader` tests (`diff_tests.rs`, `rect.rs`, and `mod.rs::stub_pipeline_is_created`) with `ONE_AT_A_TIME`, extending the rationale in #1882 / #1892 (credit to @fiestorra). Related to #1882. ## Testing - `cargo test -p victory-shader emit::rect::tests`: 1/1 passed. - `cargo test -p victory-shader stub_pipeline_is_created`: 1/1 passed. - `cargo clippy -p victory-shader --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 192 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
fuzeofficlal commented 2026-11-26 02:06:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T02:05:01Z.

Review: COMMENTED


Reviewed and verified against main (63bcca43) on Windows 11 (RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1). All updated lock sites acquire ONE_AT_A_TIME before Host::new with .unwrap_or_else(|e| e.into_inner()) (no deadlock or poison cascade even when pre-existing tests panic).

Two remaining Host::new(true) sites in victory-shader were not covered yet (optional follow-up or include here):

  1. crates/victory-shader/src/emit/synthetic_tests.rs:1006 (pops_wait_loop_exits_immediately_for_inactive_lanes) calls Host::new(true) without holding ONE_AT_A_TIME.
  2. crates/victory-shader/src/emit/host.rs:2035, 2039, 2051 (parallel_warp_pipelines_and_draws) intentionally spawns 8 concurrent WARP threads internally, so holding ONE_AT_A_TIME once at test entry would keep it from overlapping other serialized WARP tests.

Local verification:

  • Modified modules in parallel (emit::diff_tests::, emit::rect::, emit::tests::stub_pipeline_is_created, VICTORY_D3D12_DEBUG=1): 8/8 passed
  • Full parallel victory-shader --lib run: 297 passed (zero deadlocks, zero WARP concurrent crashes, zero lock-poison cascades; the 3 failures are pre-existing RTX 5090 baseline tests)
  • cargo clippy --all-targets -- -D warnings + cargo xtask policy (192 files ok): 0 warnings
<!-- greyfinch-sync:Marvisak/VIctory:review:6067588572 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2964#pullrequestreview-6067588572). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T02:05:01Z. **Review:** COMMENTED --- Reviewed and verified against `main` (`63bcca43`) on Windows 11 (RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`). All updated lock sites acquire `ONE_AT_A_TIME` before `Host::new` with `.unwrap_or_else(|e| e.into_inner())` (no deadlock or poison cascade even when pre-existing tests panic). Two remaining `Host::new(true)` sites in `victory-shader` were not covered yet (optional follow-up or include here): 1. `crates/victory-shader/src/emit/synthetic_tests.rs:1006` (`pops_wait_loop_exits_immediately_for_inactive_lanes`) calls `Host::new(true)` without holding `ONE_AT_A_TIME`. 2. `crates/victory-shader/src/emit/host.rs:2035, 2039, 2051` (`parallel_warp_pipelines_and_draws`) intentionally spawns 8 concurrent WARP threads internally, so holding `ONE_AT_A_TIME` once at test entry would keep it from overlapping other serialized WARP tests. **Local verification**: - Modified modules in parallel (`emit::diff_tests::`, `emit::rect::`, `emit::tests::stub_pipeline_is_created`, `VICTORY_D3D12_DEBUG=1`): **8/8 passed** - Full parallel `victory-shader --lib` run: **297 passed** (zero deadlocks, zero WARP concurrent crashes, zero lock-poison cascades; the 3 failures are pre-existing RTX 5090 baseline tests) - `cargo clippy --all-targets -- -D warnings` + `cargo xtask policy` (`192 files ok`): 0 warnings
kotekompotek commented 2026-11-26 03:04:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:22:57Z.

Review: COMMENTED


Verified: the remaining Host::new tests now take ONE_AT_A_TIME, consistent with the serialized-hardware convention already in valu_tests — removes the parallel-GPU-use flake without changing coverage.

<!-- greyfinch-sync:Marvisak/VIctory:review:6067722801 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2964#pullrequestreview-6067722801). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T02:22:57Z. **Review:** COMMENTED --- Verified: the remaining Host::new tests now take ONE_AT_A_TIME, consistent with the serialized-hardware convention already in valu_tests — removes the parallel-GPU-use flake without changing coverage.
Marvisak commented 2026-11-26 06:03:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:47:40Z.


Automated triage for the maintainers.

Merge candidate. This takes the existing valu_tests::ONE_AT_A_TIME lock in the remaining GPU tests that create a Host without it: the five device tests in emit/diff_tests.rs, the rect test in emit/rect.rs, and stub_pipeline_is_created in emit/mod.rs. Every other GPU test module already takes this lock, and its doc comment says why (hangs, and WARP access violations, when two GPU tests run at once). I checked that the modules have the same cfg(all(test, windows)) gating as valu_tests, and that none of the locked tests calls a helper that takes the lock again (run_cases does, but these tests don't use it), so the non-reentrant Mutex can't deadlock.

CI: not run on this head (no check runs reported).

Recommending a look, not approving.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183810944 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2964#issuecomment-7183810944). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T05:47:40Z. --- <!-- victory-triage v1 head=9956c99a5ca0cba17806a0ccbac5163c9ce320ec verdict=merge-candidate at=2026-11-26T05:47:27Z --> Automated triage for the maintainers. **Merge candidate.** This takes the existing `valu_tests::ONE_AT_A_TIME` lock in the remaining GPU tests that create a `Host` without it: the five device tests in `emit/diff_tests.rs`, the rect test in `emit/rect.rs`, and `stub_pipeline_is_created` in `emit/mod.rs`. Every other GPU test module already takes this lock, and its doc comment says why (hangs, and WARP access violations, when two GPU tests run at once). I checked that the modules have the same `cfg(all(test, windows))` gating as `valu_tests`, and that none of the locked tests calls a helper that takes the lock again (`run_cases` does, but these tests don't use it), so the non-reentrant `Mutex` can't deadlock. CI: not run on this head (no check runs reported). Recommending a look, not approving. --- _Generated by [Claude Code](https://claude.ai/code)_
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/2964:upstream-pr/2964'
git switch 'upstream-pr/2964'

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