GPU: hash DXIL shader slices zero-copy in HostPipeline::new #1993

Open
github-bot wants to merge 1 commit from github-bot/gh-1993 into main AGit
Owner

@⁠nathanbzrr on GitHub · 2026-11-25 02:32 UTC · original
nathanbzrr:gpu/cache-root-signatures → main · +89 −18 · 1 files · 1 commits · open

Summary

  • Zero-copy DXIL hashing slices (crates/victory-gpu/src/pipeline/host.rs, HostPipeline::new):
    • Replaced code_bytes (Vec<u8> allocations per shader stage) with borrowing &[u8] slices via stage_dxil / stage_bytes and extracted shader_bytecode(Option<&[u8]>) -> D3D12_SHADER_BYTECODE.
    • Updated the 3 super::library::name(...) call sites (compute, mesh, and graphics) to hash the borrowed slices directly, keeping pipeline library names unchanged.
  • Test (crates/victory-gpu/src/pipeline/host.rs):
    • Added stage_bytes_matches_code_bytes_for_pipeline_names verifying identical super::library::name(...) hashes across compute, mesh, and graphics (including absent stages, empty slices, and rectangle gs bytes).

Verification (72ab576, Windows MSVC)

  • cargo clippy --workspace --all-targets --locked -- -D warnings: passed (0 warnings)
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed (0 warnings)
  • cargo test -p victory-gpu --lib pipeline --locked: 17 passed, 0 failed
  • cargo test -p victory-gpu --lib pipeline --all-features --locked: 18 passed, 0 failed
  • cargo test --workspace --locked: all workspace crates passed (0 failures; victory-gpu: 144 passed, 0 failed, 2 ignored)
  • cargo run -p xtask -- policy --staged: asset policy: 1 files ok (crates/victory-gpu/src/pipeline/host.rs)
**@⁠nathanbzrr** on GitHub · 2026-11-25 02:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1993) `nathanbzrr:gpu/cache-root-signatures` → `main` · +89 −18 · 1 files · 1 commits · open ## Summary - **Zero-copy DXIL hashing slices (`crates/victory-gpu/src/pipeline/host.rs`, `HostPipeline::new`)**: - Replaced `code_bytes` (`Vec<u8>` allocations per shader stage) with borrowing `&[u8]` slices via `stage_dxil` / `stage_bytes` and extracted `shader_bytecode(Option<&[u8]>) -> D3D12_SHADER_BYTECODE`. - Updated the 3 `super::library::name(...)` call sites (compute, mesh, and graphics) to hash the borrowed slices directly, keeping pipeline library names unchanged. - **Test (`crates/victory-gpu/src/pipeline/host.rs`)**: - Added `stage_bytes_matches_code_bytes_for_pipeline_names` verifying identical `super::library::name(...)` hashes across compute, mesh, and graphics (including absent stages, empty slices, and rectangle `gs` bytes). ## Verification (`72ab576`, Windows MSVC) - `cargo clippy --workspace --all-targets --locked -- -D warnings`: passed (0 warnings) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passed (0 warnings) - `cargo test -p victory-gpu --lib pipeline --locked`: 17 passed, 0 failed - `cargo test -p victory-gpu --lib pipeline --all-features --locked`: 18 passed, 0 failed - `cargo test --workspace --locked`: all workspace crates passed (0 failures; `victory-gpu`: 144 passed, 0 failed, 2 ignored) - `cargo run -p xtask -- policy --staged`: `asset policy: 1 files ok` (`crates/victory-gpu/src/pipeline/host.rs`)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:50:56 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 03:00 UTC · original

Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at 0c8f440. victory-shader: 244 passed, 3 failed, 3 ignored. The 3 are #1744's NVIDIA failures on main (the two stride_tests heap-buffer reads and gathers_at_a_level_match_the_hardware). victory-gpu: 144 passed, 2 failed, with only the two NVIDIA heap-cap failures main also has (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views). Same as main on this hardware. Not run: a title.

AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-25 03:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1993#issuecomment-7151492443) Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at `0c8f440`. `victory-shader`: 244 passed, 3 failed, 3 ignored. The 3 are #1744's NVIDIA failures on `main` (the two `stride_tests` heap-buffer reads and `gathers_at_a_level_match_the_hardware`). `victory-gpu`: 144 passed, 2 failed, with only the two NVIDIA heap-cap failures `main` also has (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`). Same as `main` on this hardware. Not run: a title. AI-assisted (Claude Code).
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-25 03:39 UTC · original

