Shaders: share the per-key flight on cold cache misses #2072
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2072"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ArturoWolff on 2026-11-29T09:06:46Z.
What it changes
Follow-up to #1607 (VlREX,
ca35e799) and #1489 (FIocker,4fd7f4db), as discussed in the regression report. The current shader-specific decoded-cache path callsconvert_and_storedirectly, bypassing the existing process-local per-key flight. Two overlapping cold misses for the same key can therefore translate twice.Cache::with_key_gatehelper; keep the validated warm hit ungated.How it was tested
4d98ca87, the same-key fixture failed with two translation callbacks (expected one); the distinct-key fixture passed. Both cache source files are unchanged between that base and829188e9.829188e9plus this patch, both concurrency fixtures pass, including exact returned shader equality, warm hits, expected file count, and completion of the distinct key while the first conversion is blocked.cargo test --locked --offline -p victory-pipeline -j2: 13 passed. MSVC GPU test compile succeeded; under Wine the two concurrency tests and three fallback controls (warm/corrupt/unsupported, failed publication, missing root) passed, zero ignored. Full GPU/workspace tests, clippy and native Windows execution remain for CI; no full-suite green claim.cargo xtask policy --staged: 2 files OK. Whitespace check passed.Limitations: process-local only; unsuccessful conversions/publications may serialize later same-key retries (as already discussed on #1607). A foreground caller can wait for an existing worker. No failure sharing or additional retry loop. Sampled-marker concurrency and global counter totals were reviewed statically, not separately exercised. Actual gameplay, startup-time improvement, FPS and physical memory savings are not established by these tests.
Checked for overlap
AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by babuakhil on 2026-11-29T23:37:53Z.
Checked on native Windows 11 (Rust 1.98.1, pinned), applied on current
main(41adb551); cherry-picks cleanly. Clippy onvictory-pipelineis clean with-D warnings, andvictory-gpushows no new warnings in the touched files (the one inshader_cache.rs, an unusedAtomicBool, is onmainalready;-D warningson the crate stops at the 3victory-shadererrors that are onmaintoo). The 14victory-pipelinetests and 13 of the 14shader_cachetests pass in all five runs, including the two new concurrency tests,missing_cache_root_still_yields_the_translationandkey_gate_uses_canonical_root_and_releases_on_return.every_switch_of_the_translator_is_in_the_keyfails, but it fails the same way onmain(VICTORY_SCALAR_SPLITS, #3210).It does what it says. I ran a throwaway test (not part of this PR) through
cachedon bothmainand this PR:mainOn
main, every thread that misses translates, so the bypass is total, not occasional. With this PR every round ended with exactly one entry on disk and the same shader returned to every caller. The warm path still takes no gate.A full
cargo test -p victory-gpu --librun sometimes fails a few unrelated tests (card_steps,texback,pipeline::host,menu) that pass when run alone.maindoes the same in its own runs (uav_pool,menu), so I don't think it's caused by this PR.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.