runtime: leave unreferenced root parameters of slot 86 heap windows unset (Part of #3545) #3603
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3603"
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 R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-11-30T12:53:54Z.
Part of #3545. Rebased on
mainafter #3599 and #3606. The second commit addsstartup_indirect_mesh_cache_heap_wide_warpto theprpreset filter. The third addresses the review: per-stage visibility and aconstants-onlymarker flag.Problem
Every slot 86 request in a local title shader cache uses one root layout:
0x400on half of them and0xc00on the other half.With a published heap-buffer window (#3593, #3599), these roots still stopped at
root bindings outside supported profile, or atroot heap indexing (0xc00) has no verified binding. The cached path only accepted roots made of constants.Change
Publisher (
mesh86_cache.py):root_constant_registers).Resource Bindingstable holds nothing but cbuffers at the root's 32-bit-constants registers visible to that stage,ALLor its own visibility (prove_constants_only). D3D12 lets disjoint visibilities share a register, so mesh-only constants atb0do not cover a pixel stage'scb0.constants-onlyto the profile 3 marker to record that this proof ran.Runtime (
mesh86_cache.inl,d3d12_xs_device.cpp):0x800is accepted next to0x400. A sampler-heap flag without the resource-heap flag is still refused.constants-onlymarker: one published before the proof is refused until republished. A root of constants only still accepts the older marker.SetGraphicsRoot32BitConstantson every parameter except the root SRV, which would have been wrong for a table.Tests
startup_indirect_mesh_cache_heap_wide_{warp,hardware}repeat the five heap window cases from #3593/#3599 (views, swapped, empty, raw, uint) with the title root shape:t0-t3, space 1) that is never set;t4, space 3) that is never set;0xc00.t0, space1from the table is refused at publication.constants-onlyis refused at creation for the wide root and still draws for the narrow one.cb0): constants atb0withALLor pixel visibility pass, mesh-only constants are refused.runtime_mesh86_cache_cli_checkadds cases for:b0next to a pixel-only CBV table atb0(refused), and the reverse with pixel-visible constants (accepted).runtime_mesh86_cache_cli_checkandstartup_indirect_mesh_cache_heap_warp. After the review fixes, all 25 slot 86 tests (mesh86|indirect_mesh_cache|indirect_mesh_lease) pass on the RTX 3090 and WARP.Windows 11 build 26300, MSVC 19.44, Release, debug layer enabled. On an RTX 3090 (driver 32.0.16.1664) and WARP 10.0.26100.9818, both new tests passed with zero D3D12 warnings or errors, so leaving those parameters unset is clean on both. A serial run of
startup_(indirect|list|mesh|native_mesh|translated|compute_dispatch|resource_retire)|mesh86passed 229 of 229, with three native-compute WARP capability skips.Title run
Setup: this branch,
tools/startup/run_preset.py --console x --gpu nvidiawith a saved profile, on an RTX 3090. The run was stopped by hand at 545.7 s, after 7,131 presented frames.0x400and 2 with0xc00. All 4 now reachslot86 mesh request <key> pending, meaning they wait for a published pair. Before this change they stopped at the root-profile and sampler-heap refusals described above.ExecuteIndirectin this run window, so no title draw was attempted through them..m86requests. A title draw through this path needs a hand-published pair, and that pair has to pass the window and constants-only proofs.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-30T15:49:33Z.
#3599 and #3606 are now on
main. The current #3603 head still conflicts withmainafter the #3599 squash. Please refresh the branch as planned and retainruntime_mesh86_cache_cli_checkandstartup_indirect_mesh_cache_heap_warpin theprpreset when adding the wide-window case. That will let us review only the new root-binding change and rerun all three slot 86 checks together.Imported from R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-11-30T15:56:45Z.
Refreshed on
main(f50b85c5), head is now1e556216. The second commit widens theprfilter tostartup_indirect_mesh_cache_heap(_wide)?_warpand keepsruntime_mesh86_cache_cli_check, soctest --preset pr -Nlists all three slot 86 checks. 25/25 slot 86 tests pass locally, CI is running.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-30T15:57:29Z.
Review: CHANGES_REQUESTED
Two gaps remain in the proof that lets ExecuteIndirect leave nonconstant root parameters unset.
root_constant_registers()drops shader visibility. I compiled a valid root with mesh-only root constants atb0and a pixel-only CBV table also atb0. For a PS that readscb0,prove_constants_only()accepted the actual DXC dump ({(0, 0)}), although the PS binding resolves to the table that the runtime leaves unset. D3D12 allows overlapping register namespaces for disjoint shader visibility. Please check each dump against the constants visible to that stage, or restrict the proof toSHADER_VISIBILITY_ALL. Add a control for this split binding. https://learn.microsoft.com/en-us/windows/win32/direct3d12/creating-a-root-signature#shader-visibilityA wide root still accepts the same profile 3 marker that #3599 could publish before it checked ordinary bindings. Its hash fields identify the blobs but do not distinguish whether the new proof ran. Please require a new proof marker version or flag before using the widened runtime path. A legacy marker for a wide root should remain refused until republished; an existing narrow profile can retain its old behavior.
Imported from R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-11-30T16:07:35Z.
Both fixed in
0a0dc40b.root_constant_registers()now keeps each parameter's visibility, andprove_constants_only()checks each stage's cbuffers against constants withALLor that stage's visibility (MS 7, PS 5). Controls: the CLI check has mesh-only constants atb0with a pixel-only CBV table atb0(refused), plus the reverse with pixel-visible constants (accepted).run_heapalso runs the proof on the fixture's real DXC pixel dump (cb0):ALLand pixel visibility pass, mesh-only is refused.constants-only. A wide heap root (0x800, or any parameter other than constants) requires it and refuses an older marker withwide heap root requires a constants-only heap-buffer window. A root of constants only still accepts the older marker.heap_widechecks the refusal, and the narrowheaptest draws with the older marker.Mutation check: accepting constants of any visibility fails both
runtime_mesh86_cache_cli_checkandstartup_indirect_mesh_cache_heap_warp. All 25 slot 86 tests pass on an RTX 3090 and WARP.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-30T17:13:25Z.
Review: APPROVED
Verified the two findings from my earlier review on this revision. The publisher now checks root-constant visibility against each actual shader stage, and wide roots require the new proof marker while narrow legacy caches still draw. Local Windows Debug: 5/5 via
ctest --preset pr --no-tests=error --output-on-failure -j 1 -R '^(runtime_mesh86_cache_cli_check|startup_indirect_mesh_cache_heap_(wide_)?(warp|hardware))$'. A separate source-built DXC split-visibility fixture was refused for the pixel stage and accepted by the pixel-visible positive control.