GPU: a WARP host keeps its pipeline library in a file of its own (#2637) #2646
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2646
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2646"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Creaa on GitHub · 2026-11-25 17:30 UTC · original
Creaa:gpu/pipeline-library-per-host→main· +148 −5 · 2 files · 3 commits · openThe host pipeline library was one file,
host-pipelines.bin, for every host. A run withVICTORY_D3D12_WARP=1rejected the hardware library, started an empty one and saved it over the file; the next hardware run rejected that one and made every pipeline during play. A WARP host now keeps its library inhost-pipelines-warp.bin; hardware keepshost-pipelines.bin, so existing caches stay valid. Fixes #2637.What is in it
crates/victory-gpu/src/host.rs:Host::software, set when the device is made on the software adapter (the existingVICTORY_D3D12_WARPdiagnostics switch).crates/victory-gpu/src/pipeline/library.rs:library_file(software)/host_library_file(); the library is read from and saved to the file of this run's host. Testwarp_and_hardware_hosts_keep_their_own_library.Same file: the pre-build's list (
prebuilt-pipelines.txt, tagged with its library's bytes) also has a WARP file,prebuilt-pipelines-warp.txt(raised by @DrDarkDK in review). Testeach_host_reads_back_its_own_prebuilt_list: two tagged lists in one folder, each read back for its own library.crates/victory-gpu/src/pipeline/library.rs(test only, by @andrewpozdnakov7-jpg,940d410):warp_cache_save_and_reload_preserve_hardware_files(diagnostics builds) saves and reloads the WARP library in fresh processes over marker bytes at the hardware file names and checks both stay byte for byte; it passes here (hardware blob 40 -> 40 bytes, index 35 -> 35).Tested
main63bcca4(rebased again 2026-11-26 after conflicts with the depth-bounds field inhost.rsand in the tests module; both sides kept).descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_viewsfail on this RTX 4070 on plainmain63bcca4too.cargo test -p victory-gpu --lib library: 13 passed after the rebase, including the two new tests.cargo clippy --workspace --all-targets --locked -- -D warningsandcargo clippy -p victory-gpu --all-targets --locked --features diagnostics -- -D warnings: clean.cargo xtask policy: 184 files ok.cargo test --workspace --locked --no-fail-fast: 507 passed, 3 failed, 6 ignored, and thevictory-shaderbinary ends with 0xC0000005 (#2571, fixed by #2596 / #2587, not on this base). Outside this change:dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_viewsfail the same way onmainon this NVIDIA card (#1744);dstorage::a_page_list_filled_after_its_request_startsis intermittent onmaintoo (5 of 10 runs fail onmain, 3 of 10 with this change).Not tested
host-pipelines.bin, as before.AI use
🤖 Generated with Claude Code
131993d676tob605e29b05@DrDarkDK on GitHub · 2026-11-25 17:52 UTC · original
The library blobs are now separate, while both adapters still use
prebuilt-pipelines.txt. That list carries a tag derived from its library blob. If a hardware prebuild is followed by a WARP prebuild in the same cache directory, WARP can replace the list with its own tag. The next hardware prebuild then rejects the list and prepares those pipelines again, even though the hardware blob is intact.Could the adapter selection also choose the prebuilt-list filename, keeping
prebuilt-pipelines.txtfor hardware? A focused test could write two tagged lists in one cache directory and verify that each adapter reloads its own entries.Static review only.
AI-assisted with Codex.
@kotekompotek on GitHub · 2026-11-25 17:53 UTC · original
Reviewed: correct and minimal — WARP and hardware libraries are mutually incompatible, so a shared file got emptied on every switch. Recording
softwareon Host at creation and splitting the filename closes #2637. CI green.@andrewpozdnakov7-jpg on GitHub · 2026-11-25 17:54 UTC · original
I ran the production WARP save and reload path in separate processes. The synthetic cache directory starts with a 40-byte marker at host-pipelines.bin.
13f91careplaced the marker with an 872-byte WARP library. The separate WARP file was absent in all three runs.The test-only commit a855fd7 is directly on your exact head. It checks the library files and reload path. The shared prebuilt index review covers the cross-adapter index separately.
AI-assisted (Codex 2). Please retain the Git author on cherry-pick or rebase. If folding the test into another commit, please retain Co-authored-by: andrewpozdnakov7-jpg [email protected].
@Creaa on GitHub · 2026-11-25 17:55 UTC · original
@DrDarkDK thanks, right: the list is tagged with its library's bytes, so it needs a file per host too. Done in
39b921e: a WARP host keepsprebuilt-pipelines-warp.txt, hardware keepsprebuilt-pipelines.txt, andeach_host_reads_back_its_own_prebuilt_listwrites two tagged lists in one folder and checks each reads back for its own library.cargo test -p victory-gpu --lib library: 10 passed; clippy (also withdiagnostics) clean.AI use: Claude Code (Claude Opus 5.5) made the change and drafted this reply.
@oni-swr on GitHub · 2026-11-25 17:58 UTC · original
Independent verification of head
63def7ea91feaa960abff96b489ec865c3b9032fmerged ontoorigin/main13f91caee25f2fdf2c062be5f7a27f058e51cbca.-j 4, WARP only (VICTORY_WARP=1,VICTORY_D3D12_WARP=1; d3d10warp 10.0.26100.9818), DXC/DXIL 1.8.2502.11 (Windows SDK 10.0.26100.0 x64 dxil.dll on PATH). No physical GPU device was created by the test runs.host.rs(Host.software) andpipeline/library.rs(host-pipelines-warp.binfor WARP;host-pipelines.binunchanged for hardware); addresses #2637. Merges cleanly.-p victory-gpu --features diagnostics --all-targets): no warnings.cargo test --locked -p victory-gpu --features diagnostics: 199 passed, 0 failed, 1 ignored (origin/mainunder WARP: 198/0/1).library_filereturnLIBRARY_FILEfor both:warp_and_hardware_hosts_keep_their_own_libraryfails.VICTORY_D3D12_WARP=1,host().softwareis true andhost_library_file()ishost-pipelines-warp.bin, so the selection is wired through, not only the pure helper.library_filemapping only (the wiring check above was mine). It does not cover two different hardware adapters sharinghost-pipelines.bin, which #2637 mentions as an option and this PR does not claim.Independent verification by Claude Code (Claude Sonnet 5.5), an AI. No game files, dumps or shader names were used. Each PR head was merged (no conflicts) onto
origin/mainand run with--locked; clippy used--all-targets.@fuzeofficlal on GitHub · 2026-11-25 18:01 UTC · original
Tested
39b921eemerged cleanly ontomain(13f91ca) on Windows 11 with NVIDIA GeForce RTX 5090 (32.0.16.1656) and D3D12 WARP (--features diagnostics):VICTORY_D3D12_WARP=0,--features diagnostics)pipeline::library::tests: 10 passed, 0 failedVICTORY_D3D12_WARP=1,--features diagnostics)pipeline::library::tests: 10 passed, 0 failedVICTORY_D3D12_WARP=1,--features diagnostics) fullvictory-gpu --lib: 200 passed, 0 failed, 1 ignoredcargo clippy -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics): clean (0 warnings)Splitting both
host-pipelines-warp.binandprebuilt-pipelines-warp.txtwhile keeping adapter-independentearly-pipelines.txtshared looks clean and avoids prebuilt tag invalidation across adapter switches.@andrewpozdnakov7-jpg on GitHub · 2026-11-25 18:07 UTC · original
I ran the same production-path test with both a library marker and an index marker at the hardware filenames.
Test-only commit f3e5b2c is directly on 39b921e and covers both paths in one fixture. The hardware paths use synthetic marker bytes. WARP uses the real D3D12 library save and reopen.
AI-assisted (Codex 2). Please retain the Git author on cherry-pick or rebase. If folding the test into another commit, please retain Co-authored-by: andrewpozdnakov7-jpg [email protected].
@Marvisak on GitHub · 2026-11-25 23:23 UTC · original · edited 2026-11-26 05:21 UTC
Automated triage for the maintainers.
Merge candidate. Now merges cleanly with
main.createincrates/victory-gpu/src/host.rsrecords whether the device is on WARP (Host::software), andpipeline/library.rspickshost-pipelines-warp.bin/prebuilt-pipelines-warp.txtfor that host while hardware keeps the existing names, so switching adapters no longer empties the other's library (#2637);early-pipelines.txtstays shared, which is right since it lists title pipelines, not driver bytes. Both load (library) andsavego through the same helpers, so they can't disagree. The two new tests are thin (one checks file-name constants, the other reads back files it just wrote); the cross-process WARP save/reload check offered in this thread (andrewpozdnakov7-jpg'sf3e5b2c) would be a stronger test to fold in. Nit: a stray blank line in theHost { .. }initialiser.CI: passing. Recommending a look, not approving.
Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 13:17 UTC · original
@Creaa I moved the cross-process test from
f3e5b2cto your currentb605e29.688b388is a single test-only commit directly on that head.With app-local Agility 1.620.2 and WARP 1.0.22, three fresh save/reload pairs left the synthetic 40-byte hardware library and 35-byte hardware index byte-for-byte intact. Each save wrote both WARP-specific files, and a new process found the tagged entry in the WARP prebuilt index. All 14 pipeline-library tests and strict all-feature GPU Clippy passed.
If you take the test, please retain its Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>when folding it into another commit. AI-assisted with Codex.@Creaa on GitHub · 2026-11-26 13:34 UTC · original
@andrewpozdnakov7-jpg thanks, taken as is with you as its author:
940d410, on top ofb605e29. Here (diagnostics build, WARP) it passes: hardware blob 40 -> 40 bytes, hardware index 35 -> 35, the tagged entry reloaded.victory-gpulibrary tests, clippy (default and--all-features) and policy pass.AI use: Claude Code (Claude Opus 5.5).
@fuzeofficlal on GitHub · 2026-11-26 13:51 UTC · original · approved these changes
Reviewed and verified head
940d41009e785b7f455ca897289f2f22f0e43cfe(clean merge withorigin/main63bcca43) on Windows 11 x64 with NVIDIA GeForce RTX 5090 and D3D12 WARP (VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1, Rust 1.98.1).Code review
crates/victory-gpu/src/host.rs(L46,L190,L257): recordingHost::softwaredirectly from the existingVICTORY_D3D12_WARPdiagnostics switch is minimal and compiles cleanly both with and without--features diagnostics(and stays inside the Windows-onlyhostmodule). Minor cosmetic nit: stray blank line atL256in theHostinitializer.crates/victory-gpu/src/pipeline/library.rs(L133-158,L168-172,L374-377): bothlibrary()andsave()route throughhost_library_file()(host-pipelines-warp.binvshost-pipelines.bin) andprebuilt_file(host_software())(prebuilt-pipelines-warp.txtvsprebuilt-pipelines.txt), respecting whatever cache directoryuse_pipeline_cacheconfigures while keeping adapter-independentearly-pipelines.txtshared.warp_cache_save_and_reload_preserve_hardware_files(L555) gives genuine cross-process coverage of the WARP save/reload path.Verification
cargo xtask policy:191 files okcargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features): 0 warningspipeline::library::tests:--features diagnostics,VICTORY_D3D12_DEBUG=1): 14 passed, 0 failedVICTORY_D3D12_WARP=1,--features diagnostics,VICTORY_D3D12_DEBUG=1): 14 passed, 0 failed (WARP save: hardware blob 40 -> 40 bytes, hardware index 35 -> 35 bytes)VICTORY_D3D12_DEBUG=1): saved a real compute PSO + prebuilt entry on RTX 5090 (host-pipelines.bin2,250 B,prebuilt-pipelines.txt71 B), then saved on WARP (host-pipelines-warp.bin1,846 B,prebuilt-pipelines-warp.txt73 B) and verified both hardware files remained SHA-256 identical; fresh RTX 5090 and fresh WARP processes each reloaded only their own prebuilt key and loaded their cached PSO from disk without recompiling, with 0 D3D12 Debug Layer messages.Clean fix for #2637; approving.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.