Skip to content

Keep the shader cache warm across emitter test edits - #1908

Open
necrobytes wants to merge 2 commits into
Marvisak:mainfrom
necrobytes:fix/shader-cache-test-sources
Open

necrobytes wants to merge 2 commits into
Marvisak:mainfrom
necrobytes:fix/shader-cache-test-sources

Conversation

@necrobytes

Copy link
Copy Markdown

Editing one of the Windows emitter tests sends the next build to an empty shader cache. I reproduced this on main by warming the cache with two synthetic compute shaders, applying only the test additions from #1877, and rebuilding. Both shaders missed, and both compiled to exactly the same DXIL as before.

This marks the nine standalone emitter test modules with a leading #![cfg(test)]. The translator fingerprint skips Rust sources with that explicit guard. Removing the guard puts the file back in the fingerprint, including when its name still ends in _tests.rs. Adopting this change causes one cache rebuild because the build script itself is part of the fingerprint.

I repeated the check in separate release processes on Linux with Rust 1.98.1.

Change after warming the cache Cache hits DXIL for the two shaders
Apply the test additions from #1877 2/2 Both byte-for-byte identical
Change production compute workgroup lowering 0/2 Both changed
Restore the original lowering 2/2 Both matched the original output

The new regression edits a copy of the real valu_tests.rs, changes a translator source, and removes the test guard. It fails at the test-only edit assertion when the build script hashes every source as on main.

  • cargo test --locked -p victory-shader on Linux passed 145 tests, including the new regression. Two existing tests were marked ignored.
  • Workspace Clippy passed for x86_64-pc-windows-msvc with all targets and warnings denied, both with default features and with --all-features. The repository asset-policy check passed.

Tracked as NEW-47. Claim in #1633

Implemented and tested with Codex.

@necrobytes

Copy link
Copy Markdown
Author

I updated this branch to include upstream’s Windows test change, 42363ab, and compared the hosted run on the new PR head (1a0d45c) with the run on that exact base. Both Clippy steps passed. The shader unit suite reported 244 passed, 2 failed, and 3 ignored on both revisions, with the same diagnostics.

  • gathers_at_a_level_match_the_hardware got [66, 67, 35, 34] for lane 4 and expected [65, 66, 34, 33].
  • permutes_read_the_lane_named_and_zero_from_lanes_left_out reported hardware: no pipeline for a wave of 32.

The hosted workspace run stopped before the new integration test. I ran that test separately on the final PR head on Linux and as a Windows executable under Wine 11.21. It passed on both. I also repeated the release cache probe on that head. The test-only change kept both cache hits, and the production edit recompiled both shaders. PR run · Base run

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant