d3d12: a pipeline made again for bound formats is written to the pipeline book, so warm makes it ahead (D3D12-WARM-FORMAT-VARIANTS) #3284
Closed
cachebag wants to merge 1 commit from
upstream-pr/3284 into main
pull from: upstream-pr/3284
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!3284
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3284"
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 cachebag on 2026-12-03T03:11:25Z.
Claimed in the coordination issue as: D3D12-WARM-FORMAT-VARIANTS (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7366208362)
What and why
Refs: #3103
When a draw binds render target formats that its pipeline does not declare,
make::variantmakes the pipeline again for those formats. The variant's key went on the used list (early-pipelines.txt, throughnote_use), but no entry was written to the pipeline book, which onlyhand_outwrote to.leonida warmmakes pipelines from the book's entries, so it could not make a variant ahead, with or without--used, and the variant was compiled at its first draw in every run that started from a fresh cache. zmasi reported this as a finding in the coordination issue on 2026-12-02 while tracing #3103.The change calls
known::notefor the variant whenvariant()creates it. Its entry holds the title's shaders and the state with the bound formats, under the variant's own key, which is the key the used list names.A variant of a masked twin is not written down. An entry stores a shader's container and has no place for the mask's form, so
warmwould build the unmasked pipeline from it. The check sits invariant()and not inknown::note, so that #2957, which teaches the book to hold masked twins, keeps working if both merge. After #2957 the check can go.This removes a cause. It adds no switch.
Not measured: what share of the pipelines made in play (522 in #3103's run) are format variants. That needs a game run with the book on, a
warm, and a second run.Tested
All on Linux, as an
x86_64-pc-windows-gnubuild ofleonida-gpurun under Wine 11.23 (maindoes not build natively on Linux before #3176). No game files.cargo test -p leonida-gpu --lib -- pipeline::: 62 passed, 0 failed.make::tests::a_pipeline_made_again_for_bound_formats_is_written_down_oncefails with theknown::notecall invariant()removed, and passes with it.make::tests::a_masked_twin_made_again_for_bound_formats_is_not_written_downfails with the mask check removed, and passes with it.known::tests::a_state_for_bound_formats_comes_back_under_its_own_keypasses onmaintoo. It pins what the fix relies on: a variant's state comes back from its entry with the bound formats and gives the same key.scripts/red_green.pywas not used.leonida-gpuunit suite (--skip depth_bounds_pipeline_loads_and_filters_draws): 713 passed, 5 failed.mainat2791b7756, same build: 710 passed, the same 5 failed (hwrt::tests::the_remap_masks_and_counts_a_blas_not_built_yet_and_compiles,host::trainer::tests::the_overlay_draws_the_menu_offscreen, and three inwatch).cargo clippy -p leonida-gpu --lib --tests -- -D warnings: clean.python -I scripts/check_no_game_data.pyon both files: exit 0.Not tested: a native Windows build, and a run of the game. The path is reached only at a draw, so an in-game run on Windows is welcome before merge.
GPUs tested: n/a for the new tests (no device is made). The suite ran on an NVIDIA GeForce RTX 4080, driver 620.73.04, Arch Linux (kernel 7.3.6), Wine 11.23.
AI-assisted: yes. Written with Claude Code (Claude Fable 5.2). A separate read-only reviewer agent (Claude Fable 5.2) audited the diff before this was opened; it found nothing blocking, and its points are folded in (the mask check moved from
known::notetovariant(), test assertions that do not depend on what else ran on the thread, module docs).Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator rule)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T03:19:10Z.
Review: COMMENTED
Verified
f9c58876on2791b775with a Windows MSVC build under Wine 11.22. The pipeline suite had 62 passes and eight ignored tests, excluding my scratch-only fixture.That fixture used the real pipeline book in a temporary directory with
LEONIDA_PIPELINE_BOOK=1. Requesting the same format variant twice wrote one record. Warm’s parser read it back with the bound formats and reconstructed the exact key registered bynote_use. Removing only the newknown::notecall left the same used key and an empty book, so the on-disk assertion failed. The fixture used synthetic bytes and stopped before GPU pipeline creation.I also combined this with #2957 at
699ff016. The sole merge conflict is the two introductory doc comments inpipeline/known.rs. Keeping both paragraphs gave 63 pipeline test passes, and the same disk round trip passed. Currentmain(516c9eaa, #3276) still merges cleanly with this PR and did not change the GPU crate.AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T03:38:09Z.
VERIFY-3284 — Windows nativo: 62 tests de
pipelinepasanDos ficheros,
pipeline/known.rs+36 ypipeline/make.rs+50, un día abierto:Y el cambio, por su título y su diff: una pipeline rehecha para formatos enlazados se escribe en el libro de pipelines — el caso en que el juego crea la misma pipeline con otro render target format, se compila otra vez, y la segunda no quedaba registrada, así que el siguiente arranque la volvía a compilar.
Lo que esto vale en la warm-up de una sesión, que es donde se nota: una pipeline que no se anota se compila en cada arranque — y
#2774, que revisé esta noche, es exactamente la otra mitad de eso: la carpetapipelinesque hay que crear antes de poder escribir nada. Dos PRs de dos autores, la misma función de producto (arrancar sin recompilar), sin saber uno del otro.Lo que no probé: que el juego cree de verdad dos pipelines que sólo difieren en el formato — los tests de
pipelinecubren el libro y la creación, no el título; y una warm-up de verdad (segunda ejecución sin recompilar) necesita el juego.Y una nota de método, porque me costó dos intentos en esta ronda: la primera corrida no devolvió nada — estaba capturando el
worktree addy elcargoen la misma tubería, y el mensaje de progreso de git (Updating files: 100%) se comió la salida. Separarlos y preguntar por$LASTEXITCODEfue lo que lo arregló, que es la regla que las notas del repo ya tienen escrita sobre los bucles.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T03:43:39Z.
RUN (in game, batch of three pull requests), each head merged with
git merge --no-ffonto main516c9eaab, in one build: #30314e59d46e8, #3284f9c588760, #32868c56cb6b9. 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. #3031 was in an earlier batch on another head; this run covers its current head. #3284 changes what is written to the pipeline book; whether a later start reuses it was not checked. #3286's card selection only matters when the PC has more than one card to pick from, and its build-script change was not exercised: this run covers the default path on one dedicated card.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T11:58:31Z.
Independent check of
f9c58876onb053a181. I used a synthetic pixel container, recorded a format variant under its own key, and reopened the on-disk book in a separate process. The key selected by--useddecoded to the bound formats and reconstructed the same pipeline key. The base and variant were each stored once. This exercises persistence and selection. GPU compilation of this synthetic container was outside the check.One existing integration limitation:
pipeline::library::save()returns before writingearly-pipelines.txtif the device cannot create anID3D12PipelineLibrary. That happened under Wine/vkd3d-proton on the AMD RADV test device. The new book had the variant, but the used list was missing. Persisting the used keys through the existing atomic writer when the native library is unavailable made the normal save and the separate-process replay pass. On this setup, the pipeline suite had 62 passes and one failure ina_rejected_blob_gives_an_empty_library, reproduced on the unmodified PR as well.AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T12:32:11Z.
I isolated the AMD RADV / Wine failure from my earlier comment. On the same
ID3D12Device1, the zero-byte slice passed by the current wrapper returnedE_INVALIDARG(0x80070057). The null pointer used by #2789 created the empty library successfully. Both results held with the default vkd3d-proton configuration and withpipeline_library_app_cache.With #2789
4cd9d71fand #3284f9c58876onb053a181, normallibrary::save()wrote exactly one used key in both configurations. A separate process reopened the book and rebuilt the same variant key and bound format. Reverting just the empty-buffer pointer in the combined build reproduced the missingearly-pipelines.txt. The combined pipeline suite passed 74 tests with eight ignored. The round trip used a synthetic format record and checked persistence and selection.AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T18:03:39Z.
Thanks for the work on this. This pull request has a merge conflict with the current
mainand has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latestmaininto your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome.Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by cachebag on 2026-12-03T18:07:35Z.
What a silly rule. People have jobs. There is no way I was going to address this between last night and 1pm ET where I am.
Pull request closed