Triage verdict — Separate the hash cleanup from the cache performance decision (0c8f440)

Evidence

  • The borrowed DXIL slices replace the temporary copies used for pipeline names. The root signature cache is a separate change: it clears all entries at capacity, and concurrent misses can each serialize and create a signature before agreeing on one cached result.
  • The concurrent test checks returned COM identity. That is useful, but it does not count serializations or show whether the cache saves work during parallel pipeline creation.

Checks and limits

  • The exact-head Windows check passed. The reported tests cover key fields, reuse and result identity. I did not benchmark pipeline creation.

Next step

  • Consider landing the borrowed-slice cleanup separately after checking that compute, mesh and graphics pipeline names stay identical. For the cache, record serialization counts and elapsed time with repeated keys, parallel cold misses, and a working set that crosses the 1,024-entry cap. That would show when the added cache actually reduces work.

This verification was AI-assisted.

**@⁠jeremygold02** on GitHub · 2026-11-25 03:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/1993#issuecomment-7152114028) **Triage verdict — Separate the hash cleanup from the cache performance decision** (`0c8f440`) **Evidence** - The borrowed DXIL slices replace the temporary copies used for pipeline names. The root signature cache is a separate change: it clears all entries at capacity, and concurrent misses can each serialize and create a signature before agreeing on one cached result. - The concurrent test checks returned COM identity. That is useful, but it does not count serializations or show whether the cache saves work during parallel pipeline creation. **Checks and limits** - The [exact-head Windows check](https://github.com/Marvisak/VIctory/actions/runs/45533709082/job/138935043410) passed. The reported tests cover key fields, reuse and result identity. I did not benchmark pipeline creation. **Next step** - Consider landing the borrowed-slice cleanup separately after checking that compute, mesh and graphics pipeline names stay identical. For the cache, record serialization counts and elapsed time with repeated keys, parallel cold misses, and a working set that crosses the 1,024-entry cap. That would show when the added cache actually reduces work. This verification was AI-assisted.
Author
Owner

@⁠nathanbzrr on GitHub · 2026-11-25 04:12 UTC · original

@⁠jeremygold02 Thanks for the review! Updated gpu/cache-root-signatures (head beecf58, based on origin/main 940d32f) to address the cache eviction, concurrent-miss coalescing, pipeline-name equivalence, and benchmark points:

1. Single-flight coalescing & O(1) LRU eviction (crates/victory-gpu/src/pipeline/host.rs)

  • Single-flight cold-miss coalescing: RootSignatureCache now uses Mutex<RootSignatureCacheState> + Condvar with an explicit CacheSlot::Creating in-flight state and an RAII CreatingGuard. Concurrent misses for the same key wait on the in-flight creator and share its (ID3D12RootSignature, Arc<[u8]>) without redundant D3D12SerializeVersionedRootSignature / CreateRootSignature calls (and CreatingGuard removes the slot and notifies waiters if creation fails or unwinds).
  • O(1) LRU eviction: replaced the full HashMap wipe at ROOT_SIGNATURE_CACHE_CAP = 1024 with an intrusive O(1) LRU doubly-linked list (ReadyEntry indices in Vec<Option<ReadyEntry>>) so hot entries survive capacity eviction and evicted COM objects/blobs drop outside the cache mutex.

2. Tests & library::name equivalence

  • stage_bytes_matches_code_bytes_for_pipeline_names: verifies borrowed stage_bytes slices produce identical super::library::name(...) hashes to code_bytes across compute, mesh, and graphics (including absent stages, empty slices, and rectangle gs bytes).
  • root_signature_cache_reuses_com_identity_and_separates_distinct_layouts: verifies exact serialization counts, LRU eviction preserving hot keys over cold ones, and Creating slot recovery on creator error with a concurrent waiter.
  • root_signature_cache_canonicalizes_concurrent_misses: verifies 4 barrier-synchronized threads per key share COM/blob identity with serializations == 1 per cold key.

3. Synthetic D3D12 benchmark (bench_root_signature_cache, --release)

