GPU: hash short PSO descriptions in one frame, borrow shader bytecode #22

Closed
github-bot wants to merge 1 commit from gh-pr/22/head into gh-pr/22/base
Owner

@⁠Jineggegg on GitHub · 2026-11-28 15:44 UTC · original
Jineggegg:hot-pso-prebuild → main · +47 −27 · 2 files · 1 commits · closed without merging

What this fixes

Hot PSO prebuild copies every shader stage's bytes before hashing the pipeline name, and hashes the name parts one by one. This change:

  • Hashes small pipeline descriptions as one contiguous BLAKE3 input, so short shader chunks hash in parallel. Large descriptions still use the original streaming path.
  • Passes the DXIL slices straight to library::name instead of copying each stage's bytes through code_bytes (now removed).

The name output is unchanged, so pipeline libraries written before still load. A new test pins the old name hash and checks the length framing at the 8 KiB buffer limit.

Testing

  • cargo check -p victory-gpu --lib: clean (only pre-existing warnings elsewhere).
  • cargo test -p victory-gpu --lib pipeline::library: 7 passed, 0 failed, including the new framing test.
  • On an RTX 5090 in Jineggegg/VIctory round 1, the same change made hot PSO prebuild about 18% faster (hot-start prebuild about 107 us down to about 86 us, 380,000 rounds, no failure).

Origin

Adapted from Jineggegg/VIctory 2b98109 (round-1 item #5). Foxhound names its mesh pipeline "mesh triangles" and has a separate "graphics rectangles" name with its own geometry stage, so those call sites were adapted to the same borrow form.

**@⁠Jineggegg** on GitHub · 2026-11-28 15:44 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/22) `Jineggegg:hot-pso-prebuild` → `main` · +47 −27 · 2 files · 1 commits · closed without merging ## What this fixes Hot PSO prebuild copies every shader stage's bytes before hashing the pipeline name, and hashes the name parts one by one. This change: - Hashes small pipeline descriptions as one contiguous BLAKE3 input, so short shader chunks hash in parallel. Large descriptions still use the original streaming path. - Passes the DXIL slices straight to `library::name` instead of copying each stage's bytes through `code_bytes` (now removed). The name output is unchanged, so pipeline libraries written before still load. A new test pins the old name hash and checks the length framing at the 8 KiB buffer limit. ## Testing - `cargo check -p victory-gpu --lib`: clean (only pre-existing warnings elsewhere). - `cargo test -p victory-gpu --lib pipeline::library`: 7 passed, 0 failed, including the new framing test. - On an RTX 5090 in Jineggegg/VIctory round 1, the same change made hot PSO prebuild about 18% faster (hot-start prebuild about 107 us down to about 86 us, 380,000 rounds, no failure). ## Origin Adapted from Jineggegg/VIctory `2b98109` (round-1 item #5). Foxhound names its mesh pipeline "mesh triangles" and has a separate "graphics rectangles" name with its own geometry stage, so those call sites were adapted to the same borrow form.
Hash small pipeline descriptions as one contiguous BLAKE3 input, so short shader chunks hash in parallel; stream large descriptions as before. The name output is unchanged (pinned by test), so libraries written before still load.

Pass the DXIL slices straight to library::name instead of copying each stage bytes through code_bytes. In Jineggegg/VIctory round 1 this made hot PSO prebuild about 18% faster on an RTX 5090 (hot-start prebuild about 107 us to about 86 us, 380,000 rounds, no failure).

Adapted from Jineggegg/VIctory 2b98109. Foxhound names its mesh pipeline "mesh triangles" and has a separate "graphics rectangles" name with its own geometry stage, so those call sites were adapted to the same borrow form.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 02:23:13 +00:00
github-bot closed this pull request 2026-11-30 02:23:13 +00:00
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-11-29 08:10 UTC · original

Thanks! Ported into foxhound with credit to you (commit 6c67166) and released in v0.8.1: https://github.com/readmet3xt-lab/foxhound/releases/tag/v0.8.1. The library names stay the same, as your test pins.

**@⁠readmet3xt-lab** on GitHub · 2026-11-29 08:10 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/22#issuecomment-7252930103) Thanks! Ported into foxhound with credit to you (commit 6c67166) and released in v0.8.1: https://github.com/readmet3xt-lab/foxhound/releases/tag/v0.8.1. The library names stay the same, as your test pins.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.