Skip to content

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

Open
DenRakEiw wants to merge 1 commit into
Marvisak:mainfrom
DenRakEiw:fix/diff-tests-gpu-lock
Open

DenRakEiw wants to merge 1 commit into
Marvisak:mainfrom
DenRakEiw:fix/diff-tests-gpu-lock

Conversation

@DenRakEiw

@DenRakEiw DenRakEiw commented Nov 25, 2026 •

Copy link
Copy Markdown

Related to #1882 (extending the shared ONE_AT_A_TIME lock rationale from #433 and @fiestorra's #1892).

Every other GPU test module in crates/victory-shader/src/emit/ (valu_tests, memory_tests, flow_tests, bvh_tests, semantics_tests, stride_tests, synthetic_tests, waterfall_tests) serializes Host::new / D3D12+WARP execution via valu_tests::ONE_AT_A_TIME, except for:

  • crates/victory-shader/src/emit/diff_tests.rs (all 5 Host::new call sites)
  • crates/victory-shader/src/emit/mod.rs (stub_pipeline_is_created)
  • crates/victory-shader/src/emit/rect.rs (rectangles_get_their_fourth_corner)

Taking ONE_AT_A_TIME in these remaining GPU test call sites ensures no two victory-shader tests create or drive D3D12/WARP devices concurrently during parallel cargo test --workspace runs. (Kept as Related to #1882 so #1882 remains open until the specific intermittent bitmap failure is reproduced/confirmed resolved.)

Verified locally on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):

  • cargo test -p victory-shader --lib emit::diff_tests:: — 5 passed, 0 failed
  • cargo test -p victory-shader --lib stub_pipeline_is_created — 1 passed, 0 failed
  • cargo test -p victory-shader --lib emit::rect:: — 1 passed, 0 failed
  • cargo test -p victory-shader --lib emit::memory_tests:: — 3 passed, 0 failed
  • cargo clippy -p victory-shader --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

AI-assisted (Gemini 4 Neon).

@jeremygold02

Copy link
Copy Markdown
Contributor

Triage verdict — Keep the broader test hardening; leave the flake open (2ce000e)

Evidence

Checks and limits

Next step

This verification was AI-assisted.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f, cargo test -p victory-shader --locked.

144 passed / 0 failed. Remaining Host::new tests serialized with ONE_AT_A_TIME — fixes the flaky parallel-host-init class; same theme as #1892's shared lock (GPU side).

@Calvix2k

Copy link
Copy Markdown
Contributor

Verified on Windows 10 19045 (RX 7800 XT), your head 2ce000e plus the "skip the GPU suites a device cannot run" patch from #1991 (this host reports SM 6.5, so the probes would otherwise fail for an unrelated reason):

cargo test -p victory-shader --lib — 247 passed, 0 failed, 3 ignored, including the three tests you moved under ONE_AT_A_TIME (diff_tests, rect, stub_pipeline_is_created). The serialisation is the right fix for the shared-device flakiness; nothing else in the suite changed behavior.

One note: rect and stub_pipeline_is_created skip here (no SM 6.6 device), so the lock ordering is only exercised on a machine like CI's. If the intent is to cover them on ordinary hosts too, #1991's skip lands them as skips rather than silent passes.

github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 25, 2026

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.
Merge candidate.

This change is test-only. The remaining victory-shader tests that create a Host now take the shared valu_tests::ONE_AT_A_TIME lock, as every other GPU test module already does: all five sites in emit/diff_tests.rs, emit/mod.rs stub_pipeline_is_created, and emit/rect.rs rectangles_get_their_fourth_corner. I checked that none of these tests calls a helper that takes the lock again, so the lock cannot deadlock. #1892 covers only three of the diff_tests sites (it is marked needs work), so this PR supersedes it. As the description says, it is related to #1882 but not proven to fix that flake.

Recommending a look, not approving.

CI: passing (check).


Generated by Claude Code

@sinan-cmyk

Copy link
Copy Markdown

Offline measurement on a retail dump

Result: no count change against main.

I merged head 2ce000e onto main 940d32f (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 23,918 on main, 23,918 with this PR.

No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants