GPU: save only changed host pipeline-library shards #1650

Closed
avt0m4t48 wants to merge 2 commits from upstream-pr/1651 into main
avt0m4t48 commented 2026-11-24 20:28:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by avt0m4t48 on 2026-11-24T20:28:30Z.


GPU-PIPELINE-LIBRARY-SIZE, tracked in #1633.

Partition host pipeline-library entries by the first hexadecimal digit of the existing content hash. The sixteen files open on first use, and a save serializes only the opened shards with new entries. Each file is replaced atomically. Failed serialization or writes retain the dirty state for a later save. The early-pipeline list saves independently.

Existing host-pipelines.bin files stay untouched. A shard miss can fall back to the legacy library and promote a successful lookup into the new shard. This preserves warm legacy entries. After the first miss the legacy blob can remain in memory until exit, and the legacy file and new shards coexist on disk until the legacy file is removed separately. Saves are serialized within one process. Separate processes sharing a cache still replace a shared shard on a last-writer-wins basis.

Verification:

  • Linux standalone Rust tests of shard selection, dirty saves, failed-save retry and competing replacements: 4/4 with warnings denied.
  • Linux Windows-target compile: cargo check --locked --tests --target x86_64-pc-windows-msvc -p victory-gpu --features diagnostics,blake3/pure.
  • Windows WARP: VICTORY_D3D12_WARP=1 and cargo test --locked -p victory-gpu --features diagnostics pipeline::library:: -- --nocapture passed 7/7, including creating, saving, reopening and loading a real synthetic D3D12 compute pipeline. Windows verification

This changes file granularity. Merge-tree checks found conflicts with #275 (background saves), #1041 (pipeline deduplication), and #640 (failed-save retry) in the library file. These need reconciliation if combined. Title workload I/O savings and physical-adapter behavior remain unmeasured.

AI-assisted, using original source and synthetic inputs.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6590776116 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1651). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-24T20:28:30Z. --- GPU-PIPELINE-LIBRARY-SIZE, tracked in #1633. Partition host pipeline-library entries by the first hexadecimal digit of the existing content hash. The sixteen files open on first use, and a save serializes only the opened shards with new entries. Each file is replaced atomically. Failed serialization or writes retain the dirty state for a later save. The early-pipeline list saves independently. Existing `host-pipelines.bin` files stay untouched. A shard miss can fall back to the legacy library and promote a successful lookup into the new shard. This preserves warm legacy entries. After the first miss the legacy blob can remain in memory until exit, and the legacy file and new shards coexist on disk until the legacy file is removed separately. Saves are serialized within one process. Separate processes sharing a cache still replace a shared shard on a last-writer-wins basis. Verification: - Linux standalone Rust tests of shard selection, dirty saves, failed-save retry and competing replacements: 4/4 with warnings denied. - Linux Windows-target compile: `cargo check --locked --tests --target x86_64-pc-windows-msvc -p victory-gpu --features diagnostics,blake3/pure`. - Windows WARP: `VICTORY_D3D12_WARP=1` and `cargo test --locked -p victory-gpu --features diagnostics pipeline::library:: -- --nocapture` passed 7/7, including creating, saving, reopening and loading a real synthetic D3D12 compute pipeline. [Windows verification](https://github.com/avt0m4t48/VIctory/actions/runs/45480625023) This changes file granularity. Merge-tree checks found conflicts with #275 (background saves), #1041 (pipeline deduplication), and #640 (failed-save retry) in the library file. These need reconciliation if combined. Title workload I/O savings and physical-adapter behavior remain unmeasured. AI-assisted, using original source and synthetic inputs.
catminou4 commented 2026-11-24 23:04:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:19:53Z.

Review: COMMENTED


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

Only changed host pipeline-library shards are saved: serialize() per shard, device()/shard() accessors, old monolith kept for shard misses opened lazily. 28K diff, Windows-only — the shard-miss fallback path deserves a Windows CI run with a real library.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048311537 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1651#pullrequestreview-6048311537). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T22:19:53Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Only changed host pipeline-library shards are saved: serialize() per shard, device()/shard() accessors, old monolith kept for shard misses opened lazily. 28K diff, Windows-only — the shard-miss fallback path deserves a Windows CI run with a real library.
upstream-sync closed this pull request 2026-11-25 02:04:46 +00:00
Marvisak commented 2026-11-25 02:05:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:23:17Z.


Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #1653. Same sharding task as #1653 (#1633) in four times the code, with a legacy-file fallback that keeps the old blob in memory.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149492805 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1651#issuecomment-7149492805). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:23:17Z. --- Automated triage for the maintainers. Closing because another open pull request covers the same change. See #1653. Same sharding task as #1653 (#1633) in four times the code, with a legacy-file fallback that keeps the old blob in memory. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Marvisak commented 2026-11-25 02:06:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:33:24Z.


Automated triage for the maintainers.

Needs rebase. This pull request conflicts with main (conflicting: crates/victory-gpu/src/pipeline/library.rs). It will be reviewed once it is rebased onto the current main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149682692 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1651#issuecomment-7149682692). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:33:24Z. --- <!-- victory-triage v1 head=955905163ecb3d8f800b5d0a3514b76c5ec8cebd verdict=needs-rebase at=2026-11-25T01:33:23Z --> Automated triage for the maintainers. **Needs rebase.** This pull request conflicts with `main` (conflicting: `crates/victory-gpu/src/pipeline/library.rs`). It will be reviewed once it is rebased onto the current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_

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
Marvisak/VIctory!1650
No description provided.