Shader cache: fingerprint the running build’s source tree #3799
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3799
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3799"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@akimfomin on GitHub · 2026-11-30 07:29 UTC · original
akimfomin:codex/shader-fingerprint-source-root→main· +3 −1 · 1 files · 1 commits · openWhat it changes
The shader fingerprint build script now reads Cargo’s source directory when the script runs. A shared target directory can reuse the compiled script across worktrees. A path captured at compile time can then scan the earlier checkout and publish the wrong shader fingerprint and switch list.
How it was tested
Checked for overlap
Found in the Lab’s RT investigation. Prepared with Codex.
Fixes #
What it changes
How it was tested
cargo testpassed for the crates it touches: yes / noChecked for overlap
@babuakhil on GitHub · 2026-11-30 17:16 UTC · original
Checked on Windows 11 with Cargo 1.98.1 (pinned), on
main(84bd61e2), alone and together with #4001, which touches the samebuild.rs. The bug is real, and this fixes it.Two git worktrees of the same commit, one shared
CARGO_TARGET_DIR, andcargo check -p victory-shaderin each. The first worktree is left clean and the second has a comment appended tosrc/emit/lower.rs. A one-checkout build with that same edit fingerprints605158a35e43…; clean is34c7428dd60d…:main34c7428dd60d34c7428dd60d, the first worktree'svictory-shader-a7c8c7faba94125bfor both34c7428dd60d34c7428dd60d, and its run now watchesD:\zz-wt1\…\emit\lower.rs, the first worktree's file34c7428dd60d605158a35e43, correct34c7428dd60d605158a35e43, correct, and watchesD:\zz-wt2\…So Cargo does reuse the compiled build script across the two checkouts (same build directory each time), and
env!("CARGO_MANIFEST_DIR")then scans the first one. Reading the variable when the script runs fixes it. In the one-checkout case, this PR fingerprints exactly asmaindoes. Clippy reports nothing inbuild.rs.Since #4001 alone would make the script watch the other checkout's files, if both are taken this one should go first. Together they behave correctly.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.