Repository navigation
Conversation
e55a511 to
c4ee8a1
Compare
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed c4ee8a14 (own commit on top of #3710's a7d98042) by reading the diff; not built or run.
Verdict: approve. The carry now passes through skips that are exact for their guard by either route: the guard is still current, or a deeper skip carried it. At the restore it is used only when the restored mask is exactly the carried guard of the open skip, both lane and wave guard. No MUST.
- Checked, no finding:
- Why the kept register file is exact. Each skip in the chain opened right after the CMPX that narrowed its parent, and branches per thread. Its close merges every VGPR per lane, and per-lane closes clear changed SGPRs. So at the restore, each thread of the carried guard holds its own exact value. Nothing ran under a narrowed mask outside a skip.
- A chain that breaks. An inner skip that closes before its parent's end sets
carried_atto that earlierpc.lane_activethen stays narrowed at the parent's close, soguard_lanesis false and the parent passes nothing on. The restore then falls back to the existing clearing. carried_at == pc. Together withclosed_nested_skip, this keeps the carry to the restore instruction at the closingpc(gfx1013_direct_mesh.inl:1984).- Fixture encodings.
0x061414f2isv_add_f32 v10, 1.0, v10.0xbea6047e/0xbefe0426save and restores[38:39]. The exit offsets land on the restore, and the vertex skip is still open there.
- NIT
text.count('fadd') >= depth + 1counts adds anywhere in the output. Acceptance already shows thatv10survived the restore. Following the lastfaddto the export would also show that the per-lane merge feeds it.
Tests: -1 and -3 reach the restore path with one and three levels, and chain-end reaches the multi-level carry into #3710's retain. The two controls keep the write-before-EXECZ and non-CMPX narrowing refused. 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>
…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>
c4ee8a1 to
cf68344
Compare
|
Thanks @Leyukaka. I rebased the stack on current
#3760 had one conflict, where On top of the stack, AI-assisted. |
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed cf68344a by reading the diff; not built or run.
Verdict: approve. The conflict with #3765's narrowed restore is resolved fail-closed. No MUST.
- The only change compared with
c4ee8a14is the restore inlower_mesh(gfx1013_direct_mesh.inl:2315).narrowed_restorenow runs first, and the carried-lane skip only guards theelse if(:2327). - When both hold (one CMPX narrowed the guard inside the skip, and the nested skips closed here with the carried guard), the narrowed path keeps only registers unchanged since the narrowing or merged against it, and clears the rest. That can drop registers the carried path would keep, so the worst case is an extra refusal, never a wrong value. The refusal guard above it is unchanged.
- The test additions are the same as at
c4ee8a14.
Tests: native_direct_mesh (in the pr filter) is green on this head.
|
Census on the rebased stack (same capture and method as on #3703), so the merge can be prioritised:
Counts only; request bytes stay local. Not run in the game. AI-assisted. |
Stacked on #3710. The branch contains #3710's commit until it merges; the change here is the last commit (
e55a511f).Part of #3703. This is the wall right after #3729:
graphics register undefined on an incoming path.What goes wrong
Skinned mesh programs nest a chain of per-lane CMPX skips inside the vertex skip. Each one opens straight after a CMPX that narrows the skip around it, and all of them exit to one
s_mov_b64 exec, s[N:N+1]that restores the vertex mask. The vertex skip then goes on and reads the accumulated registers.A per-lane skip merges every register per lane when it closes, so after the chain closes each thread below V holds an exact value. #3710 carried that fact up one level only, and only when the parent closed at the same instruction. Here the chain is deeper and closes at a restore while the vertex skip continues. The restore then treated every register written since the mask was saved as stale, cleared it, and the next read refused.
Change
close_skippasses the carried lane set through any number of skips that close at one pc (a skip exact for its guard makes itsnarrowed_fromparent exact too).These still break the chain and refuse as before:
v_cmpthens_and_b64 exec).Tests
Source-built in
tests/native_direct_mesh_check.py:nested-skip-chain-restore-1and-3: one and three nested skips exit to a restore of the saved vertex mask, thenv10is read and written again under that mask before the export.nested-skip-chain-end: two nested skips that close where the vertex skip closes.nested-skip-chain-write-before-execzandnested-skip-chain-and-exec: the two controls above, stillundefined on an incoming path: 266.I removed each half of the fix in turn: dropping the multi-level carry fails
-3, and ignoring the carried set at the restore fails-1.Validation (Windows 11, MSVC, Windows SDK 10.0.26100)
ctest --test-dir out/build/dev -R "native_direct_mesh|mesh": 210/210 pass (the twomesh_two_exitshardware tests skip as usual).s_bitset1_b32, then stop at a scalar loop #3703, onmaine1161e43+ shader: lower s_not_b32, s_brev_b32 and s_bfe_i32 in the mesh frontend #3708 + shader: lower v_rcp_iflag_f32 and v_ashrrev_i32 in the mesh frontend #3709 + shader: keep a mesh lane limit across a nested CMPX skip that closes at the same restore (Part of #3703) #3710 + shader: lower v_cmpx_lg_f32, v_cmpx_gt_f32 and per-lane v_cmpx_gt_u32 in the mesh frontend (Part of #3703) #3729 + this: 749 of 1,569 distinct Mesh86 programs translate, up from 512. 237 gained, none lost. Counts only; request bytes stay local.AI-assisted.
🤖 Generated with Claude Code