Repository navigation
Conversation
8280898 to
e0fbad9
Compare
…estore A chain of per-lane skips, each opened straight after a CMPX that narrows the skip around it, merges every register per lane when it closes. R0Y00#3710 carried that fact from one nested skip to its parent only, and only when the parent closed at the same instruction. Skinned mesh programs nest three such skips inside the vertex skip and close all of them at a restore of the vertex mask, after which the vertex skip goes on. The restore then treated every register written since the mask was saved as stale and cleared it, so the next read refused with "graphics register undefined on an incoming path". The carried lane set now passes through any depth of skips closing at one pc, and an EXEC restore at that pc keeps the register file when the restored mask is the carried guard of the enclosing skip. The set is tied to its pc so it never describes a later instruction. A write between the innermost CMPX and its EXECZ, or a narrowing that is not a CMPX, still breaks the chain. Part of R0Y00#3703. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e0fbad9 to
a7d9804
Compare
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed a7d98042 by reading the diff; not built or run.
Verdict: approve. The carried guard is set only for a per-lane skip opened right after a CMPX that narrowed the parent's guard (mask_parent). It is used only when both skips close at the same pc, and only through the existing retain conditions. So every read after the restore still needs #3671's lane-range proof. No MUST.
- NIT The
carried_lane.clear()in the forward-arrival block (gfx1013_direct_mesh.inl:763) never runs whilecarried_laneis set. Arrivals atpcare merged, andforward.at(pc)erased, before the firstclose_skip().return truethen re-enters the loop with nothing left to arrive, andmerge_edgesadds no forward edges. The EXEC-definition refusal andretain'sforward.empty()are what actually guard this, so the line could go. - NIT The description lists a whole-wave nested skip (
wave_activeset) as not carried, but no case pins it. Adding one besidenested-skip-and-execwould cover thewave_active.empty()test at:1378. - Checked, no finding:
- Nested skips that end at the same restore. The middle skip cannot retain (
skip_parentsnot empty). Its ownnarrowed_fromis passed on only if its guard is stilllane_activeafter the merge, so the outer skip is otherwise not tagged and the read is refused. last_end == pc. This requires the CMPX to fall through directly into the EXECZ. Instructions that leave the loop throughcontinuedon't updatelast_name, which fails closed.- Fixture encodings.
0x7da40080isv_cmpx_eq_u32 0, v0, and0x7da80017isv_cmpx_gt_u32 s23, v0.0x7d840080, 0x87fe6a7eisv_cmp_eq_u32thens_and_b64 exec, exec, vcc.0xf2/0xf4/0xf6are 1.0/2.0/4.0, and the EXECZ offsets land on the restore.
- Nested skips that end at the same restore. The middle skip cannot retain (
Tests: the two positives reach storeVertexOutput with both constants, through exec = -1 and through the saved-EXEC restore. The two refusal cases pin the write-before-EXECZ and non-CMPX narrowing exclusions. nested-skip-full-exec keeps the count guard required. native_direct_mesh is in the pr preset filter, and CI ran it green at this head.
…at the same restore The R0Y00#3671 lane-limit proof tags partial VGPRs with the vertex skip's lane count when the skip closes, so an export under the same count may read them after full EXEC returns. It required the closing skip's guard to be the current lane mask. When a nested CMPX skip inside the vertex skip exits to the same EXEC restore, the nested mask is still current at the outer close, so the proof was skipped and the restore erased the position VGPRs ("graphics register undefined on an incoming path"). A nested per-lane skip now records the parent guard when it opens directly after a single CMPX that narrowed it. Nothing ran under the narrowed mask outside that skip, and the skip branches per thread, so after it closes every register is exact for each of the parent's lanes. If the parent then closes at the same instruction, its lane limit applies as before. Any other narrowing, a write between the CMPX and the EXECZ, or another path arriving at the restore keeps the previous behavior. Part of R0Y00#3703 (item 6). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a7d9804 to
756647a
Compare
…estore A chain of per-lane skips, each opened straight after a CMPX that narrows the skip around it, merges every register per lane when it closes. R0Y00#3710 carried that fact from one nested skip to its parent only, and only when the parent closed at the same instruction. Skinned mesh programs nest three such skips inside the vertex skip and close all of them at a restore of the vertex mask, after which the vertex skip goes on. The restore then treated every register written since the mask was saved as stale and cleared it, so the next read refused with "graphics register undefined on an incoming path". The carried lane set now passes through any depth of skips closing at one pc, and an EXEC restore at that pc keeps the register file when the restored mask is the carried guard of the enclosing skip. The set is tied to its pc so it never describes a later instruction. A write between the innermost CMPX and its EXECZ, or a narrowing that is not a CMPX, still breaks the chain. Part of R0Y00#3703. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed 756647ae by reading the diff; not built or run.
Verdict: approve. This is a rebase onto f365f125. The PR's own change is identical to a7d98042, which I approved. No MUST.
- I compared
a7d98042with756647aeusinggit range-diff. Only context lines from main changed (saveexec_vcc_testsbranch, theskip-narrow-inner-savetest line); the source and test hunks of the PR itself did not. - The earlier NITs still apply and do not block: the dead
carried_lane.clear(), and no whole-wave nested-skip control.
Tests: native_direct_mesh (in the pr filter) is green on this head.
Part of #3703 (item 6). Refs #3641, #3671.
Problem
Many slot 86 mesh programs compute their position in a vertex skip with a nested CMPX skip inside it, and both skips exit to the same EXEC restore:
#3671 lets an export read VGPRs written under a vertex skip when the read is under the same lane count. When the skip closes, it tags the VGPRs with the skip's lane limit (
close_skip,retain). That requires the closing skip's guard to be the current lane mask. Here the nested skip closes first at R and leaves its narrowed mask current. So the outer skip was never tagged, and the restore erased v1–v4.Change
src/gfx1013_direct_mesh.inl:mask_parent), the skip records the parent guard (Skip::narrowed_from).retainin place ofguard == lane_active. The tag, the restore andcheck_graphics_readare unchanged from shader: prove mesh VGPRs written under a lane count stay in range at the count export (Part of #2413) #3671, so every later read must still be under a proven bound of the same count.Census
Capture. A native Mesh86 run on
main1c634037, withX2W_REFUSE_FIXED_MESH=1andX2W_NATIVE_MESH86=1: 1,569 distinct.m86requests. Each went throughcompile_dxil … gfx1013-container-ms-texture-heap. Counts only; request bytes stay local.undefined on an incoming pathfirstmain(+ #3706, which changes none of these counts)main+ #3706 + #3708 + #3709No program that translated before is refused now. Program by program, 32 go from refused to translated, and none go the other way.
Tests
tests/native_direct_mesh_check.py, built like #3671'sbounded-export:v_cmpx_eq_u32 0, v0skip sets v10 = 2.0, both exit to the same restore, and the export runs under the count guard.nested-skip-export: restore withexec = -1.nested-skip-saved-exec: restore withs_mov_b64 exec, s[36:37]saved before the skip, as in the title.storeVertexOutputwith both constants.nested-skip-write-before-execz(av_movbetween the nested CMPX and its EXECZ) andnested-skip-and-exec(narrowing byv_cmp+s_and_b64 exec): both still stop atgraphics register undefined on an incoming path: 266.nested-skip-full-exec(export without the count guard):mesh register read outside its proven lane range: 266.nested-skip-exportwithundefined on an incoming path: 266.ctest -R "native_|mesh|gfx1013" -E "hardware|_warp": 786/788 pass. The same two local-only failures as in shader: lower s_not_b32, s_brev_b32 and s_bfe_i32 in the mesh frontend #3708: the SDK validator here supports DXIL 1.7, and those tests emit 1.8.Environment: Windows 11 build 26300, RTX 3090, MSVC 14.44, DXC from SDK 10.0.26100.
AI-assisted.
🤖 Generated with Claude Code