d3d12: give an empty pipeline library a null blob (D3D12-VKD3D-EMPTY-PIPELINE-LIBRARY) #2654
Open
kuzeyc wants to merge 4 commits from
upstream-pr/2654 into main
pull from: upstream-pr/2654
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
ProjectLeonida/mandy!2654
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2654"
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?
Imported from ubiquitarianism/leonida. Originally posted by kuzeyc on 2026-11-29T22:40:13Z.
Item:
D3D12-VKD3D-EMPTY-PIPELINE-LIBRARY(claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7263775300)What is wrong
pipeline/library.rs(open) makes the empty host pipeline library withCreatePipelineLibrary(&[]). Thewindowscrate passes an empty slice's pointer, which is dangling, not null, with a length of 0. Microsoft's D3D12 takes that. VKD3D-Proton answersE_INVALIDARG(0x80070057), andmake(&[]).ok()?dropped the error, so under Wine and Proton the run keeps no library:Nothing is stored or saved (
cache/pipelines/host-pipelines.binnever appears), and every start makes every pipeline again.The change
CreatePipelineLibrarythroughblob_pointer(), which gives a null pointer for an empty blob.the host refused an empty pipeline library, with the error) instead of dropped.an_empty_blob_is_given_as_a_null_pointer.One file,
d3d12/crates/leonida-gpu/src/pipeline/library.rs.Tested
cargo xwin test --target x86_64-pc-windows-msvc -p leonida-gpu --features diagnostics -- pipeline::library, run under Wine 11.23: 7 passed, 0 failed (the new test and the six that were there).play-linux.shof #2577.919c0a9e2, with a log line added at that call):CreatePipelineLibrary refused error=Invalid parameter. (0x80070057), thenpipelines are not kept.cache/pipelines):host pipeline library saved bytes=248 ... made=1. With the same fix on #2577's tree, the next start loggedhost pipeline library loaded bytes=6584andhost pipelines all made made=0 loaded=34.python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline/library.rs: clean.The new unit test checks the pointer, not the host: it passes on
maintoo as far as the D3D12 call is concerned, since Microsoft's runtime accepts the dangling pointer. The failure only shows under VKD3D-Proton, which is what the hardware runs above are for.Related
AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-29T22:40:21Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T22:48:45Z.
Independent synthetic A/B of
f1794125(GitHub merge71250d7bonto452d1d1b). Win64 MSVC-target Rust 1.98.1, Wine 11.22, VKD3D-Proton71cae091, DXC1.8.2505.32, RTX 4070 SUPER (620.73.04) and Radeon Raphael (RADV 26.3.1).depth_bounds_pipeline_loads_and_filters_drawsanda_mesh_pipeline_loads_from_the_library. With this PR each passed 3/3, including both depth readbacks. The library unit group went from 5 passed and the rejected-blob test failing to 7/7 on each GPU. An initial blank NVIDIA process timeout was outside the completed baseline sample.CreatePipelineLibrary(&[])call returned0x80070057. The PR path created one PSO and serialized the library, 15,664 bytes on NVIDIA and 3,136 bytes on RADV. A new process loaded the first PSO (loaded=1, made=0) and left the file size unchanged. It also rebuilt and saved successfully after I substituted a malformed blob. Each case passed 3/3 per GPU.8f5f02d80combined cleanly with this PR (local tree1b933a60). Cold and warm behavior matched the standalone PR. Replacing onlyhost-pipelines.fingerprintwith a stale value forced a rebuild and a fresh save, in 3/3 per GPU. All 36 instrumented invocations passed the depth fixture.This resolves the local Wine library assertion I reported in #2648. The hosted native Windows pixel failure there remains open. Small build note: the
!empty.as_ptr().is_null()assertion atlibrary.rs:906emitsuseless_ptr_null_checks. The test already checks the converted pointer immediately above.Synthetic fixtures only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by kuzeyc on 2026-11-29T22:53:35Z.
Thanks for the A/B on both GPUs, and for checking it together with #2569.
55ac5d337: drops the!empty.as_ptr().is_null()assertion thatuseless_ptr_null_checksflags. The converted pointer is still checked just above.pipeline::libraryis 7/7 under Wine 11.23, and clippy has no warnings inlibrary.rs.main" question better than my new unit test does. Under VKD3D-Proton,a_rejected_blob_gives_an_empty_library,depth_bounds_pipeline_loads_and_filters_drawsanda_mesh_pipeline_loads_from_the_libraryfail onmainand pass with this PR, on both your RTX 4070 SUPER and RADV.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by z3r0rc on 2026-12-01T10:45:55Z.
We independently landed exactly this on our tree and can confirm it end-to-end under Wine. Before the null-pointer fix, with
CreatePipelineLibraryreceiving the dangling non-null + 0, the library was dead here under Wine + VKD3D-Proton master (RTX 4090, NVIDIA 620.73.04): every start logged "no host pipeline library: pipelines are not kept", nothing was written at clean exit, and the entry backlog peaked ~1038 every run. With this shape — vtable call, null for the empty blob — the loop closes:saved bytes=448760 made=2347at a clean close, loadedmapped=trueat the next start, compounding 605,624 → 641,336 bytes over the next three windows with the entry backlog shrinking each time. Yourblob_pointerhelper is the cleaner way to state the rule; we inlined the same thing. Happy to test this PR as-is on our machine if useful. AI-assisted; measured logs on the setup above.Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T17:55:26Z.
Review: COMMENTED
Not superseded, and the fix is correct: main still has
device.CreatePipelineLibrary::<ID3D12PipelineLibrary>(bytes)?.cast()(library.rs:522) withmake(&[]).ok()?(:551), and windows-rs 0.62.2 doestransmute(plibraryblob.as_ptr())on an empty slice (Windows/Win32/Graphics/Direct3D12/mod.rs:9959) — a dangling non-null pointer. The manual vtable call withnull+ 0 is the right fix, and the rejected-blob test exercises that path against native D3D12 here (7/7 pass, clippy clean inlibrary.rs).One test gap: replacing
blob_pointer(bytes)at the call site withbytes.as_ptr().cast()leaves all 7 tests green — only the helper is asserted, not thatopenuses it. A small seam (or the replay vtable) that checks the pointeropenpasses would close it, since the bug is only observable under VKD3D.Also
d3d12/crates/leonida-gpu/tests/replay.rs:193still callsCreatePipelineLibrary(&[])through windows-rs, so the replay test keeps the same dangling pointer under Wine — worth switching too.Branch is 1068 commits behind main; merge-tree is clean (
0b142434a), but the head predates #2648's d3d12 cargo-test CI, so no checks have run. A rebase is needed for CI; otherwise this is good to merge.Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T20:42:36Z.
Current-head hardware check of the empty-library call on
55ac5d33, merged into66c79286f, and combined on that same base with #2938 (69485a86). Win64 under Wine 11.22 / VKD3D-Proton 3.1.0, RTX 4070 SUPER (620.73.4) and Radeon RADV (26.3.1).On each adapter, the unmodified
a_mesh_pipeline_loads_from_the_libraryfailed 3/3 on main and 3/3 with #2938 alone after both PSO requests returned. A diagnostic loggedCreatePipelineLibraryreturningE_INVALIDARGfor the empty library, before load or store. The stockpipeline::library::testsalso had exactly one failure under both trees,a_rejected_blob_gives_an_empty_library.This PR alone and the combined tree each passed 3/3 mesh-library runs and 7/7 stock library tests on each adapter, with no skips. The existing GPU mesh test reaches the production
opencall and checks that the second request actually loads from the library, which complements the pointer helper’s unit test on Wine. This run covers an empty library and in-process reuse.MEASURED with synthetic shader inputs, OpenAI Codex and a separate read-only review.
Imported from ubiquitarianism/leonida. Originally posted by kuzeyc on 2026-12-01T21:19:34Z.
Thanks @KelboLive, all three done in
f4ae7b922:origin/maininto the branch (c3ecaa558), no conflicts, so the d3d12 cargo-test CI from #2648 should now run. Merged rather than rebased, per the maintainer guide (no rebase, no force-push).tests/replay.rs: the empty library there now goes through the vtable withnulland 0, the same aspipeline::library(f4ae7b922).a_frame_is_recorded_and_replayedpasses under Wine 11.23.an_empty_blob_is_given_as_a_null_pointeronly pins the helper. The check thatopenuses it is the existing GPU testa_mesh_pipeline_loads_from_the_library, which goes through the realopen: per merzleckeier's run above it fails 3/3 on main and passes 3/3 with this PR on both an RTX 4070 SUPER and RADV under VKD3D-Proton. Puttingbytes.as_ptr().cast()back at the call site would fail it there, though not on native D3D12. If you'd still like a seam that checks the pointeropenpasses without a GPU, say so and I'll add it.pipeline::libraryis 7/7 under Wine on the merged tree. AI-assisted (Claude Code).Imported from ubiquitarianism/leonida. Originally posted by deynesdev on 2026-12-02T07:10:50Z.
Tested on Linux/NVIDIA:
f4ae7b922merged (locally, nothing pushed) intomainf37c4a87d, against plainf37c4a87d. Same save, same settings (scripts/play-linux.shdefaults,LEONIDA_SKIP_BINK=1), shader cache already translated for this build (leonida shaders).Setup: RTX 4050 Laptop 6 GB, NVIDIA 580.196.07, Fedora 44, Wine 11.21 Staging, VKD3D-Proton 3.2.0 (
71cae091b06571e+). Built with--target x86_64-pc-windows-gnullvm(not the msvc route).mainf37c4a87dno host pipeline library: pipelines are not kepthost pipeline library saved, 331,640 bytes, made=1728cache/pipelines/early-pipelines.txtleonida warm --used83670 pipelines known ... 0 to make1828 to make,1828 made in 186 s, 0 badSo on Wine/VKD3D-Proton the empty-library refusal does not only lose the library:
savereturns beforeearly-pipelines.txtis written, which leaveswarm --usedwith nothing to make on every Linux setup. This PR fixes both here. One run per row; themain"next start" run had the driver's own cache warm from an earlier run, not a library.AI-assisted: yes (Claude Code, Claude Opus 5.5): the runs, logs and this comment.
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T14:24:45Z.
Ran natively on Windows 11, head
f4ae7b922merged into currentmain(2fc7383b9, no conflicts), toolchain 1.98.1,--locked. The 7/7 native run above covers the unit tests. This one adds the debug layer, WARP, the rawCreatePipelineLibraryresults for each kind of blob, the serialised round trip of an empty library, and the empty-file paths.Tests on the merge
pipeline::library(7) +a_mesh_pipeline_loads_from_the_library+depth_bounds_pipeline_loads_and_filters_drawstests/replay.rsa_frame_is_recorded_and_replayedcargo test -p leonida-gpu --lib: 697 passed, 0 failed, 59 ignored. Clippy (--all-targets) reports nothing inlibrary.rsorreplay.rs.Native
CreatePipelineLibraryand the empty library (a throwaway test, not committed)This calls the vtable directly with each blob, then serialises the result.
S_OK, serialised size 900S_OK, 872main)S_OK, 900S_OK, 872CreatePipelineLibrary(&[])S_OKS_OKS_OK, same size, re-serialises to identical bytesE_INVALIDARGE_INVALIDARGE_INVALIDARGE_INVALIDARGSerializeinto a buffer one byte shortE_INVALIDARGE_INVALIDARGThe production
opengave a library in all three cases:Blob::None, a junk blob (it fell back to an empty one), and the serialised empty library (loaded as is, no fallback).So on native D3D12 the change makes no difference: the runtime accepts null and dangling alike, and the debug layer is silent on both. The bug can only be seen under VKD3D-Proton, which matches the earlier runs above. An empty library still serialises to a few hundred bytes, not 0.
savedoes not serialise at all whileadded == 0, andBlob::oftreats a 0-byte file as no file. So I found no path that writes, or chokes on, an empty library file.Not checked: Wine/VKD3D-Proton (covered above by others), AMD/Intel native drivers, a full save-and-reopen across two processes on native.
GPUs tested: one NVIDIA desktop card + WARP.
AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T14:31:11Z.
Review: COMMENTED
Follow-up for the replay change in
f4ae7b92, merged locally ontomain69cd4106c. I ran the same MSVC-target tests under Wine 11.22 and VKD3D-Proton0bb64c56on Radeon Raphael (RADV 26.3.1) and RTX 4070 SUPER (620.73.4).A local smoke test called the existing
tests/replay.rs::meshhelper with synthetic HLSL and required the helper to store and reload its mesh PSO. On both GPUs it failed onmainatCreatePipelineLibrarywith0x80070057and passed with this PR. The stockpipeline::librarysuite passed 7/7 on each GPU. The existing rejected-blob and runtime mesh-reload tests also failed onmainand passed with the PR.The full replay test, with its SDK-dependent mesh path inactive, reached
recorder onandscene madeand then failed with the same Wine access fault on both revisions and GPUs. The isolated smoke test exercised the updated replay call with DXC available.git merge-treealso found no textual conflict with #3150 at6a5e5bcd. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:01:29Z.
Triage of head
f4ae7b922(merge base1fff69129, 334 commits behind;git merge-treeagainst currentmain45dc41f95: no conflicts).2 files:
pipeline/library.rs(+37/-3),tests/replay.rs(+15/-7).CI is at
action_requiredon this head (fork workflow approval).Existing verification: Verified by @merzleckeier (Wine/VKD3D-Proton, RTX and RADV), @z3r0rc (same fix landed independently), @deynesdev (Linux/NVIDIA in game on this head) and @Kal0s-design (native, debug layer, WARP, raw
CreatePipelineLibraryper blob kind).This check: Not re-reviewed in depth: the empty library is created from a null blob instead of an empty slice's dangling pointer, which VKD3D-Proton rejected. Root cause, small, verified on both Windows and Proton. It touches
library::open, notlibrary::pipeline, so it does not interact with #3185.I did not build it: the crate is Windows-only (or the C++ runtime's Windows build), so no red/green was run here.
Verdict: ready (root-cause fix verified natively and under Proton; needs CI approval).
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T21:34:45Z.
RUN (independent run on Windows, head
f4ae7b922bc591918b43c4761e69f77572a4c8ac, merged intomainb41763227aeed2d23c98af84bcbc1bddc7acdc90withgit merge --no-ff)PR #2654,
D3D12-VKD3D-EMPTY-PIPELINE-LIBRARY: the empty host pipeline library is created from a null blob (newblob_pointer()helper and a raw vtable call) instead of an empty slice's dangling pointer. It also logs a refused empty library, andtests/replay.rsmakes its library the same way. Two files, +52/-10.Merge: clean, no conflict. Toolchain from the repo,
--locked,--release, native Windows 11, one shared target directory, noleonida.exerunning during the builds.Green
cargo test -p leonida-gpu --release --locked --lib: 704 passed, 0 failed, 59 ignored. All 7pipeline::librarytests pass, including the newan_empty_blob_is_given_as_a_null_pointer.cargo test -p leonida-gpu --release --locked --features diagnostics --lib: 785 passed, 0 failed, 59 ignored. I ran this one becausetests/replay.rsis behindfeature = "diagnostics".cargo test -p leonida-gpu --release --locked --features diagnostics --test replay:a_frame_is_recorded_and_replayedpasses (1/1). Without the feature this file compiles to 0 tests.Red
The PR's only new test is in
library.rs, next to the code it tests. Checking out main'slibrary.rsremoves the test andblob_pointertogether, so it cannot go red that way. I mutated the new code instead, one change at a time, then restored the file withgit checkout HEAD --:blob_pointeralways returnsbytes.as_ptr()(the old behaviour)blob_pointer(&[]).is_null()(6 passed, 1 failed)openusesbytes.as_ptr().cast()instead ofblob_pointer(bytes)M2 is the gap KelboLive pointed out in review. The unit test checks the helper, not that
openuses it. The raw-vtable call also passes a dangling pointer without error on native D3D12, so no native test can see the bug. Only VKD3D-Proton refuses it.Review
d3d12/docs/switches.mddoes not need regenerating.makestill builds the library from the bytes kept beside it inLibrary. A null pointer with length 0 is only given for an empty blob.rawis wrapped byfrom_rawonly after.ok()?succeeded, so an error leaves nothing to release.blobis still dropped before the empty library is made. No fences are involved.docs/d3d12_vulkan.md(§ onCreatePipelineLibrary) already says a null pointer with a size isE_INVALIDARG. A null pointer with size 0 is the opposite case and is not recorded there. That is a docs gap, not a blocker.D3D12-VKD3D-EMPTY-PIPELINE-LIBRARYwith a link to a claim comment on issue 2570.replay.rschange KelboLive asked for is done (f4ae7b922). (3) Theuseless_ptr_null_checkswarning is fixed in55ac5d337.git merge-treeof this head against #2789 (stale library driver stamp) conflicts inpipeline/library.rs, so whichever lands second needs a small merge. Against #3185 and #3150 it is clean. #2569, which the body mentions, is closed.f4ae7b922): one by deynesdev, Linux, Wine 11.21 plus VKD3D-Proton 3.2.0, RTX 4050 Laptop. Onmain, "no host pipeline library: pipelines are not kept". With the PR, the library is saved (331,640 bytes) and loaded at the next start. Median fps in the last 20 lines is 12.4 for both. It is a Wine/Proton run, not a native Windows in-game run. Kal0s-design ran native Windows with the debug layer and WARP on a merge (f4ae7b922into2fc7383b9): 9/9 on card and WARP, with and without the debug layer. merzleckeier and z3r0rc report Proton runs on earlier heads.Not covered
E_INVALIDARGfrom a dangling pointer) cannot be reproduced on native D3D12, so my green run does not show the bug is gone. It shows nothing broke natively.Verdict
PARTIAL: green on the merge, and the new unit test is killed by 2 of 3 mutations. M2 survives (the call site's use of
blob_pointeris not asserted), and the real failure is only visible under VKD3D-Proton, where others have already confirmed it on this head. The fix is small and the code reads as correct. A conflict with #2789 inlibrary.rsis to be expected. In-game run still required on native Windows if the maintainers want one on this head; a Proton in-game run is already posted on this head.AI-assisted (Claude Code), models: Claude Opus 5.5 (checker), separate Claude Opus 5.5 judge.
Imported from ubiquitarianism/leonida. Originally posted by bercedev on 2026-12-02T23:34:50Z.
tested this merged onto main
ef35d683eon linux: proton experimental 11.0, vkd3d-proton master f8c1cae83, rtx 4050 laptop 6 gb, nvidia 620.73.04the fix does what it says. main logs "no host pipeline library: pipelines are not kept" on every start. with this the first launch started an empty library and saved it as it went (1327 made, 259 kb host-pipelines.bin), and the second launch logged "host pipeline library loaded" and loaded 1405 of 1418 early pipelines, with only 1 made fresh
it didn't take the long stalls away on this setup though. both launches still had 10-16 s present gaps in the world, and the median fps was lower than my main runs (7.8 to 9.0 against 12.2 to 13.6). those are single runs on a 6 gb card that's at its vram limit, so i wouldn't read the fps much, but whatever causes the 10 s waits here is not only the missing library
AI-assisted: yes (claude). runs played by me
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-03T00:54:13Z.
RUN (in game, gate-style): head
f4ae7b922tested in a batch of nine pull requests: #2609 (3fbcacc4e), #2654 (f4ae7b922), #2686 (4ce795127), #2823 (854796496), #2841 (24ff8f24c), #2890 (262439781), #3154 (854fc3441), #2588 (598930e5b) and #3119 (6097c033c), merged in that order withgit merge --no-ffontomainf3865cae8. One conflict, in the credit table ofd3d12/README.mdwhen #2588 went in (both rows kept); no code conflict. Files touched by more than one of the nine:d3d12/docs/switches.md(#2686, #3119, #3154) andd3d12/README.md(#2588, #3119). Built withdiagnostics,mimalloc, targetx86_64-pc-windows-msvc. RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro (build 26300).Launcher defaults except
-PrecompileUsed, Series S settings,-NoDlss -NoFrameGen, standing at the save. On thismainthe launcher precompiles every recorded pipeline by default (88,671 here: a first warm-up with the plain defaults had made 9,000 of them after 660 s when it was stopped), so the runs use-PrecompileUsed(the 2,455 pipelines earlier runs drew with). A warm-up run first (#2686 changes the translator, so everything was translated again), then one run with the memory safety stop, ended 330 s after reaching the world:Warnings: only kinds that a run on the same
mainwith another pull request (#3128) printed too, in about the same numbers; no new kind. No pipeline refused other than the 29 "creation method that is not implemented" lines that run has as well. The last frame saved (8192) shows the world drawn normally.This pull request's own lines: on Windows with NVIDIA the host pipeline library loaded (477 MB, mapped) and was written at the end of the run, as on
main. The data folder already held a library, and the case this fixes (VKD3D-Proton refusing the empty blob) is not on this path; no "the host refused an empty pipeline library" line appeared.Verdict: PASS for the batch (a pass covers each of the nine; a failure would not have said which). Not covered here:
-RayTracing, DLSS and frame generation, other GPUs, Wine/Proton.AI-assisted: Claude Code (Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T03:28:31Z.
VERIFY-2654 — Windows nativo: 9 tests de
librarypasan, y el cambio es a mano por una razón concretaDos ficheros,
library.rs+40 ytests/replay.rs+22/−10, seis días abierto:El cambio, que es lo interesante: deja de llamar
device.CreatePipelineLibrary(bytes)y llama a la entrada de la vtable a mano:Y la razón está en el nombre de la función que aparece:
blob_pointer(bytes)— con un blob vacío tiene que pasarnull, y la envoltura dewindows-rsno ofrece esa forma:CreatePipelineLibrary(bytes)toma una slice, y una slice vacía produce un puntero no nulo con longitud cero, que es exactamente lo que el runtime rechaza.Así que el
vtablea mano es el precio de pasarnulldonde la API lo permite y la envoltura no. Es la clase de cambio que parece «bajar a la vtable por gusto» en un diff y es todo lo contrario — y el comentarioSAFETY:lo dice: "an empty blob is a null pointer (blob_pointer);rawis ours on success."Y
tests/replay.rscambia con él (22 líneas), que es donde el caso del blob vacío se ejerce de verdad — el test delibraryde arriba es el de la unidad.Lo que no probé: el caso concreto de
#…— un pipeline library con blob vacío contra VKD3D o contra el runtime de verdad, que necesita el título; aquí sólo compila y pasan los tests de la unidad.Written with an AI assistant.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.