OLD-2402: Runtime: D3D12 PSOs bind the --pc-tail-ubo set-1 block for 128-byte push-constant devices #767
Closed
whoalin1 wants to merge 1 commit from
upstream-pr/767 into main
pull from: upstream-pr/767
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!767
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/767"
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 whoalin1 on 2026-11-24T13:35:36Z.
Restores my open PR from the original repository (OLD-2402), rebased onto current
main(2d73c242f).Claim: https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7133003627
Summary
A Vulkan device whose
maxPushConstantsSizeis 128 bytes (AMD Windows driver on RDNA2 iGPUs, some Intel Arc drivers) cannot hold the 144-byteShaderUserDatapush-constant block, so previously every D3D12 PSO was refused there withE_NOTIMPL.With
--pc-tail-ubo(already merged inmain), translated shaders keeps0..s31in 128 push-constant bytes and move the 16-byte tail (heap base, code base) to a uniform block at set 1, binding 0 when a stage reads it. This PR wires that path through the D3D12 → Vulkan layer:runtime/src/shader_library.h:ShaderEntryparsespc_tail.bytesintopc_tail_bytes(covered byshader_library_test).runtime/src/vulkan_replay.h:ComputePipelineandGraphicsPipelinecarrypush_bytes,tail_set, andtail_offset;detail::bind_user_databinds set 0 (if present), set 1 with dynamic offset (if present), and pushespush_bytesat all three push sites (ExecuteIndirect,Dispatch,Draw).runtime/shims/d3d12_vulkan_device.cpp:DeviceState::pc_tailcreates oneUNIFORM_BUFFER_DYNAMICdescriptor over the arena (range 16) plus an empty set-0 layout once per device.PipelineState::user_data_layoutsizes the push-constant range from each stage'spush_constant_bytes/pc_tail_bytes(including VS+GS+PS), adds set 1 when any stage haspc_tail, writes the 16-byte tail once into the arena, and releases it on destruction. 144-byte shaders remain refused on<144-byte devices with a log pointing to--pc-tail-ubo.runtime/test/d3d12_compute_test.cpp&runtime/test/d3d12_draw_test.cpp: verify 144-byte refusal and--pc-tail-ubodispatch/draw (including VS withoutpc_tail+ PS with set-1 tail) on both simulated 128-byte devices and real 128-byte GPUs, skipping the 144-byte passes on real 128-byte hardware.docs/d3d12_vulkan.md&runtime/shims/d3d12_com.h: documentation updates.Verification (rebased on
2d73c242f,LEONIDA_VK_VALIDATION=1)shader_library_test— pass (rc=0)d3d12_compute_test(rc=0, 0 validation errors)d3d12_draw_test(rc=0, 0 validation errors)d3d12_bundle_test(rc=0, 0 validation errors)d3d12_geometry_test(rc=0, 0 validation errors)d3d12_mesh_test(LEONIDA_VK_VALIDATION=0,rc=0;VUID-07076under validation is tracked separately in #506)maxPushConstantsSize):d3d12_compute_test(rc=0, 0 validation errors):--pc-tail-ubo64/64 elements matched on simulated 128B device and real 128B GPU; 144B passes cleanly skippedd3d12_draw_test(rc=0, 0 validation errors):--pc-tail-uboVS+PS (VS withoutpc_tail, PS with set-1 tail) 4096/4096 pixels matched on simulated 128B device and real 128B GPU; 144B passes cleanly skippedAI-assisted (Gemini 4 Neon).
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T20:09:18Z.
Rebased cleanly onto current main (
db1a22d29) asa07b677bfto refresh the stale CI baseline; no conflicts. The branch remains the single pc-tail runtime/PSO binding change. AI-assisted with Devin.Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T21:07:35Z.
Local dual-GPU verification of
a07b677bf(rebased onto current main), full MSVC/Ninja runtime build 986/986 clean, then the pc-tail test executables run directly withLEONIDA_VK_VALIDATION=1on both devices:AMD Radeon(TM) Graphics — the 128-byte push-constant iGPU this PR is for (
VK_LOADER_DRIVERS_SELECT=*amd-vulkan*):d3d12_compute_testrc=0, 0 VUIDs —--pc-tail-ubo: a 128-byte device built the tail PSO and 64/64 elements matched there and on this GPU; the 144-byte PSO/dispatch/CBV/SRV checks are skipped honestly (this GPU reports 128 push-constant bytes (< 144))d3d12_draw_testrc=0, 0 VUIDs —--pc-tail-ubo graphics: a 128-byte device built the tail VS+PS PSO (VS without pc_tail, PS with set-1 tail) and 4096/4096 pixels matched; 144-byte graphics passes skipped honestlyshader_library_testrc=0NVIDIA GeForce RTX 4070 SUPER (
VK_LOADER_DRIVERS_SELECT=*nv-vk*):d3d12_compute_testrc=0, 0 VUIDs — same tail-PSO 64/64 element match (the 128-byte simulated device cross-check plus this GPU)d3d12_draw_testrc=0, 0 VUIDs — 4096/4096 pixels matchedshader_library_testrc=0The set-1 uniform block is bound and read correctly by both drivers' shader pipelines; no validation noise on either. AI-assisted (Devin).
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-28T09:33:58Z.
Tested the rectangle-list variant on
f68daac1950fa680ada0fd62c860e67eaf99d6b3after the AMD report about slot 512. On Windows with an RTX 4090 (616.64), the set-1 tail worked through the dynamically generated rectangle geometry stage.I extended the synthetic
d3d12_draw_testharness locally. The PSO used triangle topology type in every case. The triangle control submitted six indices with IA triangle-list topology. The rectangle case submitted just the first three indices with IA topology 17, so the generated fourth corner was needed to fill the expected quadrant. The pixel shader read the heap base from set 1, binding 0 to fetch the tint. The control produced a red quadrant and the rectangle drew a green quadrant on the same blue background.Two consecutive runs produced the same readbacks with Vulkan validation enabled and zero validation errors. The runtime was built from the PR head without changes. For the vertex fixture I used the translator’s standalone
BuiltIn Positionform. The stock GLSL test fixture placesPositionin an interface block, which the rectangle generator at this revision rejected before submission. Both final input modules passedspirv-valfor Vulkan 1.3 with scalar block layout.This verifies the synthetic rectangle path on NVIDIA. The outstanding game comparison is the reported AMD configuration with the tail option enabled in both arms and this runtime change applied in one. AI-assisted with OpenAI Codex (GPT-6).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T09:38:07Z.
Code-audit note at head
f68daac1950fa680ada0fd62c860e67eaf99d6b3(while@ecox982745runsVERIFY-767-RECTANGLE-PC-TAILfollowing@timbot103's#1608#issuecomment-7237165958finding — notePipelineState'sgraphics_.layoutin#767already propagates to lazyvariant(512, "draw")rectangle-stage PSOs viainfo.layout = graphics_.layout):Two narrow edge cases in
runtime/shims/d3d12_vulkan_device.cppworth folding into this PR so all--pc-tail-ubopaths agree:gta6rt --precompile-pipelines(BuildHost::open/unbuildable/build, around lines23475-23531onmain3ca0707dd):BuildHost::open()still aborts early whenstate.info.max_push_constants_size < sizeof(leonida::ShaderUserData)(144), so--precompile-pipelinesexits1immediately on 128-byte GPUs even when the shader library was translated with--pc-tail-ubo.BuildHost::open()also creates only 144-byteplain_/with_set0_compute layouts without set 1, soBuildHost::build()will failvkCreateComputePipelines(VUID-VkComputePipelineCreateInfo-layout-07988) on--pc-tail-ubocompute entries withpc_tail_bytes == 16(and precompile 144-byte push-constant layouts instead of 128-byte layouts for--pc-tail-uboentries withoutpc_tail). Sincecreate_vulkan_device_standaloneinBuildHost::open()already runs#767'screate_pc_tail(),BuildHostcan reusestate.pc_tail.empty/state.pc_tail.layoutand mirroruser_data_layout's(128|144, bindless, tail)layout selection per compute entry.LEONIDA_STUB_PIPELINESon 128-byte GPUs (PipelineState::stub_entry()+user_data_layout):stub_entry()leavespush_constant_bytes = 0andpc_tail_bytes = 0(the built-in stub VS/PS stages read no push constants), whichuser_data_layoutcurrently defaults toneed = kFull(144), causing stubbed graphics PSOs to fail withE_NOTIMPLwhenmaxPushConstantsSize < 144. Settinge.push_constant_bytes = offsetof(leonida::ShaderUserData, heap_base)(128) onstub_entry()(or sizing0-byte stub entries tokShortwhenpush_constants_need_fallbackis set) keeps stub PSOs buildable on 128-byte devices.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-28T10:01:27Z.
Rebased
pc-tail-runtimeontomain(3ca0707dd) and folded both audit items plus thedetail::first_useguard into headc1c6044775eeaed013fc4840c675301f0e8f2896:BuildHost(gta6rt --precompile-pipelines/--compile-server,runtime/shims/d3d12_vulkan_device.cpp):UserDataLayout,resolve_user_data_layout(), andcreate_user_data_layout()soPipelineState,build_compute_pipeline(), andBuildHostshare the same sizing and descriptor-set rules.BuildHost::open()stays open on 128-byte devices instead of aborting whenmaxPushConstantsSize < 144, and creates the eligible[tail][bindless][128|144]compute layouts up front (skipping 144-byte layouts whenlimit < 144soVUID-VkPushConstantRange-size-00298is not triggered).BuildHost::unbuildable()validatesresolve_user_data_layout()/layout_for()and refuses non---pc-tail-uboentries withneeds 144 push-constant byteson<144-byte GPUs while accepting--pc-tail-uboentries (push_constant_bytes = 128, optional 16-byte set-1pc_tail).build_compute_pipeline()andjournal_name_context()incorporateuser.push_bytesanduser.tail/pc_tail.setinto the journal/index keys (keeping existing 144-byte hashes byte-identical).LEONIDA_STUB_PIPELINES(PipelineState::stub_entry(),runtime/shims/d3d12_vulkan_device.cpp):push_constant_bytes = offsetof(leonida::ShaderUserData, heap_base)(128), so stubbed graphics PSOs build and draw cleanly on 128-byte devices too.detail::first_use(runtime/src/vulkan_replay.h):(!(pipeline.bindless_set || pipeline.tail_set) || vk.bind_descriptor_sets)consistently withdispatchandindirect_dispatch.runtime/test/d3d12_stub_draw_test.cpp: removed the<144-byte skip so all stub draw cases run natively on 128-byte GPUs, and added a simulated 128-byteLEONIDA_STUB_PIPELINES=colordraw check on>=144-byte GPUs.runtime/test/check_precompile_pc_tail.cmake(precompile_pc_tail) verifyinggta6rt --precompile-pipelineswith--pc-tail-uboalongside a 144-byte entry on both GPUs; updatedruntime/test/check_precompile_skip_list.cmaketo skip cleanly when only 144-byte test shaders are unbuildable (needs 144 push-constant bytes); updateddocs/d3d12_vulkan.md.Verification (clean build
94/94,VK_LOADER_LAYERS_DISABLE=~implicit~,LEONIDA_VK_VALIDATION=1withVK_LAYER_KHRONOS_validation1.4.363)NVIDIA 610.88, Vulkan1.4.341,maxPushConstantsSize: 256 bytes):9/9matched CTest targets passed (shader_library,d3d12_vulkan_device,d3d12_compute_journal,d3d12_compute,d3d12_draw,d3d12_stub_pipelines,d3d12_stub_drawincluding simulated 128-byte stub draw,precompile_skip_list,precompile_pc_tailbuilding/journaling2/2entries and hitting2journaled on rerun),0validation errors.0x164e, driverAMD proprietary driver 24.10.24, Vulkan1.3.280,maxPushConstantsSize: 128 bytes):7passed +2skipped (d3d12_compute_journal,precompile_skip_list— both use 144-byte-only test fixtures) out of9(ctestexit0),0validation errors;d3d12_stub_drawran natively and passed (0.18 s);precompile_pc_tailpassed (0.35 s, leaving outprecompile_fullasneeds 144 push-constant bytes, compiling & journalingprecompile_tail, and hitting1 journaled alreadyon rerun).unittestontests/test_ctest_registration.py+tests/test_text_write_line_endings.py(Ran 10 tests ... OK) andscripts/check_no_game_data.pyon all 7 modified/added files passed (exit 0).AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-28T11:55:17Z.
Rebased onto
main(24549bdb1) to resolve the conflict indocs/d3d12_vulkan.md(preserving#1423'spso_code_base_pairs.pymeasurements alongside#767's--pc-tail-uboand Ryzen 5 7600 updates). Head is now9ee8b36dd9224f9dc21a4baf7acf9f6a62b14862.Verification (rebased on
24549bdb1)gta6rtand target test binaries cleanly (43/43Ninja steps)ctestunderLEONIDA_VK_VALIDATION=1(shader_library,d3d12_vulkan_device,d3d12_compute_journal,d3d12_compute,d3d12_draw,d3d12_stub_pipelines,d3d12_stub_draw,precompile_skip_list,precompile_pc_tail):d3d12_compute_journal,precompile_skip_listrequire>=144Bshaders)ctest -R ^gta6rt_no_tls_callbacks$— 1/1 passedscripts/check_no_game_data.py— clean (exit 0);test_docs_cli_flags.py,test_docs_repo_paths.py,test_docs_env_vars.pyshow zero issues indocs/d3d12_vulkan.mdAI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T13:23:02Z.
Review: APPROVED
Independently verified
9ee8b36ddmerged cleanly ontomain(d48a957bb) on Windows 11 (MSVC 19.44 + Ninja) across two Vulkan GPUs withLEONIDA_VK_VALIDATION=1(zero game files):32.0.16.1664,maxPushConstantsSize: 256)gfx1036) (driver32.0.21030.2001,maxPushConstantsSize: 256)Red on
main(d48a957bb) control (check_precompile_pc_tail.cmake,LEONIDA_VK_VALIDATION=1):VUID-VkComputePipelineCreateInfo-layout-07988(Set 1, Binding 0, variable "tail"missing fromVkPipelineLayoutCreateInfo::pSetLayouts[1]).gfx1036,gta6rt --precompile-pipelines --pc-tail-uboalso exits with code2(only 1 of 2 journal files written).Green on
#767(9ee8b36dd,LEONIDA_VK_VALIDATION=1, 0 validation errors on both GPUs):shader_library: PASS on both GPUs.d3d12_compute: PASS on both GPUs (128-byte device built the tail PSO and 64/64 elements matched there and on this GPU).d3d12_draw: PASS on both GPUs (128-byte device built the tail VS+PS PSO (VS without pc_tail, PS with set-1 tail) and 4096/4096 pixels matched there and on this GPU).d3d12_stub_draw: PASS on both GPUs.precompile_pc_tail(check_precompile_pc_tail.cmake): PASS on both GPUs — first run exits0(2 built (2 compiled, 0 from a cache), 0 failed), second run exits0(0 built, 2 journaled already, 0 failed),0validation errors.LGTM.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T02:35:40Z.
Follow-Up Verification Report (
9ee8b36dd9merged intomainc8bf0e7b6)610.88,maxPushConstantsSize = 256, subgroup32..32), Vulkan SDK1.4.363.1(LEONIDA_VK_VALIDATION=1withVK_LAYER_KHRONOS_validation). No game data used (check_no_game_data.pyrc=0).#issuecomment-7237367134): Merged9ee8b36dd9cleanly intoorigin/main(c8bf0e7b6,0conflicts; 15 files changed). Confirmed both edge cases raised in#issuecomment-7237367134(plusdetail::first_use) are cleanly resolved:BuildHost(--precompile-pipelines/--compile-server) sharesresolve_user_data_layout()andcreate_user_data_layout()across[tail][bindless][128|144], stays open whenmaxPushConstantsSize < 144, includesuser.push_bytesanduser.tailin pipeline/journal keys, and reportsneeds 144 push-constant bytesfor non---pc-tail-uboentries.PipelineState::stub_entry()setspush_constant_bytes = 128(offsetof(ShaderUserData, heap_base)), keepingLEONIDA_STUB_PIPELINESbuildable on 128-byte devices.Red -> Green Results (
LEONIDA_VK_VALIDATION=1)9ee8b36dd9+mainc8bf0e7b6)shader_libraryrc=0; fails RED againstmain'sshader_library.hlackingpc_tail_bytes)d3d12_computerc=0:--pc-tail-ubo: a 128-byte device built the tail PSO and 64/64 elements matched there and on this GPU,cached PSO: 2 host adapter(s) gave the same 11 answers,0validation errors)d3d12_drawrc=0:--pc-tail-ubo graphics: a 128-byte device built the tail VS+PS PSO (VS without pc_tail, PS with set-1 tail) and 4096/4096 pixels matched there and on this GPU,0validation errors)d3d12_stub_drawrc=0, including simulated 128-byteLEONIDA_STUB_PIPELINES=colordraw,0validation errors)precompile_pc_tail&precompile_skip_listrc=0on both CTests,0validation errors)test_docs_table_rows.py&test_docs_encoding.pyrc=0)6/6CTests + doc gates pass with 0 validation errors on RTX 3090; both prior audit items confirmed resolved).AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T08:57:44Z.
Validation run of this PR on a Windows PC with a real GPU.
9ee8b36dd954b2a81e95runtime/src/vulkan_replay.h, so I tested the PR head on its own (detached at the PR head, its own base).Commands (RelWithDebInfo, Ninja,
LEONIDA_REQUIRE_VULKAN=ON):d3d12_vulkan_device.cpp,d3d12_com.h,shader_library.h,vulkan_replay.h) reverted to the PR's merge base and the tests, CMake and shader sources kept:d3d12_compute,d3d12_draw,d3d12_stub_drawfail on this 128-byte-push-constant device. The log says the pipelines need 144 bytes of push constants and the uniform-buffer fallback is not built;d3d12_draw_testthen fails at its firstCreateGraphicsPipelineState. This is the behaviour the PR fixes.shader_library: with everything reverted it is only a build failure (pc_tail_bytesis new API). Behavioural red:ShaderEntry::pc_tail_byteskept, only the line that readspc_tailfrom the metadata removed; the test then exits 1 atnative->push_constant_bytes == 128 && native->pc_tail_bytes == 16 && !entry->pc_tail_bytes.precompile_pc_tailandprecompile_skip_listpass with the revert too, so on this machine they do not tell the two versions apart.__stdio_common_vswscanfadded;fma,fmaf,GetXStateFeaturesMask,LocateXStateFeature,SetXStateFeaturesMaskabsent) because main has moved on since this PR's base; the PR diff itself adds no scanf call.Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44.
Could you merge main into the branch? It conflicts in
runtime/src/vulkan_replay.h, so a green run on the merged tree could not be done. Thanks!Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-29T17:27:40Z.
Rebased onto current
mainas5cb2fcdd0; the realruntime/src/vulkan_replay.hconflict is resolved by preserving upstream's earlier indirect-dispatch pipeline resolution and adding this PR'stail_setdescriptor-set requirement there, rather than reintroducing the obsolete downstream duplicate block.Validation after the rebase: CMake configure and build passed; ctest passed 46/47, with the single
pipeline_workersfailure reproduced identically on clean upstreammain(so it is baseline rather than PR-specific); diff-check is clean. AI-assisted.Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-30T19:45:50Z.
Rebased onto current \main\ (\
51dbc5b58) as \20f2260bf1ee83298bf05965e8058a66edd15f2\ (now \MERGEABLE). Resolved conflicts inuntime/shims/d3d12_vulkan_device.cpp\ (\LiteralSamplerSpec, \masked_layout\ via \create_layout, \rena_host/\rena_ready(), \destroy_page_mirror()\ + \pc_tail\ teardown, and \BuildHost::unbuildable) and
untime/src/vulkan_replay.h\ (\ReplayStateCache\ set-1 \ ail_set/\ ail_offset\ and \push_bytes\ handling across Draw, Dispatch, and \ExecuteIndirect\ dispatch, plus \ ail_set\ checks in \collect_unbuilt_pipelines\ and \prepare).
Local verification on \20f2260b\ (Windows 11, MSVC 19.44, Ninja \RelWithDebInfo, \LEONIDA_REQUIRE_VULKAN=ON, \LEONIDA_VK_VALIDATION=1, \VK_LOADER_LAYERS_DISABLE=
implicit):eplay_state_cache).
eplay_state_cache: 5 validation errors from \main's raw 144-byte push-constant test fixtures on a 128-byte device; the live GPU \ReplayStateCache\ graphics/compute interleave subtest passed).
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-30T22:13:14Z.
The branch has been rebased again as
b20f2260band is now mergeable. The existing approval and independent Windows/GPU validations were against the same implementation before the rebase; is anything else needed before this can be merged?Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:31:24Z.
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.Pull request closed