d3d12-shader/gpu: view-address table for dynamically picked structure descriptors (D3D12-SHADER-SLOT-VIEW-ADDRESSES) #2661
Open
zmasi wants to merge 13 commits from
upstream-pr/2661 into main
pull from: upstream-pr/2661
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!2661
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2661"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-30T00:09:03Z.
Claimed in the coordination issue as: D3D12-SHADER-SLOT-VIEW-ADDRESSES (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7249767838, https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7264381245)
What and why
Implements
D3D12-SHADER-SLOT-VIEW-ADDRESSESacrossleonida-shaderandleonida-gpu, resolving the opend3d12/docs/fork-ray-tracing.mdgap where ray-tracing shadow-mask trace programs read an acceleration structure's 64-bit title virtual address out of a descriptor picked from the view heap or a descriptor table by a computed index:SLOT_ADDRESSESRoot SRV (t251,ROOT_CBV_SPACE) &USER_TABLE_BASE(0x10b):251(SLOT_STRIDES_COUNT64-bit(low, high)word pairs,16 MiBupload buffer alongsideSLOT_STRIDESatt252) andRootType::Other(USER_TABLE_BASE)(0x10b, un-snapshotted byte offset of aRootType::Tablein the title's view heap) ind3d12/crates/leonida-shader/src/emit/{shader.rs,mod.rs}and wiresSLOT_ADDRESSESlazily ind3d12/crates/leonida-shader/src/emit/diff_tests.rs.d3d12/crates/leonida-shader/src/emit/lower.rs):Lower::slot_address(slot)clampingslottoSLOT_STRIDES_COUNT - 1(UMINtaggedTag::Clamp) and emitting a 2-dwordrawBufferLoadatslot << 3fromSLOT_ADDRESSES.title_heap_indexandtitle_fetched_index(unreplaced_table_wordviaUSER_TABLE_BASE) so dynamicRootType::TableSLOT_ADDRESSESlookups index the title's view heap even whendraw::State::tablessnapshots the table's static CBV / half-format / capped-heap entries into dynamic slots or reuses content-addressed tables (LEONIDA_CONTENT_TABLES).slot_byte_mod32/dynamic_mod32to fold constant sub-slot byte offsets acrosss_or_b32,v_or_b32,v_lshl_or_b32,v_lshl_add_u32,s_lshl*_add_u32, shifts, additions, and phis (resolving+0/+4word starts accurately while rejecting+8..+28).Lower::descriptor_dataandLower::unused_descriptor_kind(read(k)checking bothb.phisandb.insts, requiringslot_byte_mod32 == 0and(2..5).any(read)on 8-dword 2D image dimension queries) so scalars_load_dword..s_load_dwordx4and address-onlys_load_dwordx8loads (including branch-joined phi loads and+4high-dword reads) resolve(lo, hi)throughview_address.Lower::flatso per-laneglobal_load_dword*(n <= 4, sub-slot byte0 | 4) resolves fixed-offsetTablereads viaUSER_VIEW_ADDRESSand computed-indexResourceHeap/Tablereads viatitle_fetched_index+slot_address.d3d12/crates/leonida-gpu/src/{descriptor/host.rs,draw.rs,pipeline/host.rs}):view_address(+is_structure_view, plusmake_twinnedView::Placedacceleration-structure guard) to extract 48-bit title virtual addresses from bothView::ShaderandView::Placed(RAYTRACING_ACCELERATION_STRUCTUREdesc[1] == 11and buffer views).HostHeap::addresses(SLOT_STRIDES_COUNT * 8bytes upload buffer written via single atomic 8-byte-alignedu64::write_volatilestores),title_countpreservation for capped heaps, lock-freestructure_count: AtomicU32+structures: Mutex<HashMap<u32, u64>>, andwrite_address/note_structure/clear_structureacross all static and dynamic slot lifecycle paths (including freeing dynamic slot ranges inHostHeap::release_many).USER_TABLE_BASEinState::host_word, registersSLOT_ADDRESSESinpipeline::host, bindsheap.addresses_gpu()inState::bind(State::heap_addresses) without triggeringheap_buffer_pass, and includesheap.structure_addresses()inState::memory_ready(0diff lines ind3d12/crates/leonida-gpu/src/host.rs).Tested
origin/main):HeapDwordx4,HeapDwordx8,HeapBranchPhiDwordx8,HeapSplitOffset4,TableDwordx4,HeapGlobalDwordx4) fail translation withErr("a descriptor read only as data")/ unsupported global descriptor load.cargo test --manifest-path d3d12/Cargo.toml -p leonida-shader --lib -- --test-threads=4andcargo test --manifest-path d3d12/Cargo.toml -p leonida-shader --features host -- --test-threads=4->369 passed; 0 failedon NVIDIA GeForce RTX 3090 D3D12, Microsoft WARP, and DXIL validation (including all 7emit::intersect_testsPickedAddressshapes across 311 ray/node cases, loop-carriedHeapLoopSplitOffset4, distinct per-parity 42-bit structure addresses, decoupledUSER_TABLE_BASE,+8/phi + 4/ unalignedv0 << 2negative refusals, and fixed-offsetTableglobal_load_dwordx4->USER_VIEW_ADDRESS).cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib descriptor:: -- --test-threads=4->67 passed; 0 failed(includingview_address_tabledynamic AS cleanup across both uncapped and cappedtitle_count-straddling runs and compatibility withQueueMarks,LEONIDA_SPANS_QUICK, andLEONIDA_KEEP_BY_LIST).cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib draw::tests -- --test-threads=4->4 passed; 0 failed(including end-to-end RTX 3090 dispatchsnapshotted_cbv_table_keeps_title_base_for_picked_view_addressescombining a CBV at table slot0with a dynamicTableDwordx4structure-address read at table slot19).cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib pipeline::host::tests -- --test-threads=4->9 passed; 0 failed.cargo clippy --manifest-path d3d12/Cargo.toml -p leonida-shader -p leonida-gpu --testsand--features diagnostics --tests->0warnings on touched lines;python -I scripts/check_no_game_data.pyclean.GPUs tested: NVIDIA GeForce RTX 3090 (driver 610.88) and Microsoft WARP, Windows 11 Pro (26200)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a:d3d12/crates/leonida-shaderDXIL backend;docs/design.mdcoverstools/rdna2spirv.py)Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T01:01:44Z.
Independent Wine check of the computed descriptor addresses on
272aaec05merged intob8bd37111(tree6c658aa8e). Win64 withleonida-gpu/diagnosticsandleonida-shader/host, Wine 11.22, VKD3D-Proton71cae091, RTX 4070 SUPER (620.73.04) and Radeon Raphael (RADV 26.3.1).draw::tests::snapshotted_cbv_table_keeps_title_base_for_picked_view_addressesreturned[0, 0, 0, 0]in 3/3 RADV runs withVK_EXT_descriptor_heapenabled. The same binary passed 3/3 after setting onlyVKD3D_DISABLE_EXTENSIONS=VK_EXT_descriptor_heap; the log then showedVK_EXT_descriptor_bufferbindings. NVIDIA passed 3/3 with each backend. A logging-only follow-up confirmed the four-dword readback assertion was reached in every passing mode. Setting the output buffer’s initial state toUNORDERED_ACCESSalone repeated the same RADV split in one run per mode.intersect_testspassed on each GPU. The new test compiled all seven address shapes and executed them with its synthetic memory stand-in. In three compiler-only controls onmainwith the same input generator, six shapes were rejected andHeapBranchPhiDwordx8lowered.view_address_table_tracks_structures_buffers_and_clearsreached its final capped-heap cleanup assertion on both GPUs with each backend. The two failures in the widerdescriptor::filter also reproduced on plainmainwith both backends (halves_cross_an_unsigned_buffer_view_unchangedandviews_are_made_beside_the_heap_and_copied_in).Synthetic fixtures only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-30T01:14:04Z.
Thanks for the thorough multi-backend run across RTX 4070 SUPER and Radeon Raphael!
Good observation on the
VK_EXT_descriptor_heapRADV split:snapshotted_cbv_table_keeps_title_base_for_picked_view_addressescreates its CBV and raw UAV viaHostHeap::put(descriptor/host.rs), which creates descriptors in the thread-local CPU staging heap (staged()) and copies them into the shader-visible heap withCopyDescriptorsSimple— the exact same path exercised by the twomaintests (views_are_made_beside_the_heap_and_copied_inandhalves_cross_an_unsigned_buffer_view_unchanged) that showed the sameVK_EXT_descriptor_heapvsVK_EXT_descriptor_bufferbehavior on RADV 26.3.1.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T01:19:27Z.
Follow-up on the descriptor staging hypothesis. I reran the exact draw test on
272aaec05merged into0eab02a8b(tree520444fa7), with fresh Wine processes forLEONIDA_VIEW_COPY=1and0.staged()returnsNonewith0, soHostHeap::atwrites into the final slot andcopy_toskips the staging copy.MEASURED On RADV, the descriptor-heap backend still returned
[0, 0, 0, 0]in 3/3 runs with staging and 3/3 runs with direct writes. The descriptor-buffer backend passed 3/3 with each setting. NVIDIA passed 3/3 in all four combinations. The heap/buffer backend was confirmed in the VKD3D logs.For clarity on the earlier controls, the two wider descriptor-suite failures also occurred on plain
b8bd37111with both backends. The all-zero draw readback is the result that depends on the backend in this matrix.Synthetic fixtures only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by ammonium231 on 2026-11-30T05:59:54Z.
RTX 3090 / 621.40, validation on,
b6e498923merged onto main1d22590b9: leonida-shader --lib and --features host 371 pass, 4 ignored (main 370); descriptor:: 67 (main 66) incl. view_address_table_tracks_structures_buffers_and_clears; draw::tests 4 (main 3) incl. snapshotted_cbv_table_keeps_title_base_for_picked_view_addresses. No validation errors.Imported from ubiquitarianism/leonida. Originally posted by ammonium231 on 2026-11-30T11:42:05Z.
RTX 3090 / 621.40, validation on,
19e23c2aemerged onto main0568cd62e: shader --lib and host 386 pass, 4 ignored (main 385); descriptor:: 68 (main 67) and draw::tests 4 (main 3), incl. both new tests. No validation errors.Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T14:41:09Z.
Review: COMMENTED
Reviewed
b05875ff7and the merge with current main (81ff5e1b1). The computed-index claim holds:view_address/slot_byte_mod32(lower.rs:4985-5026,:4725-4746) split fixed-Tablefrom dynamic/ResourceHeaplookups,USER_TABLE_BASEreturnshandle - heap.start(draw.rs:2836-2838) andunreplaced_table_wordadds the snapshot delta (lower.rs:10554-10566), so a table picked at a computed index still addresses the title's heap aftertables()copies static entries into dynamic slots. The e2e draw test reads back exactly[0x13572468, tlas_lo, tlas_hi, 0xcafebabe], and the 311-case intersect test checks per-lane addresses across all seven shapes.The sub-slot guard is live: reverting the
0 | 4acceptance makesa_structure_address_picked_by_computed_indexfail withUnsupported { offset: 164, what: "a descriptor read only as data" }. Tests here: shader 405/405 (also--features host), descriptor 69/69, draw 4/4, pipeline 9/9,check_no_game_dataclean, and a locally merged tree compiles and passes the targeted tests — so the cleanmerge-treeis not merely textual.Two non-blocking notes:
View::Placedacceleration-structure fallback atdescriptor/host.rs:5206-5214(desc[4..5]elsedesc[10..11]) has no test: the placed case setsdesc[4..5]and leaves[10..11]zero, although the test comment calls it the "placed-base fallback".descriptor/host.rs:2383-2394) even when no shader asks forSLOT_ADDRESSES— consistent with the existing 8 MiBSLOT_STRIDEStable, but it doubles the fixed per-heap upload cost, which is worth knowing on a 16 GB card.The branch is 271 commits behind and main has since touched
lower.rs,mod.rs,draw.rsanddescriptor/host.rs, so rebase before merging even though the merge is clean.Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T14:56:59Z.
Second pass on the same head, adding three things the first review did not cover (the core claim and the
0 | 4mutation both still check out):d3d12/docs/fork-ray-tracing.md:128-131lists the five shadow-mask programs as needing "a table of addresses by slot", while the body says this PR provides it. The PR touches no docs, so the page will contradict the code after merge.unused_descriptor_kindgoes from8 if (1..5).any(read)to8 if aligned && (2..5).any(read)(lower.rs:9339), butalignedusesis_none_or(:9327-9332), so an unproven dynamic mod-32 still counts as a descriptor start — the opposite of "no defaulting unproven offsets". It may be right (the width spans dwords 1–2), but it is unverified: a corpus count or a test would settle it.structure_addresses()returns only RTAS views (host.rs:2695,is_structure_view:5218), so a buffer address picked through the same table gets nomemory_readytreatment (draw.rs:2947). The intersect test covers buffers only through theTEST_MEMORYfixture. Intentional?Also, for anyone reusing
cargo-target-2661: a staleLEONIDA_SHADER_SOURCE_HASHfrom an earlier mutation run makessource_hash_tests::the_source_hash_leaves_the_test_modules_outfail with a mismatched hash untilbuild.rsis touched — it is the shared target dir, not the PR.Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T15:09:47Z.
I ran a two-vendor synthetic dispatch verification on
b05875ffmerged intoedf7d01f8, with Win64 MSVC-target binaries under Wine 11.22 and VKD3D-Proton 3.1.0. All seven intersect_tests and the two GPU descriptor/draw tests passed on Radeon Raphael (RADV 26.3.1) and RTX 4070 SUPER (620.73.04).The computed-index test actually needs an SM 6.6 device to pass. It dispatches the seven synthetic address forms, including the branch/loop offsets and per-lane global load, with a CPU oracle and different 42-bit structure addresses per lane parity. Its rejection cases and fixed-table-offset path passed as part of the same test. The descriptor tests also exercised listed-view cache hits and clears and the retained title base for a snapshotted CBV table. DXVK reported no WARP adapter, so this is physical-GPU coverage. The dispatch fixture uses its synthetic node-memory stand-in. MEASURED, AI-assisted (Codex).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:23:53Z.
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T15:04:09Z.
Ran natively on Windows 11, head
1b3f3dee0merged into currentmain(69cd4106c, clean merge), debug test profile. This head is theSLOT_TLAS_*reconcile merge, which the earlier reports don't cover.PR tests and suites on the merge
emit::intersect_tests(--features host, debug layer on, run twice)descriptor::+draw::tests+pipeline::host::tests, card, debug layer onleonida-shader --lib --features host, fullleonida-gpu --lib --features diagnostics, full, WARPThe intersect tests pick the hardware adapter and WARP themselves.
a_structure_address_picked_by_computed_index_translates_and_runs_on_the_cardloops over both and prints "no SM 6.6 ... device; skipped" when one is missing. That line never appeared, so both dispatches ran.view_address_table_tracks_structures_buffers_and_clearsandsnapshotted_cbv_table_keeps_title_base_for_picked_view_addressesran on both the card and WARP and passed with the debug layer enabled. Clippy on both crates (--tests,diagnostics,host): nothing in the files this PR touches.d3d12_switches.py --checkis clean.On the reconcile:
SLOT_ADDRESSES(251) andSLOT_TLAS_BASE..=SLOT_TLAS_MAX(230 to 241) don't overlap. Both are in theourslist inpipeline/host.rs, and the bind loop indraw.rschecks them one after the other. Lowering fills them from separate places:tlas_srvscomes from lifted ray queries inrayquery.rs, andSLOT_ADDRESSEScomes from the software-traversal loads inlower.rs. The new 2,048-slot sampler-heap branch allocates no address table (addressesisNonefor samplers, checked).Extra throwaway host tests on the address table (not pushed), 1 run on the card and 2 on WARP, all passed
write_address(SLOT_STRIDES_COUNT, ..)release_manyin two runsstructure_count20,000, then 0; sampled entries correctmake_null, against a 1.5 s CPU readerstructure_countequal to the map size at the endTwo observations, neither blocking:
release_manyremoves freed dynamic slots fromstructures, but their table entries keep the old address until the slot is reused (0x12345678aa0was still there after the release). This matches the descriptors themselves, which are also left in place, and reallocating the run and nulling a slot rewrote its entry (the only reuse path I tried). A shader would only see the stale value if it read a freed slot.title_count. On the card, asking for 1,000,000 or 2,000,000 slots gavecount737,855 with dynamic slots 737,855 to 999,998, all belowtitle_count, soupdate_dynamic_addressnever writes them and their entries hold the title's own slots. That looks like the intended behaviour (shaders index title slots throughUSER_TABLE_BASE). I mention it because the PR's straddle test only covers the case wheretitle_countfalls inside the dynamic range. The largest heaps I could make ended at slot 999,998 on the card and 2,097,150 on WARP, inside the 2,097,152-entry table. Only a title count above 2,097,152 clamps (title_count2,097,152 for a 4,000,000 request).Small doc nit: the merged
switches.mdrow forLEONIDA_LATE_WAITnow namesleonida-gpu/descriptor/host.rs +3instead ofleonida-gpu/host.rs +2. The switch lives inhost.rs(13 mentions). The newwrite_addresscomment is the only mention indescriptor/host.rs, but the generator picks that file.--checkstill passes.Not checked: an in-game run (the gate asked for above), GPU-side reads racing CPU table writes in flight (only a CPU reader was used), debug-layer messages beyond what a failure would surface, red on
main(already shown by others), and AMD.GPUs tested: one NVIDIA desktop card + WARP.
AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-02T17:07:56Z.
RUN (in game, gate-style, as asked by MoonEyes): head
1b3f3dee0tested in a batch with #2643 (2cea6871c), #3031 (a47b86855), #2789 (4bd128a8c) and #2661 (1b3f3dee0), all merged withgit merge --no-ffontomain23a51c494(no conflict; the only file the four share isd3d12/docs/switches.md). Built withdiagnostics,mimalloc, targetx86_64-pc-windows-msvc. RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro (build 26300).Launcher defaults, Series S settings,
-NoDlss -NoFrameGen, standing at the save; a warm-up run first (the batch changes the translator, so everything was re-translated), then one run of 420 s with the memory safety stop:Verdict: PASS for the batch (a pass covers each of the four; a failure would not have said which). Not covered here:
-RayTracing(a run with it is queued), DLSS frame generation with ray tracing (needs an RTX 40/50 card), other GPUs.AI-assisted: Claude Code (Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:03:23Z.
Light code review only, not built (Windows-only
leonida-shaderandleonida-gpu). Ready, on the runs already posted on this head.1b3f3dee0, merge base229d352ee, 188 behind currentmain45dc41f95. A trial merge is clean. CI on the head: all 6 checks pass.emit::intersect_testswith the debug layer: 7/7, twice.descriptor::,draw::testsandpipeline::host::testson the card and on WARP with the debug layer: 107 passed each.leonida-shader --features host: 429 passed.leonida-gpu --features diagnostics: 779 passed.-RayTracing.Review notes (1,578 added across
emit/lower.rs,emit/shader.rs,descriptor/host.rs,draw.rs,pipeline/host.rs):SLOT_TLAS_*, kept in step with the heap. This replaces assuming a fixed slot, so the change is at the root rather than a special case.write_address(SLOT_STRIDES_COUNT, ..)shows the index guard skips out-of-range writes instead of corrupting the table.d3d12/docs/fork-ray-tracing.md:186-189("Five shadow-mask trace programs do not translate ... the host would have to give a table of addresses by slot"), but leaves that line as it is. Onlyd3d12/docs/switches.mdis updated. Please update or remove that bullet so the docs match.-RayTracing, and #3031 in that batch is under an author "do not merge" for ray-tracing hangs. So the in-game PASS most likely never ran the new lowering. Its evidence is the unit and debug-layer dispatches above. A run with-RayTracingon this head alone, with the translate count for those five programs, would be the meaningful check. enlight3d has a-RayTracingrun queued.Verdict: ready on code and unit evidence, with one docs fix (
fork-ray-tracing.md:186-189). I would wait for the queued-RayTracingrun before merging.AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T05:59:19Z.
VERIFY-2661 — 428 tests del shader en verde, y el cambio es el más grande de
emit/lower.rsEl título: «view-address table for dynamically picked structure…» — una tabla de direcciones para estructuras elegidas dinámicamente, y
lower.rs+494 es donde vive.Y es el tercero de la familia que ya he visto tres veces esta noche:
#2800(cadenas canónicas),#2686(latches paradxil-spirv),#2698(mad_legacy) — y ahora#2661: el emisor tiene que producir una forma que el consumidor sepa leer, y la tabla de direcciones es el contrato.Lo que verifiqué: 428 tests del crate con el cambio.
Lo que no: que un shader que elige una estructura en tiempo de ejecución se traduzca al DXIL correcto — el test comprueba la emisión, no el consumo por
dxil-spirv.Y una observación sobre estas cuatro: son de tres autores, tocan el mismo
emit/y ninguna se ha fusionado. Si las cuatro entran por separado,lower.rsybitcode.rsvan a chocar cuatro veces — la misma aritmética quetests/test_win_launchers.py, en el otro fichero más disputado del repositorio.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T18:03:54Z.
In-game gate run on an RTX 4060 8 GB (driver 610.88, Windows 11), in a batch of #2822, #2800, #2664 and #2661 merged into main
09273248c; this PR tested at its current head1b3f3dee0. Series S 1080, DLSS FG 2x,play-nvidia.ps1 -SeriesS -Resolution 1080 -FrameGen 2 -PrecompileUsed, scripted walk, 330 s, screen kept on.AI-assisted (Claude Opus 5.5), run and read by MoonEyes' agent.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.