Skip to content

GPU: hash small PSO descriptions in one frame, borrow shader bytecode - #1202

Open
Jineggegg wants to merge 1 commit into
trustno1-coder:mainfrom
Jineggegg:hot-pso-prebuild
Open

Jineggegg wants to merge 1 commit into
trustno1-coder:mainfrom
Jineggegg:hot-pso-prebuild

Conversation

@Jineggegg

Copy link
Copy Markdown

What this changes

Hot prebuild of the 16 hot pipelines hashed every short shader chunk with its own update call, and each pipeline name was built from a fresh copy of every stage's DXIL bytes.

  • pipeline::name now puts small descriptions (framing + bytes up to 8 BLAKE3 chunks) into one contiguous frame and hashes it in a single update, so BLAKE3 can hash the short chunks together. Large descriptions keep the original streaming path.
  • The name callers in pipeline/host.rs now borrow the translated DXIL slices instead of copying them through code_bytes, which is removed.
  • The length framing is unchanged, so names written before still load: the test pins a known name (9402d2bc...), and a new test checks the framing at the 8 KiB frame boundary (8191/8192/8193 bytes).

Adapted from Jineggegg/VIctory round 1 item 5 (commit 2b98109), rebased onto current main. The graphics path has moved on since then: it now names "graphics rectangles" and "graphics" separately with a retry without the geometry stage, so all four name call sites (compute, mesh, graphics with/without the rectangle stage) take the borrowed slices.

Testing

  • On an RTX 5090 (driver 621.14, Rust 1.98.1) in the original round 1 acceptance, the same change cut hot prebuild of the 16 pipelines from 104.0 to 84.0 us (paired -18.85%, 30 pairs, forward window) and from 103.9 to 83.6 us (paired -19.91%, reverse window). The 1 MiB writeback soak showed no stable change (p50 +0.36%, intervals crossing zero). Caveat from that acceptance: the two descriptor-sync timings rose in the same windows and round 1 could not attribute them, so it held the merge; this port changes nothing about descriptor sync.
  • On this checkout: cargo check -p victory-gpu is clean, and cargo test -p victory-gpu --lib pipeline::library passes all 7 tests, including the pinned-name and frame-boundary tests.

Notes on nearby open PRs

Hot prebuild hashed every short shader chunk with its own update and copied each stage's DXIL bytes to name a pipeline. Small descriptions now go into one contiguous frame so BLAKE3 hashes them together, and the name callers borrow the translated DXIL slices instead of copying them. Large descriptions keep the original streaming path, and the length framing is unchanged, so names from before still load.

Adapted from Jineggegg/VIctory round 1 item 5 (2b98109) to current main.
MystifiedSky added a commit to MystifiedSky/VIctory-NVIDIA-Improved that referenced this pull request Nov 28, 2026
Alxspb added a commit to Alxspb/VIctory-NVIDIA that referenced this pull request Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant