Repository navigation
Conversation
e741dfc to
664d738
Compare
664d738 to
fd2cadf
Compare
fd2cadf to
1e5b298
Compare
|
Review (head 1e5b298, diff read, not a merge-check;
Fine: in the split form a wave past the declared threads now gets an empty EXEC instead of wrapping to all lanes, and the other forms ballot AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
No open or merged PR makes the same change: AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Keep v5 ranges disjoint across every launched wave, including programs whose output extents exceed declared threads. Add CPU tests for the output-extent and wave-rounding cases. Checked: xcl-dev#3350 review 7306364917, xcl-dev#3327 interaction, REPO-TRACKER.md and search-two-pass-lanes.md.
|
@Foniass Thanks for the careful review. In d22887e, v5's group stride now uses the same whole-wave launch extent as the two-pass launch. The stride stays broad: guest code can widen EXEC after entry, so lanes beyond the declared thread count may still execute and need a disjoint v5 range; we don't have a complete proof that a program never widens EXEC. The tests cover output extents larger than the declared thread count (including the group-1 boundary that previously aliased slots 126–127) and rounding a 65-thread group to full waves for both wave sizes. The focused tests passed. The completed workspace suite set The smoke pair for this head is still pending. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
|
Follow-up review (head d22887e, since 1e5b298, diff read, not a merge-check):
New:
Fine: the stride and the launch now agree on both backends; EXEC at entry still covers only the declared threads; a group whose launch equals its threads keeps the constant EXEC and the old stride; the smoke blocks name the current head. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
Launch enough whole console waves to cover max(threads, max_vertices, max_primitives), keep EXEC at entry limited to the declared threads, and use the launched width as v5's per-group step in both backends. Compute programs are unchanged. Update mesh shader surveys and barrier fixtures to use the launched width. Add CPU coverage for output extents and wave rounding, plus a two-group GPU draw that checks the v5 step and matching records and pixels from HLSL and direct DXIL. Checked: xcl-dev#3350 review 7325409956, xcl-dev#3011 C54, and xcl-dev#3327 interaction.
d22887e to
a3f07fa
Compare
|
Follow-up review (head a3f07fa, since d22887e, diff read, not a merge-check; checks red):
New:
Fine: stride and launch agree on both backends, EXEC at entry is still the declared threads, and the runtime code in AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
@Foniass thanks for the review. Fixed in one commit, The CPU tests cover output extents and wave rounding. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
Launch enough whole console waves to cover max(threads, max_vertices, max_primitives), keep EXEC at entry limited to the declared threads, and use the launched width as v5's per-group step in both backends. Compute programs are unchanged. Update mesh shader surveys and barrier fixtures to use the launched width. Add CPU coverage for output extents and wave rounding, plus a two-group GPU draw that checks the v5 step and matching records and pixels from HLSL and direct DXIL. Checked: xcl-dev#3350 review 7325409956, xcl-dev#3011 C54, and xcl-dev#3327 interaction.
a3f07fa to
572f7ea
Compare
|
Correction: On the RTX 3090, both focused mesh filters pass (stride 2/2; two-pass 1/1). The workspace suite is 2,880 passed, 6 failed, 51 ignored, with the same six failures as main. A smoke pair for AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
|
Follow-up review (head 572f7ea, since a3f07fa, diff read, not a merge-check; checks red):
New: none. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
merge-check
This replaces the |
|
@KDenKC merge-check above: the code and tests check out here, but the PR has no |
|
@fromthemoonx thanks for the merge-check. The AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
bmjask
left a comment
There was a problem hiding this comment.
Review of 572f7eab: 3 finding(s). 2 are inline. These are on lines outside the diff:
crates/xcl/src/gpu/recomp/emit.rs:1372: Not certain about this one: the newly launched waves (EXEC=0 at entry) now run the whole program, including GS_ALLOC_REQ's unconditional if (lane_id == 0u) res.Store(xcl_rec...). For threads=64, max_vertices=128 on wave64, wave 1 has no active lanes and computes M0 from wave-dependent or uninitialized state, then races wave 0 to store the record's vertex/primitive header. A wrong nv/np makes the pass-through drop or garble triangles. The Direct DXIL lowering has the same exposure, and the HLSL mesh entry has no if ((exec_lo|exec_hi)==0u) return; like the compute path.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| sgpr.insert(3, s3); | ||
| sgpr.insert(VAR_SCC, zero); | ||
| let (lo, hi) = entry_exec(lw, ms.threads, tid); | ||
| let (lo, hi) = mesh_entry_exec(lw, ms.threads, launched, tid); |
There was a problem hiding this comment.
Not certain about this one, because it depends on unverified hardware behaviour: the entry EXEC is still limited to the declared ms.threads. On the console a group launched with launch_threads lanes probably starts with EXEC covering every launched lane, with the guest compiler guarding API threads itself. If so, a mesh program declaring 32 threads with max_vertices=64 that exports from lanes 32..63 without its own s_mov_b64 exec, -1 still starts those lanes inactive in both backends (here and emit.rs:5401 xcl_slot < threads). The vertex exports are dropped, which is the #3011 symptom. The PR says it didn't check whether retail programs widen EXEC, and the only positive test widens it explicitly.
| /// The console's v5 per group: each group gets a disjoint range covering every launched | ||
| /// lane. Output extents can exceed declared threads, and guest code can widen EXEC later, | ||
| /// so this applies to every program, not only ones whose translation proves EXEC widening. | ||
| pub fn group_stride(&self, wave64: bool) -> u32 { |
There was a problem hiding this comment.
Not certain about this one, because it depends on unverified hardware behaviour: group_stride changes v5's per-group step from the declared threads to the rounded launch width for every mesh program where they differ, including ones that worked before. A wave64 program with threads=64, max_vertices=128 that decodes its group as v5 >> 6 used to see group 1 at v5=64, but now sees v5=128 and decodes it as group 2, reading the wrong per-group data. A 32-thread wave64 program now steps by 64 instead of 32. The test fixture decodes v5 >> 7, which matches the new assumption by construction, so it doesn't confirm the console behaves this way.
Launch enough whole console waves to cover max(threads, max_vertices, max_primitives), keep EXEC at entry limited to the declared threads, and use the launched width as v5's per-group step in both backends. Compute programs are unchanged. Update mesh shader surveys and barrier fixtures to use the launched width. Add CPU coverage for output extents and wave rounding, plus a two-group GPU draw that checks the v5 step and matching records and pixels from HLSL and direct DXIL. Checked: xcl-dev#3350 review 7325409956, xcl-dev#3011 C54, and xcl-dev#3327 interaction.
Checked: xcl-dev#3350 review 6143189220 and the existing two-pass mesh test path before adjusting the regression fixture. The test now has wave 0 write the expected header and gives the empty wave a distinct M0 value, so an overwrite is observable without relying on a seeded output buffer.
572f7ea to
2ed87b0
Compare
|
@bmjask thanks for the review. The fixes are pushed: head
Raw census evidence: The performance cost of launching the additional waves has not been measured. The smoke pair in the description is for Current-main validation: all three focused filters passed on AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
|
Follow-up review (head 2ed87b0, since 572f7ea, diff read, not a merge-check; checks red):
New:
Fine: both backends apply the same gate (console lane 0 with its EXEC bit set; AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
bmjask
left a comment
There was a problem hiding this comment.
Review of 2ed87b02: 2 finding(s).
Re-review after the new commit (2ed87b02). Still open from my earlier review: the v5 group_stride change for programs that never needed widening (recomp/mod.rs ~379; e.g. wave64 32/32/32 now steps 64, wave32 48/48/48 steps 64), which nothing has checked against console behaviour. The header race from last time is now gated on EXEC, which raises the two points below. 2 are inline.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| let b1 = self.andc(bit, 1); | ||
| let live = self.cmpc(Pred::Ne, b1, 0); | ||
| let lane0 = self.cmpc(Pred::Eq, lane, 0); | ||
| let first = self.land(lane0, live); |
There was a problem hiding this comment.
GS_ALLOC_REQ now writes the record header only if lane 0's own EXEC bit is set (direct DXIL lane0 && live, HLSL lane_id == 0u && (exec_lo & 1u) at emit.rs:1379). Before, wave 0 wrote it unconditionally, which matches s_sendmsg being a scalar instruction that ignores EXEC. If a declared-thread wave 0 narrows EXEC before s_sendmsg so lane 0 is inactive (v_cmpx / s_and_saveexec on a per-thread condition), the header store is skipped. nv/np stay 0 or stale, and the passthrough drops the meshlet's triangles in programs that worked before.
| let m0 = self.sreg(124); | ||
| self.line(&format!( | ||
| "if (lane_id == 0u) {{ res.Store(xcl_rec * 4u, {m0} & 0x3FFu); res.Store(xcl_rec * 4u + 4u, ({m0} >> 12) & 0x7FFu); }}" | ||
| "if (lane_id == 0u && (exec_lo & 1u) != 0u) {{ res.Store(xcl_rec * 4u, {m0} & 0x3FFu); res.Store(xcl_rec * 4u + 4u, ({m0} >> 12) & 0x7FFu); }}" |
There was a problem hiding this comment.
Gating on EXEC only holds while the extra waves keep an empty EXEC, but this PR exists for programs that widen it. A mesh program that does s_mov_b64 exec, -1 early (the case gpu_mesh_two_pass_widens_exec_past_declared_threads covers) and runs GS_ALLOC_REQ in every wave with a wave-dependent M0 has lane 0 live in the extra wave. That wave races wave 0 on the vertex/primitive counts, and the last writer wins. Gating the header on the console wave index (xcl_wave == 0 in HLSL, wave == 0 in mesh_init) handles both this and the lane-0-masked case above.
2ed87b0 to
590f06d
Compare
|
Follow-up review (head 590f06d, since 2ed87b0, diff read, not a merge-check):
New: none. The doc comment of the test (~4654-4656) still describes the old rule ("must not write the record header" from an empty wave). AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
@bmjask thanks for the follow-up. The fixes are pushed in
On the RTX 3090 VM, The existing smoke blocks remain labeled as AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
bmjask
left a comment
There was a problem hiding this comment.
Review of 590f06db: 1 finding(s).
Re-review at 590f06db. The header is now written by wave 0, which fixes the lane-0 and widening races from my last review. Still open from earlier: entry EXEC is still limited to the declared threads (kernel.rs ~1375 / emit.rs:5412). A program that saves and restores its entry EXEC (s_and_saveexec_b64 ... ; s_or_b64 exec, exec, s[0:1]) rather than setting all lanes still drops exports from lanes >= threads. The group_stride change also has no console reference (recomp/mod.rs ~379). New finding: 1 are inline.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| let lane0 = self.cmpc(Pred::Eq, lane, 0); | ||
| let wave = self.mesh.as_ref().expect("mesh").wave; | ||
| let wave0 = self.cmpc(Pred::Eq, wave, 0); | ||
| let first = self.land(lane0, wave0); |
There was a problem hiding this comment.
Not certain about this one: with the header written only by wave 0 (also emit.rs:1378), a program whose GS_ALLOC_REQ sits in a block wave 0 skips never writes it. That happens with an execz branch taken because wave 0's lanes are all done, or a capped loop that ends wave 0's lanes early in direct DXIL, which the PR notes as open. Header dwords 0/1 stay zero or hold the previous frame's counts, so the passthrough reads nv/np = 0 or stale. Before, any wave's lane 0 still wrote it. Writing it from the first wave that reaches s_sendmsg (e.g. a per-group flag) would cover both.
|
@bmjask the ISA does not state that The 327-program census log records metadata, not disassemblies. I could not map its program IDs to the local target-dump hashes, so I cannot claim a complete branch/loop scan of all 327. In the available
AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
|
@fromthemoonx the AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
|
@KDenKC thanks for the smoke pair. AI use: Claude Code (Claude Opus 5.5) ran the checks and wrote this. |
The two-pass mesh path launched only the declared thread count. A wave64 mesh program declaring 32 threads therefore had no lanes 32–63, even when its output extents required them; exports from those lanes were lost.
Both the direct-DXIL and HLSL paths launch whole console waves covering
max(threads, max_vertices, max_primitives). Entry EXEC still starts at the declared threads. The v5 group-index step uses that rounded launch width for every mesh program, including programs that do not widen EXEC (32 threads/32 outputs on wave64 use a step of 64). GS_ALLOC_REQ writes the per-group header from wave 0 regardless of EXEC: the declared wave may narrow EXEC before the send, and a later wave may widen it.Related: #3011 (C54, lost triangles), #3484 (main's failing stand-in test). This touches the HLSL mesh entry also changed by #3327; the integration branch keeps the two-pass entry's whole-wave launch and the native branch's separate entry.
What is in it
gpu/recomp/mod.rsdefines the whole-wave launch width and group stride;gpu/dxil/kernel.rs,gpu/dxil/lower.rs, andgpu/dxil/lower_mem.rsuse them for direct DXIL and wave-0 GS_ALLOC_REQ;gpu/recomp/emit.rshandles the HLSL path.gpu/recomp/tests.rs: CPU tests cover output extents and wave rounding.gpu_mesh_mode_two_passeschecks the second group's v5 step and retains the four-way split pass-through draw.gpu_mesh_alloc_req_uses_wave0_independent_of_execchecks narrowed wave 0, a widened later wave, and an unguarded negative control through HLSL and direct DXIL.gpu/dxil/robustness_tests.rs: the existing multi-wave barrier survey now uses the launched width.Tested
XCL_NETWORK=0.590f06dbf169e3fd43a4bb606d8a6417bdde7c3f:mesh_group_stride2/2,gpu_mesh_alloc_req_uses_wave0_independent_of_exec1/1, andgpu_mesh_mode_two_passes1/1 passed (no skipped tests). The wave-0 test's unguarded HLSL negative control produced[9, 3]; the guarded HLSL and direct-DXIL paths produced[5, 2].title_texturestests andtest_title_runs_and_game_folder_is_untouched, matching main1c8b5514on this VM. The suite had 28 capability skips.title_texturesfailures. The earlier intermittent suite access violation was not reproduced in the repeat suite or these isolated runs; this evidence does not attribute it to the PR.Regression run
A 600-second JIT smoke pair on RTX 5090, with held Enter and the same copied cache seed (
main-full-d8bd) plus accepted-terms profile (r18-terms) in both arms. Both reached the world; neither crashed or had a device removal. These blocks are verbatim from the run report.Main
1c8b5514:Head
590f06db:Not tested
AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR