Repository navigation
Shaders: O(1) LRU shader cache, compile coalescing, and mesh CS caching - #255
RandomGithub12309 wants to merge 1 commit into
Conversation
|
Tested on RTX 5060 Ti 8 GB, driver 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native), Rust 1.100.0 msvc, debug. One review note: Run and written with Claude Code (Claude Opus 5.5). |
|
Tested
Tested
Not tested
🤖 Claude Fable 5.2 |
|
Test run on AMD RDNA4 – commit Tested
Not tested
AI use: run and report by Claude Code (Claude Opus 5.5). |
Replace the VecDeque shader cache with a hash-indexed doubly-linked O(1) LRU cache (cap 4096), coalesce concurrent same-key shader compilations (including shared failure results), and cache console_mesh compute translations under a separate Mesh stage.
6873d46 to
80c5ca5
Compare
|
Updated at |
Part of #156. Reuse shader translations across PSO workers and mesh/pixel shader pairings.
What is in it
crates/xcl/src/gpu/recomp/pso.rs:VecDequeshader cache with hash buckets and a doubly-linked intrusive LRU order (expected O(1) lookup and eviction under the cache lock, cap 4,096 entries within the 64 MiB budget, full shader-byte verification on hash collisions).(cache, key, blob)via anInFlightleader/waiter (Mutex+Condvar+ panic-safeDropguard) so concurrent waiters share both successful builds and compile failures instead of retrying failing compiles serially, while distinct keys compile in parallel andcached_onlyprobes stay non-blocking.console_mesh, both HLSL andXCL_DIRECT_DXILpaths) under a separateCacheStage::Meshin-memory andv2on-disk cache identity.shader_cache_coalesces_concurrent_same_key_compiles,shader_cache_coalesces_concurrent_same_key_failures), and mesh vs compute disk-cache isolation.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)stable-x86_64-pc-windows-msvc, Windows SDK DXC 1.8.2502.11 (debug for unit tests, release forsmoke.ps1).cargo test -p xcl --lib gpu::recomp::pso -- --test-threads=1 --nocaptureat80c5ca5: 20 passed, 0 failed, 1 ignored (0 skipped).cargo test --workspace -- --test-threads=4 --skip fuzz_validate_and_gpuat80c5ca5:xcllib 944 passed, 0 failed, 25 ignored (SKIPPEDon this adapter: wave64-only GPU tests andpso_measurement_compiles_an_exact_synthetic_recordbecause Windows Developer Mode is off;gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3}excluded due to pre-existing0x8007000ECreateComputePipelineStateOOM on this adapter).scripts/smoke.ps1release build at80c5ca5vsmain(8e87fc7).Regression run
Not tested
XCL_SAMPLE_*data, an end-to-end repeatedconsole_meshcache-hit test on a real MS container, and gameplay beyond the 60 s smoke window.AI use
main, added shared failure coalescing and its test, ran the tests andscripts/smoke.ps1on the hardware above, and updated this description. OpenAI Codex (GPT-6) implemented the linked LRU eviction and collision-bucket repair test in the earlier revision.