Measured on Windows MSVC (cargo test --release -p victory-gpu --lib pipeline::host::tests::bench_root_signature_cache -- --ignored --nocapture):

  • Repeated keys (2,000 lookups over 16 keys): uncached 16.19 ms (serializations=2000) vs cached 0.50 ms (serializations=16) — 32.11x
  • Parallel cold misses (8 threads x 32 keys, barrier-synchronized per key): uncached 15.27 ms (serializations=256) vs cached 18.48 ms (serializations=32) — 0.83x (single-flight reduces D3D12 serializations/creations 8x from 256 to 32; remaining threads wait on Condvar + RootSignatureKey Vec construction for trivial 2-param descriptors)
  • Working set > cap (2,124 lookups across 1,100 distinct keys with cap=1024: 256 hot keys touched 5x interleaved with 844 cold keys): uncached 14.18 ms (serializations=2124) vs cached 14.20 ms (serializations=1100) — 1.00x (halves D3D12 serializations and preserves hot keys across the 1,024 cap while breaking even on elapsed time for synthetic 2-param root signatures)

If maintainers prefer landing the zero-copy stage_bytes cleanup in HostPipeline::new as a standalone PR before deciding on the root signature cache, happy to split it out.

Verification (beecf58, Windows MSVC)

  • cargo run -p xtask -- policy --staged: asset policy: 1 files ok
  • cargo clippy --workspace --all-targets --locked -- -D warnings & --all-features: clean
  • cargo test -p victory-gpu --lib pipeline --locked: 20 passed, 0 failed, 1 ignored (--all-features & VICTORY_D3D12_WARP=1 VICTORY_D3D12_DEBUG=1 --features diagnostics -- --test-threads=1: 21 passed, 0 failed, 1 ignored)
  • cargo test --workspace --locked: all crates passed (0 failures; victory-gpu: 147 passed, 0 failed, 3 ignored)
**@⁠nathanbzrr** on GitHub · 2026-11-25 04:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/1993#issuecomment-7152633256) @⁠jeremygold02 Thanks for the review! Updated `gpu/cache-root-signatures` (head `beecf58`, based on `origin/main` `940d32f`) to address the cache eviction, concurrent-miss coalescing, pipeline-name equivalence, and benchmark points: ### 1. Single-flight coalescing & O(1) LRU eviction (`crates/victory-gpu/src/pipeline/host.rs`) - **Single-flight cold-miss coalescing**: `RootSignatureCache` now uses `Mutex<RootSignatureCacheState>` + `Condvar` with an explicit `CacheSlot::Creating` in-flight state and an RAII `CreatingGuard`. Concurrent misses for the same key wait on the in-flight creator and share its `(ID3D12RootSignature, Arc<[u8]>)` without redundant `D3D12SerializeVersionedRootSignature` / `CreateRootSignature` calls (and `CreatingGuard` removes the slot and notifies waiters if creation fails or unwinds). - **O(1) LRU eviction**: replaced the full `HashMap` wipe at `ROOT_SIGNATURE_CACHE_CAP = 1024` with an intrusive `O(1)` LRU doubly-linked list (`ReadyEntry` indices in `Vec<Option<ReadyEntry>>`) so hot entries survive capacity eviction and evicted COM objects/blobs drop outside the cache mutex. ### 2. Tests & `library::name` equivalence - `stage_bytes_matches_code_bytes_for_pipeline_names`: verifies borrowed `stage_bytes` slices produce identical `super::library::name(...)` hashes to `code_bytes` across compute, mesh, and graphics (including absent stages, empty slices, and rectangle `gs` bytes). - `root_signature_cache_reuses_com_identity_and_separates_distinct_layouts`: verifies exact serialization counts, LRU eviction preserving hot keys over cold ones, and `Creating` slot recovery on creator error with a concurrent waiter. - `root_signature_cache_canonicalizes_concurrent_misses`: verifies 4 barrier-synchronized threads per key share COM/blob identity with `serializations == 1` per cold key. ### 3. Synthetic D3D12 benchmark (`bench_root_signature_cache`, `--release`) Measured on Windows MSVC (`cargo test --release -p victory-gpu --lib pipeline::host::tests::bench_root_signature_cache -- --ignored --nocapture`): - **Repeated keys** (2,000 lookups over 16 keys): uncached `16.19 ms` (`serializations=2000`) vs cached `0.50 ms` (`serializations=16`) — **32.11x** - **Parallel cold misses** (8 threads x 32 keys, barrier-synchronized per key): uncached `15.27 ms` (`serializations=256`) vs cached `18.48 ms` (`serializations=32`) — **0.83x** (single-flight reduces D3D12 serializations/creations 8x from 256 to 32; remaining threads wait on `Condvar` + `RootSignatureKey` `Vec` construction for trivial 2-param descriptors) - **Working set > cap** (2,124 lookups across 1,100 distinct keys with `cap=1024`: 256 hot keys touched 5x interleaved with 844 cold keys): uncached `14.18 ms` (`serializations=2124`) vs cached `14.20 ms` (`serializations=1100`) — **1.00x** (halves D3D12 serializations and preserves hot keys across the 1,024 cap while breaking even on elapsed time for synthetic 2-param root signatures) If maintainers prefer landing the zero-copy `stage_bytes` cleanup in `HostPipeline::new` as a standalone PR before deciding on the root signature cache, happy to split it out. ### Verification (`beecf58`, Windows MSVC) - `cargo run -p xtask -- policy --staged`: `asset policy: 1 files ok` - `cargo clippy --workspace --all-targets --locked -- -D warnings` & `--all-features`: clean - `cargo test -p victory-gpu --lib pipeline --locked`: 20 passed, 0 failed, 1 ignored (`--all-features` & `VICTORY_D3D12_WARP=1 VICTORY_D3D12_DEBUG=1 --features diagnostics -- --test-threads=1`: 21 passed, 0 failed, 1 ignored) - `cargo test --workspace --locked`: all crates passed (0 failures; `victory-gpu`: 147 passed, 0 failed, 3 ignored)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 09:16 UTC · original · edited 2026-11-25 11:22 UTC

