d3d12: realize console streams with their depth-bounds flag and back-face stencil masks (RT-DEPTHBOUNDS-STREAM-EXTRAS) #1695
Closed
thiefyzheng wants to merge 3 commits from
upstream-pr/1695 into main
pull from: upstream-pr/1695
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!1695
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1695"
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 thiefyzheng on 2026-11-25T08:33:27Z.
RT-DEPTHBOUNDS-STREAM-EXTRAS — Depends on: #815
Claimed on #1608 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156944266). This fixes @djrolfes' integration finding on #815 (https://github.com/ubiquitarianism/leonida/pull/815#issuecomment-7156015786). @kotekompotek: happy to have this folded into #815 instead of a stacked PR — say so and I'll drop it.
Note: the diff includes #815's commit until it merges, since this branches from its head
efea97331.What
PipelineState::resolve_type'sstd::call_onceblock (runtime/shims/d3d12_vulkan_device.cpp:7059) realized a console stream withcreate_graphics(stream.graphics, &stream.ms, &stream.as), silently droppingstream.extras(the depth-bounds flag, #815'sGraphicsStreamExtras) andstream.back_stencil(DEPTH_STENCIL2 back-face masks, whichparse_pipeline_streamfills right next to the front ones). The eagerCreatePipelineStatebranch passes both. It now passesstream.back_masks?&stream.back_stencil:nullptrand&stream.extras— argument-for-argument identical to the eager call at ~12104.prepare_console_stream(~10367) set the pipeline cache key frompipeline_key(stream.graphics)alone; the plainD3D12_DEPTH_STENCIL_DESCthe key hashes cannot see the depth-bounds flag or back-face masks, so two console PSOs differing only in those would collide. The key now post-mixesback_masks,back_stencil.read/.writeandextras.depth_bounds_testwith the samecached_pso::KeyBuilder/sha256_hexidiompipeline_keyitself uses.runtime/test/d3d12_mesh_test.cpp: a console stream (device slot 86, mesh-shader subobject 24) carrying DEPTH_STENCIL1 withDepthBoundsTestEnableand a D32_FLOAT DSV, drawn once insideOMSetDepthBounds(0, 1)(red — depth 0 is inside) and once insideOMSetDepthBounds(0.5, 1)(blue — the discard only happens if the flag reached the pipeline). Without the source fix both draws come out red.What was run
create_graphicssignature match (7119–7123), thePipelineStreamfields and their parse fill, every identifier the test uses in scope with types lined up, fence values (the newbounds_fencepre-increments from 3, first Signal is 4 — no collision with the earlier Signals 1–3), the readback footprint/offset parity with the file's existing usage, slot 86 = consoleCreatePipelineState, and subobject 24 = the console mesh shader (consistent with the existing stream test at line 341 and the console→PC remap ind3d12_xs_pso_stream.h:31). That review caught two real defects, both fixed here: the test's second-frame depth barrier indicated a COMMON→DEPTH_WRITE transition from a buffer already in DEPTH_WRITE (now conditional onfirst_frame), and the cache-key collision above.d3d12_mesh_testwith the one-line source change reverted and show the bounds case fails) needs a depth-bounds-capable Vulkan device, which the author host does not have. The test skips cleanly whenDepthBoundsTestSupportedis FALSE or inpc_onlybuilds.Attribution
AI-assisted: implementation (Claude Sonnet 5.5 worker), independent review and follow-up fixes (GLM 5.3 Flash worker), orchestration and verification by the contributor. No game files were used or are needed; no game data in this PR.
Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-25T09:45:31Z.
Review: COMMENTED
Review (read-only, not run). The pipeline-cache key now including the back-face masks and the depth-bounds flag is an important catch, and the plumbing through
OMSetDepthBounds, bundles andDrawlooks complete. Three points:vulkan_replay.h,d3d12_com.cppand the device; please get at least a build andd3d12_mesh_testfrom someone with a depthBounds-capable GPU before merge. I can run it on an RTX 5070 Ti if it helps.enable.depthBounds = chosen_features.depthBoundsis added increate_vulkan_device_standalone.DepthBoundsTestSupportedand the PSO check readstate_.info.features.depthBounds. When the device comes from the runtime's own creation path (not standalone), isinfo.featuresthe enabled set or the supported set? If it is the supported set, a PSO could enabledepthBoundsTestEnableon a device that never enabled the feature (a VUID).dyn_list[9]: with #778 (addsVK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXTto the same list) the maximum becomes 7 + 1 + 1 = 9, so 9 is exactly enough. Astatic_assertor a comment counting the entries would keep the next addition from overflowing it.AI-assisted review (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by potatoe0100 on 2026-11-25T11:18:34Z.
Tested
766c6c42emerged ontomainbcaa13dad(clean), native Windows 11 Pro 26H2 (build 26300), NVIDIA GeForce RTX 4060 (depthBounds and mesh shaders supported), driver 621.14, VS 2022 RelWithDebInfo + Ninja.ctest -j 6: 409 of 409 passed, same asmain; that includesd3d12_mesh,d3d12_bundle_forbidden,d3d12_close_parity,d3d12_comandd3d12_vulkan_device.d3d12_mesh_testwithLEONIDA_VK_VALIDATION=1: exit 0, 0 VUIDs, "DispatchMesh over X, Y and Z and a stream VS draw matched all 4096 pixels".run_gpu_tests.py: 209/263 passed, 53 skipped, identical tomain.AI-assisted testing (non-developer tester).
Imported from ubiquitarianism/leonida. Originally posted by adrianmjim on 2026-11-25T11:24:32Z.
Tested
766c6c42eapplied ontomain42537e7b6on AMD: Radeon RX 7900 XT (RDNA3,depthBounds = true), AMD driver 32.0.32029.2010 (26.11.2), Windows 11 build 26300, VS 2022 RelWithDebInfo. No game files.Tests:
LEONIDA_VK_VALIDATION=1(no messages):d3d12_mesh,d3d12_com,d3d12_close_parity,d3d12_bundle_forbidden,d3d12_vulkan_device,pso_stream,d3d12_draw,d3d12_pso_validation,d3d12_depth24_draw,d3d12_geometry,d3d12_multi_viewport,d3d12_rect_list,d3d12_quad_index,d3d12_translated_draw.ctest -j 6: 399 of 402, with the same three failures asmain.Three things in the code:
1.
OMSetDepthBoundswith a NaN. The D3D12 reference says of bothMinandMax: "NaN values silently convert to 0". At replay the PR makes any NaN an empty range ((mn != mn) || (mx != mx)→set_depth_bounds(1, 0)), so every pixel is discarded.OMSetDepthBounds(NaN, 0.5)should test[0, 0.5].(0.2, NaN)happens to come out right, because D3D12's[0.2, 0]is empty too. Mapping NaN to 0 first and then applying the existing clamp/empty rules would match D3D12.2. The extra cache-key mix is dropped.
pipeline->set_cache_key(pipeline_key(stream.graphics) + leonida::sha256_hex(extra.data()))appends a second 64-character hash to a key that is already a 64-charactersha256_hex.cached_pso::encode()/check()dopadded.resize(key_bytes)withkey_bytes = 64, so the back-face masks and the depth-bounds flag never reach the cached blob. So two console streams that differ only in those return byte-identicalGetCachedBlobblobs, and the mix has no effect. Hashing the two parts together, for example by feedingextra's bytes into the sameKeyBuilderbefore thesha256_hex, would keep the key at 64 characters.3. The new
d3d12_meshcase doesn't go through the newresolve_typepath. ctest runs it withoutLEONIDA_PIPELINE_COMPILE=on-demand, so slot 86 goes to the eagerCreatePipelineStatepath, which this PR also changes to pass&stream.extras. The test would pass without theresolve_typechange.I tried it with
LEONIDA_PIPELINE_COMPILE=on-demand.d3d12_meshthen fails, but it fails the same way onmainwithout this PR: the console stream from slot 86 isn't created (SUCCEEDED(console_hr) && console_pso.p, line 353 with the PR, line 344 onmain). So the test can't cover the on-demand path at the moment. That failure is separate and predates this PR.Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-11-25T11:28:43Z.
@adrianmjim — thank you for the 7900 XT run and the three review points. Both code findings are fixed in
6f710e57(a fast-forward on the tested766c6c42, so your results still describe the base):1. Cache-key mix truncated away — fixed.
cached_psoresizing the key to 64 chars means the appended second hash never reached the blob.pipeline_key(graphics overload) now takes an optionalconst KeyBuilder* extrahashed into the same builder before its singlesha256_hex;prepare_console_streampasses the back-masks/back-stencil/depth-bounds builder. All otherpipeline_keycall sites keep byte-identical keys (defaultnullptr, no bytes appended): the trace print at ~7285, the compute overload at ~10371,shared_native_graphicsat ~10388,CreateComputePipelineStateat ~11967,CreateGraphicsPipelineStateat ~11984 (eagerCreatePipelineStatedoesn't callpipeline_keyat all).2. NaN depth bounds — fixed on this branch, with a note for @kotekompotek. Replay now maps NaN to 0 first (
vulkan_replay.h~4893), then the existing clamp/inverted-is-empty rules unchanged — so(NaN, 0.5)behaves as[0, 0.5]and(0.2, NaN)as[0.2, 0](empty). Record-time acceptance and bundles are untouched. This is replay-side code that came in with #815; kotekompotek, if you would rather carry it in #815 itself, say so and I'll drop the hunk here and rebase on your fix.3. Test covers only the eager slot-86 path — acknowledged. Under plain ctest
LEONIDA_PIPELINE_COMPILEisn't on-demand, soCreatePipelineState(~12090-12122, eagercreate_graphicsat 12118) is what the mesh case exercises; theresolve_typelazy realization at ~7055/7063 is not covered, because on-demand mode fails earlier — console stream from slot 86 not created (the SUCCEEDED(console_hr) bail atd3d12_mesh_test.cpp:349/~353), identically onmain. I have not touched that pre-existing failure; the case still guards the eager path plus the replay-side bounds, and theresolve_typechange remains a code-path-observation fix for now.New commit is again not compiled and not GPU-confirmed on the author host (no Vulkan SDK / MSVC here); it needs one more hardware look like yours when convenient.
Imported from ubiquitarianism/leonida. Originally posted by adrianmjim on 2026-11-25T12:48:47Z.
Rechecked
6f710e574on the RX 7900 XT (driver 32.0.32029.2010, Windows 11 26300, VS 2022 RelWithDebInfo). Both points are fixed:KeyBuilder, so the key stays one 64-character hash.OMSetDepthBounds(NaN, 0.5)is in the state sweep and gives the same result as host D3D12 here (0x00000000 | 0x00000000 | match).The 14 related tests pass with
LEONIDA_VK_VALIDATION=1and no VUIDs. Wholectest -j 6: 398 of 402 pass or skip. The failures ared3d12_texture_tiles,d3d12_clearandd3d12_geometry_views, which fail onmainhere too, plusd3d12_api_descriptor_copy, which failed once under-j 6and passes 3 of 3 alone.Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-11-25T12:52:07Z.
@adrianmjim — thank you for the recheck on
6f710e57. Recording the state for whoever merges: the head now carries an independent hardware verification on RDNA3 covering all three of your original points (single 64-char key, NaN→0 matching host D3D12, eager-path suite green withLEONIDA_VK_VALIDATION=1, 0 VUIDs), with the only ctest failures being the three pre-existingmainbaseline ones plus one-j 6flake that passes alone.Open item unchanged: @kotekompotek, whether the NaN hunk stays here or you carry it in #815 — the default assumed here is that it stays unless you'd rather have it; a maintainer can also drop it at merge. Everything else on this PR is reviewer-verified. AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-11-25T14:26:07Z.
Rebased onto #815's new head
a635392c6(post its71a769d7drebase) — our two commits are now6b7bf490andbb8e1131, conflict-free (this PR never touchesd3d12_com.cpp, where #815's own conflict was). The commit contents are unchanged from the previously verified766c6c42/6f710e57, so the hardware receipts above (RTX 4060 full suite, RX 7900 XT recheck of both review fixes) carry over modulo the new base; one more spot-check on the new head is welcome when convenient — @potatoe0100, @adrianmjim, either of you has the fastest boots for this.The NaN hunk stays in this branch as agreed default unless @kotekompotek moves it into #815 — say the word and I'll drop it here. AI-assisted (orchestrator).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-25T18:15:56Z.
Ran #1695 at head
bb8e11314on a depth-bounds-capable GPU.Config: Windows 11 (26300), RTX 4060 desktop, NVIDIA 610.88 (
depthBounds= true), MSVC 19.44, RelWithDebInfo, Vulkan SDK 1.4.363.0. Test targets only, no game files.d3d12_mesh_test,d3d12_vulkan_device_test,d3d12_com_test,d3d12_close_parity_test,d3d12_bundle_forbidden_test(0 errors).ctest:d3d12_mesh,d3d12_vulkan_device,d3d12_com,d3d12_close_parity,d3d12_bundle_forbiddenall pass. The new depth-bounds case does run here (not skipped): red insideOMSetDepthBounds(0, 1), clear blue inside(0.5, 1).resolve_typeline put back tocreate_graphics(stream.graphics,&stream.ms,&stream.as)andd3d12_mesh_testrebuilt, the test still passes. So under plain ctest the new case does not catch the dropped flag; slot 86 takes the eager path, as in your finding 7161103050.LEONIDA_PIPELINE_COMPILE=on-demand: fails atline 353: SUCCEEDED(console_hr) && console_pso.p, the same with and without the fix, before the depth-bounds case. That is consistent with 7161103050 on NVIDIA (I compared the PR head with and without the fix line, not main).So: it compiles and nothing regresses in these 5 tests, but the lazy-path fix itself is not exercised by any test I ran. Not covered: full runtime build, full ctest, AMD/Intel.
AI-assisted: yes (Claude Code ran the tests)
Imported from ubiquitarianism/leonida. Originally posted by Tauwni on 2026-11-27T13:23:00Z.
@thiefyzheng heads-up from RT-STATE-AUDIT-PIPELINE (issue #2464, part B): this PR is listed there for depth bounds and back-face stencil, but it carries needs rebase and conflicts with
main(2859d0c9b). Once it's updated, I can run it on a Mac (Apple M3, under Wine) and report here. One thing worth knowing for it: MoltenVK and KosmicKrisp both lackdepthBounds, so on Macsd3d12_vulkan_device.cpp:12096refuses every depth-bounds PSO, and carrying the flag on more paths would turn more PSOs into refusals there (finding: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7216500497).AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-11-27T15:49:58Z.
Status for @Tauwni and whoever tests this next: #1695 is stacked on #815 (our two commits sit on #815 head
a635392c6), and #815 itself is currentlydirtyagainstmain(ec91d695c). Rebasing this PR first would not build without #815's changes, so it waits for #815's own rebase; once that lands we rebase onto it and re-run the 14 related tests. No change to the commits (6b7bf490d,bb8e11314) until then.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T17:59:18Z.
Hi @thiefyzheng, thanks for this pull request. It currently conflicts with
main(conflicting file(s):runtime/shims/d3d12_com.cpp,runtime/shims/d3d12_com.h,runtime/shims/d3d12_vulkan_device.cpp,runtime/src/vulkan_backend.h,runtime/src/vulkan_replay.h,runtime/test/d3d12_mesh_test.cpp,runtime/test/d3d12_vulkan_device_test.cpp), so it carries theneeds rebaselabel. CONTRIBUTING.md asks authors to rebase their branch onmain; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T12:33:40Z.
Run of #1695 on a native Windows GPU (NVIDIA RTX 3090, depthBounds supported). Synthetic tests only, no game files.
Heads: PR
bb8e11314, main8fb974878.Merged or head-only: head-only.
git merge --no-ffof the PR into main conflicts inruntime/shims/d3d12_com.cpp,runtime/shims/d3d12_com.h,runtime/shims/d3d12_vulkan_device.cpp,runtime/src/vulkan_backend.h,runtime/src/vulkan_replay.h,runtime/test/d3d12_mesh_test.cpp,runtime/test/d3d12_vulkan_device_test.cpp, so everything below ran on the PR head itself (detached atbb8e11314, which carries #815's commit).Commands:
Green (all Passed, none skipped):
d3d12_mesh,d3d12_vulkan_device,d3d12_com,d3d12_close_parity,d3d12_bundle_forbidden.Red:
6b7bf490dandbb8e11314, reverted ind3d12_vulkan_device.cppandvulkan_replay.h, tests kept): not red. All five tests still pass, includingd3d12_mesh. The new case's console stream carries a mesh shader, so it is created through the eagerCreatePipelineStatebranch, notPipelineState::resolve_type, and theresolve_typechange is not what the case measures. To check that the case is live, I passednullptrfor the extras in the eager call only:d3d12_meshthen fails atbounded_pixel(0.5f, 1.0f) == clear_blue. So the case guards the eager path (already in #815's commit) and does not fail for theresolve_type/ cache-key / NaN changes in this PR. The cache-key and NaN changes have no red here either.runtime/test, plus the docs) reverted to the merge base71a769d7d, tests kept: build failure only,d3d12_com_test.cppdoes not compile (rt::d3d12::depth_boundsmissing).d3d12_mesh,d3d12_close_parityandd3d12_vulkan_devicebuild and pass in that state, most likely because the depth-bounds block ofd3d12_meshis skipped there (DepthBoundsTestSupportedis only reported with #815's changes); I did not trace that.Link: no new imports vs the merge base
71a769d7d(gta6rt.exe built at both). Against current main8fb974878the only difference isapi-ms-win-crt-stdio-l1-1-0.dll!__stdio_common_vswscanf, which the merge-base build already has, so it is not from this PR (main's own build does not import it).Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44, RelWithDebInfo, Ninja, Vulkan SDK 1.4.363.1.
Could you add a case that reaches
PipelineState::resolve_type(a stream that is not created eagerly), so the PR's own change has a red/green? And the branch conflicts with current main in the 7 files above: could you merge main into it? Thanks.Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-12-01T00:24:43Z.
Follow-up investigation of @enlight3d's deferred-path request (local only; no branch change):
The existing mesh case is the wrong vehicle for the on-demand case because its earlier slot-86 mesh stream fails first. A clean test shape appears to be the existing synthetic VS harness in
runtime/test/d3d12_depth24_draw_test.cpp, withVulkanDeviceInfo::prepare_on_bind = true, a valid slot-86 VS stream usingD3D12_DEPTH_STENCIL_DESC1.DepthBoundsTestEnable, then reset/bind/draw so realization necessarily goes throughPipelineState::resolve_type.Suggested assertions on the existing depth triangle:
[0.5,1]at depth 0.25 must produce 0/4096 passes (shows deferred extras arrived);[NaN,0.5]must produce 4096/4096 (shows NaN maps to zero);Independent controls: drop
&stream.extrasonly inresolve_typefor the first red; revert only the single-key cache expression for the second; revert only NaN mapping for the third.I have not implemented or claimed this green: this Linux host has no Windows compiler/Wine and CMake omits the D3D12 targets (
No rule to make target 'd3d12_depth24_draw_test'). No replay-only test is being offered as a substitute. Dependency #815 is unchanged and this branch has not been rebased or pushed. AI-assisted source-path investigation.Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-12-01T11:09:11Z.
Rebased the two #1695 commits onto current canonical main
da56079c9eplus a local rebase of dependency #815 (171c85b41b). New head:651a3c21d8a72263c9d674869e5d2c56f23b14a3(f746816544+ this commit).The resolution preserves main's order-key/prewarm handling and
ReplayStateCache, #815's clamp/empty-range rules, and this PR's deferred extras/back-stencil path, single-key cache hashing and D3D12 NaN-to-zero conversion. Range-diff maps both original commits one-to-one.Focused portable checks (CPU-only, no game data):
replay_state_cache_testandvk_command_replay_testbuild and pass 2/2;git diff --checkand no-game-data checks pass. #815's separately verified stack had 6,721 semantic + 69 viewer tests passing and one CTest failure reproduced identically on main (vk_predicated_copy).The requested deferred
PipelineState::resolve_typeVS regression is still NOT implemented here, because the native Windows/D3D12 target cannot compile or run on this host. No new off-target replay test is substituted. Native Windows/MSVC and depth-bounds GPU behavior remain unverified on this rebased head; the earlier deferred-VS design and three controls remain the next test step.AI-assisted (Kimi K3.1 Pro).
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:36:59Z.
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