d3d12-shader/gpu: view-address table for dynamically picked structure descriptors (D3D12-SHADER-SLOT-VIEW-ADDRESSES) #2661
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u origin "github-pr/2661:github-pr/2661" git switch "github-pr/2661"
Open
leonida/mandy
zmasi wants to merge 13 commits from
github-pr/2661 into main
pull from: github-pr/2661
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/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!2661
Loading…
Reference in a new issue
No description provided.
Delete branch "github-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?
This pull request has changes conflicting with the target branch.
Merge manually to resolve the conflicts.
Reviewers 0 approvals
Details
This pull request has changes conflicting with the target branch.
Merge manually to resolve the conflicts.
d3d12/crates/leonida-shader/src/emit/mod.rsView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.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)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.
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.
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.
RTX 3090 / 621.40, validation on, b6e498923 merged onto main 1d22590b9: 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.
RTX 3090 / 621.40, validation on, 19e23c2ae merged onto main 0568cd62e: 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.
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.I ran a two-vendor synthetic dispatch verification on b05875ff merged into edf7d01f8, 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).
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).
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).
RUN (in game, gate-style, as asked by MoonEyes): head 1b3f3dee0 tested in a batch with #2643 (2cea6871c), #3031 (a47b86855), #2789 (4bd128a8c) and #2661 (1b3f3dee0), all merged with
git 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)
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
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.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.