Repository navigation
vs_layout_census: confirm the VS input layout is legacy non-NGG per PAL hardware stage; measure the 195 ES variants - #6558
Conversation
…easure the 195 ES variants scripts/vs_layout_census.py joins every tag-0x0D payload's PAL stage record (tools/pal_stages.py) with its code markers over the whole carve index, plus the entry VGPRs read before written for API-VS payloads. Over 1.0.2.1 (26,503 containers, 26,698 payloads): all 2,236 stage-4 VS payloads are legacy non-NGG (no exp prim / s_sendmsg / v_mbcnt, all export pos0+param), so v0 = VertexIndex (zero-based) is confirmed, not NGG; the 9,282 stage-7 payloads are the NGG/mesh ones. The 195 stage-2 payloads are the ES variants of the two-payload $VS_VoxelizeGeneric containers (no exp, LDS writes, v_mbcnt, entry VGPRs v5/v9-v11/v13-v14), which fssm_unpack's last-payload default leaves untranslated. docs/design.md gains the two contract rows and a PAL-stage cross-reference; docs/fssm_crosscheck.md records the measured hardware-stage split for the two-payload selection unknown.
shayderrr
left a comment
There was a problem hiding this comment.
Summary
Adds scripts/vs_layout_census.py, which joins each tag-0x0D payload's PAL stage record (pal_stages.stage_descriptors) with code markers and VS entry VGPRs across the 26,698 payloads, disassembling unlisted payloads via shader_disasm. It confirms all 2,236 stage-4 VS are legacy non-NGG, stage-7 payloads carry NGG markers, and the 195 stage-2 ES payloads (in $VS_VoxelizeGeneric_* containers) have no exp, reading v5, v9–v11, v13–v14. docs/design.md and docs/fssm_crosscheck.md record the measurement; tests/test_vs_layout_census.py builds synthetic containers.
Why merge
This turns the PAL stage-id mapping from an outside project's claim into a code-verified result, and documents which of the two VS payloads fssm_unpack actually translates.
Verdict: Approve
SummaryAdds Why mergeThis turns the PAL stage-id mapping from an outside project's claim into a code-verified result, and documents which of the two VS payloads Verdict: Approve |
Claimed in the coordination issue as: #6214 (comment) (README bullet: "the vertex-shader input layout (
v0=VertexIndexis unverified if the console runs VS as NGG)")Depends on: none — builds on merged #4347 (
tools/pal_stages.py) and #436 (scripts/vs_input_survey.py); no open PR touches these files. The README bullet itself is edited by #4118 (README only, no overlap).What and why
The README bullet asks whether the console runs the vertex shader as NGG (which would put the VS inputs at
v5/v8and makev0=VertexIndexwrong). This PR answers it with a census over every tag-0x0D payload of the 1.0.2.1 corpus, joined with the PAL hardware-stage record of each payload:scripts/vs_layout_census.py(new): for each container's payloads, reads the PAL stage record (tools/pal_stages.py), the carve-index stage, the code markers (NGGexp prim/s_sendmsg MSG_GS_ALLOC_REQ/v_mbcnt,exp pos0/param, the fetch call) and, for API-VS payloads, the entry VGPRs read before written (scripts/vs_input_survey.read_before_write). The.slisting covers each container's last payload (the onefssm_unpack.pytranslates); unlisted payloads are disassembled with llvm-mc. Counts only,--jsonfor the full table.tests/test_vs_layout_census.py(new): 5 tests on hand-built DXBC/FSSM containers (synthetic bytes only).docs/design.md: two contract rows (VS input layout, per PAL hardware stage, VS as ES (two-payload VS containers)) and a cross-reference in PAL stage descriptors.docs/fssm_crosscheck.md: the two-payload selection unknown now records the measured hardware-stage split.Corpus counts (1.0.2.1, 26,503 containers / 26,698 payloads)
exp prim, nos_sendmsg, nov_mbcnt), every one exportspos0andparam. Sov0=VertexIndex(zero-based,DrawParameters) is confirmed, not NGG.s_sendmsg MSG_GS_OP_*+v_mbcnt, no position export.$VS_VoxelizeGenericcontainers: noexp(vertex outputs go to LDS for the GS),v_mbcntlane id, entry read-before-write VGPRsv5,v9–v11,v13–v14(neverv0/v3), no fetch call.fssm_unpack.pydefaults to the last payload, so the ES variant is untranslated; which payload a GS-bound pipeline selects is still open.v_mbcntin 332 / 266,s_sendmsgin 10 PS, noexp prim.Tested
Commit
b68703ac0(rebased on origin/main1cc6e3c12). No translator change, so there is no translate/spirv-val before-and-after: this is a static count over the carved corpus.Full-corpus census (CPU only, 735 s):
python -I scripts/vs_layout_census.py <work>/shaders/dxbc --json vs_layout_census.json: 26,503 containers, 26,698 payloads, 0 without a PAL record, 0 API-stage mismatches, 195 unlisted payloads disassembled. As a cross-check, a separate scan of the 26,503 listings fors_sendmsgfound it only in hardware stages 3 (195), 5 (10) and 7 (9,282), the same as the census.Windows 11 (10.0.26200), Python 3.12.10, CPU only: no GPU or driver involved.
AI-assisted: yes (omp orchestrator).
Checklist
docs/design.md, with how it was confirmed.