d3d12: discard stale pipeline libraries across driver updates and self-heal refused entries (D3D12-PIPELINE-LIBRARY-DRIVER-STAMP) #2789
Open
zmasi wants to merge 12 commits from
upstream-pr/2789 into main
pull from: upstream-pr/2789
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!2789
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2789"
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 zmasi on 2026-11-30T21:08:42Z.
Summary
Fixes #2781 (
D3D12-PIPELINE-LIBRARY-DRIVER-STAMP).Across NVIDIA driver updates (
616.64 -> 621.01),ID3D12Device1::CreatePipelineLibrarycan accept the outerhost-pipelines.bincontainer at startup whileLoadGraphicsPipeline/LoadComputePipeline/LoadPipelinesubsequently reject every stored blob withE_INVALIDARG(0x80070057). Whenpipeline()recompiled each refused PSO (410–5,228 msper hitch) and calledStorePipeline(name, &pso),StorePipelinealso failed withE_INVALIDARGbecause anID3D12PipelineLibrarycannot overwrite an existing name — leavingadded == 0(or re-serializing the stale blobs back to disk) and keeping the mismatched driver's library alive until device removal (0x887A0005).This change adds two defense-in-depth layers inside
d3d12/crates/leonida-gpu/src/pipeline/library.rs, controlled byLEONIDA_LIBRARY_DRIVER_CHECK(on by default;LEONIDA_LIBRARY_DRIVER_CHECK=0restores the previous behavior):Proactive adapter & driver stamp sidecar (
host-pipelines.driver):vendor,device,subsys,revfromDXGI_ADAPTER_DESC1plusHost::driver()whendriver != 0) alongsidehost-pipelines.bin.open_in(), ifhost-pipelines.drivernames a different adapter or driver,host-pipelines.next,host-pipelines.bin, andhost-pipelines.driverare discarded upfront beforeCreatePipelineLibraryis called, and an empty library is started cleanly.<stamp> older=1on save until replaced, preservingOrigin::doubtful()for Layer 2.Reactive self-healing swap (
Library::keep/stale/begin_anew):RwLock<Active>(keepingsavingseparate soSerializenever blocks loads).Load*Pipelineon generationg,create()succeeds,StorePipeline(name, &pso)fails withE_INVALIDARGon the same generationgwithoutnamehaving been stored in this run (Seen::stored, guarded undersame_name(name)), and a fresh empty library acceptspso,begin_anew()atomically swaps in the fresh library, replays non-title static-sampler probe pipelines (Seen::besideforpipeline::places), retains any mappedBlobinLibrary::retired(releasing its working-set pages viaVirtualUnlocksotrim()andremoval_note()never see an unmapped view), and marks the library dirty (anew) sosavereplaceshost-pipelines.binand writes this driver's plain stamp.std::ptr::null()) toCreatePipelineLibrarywhenbytes.is_empty()(avoiding Rust's dangling0x1empty-slice pointer on VKD3D-Proton), uses unique staging filenames on save, and removes any stalehost-pipelines.nextwhen an in-place rename succeeds.Verification
Tested on Windows 11 (
10.0.26200), NVIDIA GeForce RTX 3090 (driver610.88, UMD32.0.16.1088), and D3D12 WARP (0x1414):16tests inpipeline::library::tests,47passed acrosspipeline::):with_the_check_off_a_refused_pipeline_is_made_in_every_run(reproduces repeated0x80070057on bothLoadComputePipelineandStorePipeline,added == 0, unchanged file across restarts whenLEONIDA_LIBRARY_DRIVER_CHECK=0).a_pipeline_neither_loaded_nor_replaced_begins_the_library_anew(verifies swap +0.005–0.015 mssubsequent loads across both mapped and held blobs).a_library_of_another_driver_is_not_handed_to_the_hostanda_library_of_another_driver_that_cannot_be_deleted_is_not_called_this_drivers.a_name_stored_in_this_run_does_not_begin_the_library_anew(4-thread barrier benign-race test),threads_that_find_it_out_together_begin_the_library_anew_once(8-thread single-swap race test), andpipelines_kept_beside_the_titles_go_into_the_library_begun_anew(placesprobe carry-over).cargo clippy -p leonida-gpu --all-targets --lockedand--features diagnostics --all-targets --locked:0warnings inlibrary.rs; single touched file (host.rsandmake.rsuntouched).python -I tests/test_d3d12_switches.py(19/19passed) andpython -I scripts/check_no_game_data.py(rc=0).AI-assisted: authored with Claude Fable 5.2, independently reviewed with Gemini 4 Neon (XHigh), and verified with Gemini 4 Carbon (High).
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T04:47:30Z.
Review: COMMENTED
Verified here on the machine that has the problem: NVIDIA
0x2705with the driver line captured,cargo test -p leonida-gpu --lib pipeline::-> 47 passed, 7 ignored (16 new library tests, and the GPU ones really ran — one prints "loaded from the library begun anew in 0.009 ms"),tests/test_d3d12_switches.py19 OK with the switch read as "on,0turns it off".The mechanism does what it says for a pre-sidecar cache:
stamp_of(library.rs:928) writes vendor/device/subsys/rev plusHost::driver()(host.rs:1373),open_in(:990) classifies it, a mismatch discards the pair throughdiscard(:948), and on a refusal that also loses the store,stale()+begin_anew(:749,:767) swap in an empty library andsavewrites a clean file under this driver's stamp. Nothing refused is ever written back: serialisation only ever usesactive.library.Two notes.
E_INVALIDARGon this device (the tests assert that after a swap), so the first run still logsmade … did not load it: 0x80070057for nearly every pipeline and still compiles all of them; the second run is the healed one. Otherwise testers (this machine included) will read the first run as the fix not working.replace_librarytreats a failed removal ofhost-pipelines.nextas success (library.rs:1302-1308). If NEXT is held by something else — a casediscardalready documents — the rename succeeds, the removal fails silently, andnote(dir, &active, true)(:1246) writes this driver's plain stamp (:877-884). The next start then trusts the line,Blob::of(:263) renames the surviving other-driver NEXT over the library, the file loads asOrigin::Noted, andstale()never heals it. Reproduced with NEXT heldshare_mode(0): after the save the line names this driver while NEXT still exists, and the next run stays(0, Noted)after a refusal. Only write the plain stamp when NEXT is actually gone (or adopt NEXT before comparing the sidecar).Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-01T06:13:43Z.
Independent Windows check of
e38238383on currentmain640b0d0df(no conflict, merge5ec44016e). Native Windows 11, MSVC x64, Rust 1.98.1, with a hardware D3D12 device, so the library tests that make real pipelines throughCard(host().device→ID3D12Device1) ran rather than skipped.cargo test -p leonida-gpu --lib: 609 passed, 0 failed, 54 ignored.mainlists 653 tests, the merge 663, so the 10 newpipeline::librarytests are the only addition.pipeline::librarytests, the new ones included, run 200 times on their own in the release build with 16 test threads: 0 failures. That coversthreads_that_find_it_out_together_begin_the_library_anew_once,a_library_of_another_driver_is_not_handed_to_the_hostandconcurrent_write_atomically_never_fails_or_truncates.AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by Neutron-0 on 2026-12-01T10:20:26Z.
A heads-up for this pull request: the page of D3D12 switches (
d3d12/docs/switches.md) is written bytools/d3d12_switches.pyfrom the sources ofd3d12/, and 1 name this pull request reads is not on the page yet:LEONIDA_LIBRARY_DRIVER_CHECK.Nothing checks that today, so the page has drifted before (it was a name behind when this was measured). A test that checks it is waiting to be opened (DOCS-SWITCHES-PAGE-CHECK), and it would make this pull request's CI red until the page is written again. One command does that:
It writes the page with the names in it and nothing else; the diff is the new rows.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-01T10:58:11Z.
Thanks for the heads-up @Neutron-0 — regenerated
d3d12/docs/switches.md(LEONIDA_LIBRARY_DRIVER_CHECK,--checkrc 0) in573f7f216.AI-assisted: Gemini 4 Carbon.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T12:17:19Z.
Independent check of
573f7f216onc60ce461a. All 16 pipeline-library tests completed on both GPUs, using the Windows MSVC test binary under Wine and vkd3d-proton 3.1.0 withVKD3D_CONFIG=pipeline_library_app_cache. GPUs were AMD Raphael (RADV 26.3.1) and RTX 4070 SUPER (NVIDIA 620.73.4).The test cases cover a differing driver note, refusal of a cached compute pipeline with the check off, saving and then reloading a rebuilt entry with the check on, and concurrent detection rebuilding the library only once. The revisions to the library state were synthetic. A native Windows driver upgrade was outside the run.
AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T21:49:16Z.
Independent check of
c44b20fecmerged cleanly onmain(1e3e316c5), on native Windows 10 Pro 22H2 (build 19045) + NVIDIA GeForce RTX 5070 12 GB (driver621.40, Ryzen 9 5950X):cargo test --locked -p leonida-gpu --lib pipeline::library -- --nocapture: 16 passed, 0 failed (live GPU self-heal tests ran on RTX 5070 /621.40, printingloaded from the library begun anew in 0.009 msand0.008 ms).cargo test --locked -p leonida-gpu --lib pipeline:: -- --skip depth_bounds_pipeline_loads_and_filters_draws: 47 passed, 0 failed, 8 ignored (depth_bounds_pipeline_loads_and_filters_drawsskipped for the separate Win10 inboxd3d12.dllSM 6.6 flag issue tracked in #2855).python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: exit0;test_d3d12_switches.py: 19 passed, 0 failed.pipeline/library.rs.AI-assisted: Antigravity
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T22:31:31Z.
Independent verification on an RTX 4090, driver 621.24 (32.0.16.2124), Windows 11 - by the method in
AGENTS.md(PR ref, merge-tree, apply it onmain, run what it touches).Applied on
main1fff69129:One thing worth knowing: a commit-by-commit cherry-pick of the range (
3dd1bf42..c44b20fec, 8 commits) does conflict inpipeline/library.rs-mainmoved under it. The squash-merge is clean, so merging is fine; a rebase would be needed only if the branch is to be kept linear.What it does here:
What I could not test, and would not claim: the case the issue is about - a library written under one driver and opened under another. Downgrading this machine's driver is not something I will do to a working setup, so the 616.64 -> 621.01 transition is verified only through your own tests (
a_library_of_another_driver_is_not_handed_to_the_hostand the two that begin the library anew), which is a fake stamp, not a driver that changed. And the title was not run with it.What that leaves as risk: the stamp is read from
DXGI_ADAPTER_DESC1, and the case that matters is a driver update that keeps the same device id and changes only the UMD version - if the driver applies its version elsewhere than the fields you read, the stamp would not move and the library would still be handed over. Worth one line in the PR saying which fields change on an update, since the person who can check it is someone who upgraded and kept the old file.AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-02T00:26:47Z.
At
4cec236e4I queried the production stamp(host) in three fresh Windows processes using one diagnostics build. The RTX 5070 returned vendor 0x10de, device 0x2f04, driver 9007199255791260. WARP returned vendor 0x1414, device 0x008c, driver 2814751477606228. Returning to the 5070 reproduced the complete first stamp byte for byte.I then exercised both on-disk mismatch tests on the 5070, substituting that measured WARP stamp in the test sidecar. With the check enabled, the ordinary case discarded the stale library, saved a rebuilt pipeline under the current stamp and loaded it on reopen. With an exclusive handle on the stale library file, the save could not replace it. The file was not relabeled as current, and reopening started with an empty library. Both tests reached the readback assertions; I added temporary test-only output to distinguish that from an early return.
These are real D3D12 pipeline files in temporary directories, with deliberately mismatched metadata. No driver installation was changed. Codex-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:25:17Z.
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by ninjalegxd on 2026-12-02T14:53:41Z.
Tested this PR on RTX 3090, driver 621.14 (32.0.16.2114), Win11, -SeriesS -NoFrameGen:
pipelines=Older(unstamped)Important: this library was created fresh last night by the SAME driver (621.14),
after I had moved the previous one aside. So on this machine the blobs are refused
without any driver change; the stamp alone can't catch it, and the self-heal swap
did not trigger either.
Log attached.
play-1202-164536.log
Imported from ubiquitarianism/leonida. Originally posted by ninjalegxd on 2026-12-02T14:55:59Z.
Head tested:
4bd128a8c7.Numbers for comparison, same PC / save / area, -SeriesS:
2705632c5and before)4bd128a8c7)On main, 2 of the 4 runs had -FsrFrameGen and 2 had -NoFrameGen; all lost the device.
The PR run was -NoFrameGen.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T15:11:51Z.
Review: COMMENTED
On
4bd128a8merged onto83046a71, all 16 library tests reported pass on both Radeon RADV and RTX 4070 SUPER (Wine 11.22 / VKD3D-Proton). I also ran a local probe that required a real D3D12 device and supplied a synthetic same-driver stamp, so the provenance cases could not skip for missing driver metadata.On both GPUs, four free-name
LoadComputePipelinecalls each returnedE_INVALIDARG, but the newly compiled pipelines stored successfully and the library stayed in generation 0. Changing the descriptor of an existing name produced the same load HRESULT and a duplicate-name store refusal. Witholder=1, that triggered the replacement and the rebuilt entry loaded successfully. The replacement no longer held any of the four fresh entries stored earlier in that run. With a plain current stamp, no replacement happened and all four remained.The load HRESULT count alone therefore cannot show why the reported run did not swap. Recording the store result and origin on the refusal path would help distinguish these cases. This probe uses synthetic pipelines and does not establish a cause for the reported device loss. Reported run
The head merges cleanly on
83046a71. Pairwise merge-tree checks with #2654 and #3150 each reported a conflict inpipeline/library.rs. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T15:16:03Z.
Read the 3090 report against what this branch actually stamps, because it separates into two things that are not this change.
1. The head is right, the merge is not the requested one.
4bd128a8c7is the current head, as the report says - but it was merged with amainthat has since moved: the branch is 60 files behindorigin/mainright now (docs/lua-modding.md,scripts/play-linux.sh,tests/*), so a report on this head is not a report on "the current head merged onto current main". A fresh merge + a re-run is what @MoonEyes asked for, and it is cheap.2. The device removal is not this change.
device removed (0x887A0005) after ~5 minis #3068's exact shape ("after 7–18 min of play, right after a masked-twin ..."), and it happened onmainbefore this branch existed. Whatever the library does, that will still be there, so the two should not be read together.3. The 35 loads that failed are the interesting part, and the stamp does not explain them. What the note records is "one line that names the adapter and driver" (
library.rs:584-586), andolder=1marks a library taken over from before the check existed. A library made by another build of the layer on the same card and driver passes that check and is loaded, and the reporter says this one was "created fresh last night by the SAME driver" - so a library from a different build of the layer is exactly the case the stamp cannot see.But it is not simply "another build" either: on this machine (RTX 4090, driver 621.24) a library written by one build loads in another -
540 of 540 in the pipeline library, written in 21 sin aleonida warmrun against last night's cache. So the build is a variable, not the whole story, and0x80070057(E_INVALIDARGout ofLoadPipeline) says those particular blobs were refused rather than the library being from elsewhere.What would settle it, in that log:
host-pipelines.drivernext tohost-pipelines.bin- it names the adapter and driver, so it says whether the check thought the library was its own;the library did not load it ... (0x80070057)line with its pipeline name, and whether the same pipelines were made again in that run (they would appear in thewarm/first bindlines);AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by ninjalegxd on 2026-12-02T15:21:29Z.
Checked the log as asked: the refused loads are new pipelines, not stale blobs.
Example: [mesh 024bb426570bd221, pixel 1dc40c638c94c4b0] "did not load it (0x80070057)".
The same log shows
shader translated stage="mesh" hash=024bb426570bd221and its first bindat 14:50:08, i.e. first time in that run. All 35 lines are in the dump printed at the removal
("ms before"), from the last ~30 s, after a burst of new pipelines in a new area.
host-pipelines.driver:
vendor=0x10de device=0x2204 subsys=0x40431458 rev=0xa1 driver=9007199255791682 older=1
(= 32.0.16.2114, the installed 621.14)
So the library looks fine here; my device loss matches #3068 rather than this PR.
AI-assisted: -Claude Opus 5.5 helped analyze the logs and draft all comments.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T17:04:24Z.
RUN (independent run on Windows, #2789 head
4bd128a8c, merged locally intomain5b1fff821withgit merge --no-ff)Machine: RTX 4060, driver 32.0.16.1088. Only
leonida-gpuwas built (release,--locked). The pipeline library tests make real pipelines on the card; they return early when there is no GPU, and here there is one.Red (main's
library.rsswapped back into the merged tree, same command:cargo test -p leonida-gpu --release --locked --lib -- pipeline::library)git statusclean.Green (merged tree)
-- pipeline::library: 16 passed, 0 failed (the 6 of main plus 10 new, among thema_library_of_another_driver_is_not_handed_to_the_host,..._that_cannot_be_deleted_is_not_called_this_drivers,a_library_this_driver_made_whole_is_not_begun_anew,the_line_beside_the_file_says_what_is_known_of_the_library,the_adapter_and_driver_are_named_on_one_line).leonida-gpulib: 713 passed, 0 failed, 59 ignored (the ignored ones are measurements or marked so in the code).Mutations (each one edit in
pipeline/library.rs, then the 16 library tests)if false && driver_check()inopen_in): 2 fail (a_library_of_another_driver_is_not_handed_to_the_host,..._that_cannot_be_deleted_...). Killed.Noted): 4 fail. Killed.discardno longer deleteshost-pipelines.bin): 2 fail. Killed.driver=written with the adapter revision): 1 fail,the_adapter_and_driver_are_named_on_one_line. Killed, but only by that pure test: the on-card tests build both sides with the same function, so they would not see it.Origin::Empty if replaced => return): 2 fail. Killed.5 of 5 killed.
Review
host-pipelines.driverdiffers from the current one, sodiscarddeleteshost-pipelines.next, then the library, then the line, and an empty library is begun in the same run. No crash, nothing handed to the host; every pipeline is compiled once and the first save writes a library and a line for the new driver. The test then reloads it and getsOrigin::Notedwith the pipeline loaded from the file.older=1) is read as another driver, so the library is discarded. The line is escaped and cut to 160 characters before it is logged. Non-UTF-8 bytes are read lossily, so they also mismatch.Unnoted), so nothing changes for those. The old fallback then covers it: when a load is refused and the replacement cannot take the name, the library is begun anew once. This is the case of anyone who already has a stale file from before this PR; they are fixed on the first refusal, not at open.LEONIDA_LIBRARY_DRIVER_CHECK=0returns to the old behaviour; it is inswitches.md.Host::driver(); I did not check it moves between two NVIDIA builds that share a version number (hotfix reinstall).Not covered: no in-game run from me; the 3090 run is pending. Not run: the other crates, and the real driver-update path (the tests write an older line by hand; no second driver was installed).
Verdict: PASS on the tests and the review. Red is shown by mutation, not by main's own tests.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-02T17:07:49Z.
RUN (in game, gate-style, as asked by MoonEyes): head
4bd128a8ctested in a batch with #2643 (2cea6871c), #3031 (a47b86855), #2789 (4bd128a8c) and #2661 (1b3f3dee0), all merged withgit merge --no-ffontomain23a51c494(no conflict; the only file the four share isd3d12/docs/switches.md). Built withdiagnostics,mimalloc, targetx86_64-pc-windows-msvc. RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro (build 26300).Launcher defaults, Series S settings,
-NoDlss -NoFrameGen, standing at the save; a warm-up run first (the batch changes the translator, so everything was re-translated), then one run of 420 s with the memory safety stop:This pull request's own lines:
host-pipelines.driverwas written during the warm-up (stamp with the adapter and driver,older=1as the change describes for a pre-existing library), the library then loaded (pipelines=Older) and saved with 2,330 pipelines loaded and 47 made, and no "the library did not load it" line appeared. No driver change was exercised here (the driver did not change between runs).Verdict: PASS for the batch (a pass covers each of the four; a failure would not have said which). Not covered here:
-RayTracing(a run with it is queued), DLSS frame generation with ray tracing (needs an RTX 40/50 card), other GPUs.AI-assisted: Claude Code (Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T17:12:33Z.
Merging. Head
4bd128a8cmerges cleanly withmain5b1fff821and does not force a rebase of #2566. In-game gate: enlight3d's batch run on the RTX 3090 with this head4bd128a8cmerged onto main (lot A: #2643, #3031, #2789, #2661), PASS, comment 7352941075. Independent red/green by MoonEyes' agent on4bd128a8c: pipeline::library 16 passed, leonida-gpu lib 713 passed; 5 of 5 targeted mutations killed (stamp not compared, stamp ignored on mismatch, old file kept, wrong driver field, line never written), comment 7352861392. CI green incl. no-game-data. Not claimed as the fix for the device-removed reports, which point at #3068. Merged by MoonEyes.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:29:45Z.
Verification triage of #2789
Head
4bd128a8cis already verified on this exact head: ninjalegxd, MoonEyes (independent run) and enlight3d (in-game gate run). MoonEyes posted "Merging" on this head at 2026-12-02 17:12. The PR is still open, its merge state is nowclean, and CI passes (6/6). No new run here (Windows-only). Verdict: ready (already verified; a maintainer is merging it).AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T03:32:27Z.
Merged
origin/main(516c9eaabf) intob511f5c930strictly to regenerated3d12/docs/switches.md(needs rebase);d3d12/crates/leonida-gpu/src/pipeline/library.rshas a byte-identical diff againstorigin/maincompared to4bd128a8c7.AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T04:29:38Z.
RUN (in game, batch of two pull requests), each head merged with
git merge --no-ffonto main516c9eaab, in one build: #2789b511f5c93, #307298a532249. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used, so the default start (every known pipeline precompiled) was not exercised. Both were in earlier batches on other heads; this run covers their current heads. #2789's discard of stale pipeline libraries only acts after a driver update; the driver did not change here, so that path was not exercised.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T04:53:24Z.
Integration check on
b511f5c9. The head merges cleanly with both #3286 (8c56cb6b) and #2948 (5284c6ea) in separate pairs. I built the #3286 pair for Windows MSVC and ran the synthetic driver-stamp formatting test under Wine. It passed, as did the catalog checker and all 20 catalog tests.In the merged #3286 source,
Host::driver()queries the adapter stored from the created device’s LUID. The pipeline library also finds its descriptor via that device LUID. Thus an explicit WARP selection or a change to the default adapter picker still sources both fields from the device that was actually created. The run covered the CPU stamp fixture. Live adapter switching is outside that test’s scope. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T11:32:42Z.
Merged
origin/main(6e97990505,#3318) into4cd9d71f80strictly to regenerated3d12/docs/switches.md(needs rebase);d3d12/crates/leonida-gpu/src/pipeline/library.rshas a byte-identical diff againstorigin/maincompared tob511f5c930.AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T14:31:58Z.
RUN (in game, third party, batch of five pull requests), each head merged with
git merge --no-ffonto mainb053a1813, in one build: #2686c5269801b, #26432e0b23a00, #27894cd9d71f8, #30720f1e26355, #299991537d2af. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.6 fps on other runs today: a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it. #2834 was left out of the batch (it conflicts with the others).
Limits: one run; arrival in the world was driven by keys and not checked on pictures. The precompile took 589 s (the batch changes shader code, so the pipeline cache was cold). Switches that are off by default were not turned on: this run covers their default path only.
AI-assisted (Claude Code, Claude Opus 5.5).
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.