First incremental build after a DXIL source deletion can miss valid shader-cache entries #2023

Open
opened 2026-11-25 01:21:36 +00:00 by lewisnic94-max · 2 comments
lewisnic94-max commented 2026-11-25 01:21:36 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by lewisnic94-max on 2026-11-25T01:21:36Z.


After #1947 merged at 0f293bec8fd53b1478328627a1f08a6155dd2813, the first Cargo build after deleting a nested translator source can retain the fingerprint that included it. I reproduced this with the merge commit’s build script and source inputs, again on main b8428c5efe826a63994d0f8723846f8bb4cd3666, and on the closing tip aa9ab8a3e7b738ec48899e37805f6a7d2d22da53.

On Windows, set XCL_DIRECT_DXIL=1 and populate a direct compute cache. Add a comment-only crates/xcl/src/gpu/dxil/module/review_temporary_input.rs, build, remove the file, then build once more against the original cache. The restored source tree should select its previous entries. On reviewed head 1831ec4a5abb1c3ae0ca4ab3803776f7fafe30cb the first build missed the original entry. Three separate runs of a synthetic MSAA shader wrote a second cache entry containing identical DXIL. The following Cargo build recovered the original fingerprint.

With the merged sources, the initial fingerprint was ea4eb18707b545fe. After removal the first build kept fdef19ef4a8e639a. The next build restored the initial value. In eight repeated add/build/remove/build cycles on the PR’s build script, the first post-deletion build kept the stale value 8/8 times. Keeping the directory watch for additions and emitting cargo:rerun-if-changed for each hashed file restored the initial value on the first build in 8/8 cycles. A regression test should compare the first post-removal Cargo build with a clean build. Build-script directory watch

P3, high confidence. The measured impact was an unnecessary shader translation and disk entry. Windows 11 build 26200.9974, Ryzen 7 5800X, RTX 3080 driver 616.92, Rust/Cargo 1.100.0 MSVC. Codex (GPT-6) assisted with the reproduction, measurements and analysis.