Automated triage for the maintainers.

Merge candidate. The root signature cache is gone. The PR is now only the borrowed-slice cleanup in crates/victory-gpu/src/pipeline/host.rs (HostPipeline::new). stage_dxil/stage_bytes hand library::name the translated DXIL bytes directly instead of copying them through code_bytes, and shader_bytecode builds the same D3D12_SHADER_BYTECODE as before. An absent stage still hashes as an empty slice, so pipeline names do not change, and the three call sites (compute, mesh, graphics) match.

On your reply: confirmed. The head 72ab576 is a single commit with only this change (+89/−18), and it merges cleanly. A small optional point: stage_bytes_matches_code_bytes_for_pipeline_names keeps a copy of the removed code_bytes only to compare against it, so it could be dropped without losing coverage. CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 09:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/1993#issuecomment-7158106934) · edited 2026-11-25 11:22 UTC <!-- victory-triage v1 head=72ab576d6f75f93ee1aa270249bbea04de2c75af verdict=merge-candidate at=2026-11-25T11:22:46Z --> Automated triage for the maintainers. **Merge candidate.** The root signature cache is gone. The PR is now only the borrowed-slice cleanup in `crates/victory-gpu/src/pipeline/host.rs` (`HostPipeline::new`). `stage_dxil`/`stage_bytes` hand `library::name` the translated DXIL bytes directly instead of copying them through `code_bytes`, and `shader_bytecode` builds the same `D3D12_SHADER_BYTECODE` as before. An absent stage still hashes as an empty slice, so pipeline names do not change, and the three call sites (compute, mesh, graphics) match. On your reply: confirmed. The head `72ab576` is a single commit with only this change (+89/−18), and it merges cleanly. A small optional point: `stage_bytes_matches_code_bytes_for_pipeline_names` keeps a copy of the removed `code_bytes` only to compare against it, so it could be dropped without losing coverage. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠nathanbzrr on GitHub · 2026-11-25 09:29 UTC · original

