perf(gpu): add opt-in sharded pipeline library storage (VICTORY_SHARDED_PSO=1) #419

Closed
Vladimir-Human wants to merge 660 commits from upstream-pr/419 into main
Vladimir-Human commented 2026-11-28 15:22:43 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Vladimir-Human on 2026-11-28T15:22:43Z.


Implements the sharded PSO library storage portion of item #2 from #401 strictly opt-in (VICTORY_SHARDED_PSO=1, default OFF = 0).

Summary (4e5defe)

  • pipeline/library/sharded.rs + pipeline/library.rs route pipeline library entries across 64 lazy shards (128 MiB payload cap/shard), flushing only dirty shards atomically (temp + rename) instead of rewriting a monolithic cache blob, and isolating/rebuilding corrupt shards without losing healthy ones.
  • When VICTORY_SHARDED_PSO is unset or 0, retains exact monolithic host-pipelines.bin path and preserves all static-sampler / adapter-key gates; Cargo.lock untouched.
  • Note: full SamplerDescriptorHeap[] indirection is left for a dedicated follow-up (see roadmap note on #401).

Verification

  • cargo xtask policy: OK
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings & --features diagnostics: 0 warnings
  • VICTORY_D3D12_DEBUG=1 & VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --features diagnostics --locked --lib pipeline::: 58/58 passed on both
<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5541662112 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/419). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-28T15:22:43Z. --- Implements the sharded PSO library storage portion of item #2 from #401 strictly opt-in (`VICTORY_SHARDED_PSO=1`, default OFF = `0`). ### Summary (`4e5defe`) - `pipeline/library/sharded.rs` + `pipeline/library.rs` route pipeline library entries across 64 lazy shards (128 MiB payload cap/shard), flushing only dirty shards atomically (temp + rename) instead of rewriting a monolithic cache blob, and isolating/rebuilding corrupt shards without losing healthy ones. - When `VICTORY_SHARDED_PSO` is unset or `0`, retains exact monolithic `host-pipelines.bin` path and preserves all static-sampler / adapter-key gates; `Cargo.lock` untouched. - Note: full `SamplerDescriptorHeap[]` indirection is left for a dedicated follow-up (see roadmap note on #401). ### Verification - `cargo xtask policy`: **OK** - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` & `--features diagnostics`: **0 warnings** - `VICTORY_D3D12_DEBUG=1` & `VICTORY_D3D12_WARP=1` `cargo test -p victory-gpu --features diagnostics --locked --lib pipeline::`: **58/58 passed** on both
Garu667 commented 2026-11-28 18:48:22 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Garu667 on 2026-11-28T18:48:22Z.


Tested on an RTX 3080 10 GB (4e5defe, Series S, 5 min runs, 1 warm-up run excluded, 3 pairs):

mean fps p10 prep median
off 15.3 / 14.4 / 14.6 10.4 / 6.1 / 7.7 46.5 / 49.0 / 50.8 ms
VICTORY_SHARDED_PSO=1 15.6 / 15.4 / 15.2 9.9 / 9.0 / 8.5 48.4 / 47.5 / 47.8 ms

Slightly ahead with shards on (~+4% mean fps, better p10 in 2 of 3 pairs), but close to run-to-run noise here. No issues seen; pipelines loaded from the library were the same count both ways (~1050).

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7244067849 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/419#issuecomment-7244067849). Originally posted by [Garu667](https://github.com/Garu667) on 2026-11-28T18:48:22Z. --- Tested on an RTX 3080 10 GB (`4e5defe`, Series S, 5 min runs, 1 warm-up run excluded, 3 pairs): | | mean fps | p10 | prep median | |---|---|---|---| | off | 15.3 / 14.4 / 14.6 | 10.4 / 6.1 / 7.7 | 46.5 / 49.0 / 50.8 ms | | `VICTORY_SHARDED_PSO=1` | 15.6 / 15.4 / 15.2 | 9.9 / 9.0 / 8.5 | 48.4 / 47.5 / 47.8 ms | Slightly ahead with shards on (~+4% mean fps, better p10 in 2 of 3 pairs), but close to run-to-run noise here. No issues seen; pipelines loaded from the library were the same count both ways (~1050).
TaynanGT commented 2026-11-29 11:35:42 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T11:35:42Z.


Thanks for the paired sharded-library results. The small improvement is close to the observed variation, so I wouldn't claim a general FPS gain. The equal library-hit counts are useful; cold reload, corrupt-shard recovery and memory overhead matter more for deciding whether to expand this.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7255218039 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/419#issuecomment-7255218039). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T11:35:42Z. --- Thanks for the paired sharded-library results. The small improvement is close to the observed variation, so I wouldn't claim a general FPS gain. The equal library-hit counts are useful; cold reload, corrupt-shard recovery and memory overhead matter more for deciding whether to expand this.
TaynanGT commented 2026-11-30 17:08:07 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:08:07Z.


main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7285772760 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/419#issuecomment-7285772760). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:08:07Z. --- `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
TaynanGT/Vice-Tay!419
No description provided.