GPU: the host pipeline library works under Wine (null blob for an empty library) #1722
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!1722
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1722"
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?
@Impre-visible on GitHub · 2026-11-24 21:19 UTC · original
Impre-visible:fix/pipeline-library-null-blob→main· +28 −1 · 1 files · 3 commits · openWhat
Two changes in
crates/victory-gpu/src/pipeline/library.rs, both about hosts where D3D12 is vkd3d-proton (Wine/Proton).1. An empty library is created with a null blob.
make(&[])passes an empty Rust slice, whose pointer is dangling and non-null. Windows only looks at the length. vkd3d-proton refuses a non-null blob of length 0 withE_INVALIDARG, so under Wine every run logsand neither
host-pipelines.binnorearly-pipelines.txtis ever written: no pipeline is started early on the next run. The empty library is now asked for through the vtable with a null pointer and length 0. A refusal is logged with its error.2. A pipeline is loaded outside the library's lock.
pipeline()held the mutex for the wholeLoadPipelinecall. Creation was already done outside the lock ("compiles take up to seconds"); with vkd3d-proton's internal cache on, its library stores no compiled code, so a load is a whole pipeline creation too, and the workers then made loaded pipelines one at a time. The load now uses a clone of the library interface taken under the lock.StorePipelineandSerializestill run under it.Measured
Linux, Wine (GE-Proton11-6) + vkd3d-proton, GTX 1660, NVIDIA 620.73.04.
On this branch (main + this commit), two 75 s runs in a row:
saved bytes=2552 early=12 made=13 loaded=0host pipeline library loaded bytes=2552,title pipelines to start early pipelines=12On a larger test tree, at world entry (about 1,400 pipelines first bound in one frame):
Mutex::lock_contendedinsidelibrary::pipeline, the eighth is in the host's create callhost pipelines all made made=0 loaded=500 started_early=499)Before change 1:
madeequals everything on every run, nothing loaded, nothing started early.Not tested
cargo build --release -p victorywith and without--features diagnosticsbuilds forx86_64-pc-windows-msvc. A null blob with length 0 is the documented way to create an empty library, so I expect no change there, but that is unverified.cargo clippy: not run here.VKD3D_SHADER_CACHE_PATH=0, where it would store SPIR-V and driver blobs): not measured.🤖 Generated with Claude Code
683ad7a) into fix/pipeline-library-null-blob 08b526d98c940d32f) into fix/pipeline-library-null-blob ee84a44859@Impre-visible on GitHub · 2026-11-25 00:21 UTC · original
Merged today's
maininto this branch.mainnow takes the library interface under the lock and loads outside it (the second change here), so I keptmain's version of that and this PR is down to its first change: the empty library is created with a null blob, which vkd3d-proton needs.Re-measured on the merged branch (Linux, Wine + vkd3d-proton, GTX 1660), two 75 s runs in a row: run 1
saved bytes=2744 early=14 made=14 loaded=0; run 2made=0 loaded=14 started_early=14. Without the change,mainstill logsno host pipeline library: pipelines are not keptthere. Builds forx86_64-pc-windows-msvcwith and without--features diagnostics.🤖 Generated with Claude Code
@Marvisak on GitHub · 2026-11-25 02:16 UTC · original · edited 2026-11-25 11:20 UTC
Automated triage for the maintainers.
Merge candidate.
The head is unchanged since the last triage (
ee84a44). The PR is still one change incrates/victory-gpu/src/pipeline/library.rsopen: the empty host pipeline library is created with a null blob and length 0 through the rawCreatePipelineLibrarycall, instead ofmake(&[]), which passes a dangling non-null pointer. Main (940d32f) still hasmake(&[])at that spot. The change is small, the failure path still returnsNone(now with a log line), and it touches no dependencies. CI is passing (check), and it merges cleanly.On your reply: thanks. There is now an independent run on a second vendor (RX 9070 XT, RADV under Wine): the library is saved and reloaded across runs, and
a_rejected_blob_gives_an_empty_librarypasses there. Your world-scale run shows the same. Nobody has run it on Windows yet. Since a null blob of length 0 is the documented way to ask for an empty library, the risk there is low.Generated by Claude Code
@Impre-visible on GitHub · 2026-11-25 05:00 UTC · original
Merged the current
main(940d32f) into this branch; it merges without conflict now. Builds forx86_64-pc-windows-msvcwith and without--features diagnostics;cargo test -p victory-shader --lib: 145 passed, 2 ignored.🤖 Generated with Claude Code
@ntgata1-dotcom on GitHub · 2026-11-25 10:15 UTC · original
RX 9070 XT (RADV) under Wine 11.22: pipelines are kept and loaded (menus only)
Setup: Arch Linux, RX 9070 XT (RDNA4), RADV / Mesa 26.3.1. System Wine 11.22. vkd3d-proton
v3.1-83-gcae8353edand DXVKdxgifrom GE-Proton11-14. Release build ofee84a44, cross-built with cargo-xwin. Title first-boot screens only, no input. Two 150 s runs in a row on one cache folder.main940d32fno host pipeline library: pipelines are not kept; nothing writtenstarting an empty one, then saves up tobytes=1208 early=6 made=6 loaded=0title pipelines to start early pipelines=6,loaded bytes=1208, thensaved … made=0 loaded=6 started_early=6crashes.log, no amdgpu messages in the kernel log during the runs. The other warnings are the same as onmain.victory-gputests under Wine:pipeline::library::tests::a_rejected_blob_gives_an_empty_librarynow passes (131 passed, 12 failed;main: 130 / 13). The other 12 failures are the same on both.Not tested: the world (the menus make only 6 pipelines), Windows.
AI-assisted (Claude Code); numbers from my own runs.
@Impre-visible on GitHub · 2026-11-25 10:17 UTC · original
@ntgata1-dotcom thank you, that is the independent run this needed, and on a different vendor (RADV) than mine.
To cover the part you list as not tested: a world-scale number from my side (NVIDIA GTX 1660, Wine + vkd3d-proton
2576c0b, same null-blob change applied to another tree): one 20-minute run into the world ends withhost pipeline library saved bytes=308408 early=1717 made=1615 loaded=89, and the next launches start those early. I measured no gain in time to reach the world from it on this card (151 s on the cold run; 201, 157 and 159 s on three warm ones), so the benefit I can show is that the pipelines are kept and reloaded, not a faster start. Without the change that tree logsno host pipeline library: pipelines are not kepton every run, asmaindoes.🤖 Generated with Claude Code
@OsiPog on GitHub · 2026-11-25 11:38 UTC · original
Tested on Linux (Wine-staging 11.21 + vkd3d-proton, RADV): without this the library is never kept (E_INVALIDARG from CreatePipelineLibrary with an empty blob); with it a 4.5 MB library loads in 9-17 ms and ~2.4k pipelines are reused on the next run.
@axknxla on GitHub · 2026-11-25 15:40 UTC · original
I independently verified the host pipeline library save and reload on RTX 2070 SUPER, NVIDIA 620.73.04, Linux and GE-Proton 11-14. I used upstream
940d32f6and this PR atee84a448(merge commit39565b61), release + diagnostics, Rust 1.98.1, with the same local trace in both binaries. The guarded runs used the same Series X profile, copied save and scripted first-mission route.The cold PR run reached the heavy transition and saved 27,128 bytes in
host-pipelines.binand 1,279 keys inearly-pipelines.txt. Every subsequent run started from a private copy of that same snapshot. For the main control I omitted both host pipeline files. For the last PR run I omitted only the early-start list.Both full replays read all 1,279 early-start entries. The guard recorded no GPU fault. The library-only replay reached heavy demand with the same saved library, so in this test the early exit reproduced with the full early-start list. The logs didn’t establish why the process exited.
The full replays ended before I could compare mission readiness. In the library-only versus main pair, all 1,165 matched keys were pending at first request. Of the 356 keys with at least one second of common follow-up, 37 were ready within one second on the library-only replay and 222 on main. This was one pair, with the early-start list omitted on both sides, so it leaves the performance impact of the normal warm path open.
Codex assisted with the local instrumentation and analysis. These are aggregate timings and counts.
@axknxla on GitHub · 2026-11-25 16:02 UTC · original
I traced the early exit from the full-cache replays and posted the results in the existing compiler-crash issue. Both detailed startup traces faulted while creating compute shader
76c35de1c2444e67after a library miss, matching the shader already reported on RTX 5090.Upstream main also hit the same NVIDIA compiler offset later during graphics pipeline creation with both host pipeline files omitted. On this route the full early-start list moved the failure to startup. The library save and reload results above still hold.
@arogan178 on GitHub · 2026-11-25 23:42 UTC · original
Verified on RDNA 4 under Proton:
pipeline::library::tests::a_rejected_blob_gives_an_empty_libraryandpipelines_load_on_many_threads_at_oncefail onmain("an empty library") and pass with this PR.Setup: RX 9070 XT, RADV (Mesa 27.0-devel), Proton-CachyOS 11.0 with vkd3d-proton 3.2.0 from Proton Experimental, Windows SDK
d3dcompiler_4710.0.26100.victory-gpulib tests cross-built forx86_64-pc-windows-msvcfrommainat63bcca4merged with #1722 and #2101 (both merge cleanly): 232 passed, 0 failed.mainalone: 228 passed, 3 failed, the three named in these two PRs.@necrobytes on GitHub · 2026-11-26 01:25 UTC · original
I tested the empty-library change from
ee84a448on63bcca43on Fedora 45, Ryzen 5 9600X and RX 9060 XT (RADV 26.2.7, vkd3d-proton 3.2.0). Both builds used the same Proton Experimental client, view-lookup-patched wineserver and graphics DLLs. The existinga_rejected_blob_gives_an_empty_librarytest failed on main and passed with this PR on the physical GPU.Each build got one warmup into the opening sequence. For each of three timed launches per build I restored its warmed caches and the same starting profile at 1280×720. Main logged that it could not create a host pipeline library. The PR saved 313,400 bytes and 1,765 early-start entries. On the next launch it reported 1,360 pipelines loaded and zero created before the world marker.
One main run exited early. All three PR runs exited early, one before the marker and the others about 23 and 62 seconds afterward. Two compute pipelines from the failing runs also failed independently on main and compiled with #2723. The library fix restores reuse on this machine. The surviving frame-time samples are too few to establish an FPS improvement.
AI-assisted with Codex.
@arogan178 on GitHub · 2026-11-26 08:18 UTC · original
Tested at head
ee84a4485on AMD under Proton. It works: the library is created, saved and reloaded.Setup: RX 9070 XT, Mesa RADV, CachyOS, Proton Experimental bleeding-edge 11.0-20261125 (vkd3d-proton
71cae0, rebuilt with the dxil-spirv#383 fix so the prebuild survives; see #3101), Series X 1.0.2.1, cross-built release.no host pipeline library: pipelines are not keptno host pipeline library yet; starting an empty one, then savedtranslate --cache --pipelines, first runhost-pipelines.bin4.5 MBhost pipeline library loaded: 0 made, 27,120 already in the library, 2.0 sOnly
library.rschanges, and the diff applied cleanly to current main. #347 is the older, conflicting version of the same fix, so this one is the one to merge.@DenRakEiw on GitHub · 2026-11-24 21:26 UTC · original · approved these changes
Verified locally merged onto
origin/main(Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):cargo test -p victory-gpu— 50 passed, 0 failed (1 ignored) on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— okClean Wine compatibility fix passing a null blob for an empty pipeline library and performing loads outside the lock. Looks good.
AI-assisted (Gemini 4 Neon).
@catminou4 on GitHub · 2026-11-24 21:36 UTC · original · reviewed
Static review only: this crate is Windows-only (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.
Empty pipeline library under Wine: an empty Rust slice has a dangling non-null pointer, and vkd3d-proton rejects a non-null blob of length 0 with E_INVALIDARG. The fix asks for a truly null blob via the vtable directly (CreatePipelineLibrary(null, 0)) and falls back to the normal path otherwise. Minimal and correct-looking; the vtable call is unsafe but matches the COM signature. Windows/Wine-only.
@fuzeofficlal on GitHub · 2026-11-26 12:40 UTC · original · approved these changes
Reviewed and verified
ee84a448againstorigin/main(63bcca43; cleangit merge-tree):CreatePipelineLibrary(crates/victory-gpu/src/pipeline/library.rs:170-198) resolves the dangling-pointer rejection on empty libraries cleanly, checks the HRESULT before taking ownership ofout, and safely releases the temporaryID3D12PipelineLibraryif theID3D12PipelineLibrary1cast fails.Local checks on
ee84a448passed:xtask policy(182 files ok),cargo clippy -p victory-gpu --all-targets -- -D warnings(default &--all-features), andvictory-gpu --lib pipeline::library::tests(8 passed, 0 failedon RTX 5090, RTX 5090 +VICTORY_D3D12_DEBUG=1, and WARP +VICTORY_D3D12_DEBUG=1). Approve.@pickles976 on GitHub · 2026-11-26 19:10 UTC · original · edited 2026-11-26 19:16 UTC
Independent verification of exact production head
ee84a44859d4384ea5b945fa59e09ad9f9ac8d61on Linux/Wine 11.0 and the physical NVIDIA GeForce RTX 4060 Laptop GPU (driver 590.48.1): 2 focused tests passed, 0 failed/ignored, 1.04 s after fresh 6.41 s compilation.a_rejected_blob_gives_an_empty_library: a rejected non-library blob falls back to a live empty library with a nonzero serialized size.pipelines_load_on_many_threads_at_once: cold library creation, 48 stored synthetic compute PSOs, serialization/reopen, concurrent load/store across eight threads, rejection of mismatched/missing descriptions, and eventual loads of all 96 entries pass.Only three local test changes: replace both absent-device returns and the unavailable-shader-compiler return with panics. Adapter and compiler absence cannot silently pass. Production source unchanged; required real host was enumerated. Rust 1.98.1, Windows MSVC target,
DXVK_CONFIG='dxgi.hideNvidiaGpu = False', one test thread, 9 GiB memory/512 MiB swap scope and180s timeout. Installed vkd3d-proton3.2.02576c0b4adfae4a+is the lab's diagnostic-relaxed build, not stock-driver certification.These fixtures create real host PSOs and exercise library serialization/loading, but do not dispatch shaders, launch the title, measure cache hit rates during loading, or demonstrate RAM relief. Our previously recorded empty-blob
E_INVALIDARGfailure on #3147 was not rerun merely to reconfirm it; this is not a newly matched same-fixture head/base comparison.Build-provenance caveat: the first attempted compile reused incompatible shader-crate metadata from another worktree (
Hostappeared to have a privatewarpfield absent from this checkout). Touching the local shader/core/formats/pipeline/GPU crate roots forced matching fresh compilations and resolved it without production edits. That attempt is a shared-target lab failure, not a PR build defect.Evidence:
.compat-runtime/logs/verify-pr1722-wine-library-fresh-deps.log; initial invalid build attempt retained asverify-pr1722-wine-library.log. AI-assisted verification (OpenAI GPT-6 Astra).Integration follow-through: #3147 plus this bootstrap fix passed 14/14 library checks, including a populated file-mapped library with concurrent real-host PSO reloads. That is a disclosed mixed-stack/local-probe result, not an exact-head full-suite or loading-RAM claim.
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.