Addressed the triage feedback (#issuecomment-7158106934) at 72ab576 (based cleanly on origin/main 940d32f):

  • Removed the root signature cache completely from this PR, leaving it scoped strictly to the zero-copy stage_bytes DXIL slice cleanup (shader_bytecode, stage_dxil, stage_bytes, and the 3 super::library::name(...) call sites in HostPipeline::new) plus stage_bytes_matches_code_bytes_for_pipeline_names in crates/victory-gpu/src/pipeline/host.rs (+89 / -18 lines).
  • Updated the PR title and description accordingly. Any root signature cache proposal will only be opened separately if backed by a title-run measurement showing real root signature creation cost.

Local Verification (72ab576, Windows MSVC)

  • cargo clippy --workspace --all-targets --locked -- -D warnings: passed (0 warnings)
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed (0 warnings)
  • cargo test -p victory-gpu --lib pipeline --locked: 17 passed, 0 failed
  • cargo test -p victory-gpu --lib pipeline --all-features --locked: 18 passed, 0 failed
  • cargo test --workspace --locked: all workspace crates passed, 0 failed (victory-gpu: 144 passed, 2 ignored)
  • cargo run -p xtask -- policy --staged: asset policy: 1 files ok
**@⁠nathanbzrr** on GitHub · 2026-11-25 09:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/1993#issuecomment-7158410822) Addressed the triage feedback (`#issuecomment-7158106934`) at `72ab576` (based cleanly on `origin/main` `940d32f`): - **Removed the root signature cache completely** from this PR, leaving it scoped strictly to the zero-copy `stage_bytes` DXIL slice cleanup (`shader_bytecode`, `stage_dxil`, `stage_bytes`, and the 3 `super::library::name(...)` call sites in `HostPipeline::new`) plus `stage_bytes_matches_code_bytes_for_pipeline_names` in `crates/victory-gpu/src/pipeline/host.rs` (+89 / -18 lines). - Updated the PR title and description accordingly. Any root signature cache proposal will only be opened separately if backed by a title-run measurement showing real root signature creation cost. ### Local Verification (`72ab576`, Windows MSVC) - `cargo clippy --workspace --all-targets --locked -- -D warnings`: passed (0 warnings) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passed (0 warnings) - `cargo test -p victory-gpu --lib pipeline --locked`: 17 passed, 0 failed - `cargo test -p victory-gpu --lib pipeline --all-features --locked`: 18 passed, 0 failed - `cargo test --workspace --locked`: all workspace crates passed, 0 failed (`victory-gpu`: 144 passed, 2 ignored) - `cargo run -p xtask -- policy --staged`: `asset policy: 1 files ok`
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 01:41 UTC · original

Code review and RTX 5090 + WARP verification at head 72ab576d6f75 merged cleanly onto main (63bcca43c6a0):

  • Byte-for-byte cache-key parity audit (crates/victory-gpu/src/pipeline/host.rs:595-610, 647-652, 728-733, 871-880):
    • Replacing code_bytes() + to_vec() with zero-copy stage_bytes(i) / shader_bytecode(stage_dxil(i)) feeds the exact same byte slices (&[] for absent stages, t.host.dxil.as_slice() for present stages) into library::name across compute, mesh, and graphics pipelines — zero disk pipeline-library cache invalidation, and t.host.dxil borrows cleanly outlive D3D12_SHADER_BYTECODE across HostPipeline::new.
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-gpu --tests -- -D warnings: 0 warnings
    • victory-gpu -- pipeline::: 24/24 passed on both RTX 5090 and WARP (including stage_bytes_matches_code_bytes_for_pipeline_names).

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 01:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/1993#issuecomment-7180032730) Code review and RTX 5090 + WARP verification at head `72ab576d6f75` merged cleanly onto `main` (`63bcca43c6a0`): - **Byte-for-byte cache-key parity audit (`crates/victory-gpu/src/pipeline/host.rs:595-610, 647-652, 728-733, 871-880`)**: - Replacing `code_bytes()` + `to_vec()` with zero-copy `stage_bytes(i)` / `shader_bytecode(stage_dxil(i))` feeds the exact same byte slices (`&[]` for absent stages, `t.host.dxil.as_slice()` for present stages) into `library::name` across compute, mesh, and graphics pipelines — zero disk pipeline-library cache invalidation, and `t.host.dxil` borrows cleanly outlive `D3D12_SHADER_BYTECODE` across `HostPipeline::new`. - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy --locked -p victory-gpu --tests -- -D warnings`: 0 warnings - `victory-gpu -- pipeline::`: **24/24 passed** on both RTX 5090 and WARP (including `stage_bytes_matches_code_bytes_for_pipeline_names`). LGTM.
Author
Owner

@⁠catminou4 on GitHub · 2026-11-25 02:48 UTC · original · reviewed

Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

Host root-signature cache + zero-copy DXIL slice hashing — CPU overhead reduction on pipeline creation; hash must cover every byte that affects the PSO.

**@⁠catminou4** on GitHub · 2026-11-25 02:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/1993#pullrequestreview-6051087395) · **reviewed** Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Host root-signature cache + zero-copy DXIL slice hashing — CPU overhead reduction on pipeline creation; hash must cover every byte that affects the PSO.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 13:32 UTC · original · approved these changes

Reviewed and verified 72ab576d merged locally onto origin/main (63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust 1.98.1 MSVC, Windows SDK 10.0.26100.0 dxil.dll; synthetic tests only, no game files).

Verification

  • git merge-tree against origin/main (63bcca43) and combined with #1571: clean.
  • cargo xtask policy (PR head): 182 files ok.
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --all-features, PR head, merged, and combined #1993 + #1571): 0 warnings.
  • RTX 5090 (merged, default): cargo test --locked -p victory-gpu --lib -- pipeline:: — 24 passed, 0 failed (including stage_bytes_matches_code_bytes_for_pipeline_names).
  • RTX 5090 & WARP (VICTORY_D3D12_DEBUG=1, --features diagnostics): pipeline:: — 27 passed, 0 failed on both adapters.
  • Combined #1993 + #1571 on 63bcca43 (RTX 5090, VICTORY_D3D12_DEBUG=1, --features diagnostics): 31 passed, 0 failed.

Review Notes

  • Replacing code_bytes() + to_vec() with zero-copy stage_dxil / stage_bytes and shader_bytecode (crates/victory-gpu/src/pipeline/host.rs:520-527, 535, 571-576, 639-644, 755-763) feeds identical byte slices (&[] for absent/empty stages, t.host.dxil.as_slice() for present stages) to super::library::name across compute, mesh, and graphics pipelines, preserving existing disk pipeline-library cache keys byte-for-byte while dropping both the per-stage heap copies and the production from_raw_parts unsafe block.
  • Borrowed t.host.dxil slices live inside Arc<Shader>'s OnceLock and outlive D3D12_SHADER_BYTECODE across HostPipeline::new.

Looks good to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 13:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1993#pullrequestreview-6075004940) · **approved these changes** Reviewed and verified `72ab576d` merged locally onto `origin/main` (`63bcca43`) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust `1.98.1` MSVC, Windows SDK `10.0.26100.0` `dxil.dll`; synthetic tests only, no game files). ### Verification - `git merge-tree` against `origin/main` (`63bcca43`) and combined with `#1571`: clean. - `cargo xtask policy` (PR head): `182 files ok`. - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--all-features`, PR head, merged, and combined `#1993 + #1571`): 0 warnings. - **RTX 5090 (merged, default):** `cargo test --locked -p victory-gpu --lib -- pipeline::` — **24 passed, 0 failed** (including `stage_bytes_matches_code_bytes_for_pipeline_names`). - **RTX 5090 & WARP (`VICTORY_D3D12_DEBUG=1`, `--features diagnostics`):** `pipeline::` — **27 passed, 0 failed** on both adapters. - **Combined `#1993 + #1571` on `63bcca43` (RTX 5090, `VICTORY_D3D12_DEBUG=1`, `--features diagnostics`):** **31 passed, 0 failed**. ### Review Notes - Replacing `code_bytes()` + `to_vec()` with zero-copy `stage_dxil` / `stage_bytes` and `shader_bytecode` (`crates/victory-gpu/src/pipeline/host.rs:520-527, 535, 571-576, 639-644, 755-763`) feeds identical byte slices (`&[]` for absent/empty stages, `t.host.dxil.as_slice()` for present stages) to `super::library::name` across compute, mesh, and graphics pipelines, preserving existing disk pipeline-library cache keys byte-for-byte while dropping both the per-stage heap copies and the production `from_raw_parts` `unsafe` block. - Borrowed `t.host.dxil` slices live inside `Arc<Shader>`'s `OnceLock` and outlive `D3D12_SHADER_BYTECODE` across `HostPipeline::new`. Looks good to merge.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1993/head:github-bot/gh-1993'
git switch 'github-bot/gh-1993'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1993'
git switch 'github-bot/gh-1993'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1993'
git switch 'github-bot/gh-1993'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1993'
git switch 'main'
git merge --squash 'github-bot/gh-1993'
git switch 'main'
git merge --ff-only 'github-bot/gh-1993'
git switch 'main'
git merge 'github-bot/gh-1993'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1993
No description provided.