Repository navigation
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):
cargo test -p victory-gpu --lib pipeline::— 21 passed, 0 failed on RTX 5090 (includingshader_deduplicates_and_matches_blake3_prefix)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean elimination of the startup pipeline allocation storm, double BLAKE3 hashing, and USED lock contention. Looks great.
AI-assisted (Gemini 4 Neon).
Xvania7
left a comment
There was a problem hiding this comment.
Verified locally merged onto main (940d32f, Windows 10 x64, NVIDIA GeForce RTX 5060, Rust MSVC):
cargo test -p victory-gpu --lib -- --test-threads=1 pipeline::— 21 passed, 0 failedcargo clippy -p victory-gpu --all-targets -- -D warnings— 0 warningscargo xtask policy— ok (182 files ok)
Synthetic tests only; no game data.
|
Automated triage for the maintainers. Merge candidate. The PR is now small. On your reply: thanks for splitting it. Dropping the CI: Generated by Claude Code |
… on Translated Trimmed per triage feedback (removed the GraphicsState escaper and library/early-list key rewrite so only the zero-risk savings remain): - Reuse the single blake3::hash(bytes) in pipeline::shader() instead of re-hashing inside Shader::new, and allocate Arc<Shader> outside SHADERS. - Compute dxil_atomics64(&host.dxil) once inside with_resources() and cache atomics64: bool on Translated instead of re-parsing the DXIL container on every HostPipeline creation. Assisted-by: T3 Code (Antigravity, gemini-4-neon)
4ccd2e3 to
ab5ac96
Compare
|
Rebased cleanly onto
|
fuzeofficlal
left a comment
There was a problem hiding this comment.
Tested merged against current main (63bcca43) on Windows 11. Although git merge-tree reports zero text conflicts and cargo check -p victory-gpu --lib compiles, merging into current main breaks test compilation (error[E0063]) under both default and --features diagnostics:
- Adding
pub(crate) atomics64: booltopipeline::Translatedbreaks 3 newerTranslated { ... }initializers added onmainsince13f91caee:crates/victory-gpu/src/draw.rs:3408(default &diagnostics)crates/victory-gpu/src/pipeline/depth_bounds_test.rs:58(default &diagnostics)crates/victory-gpu/src/pipeline/placed_uav_tests.rs:82(--features diagnostics)
- Needs a rebase onto
mainupdating those three test initializers (note: #2974 also introducesatomics64onTranslatedwith those three call sites updated).
|
Heads-up before this lands: merged onto current They come from e976344 (#2155) and 842b0cb (#158). On the merge, Found by merging locally (Windows 11, Rust 1.98.1, no game files). Tested with Claude Code's help. |
…shader() and cache SFI0 atomics64 on Translated
) and atomics64 field in Translated test helpers (Marvisak#2211)
) and atomics64 field in Translated test helpers (Marvisak#2211)
During startup pipeline creation (~60,000+ pipelines in the world), pipeline registration, key hashing, and library tracking perform avoidable allocations, double hashing, and lock contention:
pipeline::shader()computes BLAKE3 twice and allocatesArc<Shader>while holding theSHADERSmutex.GraphicsState::describe()builds intermediateString/Vec<String>allocations on everymake::key()andlibrary::name()call.library::USEDacquires a global mutex on every early-pipeline lookup and stores full 32-byteStringkeys in bothUSEDandCREATED.dxil_atomics64re-parses the DXIL container on every host pipeline creation instead of caching the result onTranslated.Claimed on #1633 (
https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7155570873).The change
crates/victory-gpu/src/pipeline.rs:shader()and allocateArc<Shader>outside theSHADERSmutex on misses (re-checking under the lock before inserting).dxil_atomics64once insidewith_resources()and cacheatomics64: boolonTranslated.shader_deduplicates_and_matches_blake3_prefixanddxil_atomics64_reads_sfi0_flags.crates/victory-gpu/src/pipeline/host.rs&crates/victory-gpu/src/pipeline/make.rs:GraphicsState::write_description()+Blake3Writerformake::key()andlibrary::name_with(), preserving byte-for-byte identical keys and library names.write_description_matches_legacy_describe_and_blake3.crates/victory-gpu/src/pipeline/library.rs:name_with()streaming the state description directly into BLAKE3 with identical length-prefixed layout.early-pipelines.txtkeys into a lock-freeOnceLock<KeySet>(EARLY_BEFORE) and store canonical 32-hex keys as compactu128values (with exact string fallback for non-canonical lines) in bothEARLY_BEFOREandCREATED.parse_key_u128_accepts_only_canonical_32_hex,created_deduplicates_hex_and_non_hex_keys, andearly_before_lock_free_lookup_handles_hex_and_non_hex.Not a duplicate of
#2192(#1509) replacesmake.rs's FIFO queue with a shader/PSO dependency DAG; it does not removeshader()double-hashing, streamGraphicsStatedescriptions, moveearly-pipelines.txtto lock-freeOnceLock<KeySet>, or cacheatomics64.#2179decoupleslibrary::pipeline()loads fromsave()via a second library handle, and#2180skips rewritinghost-pipelines.binwhen onlyearly-pipelines.txtchanged; both are orthogonal to key hashing andEARLY_BEFORE/CREATEDstorage.Tested
windows-latestMSVC + Windows WARP SM 6.6 CI run45570823602(Clippyclean,Clippy, diagnostics buildclean,Tests:731 passed; 0 failed; 10 ignored,victory-gpu:153 passed; 0 failed; 2 ignored+1 passed,xtask:6 passed; 0 failed):pipeline::tests::shader_deduplicates_and_matches_blake3_prefix ... okpipeline::tests::dxil_atomics64_reads_sfi0_flags ... okpipeline::host::tests::write_description_matches_legacy_describe_and_blake3 ... okpipeline::library::tests::parse_key_u128_accepts_only_canonical_32_hex ... okpipeline::library::tests::created_deduplicates_hex_and_non_hex_keys ... okpipeline::library::tests::early_before_lock_free_lookup_handles_hex_and_non_hex ... okNot run: the title; any hardware GPU. The title was not used in these tests.
AI-assisted: T3 Code (Antigravity, gemini-4-neon)