Repository navigation
Conversation
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed and verified against main (63bcca43) on Windows 11 (RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1) — clean design, thread-safe, and ready to merge:
- Reuses existing
miniz_oxidewith--locked(zero new dependencies). - Lock ordering is clean (
SHADERS,Shader.container, andDXIL_CACHEnever nest);HostPipeline::newretainsVec<Option<Arc<[u8]>>>across PSO creation andrectangle_gsso bytecode pointers stay valid;Shader::dxil()falls back throught.host.dxil->DXIL_CACHE->shader_cache::host_shader(&container)cleanly;Pending.graphicsis safely dropped afterPending::make()completes. - (Minor non-blocking optimization note:
shader()computesblake3::hash(bytes)once beforeShader::new()computes it again, and deflate compression runs while holding theSHADERSmutex — compressing/hashing before locking would cut contention during bulk shader loads.)
Local verification:
victory-gpu(VICTORY_D3D12_DEBUG=1): RTX 5090 and WARP both passed defaultpipeline::27/27,shader_cache::4/4,draw::20/20, and--features diagnosticspipeline::30/30 (including all 4 new memory-reclamation unit tests)cargo clippy --all-targets -- -D warnings(default &--features diagnostics) +cargo xtask policy(191 files ok): 0 warnings
kotekompotek
left a comment
There was a problem hiding this comment.
Verified all three mechanisms: (1) Weak shader cache prunes dead entries amortized at max(2*len,1024), and dedup still works among live pipelines holding Arcs. (2) container compression stores only when deflate actually wins, translation failure frees it entirely via Empty. (3) host.dxil moves to a bounded FIFO; dxil() correctly chains empty-slot -> RAM cache -> disk shader cache -> re-insert, and the Arc lives in dxils during CreateGraphicsPipelineState so bytecode pointers stay valid. atomics64 hoist to per-translation is right too.
|
Automated triage for the maintainers. This reduces RAM use in What it needs:
Verdict: needs work. CI: passing. Generated by Claude Code |
…lock, document failure drop
|
Addressed all triage and review notes:
|
Summary
SHADERScache & pruning (pipeline.rs): storeWeak<Shader>in the global shader map with periodic pruning instead of retaining every shader forever.Pending::graphics& failed containers (pipeline.rs,make.rs): dropGraphicsStateonceHostPipeline::newfinishes and clearShader::containerif translation fails.Shader::containerin RAM (pipeline.rs): deflate containers >= 1 KiB withminiz_oxide(level 1) while kept in memory.pipeline.rs,pipeline/host.rs): keep translated DXIL bytecode in a 32 MiB FIFO cache instead of retaining every translated DXIL buffer inTranslated, reloading on miss fromshader_cachevia the compressed container. (Note: cachingatomics64onTranslatedand hashing once inShader::newalso overlaps slightly with GPU: hash shaders once in pipeline::shader() and cache SFI0 atomics64 on Translated #2211.)Testing
cargo xwin check --tests --profile diag -p victory-gpu --features diagnostics --target x86_64-pc-windows-msvc --lockedpasses cleanly.unreferenced_shaders_are_released_from_cache,dxil_cache_evicts_oldest_past_cap,large_shader_containers_are_stored_compressed,graphics_state_is_released_after_make) pass under Wine (RTX 3060).