<!-- greyfinch-sync:ivall/xcl:issue:6594927249 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2033). Originally posted by [lewisnic94-max](https://github.com/lewisnic94-max) on 2026-11-25T01:21:36Z. --- After [#1947](https://github.com/xcl-dev/xcl/pull/1947) merged at `0f293bec8fd53b1478328627a1f08a6155dd2813`, the first Cargo build after deleting a nested translator source can retain the fingerprint that included it. I reproduced this with the merge commit’s build script and source inputs, again on main `b8428c5efe826a63994d0f8723846f8bb4cd3666`, and on the closing tip `aa9ab8a3e7b738ec48899e37805f6a7d2d22da53`. On Windows, set `XCL_DIRECT_DXIL=1` and populate a direct compute cache. Add a comment-only `crates/xcl/src/gpu/dxil/module/review_temporary_input.rs`, build, remove the file, then build once more against the original cache. The restored source tree should select its previous entries. On reviewed head `1831ec4a5abb1c3ae0ca4ab3803776f7fafe30cb` the first build missed the original entry. Three separate runs of a synthetic MSAA shader wrote a second cache entry containing identical DXIL. The following Cargo build recovered the original fingerprint. With the merged sources, the initial fingerprint was `ea4eb18707b545fe`. After removal the first build kept `fdef19ef4a8e639a`. The next build restored the initial value. In eight repeated add/build/remove/build cycles on the PR’s build script, the first post-deletion build kept the stale value 8/8 times. Keeping the directory watch for additions and emitting `cargo:rerun-if-changed` for each hashed file restored the initial value on the first build in 8/8 cycles. A regression test should compare the first post-removal Cargo build with a clean build. [Build-script directory watch](https://github.com/xcl-dev/xcl/blob/0f293bec8fd53b1478328627a1f08a6155dd2813/crates/xcl/build.rs#L86) P3, high confidence. The measured impact was an unnecessary shader translation and disk entry. Windows 11 build 26200.9974, Ryzen 7 5800X, RTX 3080 driver 616.92, Rust/Cargo 1.100.0 MSVC. Codex (GPT-6) assisted with the reproduction, measurements and analysis.
JJAutoCompare commented 2026-11-25 02:08:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T01:33:15Z.


Tested

Independent Windows reproduction using the exact crates/xcl/build.rs from live main 8f5fca5bb9ad6e695093d75294ad2cec023bba60 (blob 311d5c923ca88ae8fbba2da8864b4a7381341d08). Windows 11 Enterprise Evaluation x64 build 26200.9974, NTFS, Ryzen 7 3800X, Rust/Cargo 1.100.0 MSVC, dev profile.

A dependency-free probe printed the three IDs compiled into its binary. Its inputs were comment-only stand-ins at the 17 fixed translator paths and two permanent DXIL paths (src/gpu/dxil/mod.rs and src/gpu/dxil/module/mod.rs). I added src/gpu/dxil/module/review_temporary_input.rs, built, removed it, and built twice against the same incremental target. An independent clean target on the original source tree provided the comparison ID. I ran eight cycles each with upstream and with a local variant that keeps the directory watch and also watches each hashed DXIL file. Every step used cargo build --offline --target x86_64-pc-windows-msvc -vv, then ran the resulting probe.

Build script With temporary file First build after removal Second build after removal
Upstream 7be018e2e33349c1 7be018e2e33349c1 in 8/8 ff8092c268136b11 in 8/8
Directory and file watches 7be018e2e33349c1 ff8092c268136b11 in 8/8 ff8092c268136b11 in 8/8

Both clean controls produced ff8092c268136b11. The other two IDs matched throughout. All 52 Cargo invocations and 52 probe runs exited 0, with no skips. The regression assertion exited 1 upstream (0/8 first builds matched clean) and 0 with both watches (8/8). Cargo reported the upstream first post-removal build as fresh. With both watches, it reported the missing file and reran the script on that first build.

Not tested

XCL workspace build or tests, GPU, titles, or shader-cache I/O. This run measured the compiled-in source ID.

AI use

Codex in T3 Code (gpt-6.2-sol) wrote and ran the fixture and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7149679779 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2033#issuecomment-7149679779). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T01:33:15Z. --- **Tested** Independent Windows reproduction using the exact `crates/xcl/build.rs` from live main `8f5fca5bb9ad6e695093d75294ad2cec023bba60` (blob `311d5c923ca88ae8fbba2da8864b4a7381341d08`). Windows 11 Enterprise Evaluation x64 build 26200.9974, NTFS, Ryzen 7 3800X, Rust/Cargo 1.100.0 MSVC, dev profile. A dependency-free probe printed the three IDs compiled into its binary. Its inputs were comment-only stand-ins at the 17 fixed translator paths and two permanent DXIL paths (`src/gpu/dxil/mod.rs` and `src/gpu/dxil/module/mod.rs`). I added `src/gpu/dxil/module/review_temporary_input.rs`, built, removed it, and built twice against the same incremental target. An independent clean target on the original source tree provided the comparison ID. I ran eight cycles each with upstream and with a local variant that keeps the directory watch and also watches each hashed DXIL file. Every step used `cargo build --offline --target x86_64-pc-windows-msvc -vv`, then ran the resulting probe. | Build script | With temporary file | First build after removal | Second build after removal | | --- | --- | --- | --- | | Upstream | `7be018e2e33349c1` | `7be018e2e33349c1` in 8/8 | `ff8092c268136b11` in 8/8 | | Directory and file watches | `7be018e2e33349c1` | `ff8092c268136b11` in 8/8 | `ff8092c268136b11` in 8/8 | Both clean controls produced `ff8092c268136b11`. The other two IDs matched throughout. All 52 Cargo invocations and 52 probe runs exited 0, with no skips. The regression assertion exited 1 upstream (0/8 first builds matched clean) and 0 with both watches (8/8). Cargo reported the upstream first post-removal build as fresh. With both watches, it reported the missing file and reran the script on that first build. **Not tested** XCL workspace build or tests, GPU, titles, or shader-cache I/O. This run measured the compiled-in source ID. **AI use** Codex in T3 Code (`gpt-6.2-sol`) wrote and ran the fixture and prepared this report.
Decodere commented 2026-11-25 02:09:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T01:43:53Z.


Since PR #2047 has been opened for #2033, we dropped our local branch and are stepping back to avoid duplicate PRs.

<!-- greyfinch-sync:ivall/xcl:comment:7149889658 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2033#issuecomment-7149889658). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-25T01:43:53Z. --- Since PR `#2047` has been opened for `#2033`, we dropped our local branch and are stepping back to avoid duplicate PRs.
Sign in to join this conversation.
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
xcl-dev/xcl#2023
No description provided.