Repository navigation
Shaders: restore direct DXIL cache ID after source deletion - #2047
luckyteagirl wants to merge 1 commit into
Conversation
lewisnic94-max
left a comment
There was a problem hiding this comment.
At 3933694fcb35f157fd4b169ecfd14015b9724ce2, the first Cargo build after deleting a nested direct-DXIL source restored the clean fingerprint in 8/8 cycles, versus 0/8 on merge base 3da2abb81606df622610e009f0430de99aa9881c. The first restored workspace executable also reused the original HLSL, direct-compute, direct-all and per-lane entries. All four synthetic compute pipelines were created, with unchanged cache paths, bytes and timestamps.
Two P3 findings in scripts/test_dxil_source_id.py (high confidence)
-
Line 69. With
PYTHONOPTIMIZE=1, the PR script paired with the unpatched build.rs exits 0 even though the first restored ID is26dcbf2be98a5142and the clean ID is344117f303413662. Normal Python exits 1 on the same input. Use explicit checks that raise or exit nonzero, and run this known-bad control with optimization enabled. -
Line 32. With
CARGO_BUILD_TARGET=x86_64-pc-windows-msvcon native Windows, Cargo builds the probe successfully, then the script raisesFileNotFoundErrorlooking underdebug/. Usecargo run --offline --quietto read the ID without guessing the executable path. A scratch copy with both corrections passed on the fixed head with the host target set and failed on the optimized broken control.
The default script failed on the merge-base build script and passed on this head. Adding it to Windows CI would exercise this regression on future changes. The workspace suite currently does not invoke it.
Tested. Windows 11 26200.9974, Ryzen 7 5800X, RTX 3080 (616.92), Rust/Cargo 1.100.0 MSVC, DXC 1.9.2602.17. cargo test --locked --workspace --no-fail-fast -j 1 -- --test-threads=4 --nocapture gave 1,111 passed, 0 failed, 46 ignored on the head and 1,111 passed, 0 failed, 46 ignored on the base. The head emitted 27 explicit SKIPPED messages and 12 other skip messages, some for subcases. The shader_cache_tests filter passed 15/15.
AMD and coverage. Earlier RX 6800M runs on driver 30.0.13002.13003 also reported device removal. A pre-existing failure cascade is plausible, but the public record does not establish the cause of all 158 failures. A same-driver merge-base run with the first error and per-test results would distinguish them. I did not test AMD, wave64, release builds or a retail title. Earlier RX 6800M report
AI assistance. OpenAI Codex (GPT-6) inspected the changes, ran the independent tests and drafted this review.
|
One thing that only shows after a merge with The Read by Claude Code (Claude Opus 5.5), checked with Claude Fable 5.2; each point checked by a person before posting. |
|
Tested Windows 11 Enterprise Evaluation x64 build 26200.9974, NTFS, Ryzen 7 3800X, native Command for each run:
Not tested Rebased or merged PR tree, XCL workspace build or tests, GPU execution, titles, and shader-cache I/O. The probe measured the compiled-in source ID. AI use Codex in T3 Code ( |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
3933694 to
859e8c0
Compare
|
Independent CPU-only verification on exact head Tested
Optional companion c63333b is directly on this PR's head and contains only that existing integration fixture. No runtime edits or competing PR. Not tested AI use: Codex (GPT-6; exact variant unavailable) reused the integration fixture, ran the script / negative control / CPU test and prepared this report. |
lewisnic94-max
left a comment
There was a problem hiding this comment.
Reviewed commit 859e8c0c2e496c45856edce382b7e1026e60b3d5.
I rechecked the two regression-script findings and the newer build-script dependency. The fixture now copies src/source_hash.rs, invokes Cargo to run the binary, and checks the IDs even with Python optimization enabled. On the standalone head, with CARGO_BUILD_TARGET=x86_64-pc-windows-msvc, and on the clean merge tree 833140040a2de15ad310094cac29bd7ba9a5eedc with main 568e7db, the first incremental build after deletion restored 13533542a3f5a0ac. Adding the nested file had changed it to 6404de24ffc18849.
As a negative control I removed only the per-file Cargo watch from the direct-source loop. Running the unchanged script with python -O exited 1 on the first stale post-deletion ID. The next build and clean build both recovered. That distinguishes a working assertion from a script that always exits successfully. I consider the two earlier P3s resolved on this head.
Windows 11 x64, Ryzen 7 5800X, Rust/Cargo 1.100.0 MSVC. The RTX 3080 was idle for these CPU tests. Three positive script runs passed and one negative control failed as intended. No skipped cases. Coverage was the Cargo fingerprint fixture. The eight-cycle and shader-cache results in the earlier review belong to its earlier commit.
AI assistance: OpenAI Codex (GPT-6) inspected the implementation, analyzed the synthetic test evidence and drafted this review.
Fixes #2033. Cargo can miss the first build after a nested direct-DXIL source is deleted, leaving the temporary source ID in the binary and missing otherwise valid shader-cache entries. The build script keeps its directory watch for additions and now also watches each file it hashes, so removal of a watched file reruns the script immediately. The hash algorithm and cache identity for unchanged sources do not change.
What is in it
crates/xcl/build.rs: emitcargo:rerun-if-changedfor every direct-DXIL source included in the hash, while retaining the directory watch.scripts/test_dxil_source_id.py: run the real build script in a temporary, dependency-free Cargo package; add and remove a nested DXIL source, then compare the first post-removal incremental ID with a clean build. It copies the build script'ssource_hash.rsmodule, usescargo runto respect an explicit target triple, and raises errors even with optimized Python..github/workflows/ci.yml: run the regression script on the Windows CI runner.Tested
859e8c0c2e496c45856edce382b7e1026e60b3d5on mainf5c5bdf0e91035f8f1404f46f4f2f7aedc259e7f; Windows 11 build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5.python scripts/test_dxil_source_id.pypassed: original, first post-deletion, clean, and second post-deletion IDs were13533542a3f5a0ac; adding a file produced6404de24ffc18849. The same script passed withPYTHONOPTIMIZE=1, and with both optimization andCARGO_BUILD_TARGET=x86_64-pc-windows-msvcset. Under optimized Python, the unpatched mainbuild.rsreturned the stale ID on the first post-deletion build, and the script exited 1 at the intended check.git show --check HEADandcargo build --locked --workspace -j 2passed. Release workspace builds passed on both revisions.cargo test --locked --workspace --no-fail-fast -j 2 -- --test-threads=4 --show-outputcompleted on both revisions: 993 passed, 161 failed, 46 ignored on each. The 161 failing test names matched exactly, all undergpu::; both runs reported0x887A0005GPU suspension. This is parity evidence, not a diagnosis of the suspension. The separate initial main run lacked debug title artifacts; a workspace build and rerun resolved that unrelated setup failure.Regression run
main:
PR head:
Not tested
AI use
OpenAI Codex (GPT-6, exact variant not exposed in this session) implemented the fix and regression script, addressed reviewer findings, ran the builds and tests, reviewed the diff, and drafted this description.