Repository navigation
D3D-315: census of root-signature spill evidence (no below-base candidates) - #4163
Conversation
tools/root_spill_census.py counts, per stage, user-SGPR reads used as an address below the stage base (where the compute spill pointer s[0:1] was measured), the highest user SGPR read and its kind, the RSRC2 USER_SGPR budget where index.json records it, and RTS0 parts in the carved containers. --expect-no-spill turns it into a check. Counts only, from index files; no game bytes. On Xbox Series 1.0.2.1 (26,501 translated shaders, 26,503 containers): 0 RTS0 parts, 0 spill-pointer candidates in any stage, compute at most 14 user SGPRs (10 of 28 root dwords). docs/d3d12_vulkan.md records the counts; pack() keeps refusing over 32 dwords, now with the measured reason that no shader would read a spill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
whattheflop
left a comment
There was a problem hiding this comment.
AI-assisted Windows review of 6edda935, uv CPython 3.12.13, synthetic index data only. The 9 stock tests and 19 added CLI checks passed. For each default stage, a pointer at base−1 tripped the gate while pointers at base and base+1 passed. The synthetic carve check counted 2 of 3 containers with RTS0.
Please narrow the spill-policy conclusion and its cross-references. Zero classified address reads below the stage base supports “zero below-base candidates in the translated sample.” The number of runtime-created signatures that exceed the budget, and the reason for a particular pack() refusal, are still open. The section already notes that a pointer at or above the base can be indistinguishable from a table pointer. Spill policy
A partial CLI override also narrows the gate silently. A fixture with a PS address read at s7 exits 1 with defaults. Adding only --base cs=4 gives PS base: null and exit 0. Please document that --base replaces the entire stage map, or retain defaults for omitted stages. CLI
…aults docs: the census shows zero below-base spill-pointer candidates in the translated shaders, not that no signature spills. How many runtime signatures exceed the budget and why a given pack() refusal happens stay open; listed with the at-or-above-base blind spot. root_spill_census.py: --base overrides only the stages it names. Before, --base cs=4 alone dropped every other stage from the check (a PS address read at s7 passed --expect-no-spill). Tests cover that case and the base-1 / base / base+1 boundary for every default stage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @whattheflop. Both points were right; fixed in d34d165.
Re-checked: 11 tests pass, |
|
Retested d34d165 on Windows, uv CPython 3.12.13. All 11 stock tests and 22 synthetic CLI checks passed. The original PS s7 case still exits 1 with only --base cs=4, and an empty override retains all five defaults. The revised docs leave runtime signature size and the cause of pack() refusals open. Both review findings are resolved. AI-assisted. |
|
Tested
AI-assisted (Claude Code). |
Item: D3D-315 (claimed in #2516; tracked in #313).
What this does
D3D-315 asked to count how many root signatures and shaders in the corpus go over 32 user dwords and how the shaders read the overflow, then define the spill layout. This PR is the measuring half. The count finds zero below-base spill-pointer candidates in the translated shaders, so the spill layout stays unimplemented and
pack()keeps refusing.tools/root_spill_census.py(stdlib only, reads index files only, prints counts) reports per stage:ptr32_lo,ptr64_lo,ptr64_hi) below the stage base (default ps/vs/gs s8, cs s4, ms s16). For compute, that block is where section 7 measured the spill pointers[0:1];USER_SGPRbudget whereindex.jsonrecords it (compute), and the root dwords that leaves above the base;--carve <dxbc/index.json>, how many containers carry anRTS0part;--expect-no-spillexits 1 if any stage has a candidate;--base STAGE=SGPRoverrides only the stages it names; the others keep their defaults.tests/test_root_spill_census.py: 11 tests on hand-written index data, no game files.docs/d3d12_vulkan.md: the counts under "Spill policy" (section 3.5), plus pointers from theCreateRootSignatureline and the "Root signature larger than 32 dwords" open item.Counts (Xbox Series 1.0.2.1, my own copy)
26,503 carved containers, 26,501 translated shaders (the other 2 are the compute shaders refused for workgroup memory under wave64 emulation, SHADER-309):
RTS0part. The signatures are built at run time, so how many exceed 32 dwords is still open until someone dumps them from the executable.s0ands1are never read as an address. The only reads there ares1as a 32-bit constant (109 CS, 551 PS, 12 VS).USER_SGPRcount is 14 (31 of 2,687 shaders), so at most 10 of the 28 root dwords above s4 are used.What this does not settle (listed in the docs too):
pack()refusal happens:pack()counts two dwords per table from s0, which the §3.5 census disagrees with, so a refusal may be that model or a real spill;Tested
python -I tests/test_root_spill_census.py: 11 tests pass (after the review: a partial--basekeeps the other stages, and the base−1 / base / base+1 boundary for every default stage).python -I tests/test_docs_links.py: passes.python -m compileall -q tools/root_spill_census.py tests/test_root_spill_census.py: clean.python -I tools/root_spill_census.py <spirv/index.json> --carve <dxbc/index.json> --expect-no-spillon a full work folder built withmake_game.pyataa2988cc(wave64 emulation on): exit 0, with the counts above; also exit 0 with--base cs=4.AI-assisted (Claude Code). No game data in this PR: counts only, no shader names, bytes or disassembly.
🤖 Generated with Claude Code