OLD-2402: Runtime: D3D12 PSOs bind the --pc-tail-ubo set-1 block for 128-byte push-constant devices #767
Closed
leonida/mandy
whoalin1 wants to merge 0 commits from
pc-tail-runtime into main
pull from: pc-tail-runtime
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!767
Loading…
Reference in a new issue
No description provided.
Delete branch "pc-tail-runtime"
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?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
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).
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.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).
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).
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.
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.
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.
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.
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.
Validation run of this PR on a Windows PC with a real GPU.
runtime/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!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.Rebased onto current \main\ (\51dbc5b58) as \20f2260bf1ee83298bf05965e8058a66edd15f2\ (now \MERGEABLE). Resolved conflicts in
untime/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.
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?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.