GPU: ask for an empty pipeline library with a null blob #347
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!347
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-347"
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?
@AugustoZFJ on GitHub · 2026-11-24 02:29 UTC · original
AugustoZFJ:fix/empty-pipeline-library→main· +29 −2 · 1 files · 1 commits · openSummary
Under vkd3d-proton,
pipeline::library::open()never gets a pipeline library, solibrary()logs "no host pipeline library: pipelines are not kept" and nothing is cached between runs.When there is no saved blob, or the saved one is rejected,
open()asks for an empty library with an empty slice. An empty Rust slice still has a non-null address (0x1here). vkd3d-proton rejects a non-null blob of length 0 and accepts null.In outline, not the literal diff:
Only the empty request changes. It goes through the raw vtable, because the
windowswrapper takes a slice and a slice can't be null. Loading a saved blob still uses the wrapper. If the host refuses even the empty library, the error is now logged instead of dropped. Onlycrates/victory-gpu/src/pipeline/library.rschanges.Evidence
Everything below ran on GE-Proton11-14 (its vkd3d-proton is v3.1-83) with an RX 6900 XT on RADV 26.2.6, built with
cargo xwinforx86_64-pc-windows-msvc. No game files were used.What
CreatePipelineLibraryreturns there, from a throwaway test that isn't in this PR:S_OK0x1, 0E_INVALIDARG(0x80070057)D3D12_ERROR_DRIVER_VERSION_MISMATCH(0x887E0002)d2a4baethe existing testpipeline::library::tests::a_rejected_blob_gives_an_empty_librarypanics at.expect("an empty library").victory-gpu: 40 passed, 3 failed.After: with this change it passes.
victory-gpu: 41 passed, 2 failed. The two that remain,argument_clamp_builds(#170) andbuffer_data_reaches_the_host_texture(#128), fail the same way before the change.The same throwaway test also ran one round trip with a trivial compute pipeline.
StorePipelineandSerializesucceed (200 bytes), a second library opens from those bytes,LoadComputePipelinereturns the stored pipeline, and an unknown name givesE_INVALIDARG. So the cache works for one pipeline. I haven't run the title with it.Not checked: Windows, because I have no Windows machine. Only the empty request differs there, null instead of
0x1. Microsoft's page forCreatePipelineLibrarysays an empty blob gives an empty library and doesn't say what the pointer should be, so this needs one run of that test on Windows.Merge Danger
Door: two-way
For the code, a revert is enough. A
host-pipelines.binwritten under vkd3d-proton in the meantime stays in thepipelinescache folder and the reverted code would still load it, so undoing it fully also means deleting that folder.Blast Radius: pipeline-cache
On Windows the empty-library request passes null instead of a dangling pointer. That is untested.
Under vkd3d-proton the whole cache switches on for the first time.
LoadGraphicsPipeline,LoadComputePipelineandLoadPipelineare tried before every pipeline is made, and new ones are stored.save()serialises under the library lock, at most every 20 seconds, and writeshost-pipelines.binandearly-pipelines.txt. On the next run the saved blob is reopened and the pipelines listed inearly-pipelines.txtare started early. Of all that, only the one-pipeline round trip above has been exercised.@jeremygold02 on GitHub · 2026-11-24 04:22 UTC · original
Tested PR #347 at head
197c7acf1fb0a1bd51db4f54d6ae934f91edcf25(state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at197c7acf1fb0a1bd51db4f54d6ae934f91edcf25.cargo test --locked -p victory-gpu --lib— passed (ok. 43 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.31s ); cases: device::tests::creation_hands_out_the_device, device::tests::feature_levels_pick_the_highest_supported, device::tests::virtual_memory_configuration_reports_user_space, fence::tests::signals_set_waiting_events, and 39 more.Behavior covered: Runs GPU library unit tests against the null-blob pipeline-library initialization change.
Code: crates/victory-gpu/src/pipeline/library.rs
@CaravelaLabs on GitHub · 2026-11-24 11:21 UTC · original
Tested under vkd3d-proton, which fills the gap in @mercuryVM's review. Thanks @AugustoZFJ, the null-blob fix works there too.
Setup: Radeon 8060S (Strix Halo, RADV GFX1151, Mesa 25.2.8), Ubuntu 24.04, Wine 11.22 + vkd3d-proton 3.1 (
d3d12,d3d12core,dxgi=n).cargo xwin test --locked -p victory-gpu --libforx86_64-pc-windows-msvc, sandboxed with no network. No game files.a_rejected_blob_gives_an_empty_librarymainffe310ean empty library(library.rs:249), reproduced 3/3main+197c7acThe test reaches the device here (main fails on it rather than returning early), so the pass means vkd3d-proton now hands back an empty library for the null blob.
Everything else in the crate behaves the same on both. The only other failure is
indirect::tests::argument_clamp_builds, which is #170 (Wine's builtind3dcompiler_47) and unrelated to this PR.frame::tests::waits_end_on_ticks_and_count_framesalso failed once in one of the two PR runs, which is the timing case #689 covers.AI-assisted test. The runs were done on this machine.
@ThomasHFWright on GitHub · 2026-11-24 12:43 UTC · original
Independent NVIDIA/vkd3d-proton validation on
mainffe310eb2098e52169f4c44db5ffdabf43a72622, with only this PR'spipeline/library.rspatch from197c7acf1fb0a1bd51db4f54d6ae934f91edcf25applied in a separate checkout.Environment: Linux x86_64, Rust 1.98.1, Windows MSVC cross-build (
x86_64-pc-windows-msvc), Wine 11.22 with app-local vkd3d-proton 3.1 (0bb64c56c8f0dcc) and DXVK 3.1.1 (97-ga78a467cadb22be-pcos), RTX 5090 / NVIDIA 620.73.4. Tests ran offscreen with networking disabled; no game files were needed.victory-gputestsffe310epipeline::library::tests::a_rejected_blob_gives_an_empty_libraryfails on the base and passes with the patch. The remaining failure isindirect::tests::argument_clamp_builds(Wine's shader compiler), unchanged between runs. This confirms the fix on NVIDIA as well as the existing RADV reports.Not checked here: native Windows, persistent-cache round trips, or gameplay with this patch. This is synthetic GPU-test validation, not an end-to-end gameplay result.
AI-assisted testing with Codex.
@0xKaji on GitHub · 2026-11-24 14:46 UTC · original
Tested this PR (
197c7ac) under Wine11.22+vkd3d-proton 3.2.0(GE-Proton11-14,VK_EXT_descriptor_heap enabled) on an RTX 3060 8GB (driver620.73.04, CachyOS Linux7.3.5-2), both in unit tests and in a 120s cold-cache live title run into Stage (e) (stacked onffe310e+ #177 + #190,VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains).Unit Tests (Windows
x86_64-pc-windows-msvcunder Wine)victory-gpu(--test-threads=1): 50 passed, 0 failed, 1 ignored —pipeline::library::tests::a_rejected_blob_gives_an_empty_librarypasses (flipped from panicking atan empty libraryonmain).Live Title Result (Cold-Cache 120s Run)
run3), the title loggedno host pipeline library: pipelines are not keptand discarded compiled pipelines.run4),victory_gpu::pipeline::librarycleanly created an empty library (0errors) and flushed5incremental saves during the 120s run, ending at:host pipeline library saved bytes=39224 early=105 made=204 loaded=12 started_early=0host-pipelines.bin(39,224bytes) andearly-pipelines.txt(104lines).loaded=12cache hits occurred inside the very first cold run viavkd3d-proton's pipeline library lookup without any crashes or GPUXids (0crashes,0Xids,512host pipelines built total including222mesh pipelines).Warm-Cache Reload (
run5, Reusinghost-pipelines.binAcross Launch)0library errors):14:38:05.925Z:title pipelines to start early pipelines=10514:38:05.979Z:host pipeline library loaded bytes=39224vkd3d-protonalso promoted its write cache (vkd3d_pipeline_library_disk_cache_merge: Promoting write cache to read cache; stream archive parsed in0.325 ms).made=0):+3.8 s:victory_gpu::pipeline::make: host pipelines all made made=0 loaded=80 started_early=80+31 s:victory_gpu::pipeline::make: host pipelines all made made=0 loaded=112 started_early=112732→130), Wave64#817refusals dropped (58→2), anddropped 0 without a host pipelineheld across all 11 logged FPS intervals (frames 1..1123).run5terminated at+66 s(14:39:10.948Z) with an unrelated NVIDIAvkAllocateMemory Exception 0xc0000005under 8 GB VRAM / 15 GiB RAM exhaustion (NVRMNV_ERR_NO_MEMORYinsystem_mem.c:555), with0GPUXids and0pipeline library errors. On GPUs with more VRAM this OOM may not occur; on 8 GB it's the current ceiling once compilation stalls are gone.)@Marvisak on GitHub · 2026-11-25 00:15 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-gpu/src/pipeline/library.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
@mercuryVM on GitHub · 2026-11-24 08:17 UTC · original · approved these changes
Tested
197c7acon Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (264 passed, 0 failed). Not tested under vkd3d-proton.&[]has a dangling non-null pointer, and the D3D12 contract (and vkd3d-proton's check) treats non-null with length 0 as invalid, while null with 0 means "empty library". Native D3D12 accepts both, which is why this only showed up under vkd3d-proton.CreatePipelineLibrary(null, 0, &IID_ID3D12PipelineLibrary, &mut raw)matches the signature, a nullrawafter success becomesE_POINTER, andfrom_raw+casttoID3D12PipelineLibrary1releases the base reference when it drops.No issues found.
AI-assisted (Claude Code).
@RobertAndreiGit on GitHub · 2026-11-26 13:31 UTC · original
Confirmed the empty-library fix on a real 8 GB RTX 3060 Ti under CachyOS Proton (NVIDIA 615.78.08, vkd3d-proton 3.2.0). Tested a
cool_foxbackport of the same(NULL, 0)fix from Scarlight #119, based onf4b48ad766dd; not this PR’s HEAD.fresh_library_can_be_serialized_and_reopened. The next game launch loaded the persisted, mapped host pipeline library. A later warm run ended withloaded=1872 made=26.victory translate --warm <world-list> --jobs 1over the shader pack and the upscaler/BVH DLLs found 43 of 55 profiled world shader IDs. All 43 were already cached; the other 12 were not found in those inputs. The run with 1,872 pipelines loaded still measured 2.2 FPS in the world.This verifies persistence across runs, not faster steady-state execution. Related implementation: #1722.
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 13:41 UTC · original
@AugustoZFJ I resolved the conflict with current main
63bcca43in8a6e773. Your exact197c7acis the first parent. The fresh/rejected-library path passes(NULL, 0)as in your patch, while the nonempty blob and the current prebuilt-index fields stay on main's paths.On native Windows with app-local Agility 1.620.2 and WARP 1.0.22, the rejected-blob fallback and the pipeline-library serialize/reopen test both passed. Full GPU diagnostics had 247 passes, 0 failures and 1 ignored. Strict all-feature GPU Clippy passed. The Proton and title results are those reported by the other testers in this thread.
You can fast-forward your branch to the tested merge. AI-assisted with Codex.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.