Recompiler: two-pass mesh groups run in whole console waves #3350
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3350"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T09:58:20Z.
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
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:12:24Z.
Review (head
1e5b2981, diff read, not a merge-check;PR descriptionred: its smoke blocks and counts namefd2cadf7, not this head):group_stride(gpu/recomp/mod.rs~380) makes v5group × max(threads, vertices, primitives) + slotfor every program with more vertices or primitives than threads, whether or not it widens EXEC; on main it isgroup × threads + slot. It is used atgpu/dxil/kernel.rs~1320 andemit.rs~5408. The new test draws one group, so the group number is 0 and the stride never shows. All existing mesh GPU tests have at least as many threads as vertices and primitives.launch_threads). With 32 threads, 64 vertices and 126 primitives on wave64, 128 lanes launch with a stride of 126, so lanes 126-127 of group 0 get the same v5 as lanes 0-1 of group 1. Whether the console's v5 counts the launched lanes or the max is the question, and a two-group test would settle it.@xcl_bar). The PR's 600 s pair never reached the world, so nothing measured it.compute_initnow emitstid < totalwhere it used a constanttrue, so compute shaders change too and recompile once.shaders.rs~603 (the survey) and the test helper attests.rs~11678 still usems.threads(diagnostics only).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
slot < threads. Lanes past the record are still blocked by the vertex and primitive bounds checks. Barrier wave counts follow the launched threads on both backends. The group count is unchanged and the launch is capped at 1024.mod.rsandemit.rsare inTRANSLATOR_SOURCES, so no stale DXIL is served. The tests skip throughgpu_ready()/mesh_ready()and check both backends' pixels. It will conflict with #3327 (yours) in the HLSL mesh entry.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:50:30Z.
Triage (#1607) – head
d22887eNo open or merged PR makes the same change:
launch_threads/group_strideare not on main. #3504, #3052 and #2092 touch other parts of the two-pass mesh path, not the group launch width or entry EXEC. Both backends now launch whole console waves covering max(threads, max_vertices, max_primitives), with EXEC at entry limited to the declared threads, and the GPU test draws through both backends. Note that v5's per-group step is nowgroup_stride(wave64), the launch width (max(threads, max_vertices, max_primitives) rounded up to whole waves), for every two-pass mesh program. So it also changes fromthreadsfor programs whose thread count is not a multiple of the wave size, not only for those with more vertices or primitives than threads. The regression run does not show whether the title depends on that.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T12:11:47Z.
@Foniass Thanks for the careful review. In
d22887ec, 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
XCL_NETWORK=0for the test processes and had no binaries without results. Its six failures match the VM's known baseline failures: D16 resinfo, placed title textures, the three stream-recheck cases, and the title-folder e2e check.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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T20:52:43Z.
Follow-up review (head
d22887ec, since1e5b298, diff read, not a merge-check):d22887ecnow sets the stride on purpose (group_stride=launch_threads,mod.rs~379) and adds CPU tests of that function (tests.rs~11-27), but the third assert there only repeats the first (128 >> 7 is 1), and no test draws a second group, so neither backend's emitted v5 step is checked (kernel.rs~1320,emit.rs~5408). The description still does not say v5's step also changes for programs that never widen EXEC (32 threads with 32 vertices on wave64 now get a stride of 64, not 32).@xcl_barfor programs whose launch exceeds their threads are not measured.compute_initemitstid < totalinstead of a constanttrue(kernel.rs~1201, compute DXIL recompiles once);ms.threadsstays in the survey and test helper (shaders.rs~603,tests.rs~11673); two blank lines after the new GPU test (tests.rs~4514).New:
d22887ecrewritesgroup_stride, which1e5b2981added, so the two are one change; its body points to files not in the repository (REPO-TRACKER.md,search-two-pass-lanes.md), and the description still says "one commit" and does not list the new CPU tests.d22887eclists 6 failures (gpu_direct_image_get_resinfo_d16,placed_title_textures_share_vram_and_preserve_pixels, threestream_recheck_*,test_title_runs_and_game_folder_is_untouched) without saying whether they also fail onmain.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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T22:12:57Z.
Follow-up review (head
a3f07fa4, sinced22887ec, diff read, not a merge-check; checks red):tests.rs~21-23 checks that 32 threads with 32 vertices get a stride of 64 on wave64, andgpu_mesh_mode_two_passes(~4363, ~4412-4420, ~4445-4447) now draws two groups with a launch of 128 and an extent of 126 on both backends, so a wrong step would show in group 1. The description still does not say v5's step also changes for programs that never widen EXEC.shaders.rs~603) and the barrier-test helper (tests.rs~11703) uselaunch_threadsand the blank lines are gone;compute_initstill emitstid < totalinstead oftrue(kernel.rs~1201, ~1368).gpu_mesh_two_pass_widens_exec_past_declared_threads.New:
gpu_mesh_mode_two_passeswent from 128/128/128 to 32/64/126 (tests.rs~4363), sopassthrough_splitnow returns 1 and the assert changed from 4 to 1 (~4480-4486).mesh_draw_splithas no other test caller, so no GPU test draws a record split over several mesh groups any more, thoughpso.rs~1436 still takes that path. The split check needs its ownMsInterfacewith 128 vertices.stride_msblock repeats the first draw.MsInterface { threads: 32, max_vertices: 64, max_primitives: 126, ..ms.clone() }(~4452) is the same asms, so that block repeats the draws above.d22887ec, whilea3f07fa4changesshaders.rsand rewrites the GPU test;PR descriptionfails on that.Fine: stride and launch agree on both backends, EXEC at entry is still the declared threads, and the runtime code in
kernel.rs,emit.rsandmod.rsis unchanged sinced22887ec.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T22:14:15Z.
@Foniass thanks for the review. Fixed in one commit,
a3f07fa4. The v5 step now uses the whole-wave launch width for every mesh program: on wave64, 32 declared threads with 32 outputs use a stride of 64; output extents that require more lanes are rounded up to whole waves. This avoids lane 126/127 aliasing the next group's first lanes when the launch width is 128.The CPU tests cover output extents and wave rounding.
gpu_mesh_mode_two_passesdraws two groups and checks records and pixels through both HLSL and direct DXIL. On the RTX 3090, the focused filters passed (stride 2/2; two-pass 1/1). The workspace suite was 2,880 passed, 6 failed, 51 ignored; the same six failed on main: D16 resinfo, placed title textures, three stream-recheck tests, and the title-folder test. The placed-title test passes alone on main but fails in the suite. Cost of the extra launched lanes and multi-wave barrier work remains unmeasured. A smoke pair for this updated head is 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.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T22:30:49Z.
Correction:
a3f07fa4also changed partial compute DXIL through the sharedentry_exec, despite the description saying compute was unchanged. In572f7eab, mesh EXEC handling is separate and the compute helper is restored to its previous behavior. The survey and test helper now use the launched mesh width; the redundant blank lines are removed.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
572f7eabis 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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T22:30:56Z.
Follow-up review (head
572f7eab, sincea3f07fa4, diff read, not a merge-check; checks red):compute_initemitstid < totalinstead oftrue: fixed. Compute keepsmain'sentry_execexactly (constant mask on a full wave, the split-wave mask, orballot(true)), and the declared-threads ballot is now only in the newmesh_entry_exec(gpu/dxil/kernel.rs~1333-1413), so compute DXIL no longer changes.stride_msblock repeats the first draw: still open.tests.rsis unchanged sincea3f07fa4, sopassthrough_splitstill returns 1 for the shared 32/64/126 fixture (~4363, ~4480) and no GPU test draws a record split over several mesh groups.d22887ec, two pushes back; the description still says "One commit" without the CPU tests or the fixture change, and does not say that v5's step also changes for programs that never widen EXEC.New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-02T01:00:25Z.
merge-check
base:
d71578f857head:
590f06dbf1merge: conflicts (
crates/xcl/src/gpu/dxil/kernel.rs, theEntry::Mesharm, sinceb0b44546landed on main)build: cargo build --workspace -> not run on this base (conflict); ok merged onto
df0cfef6tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run on this base; merged onto
df0cfef638306f325b208e5adae18d35ab4bf4ed, the main of an hour earlier: 2915 passed, 0 failed, 51 ignored (that base: 2911 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as that base; failing: nonereview: read the whole diff (8 files, +284 -36). The code had no blocking problem on the older base; the conflict is what is open.
ms.threadsis a multiple of 64 (and is 64 if it uses LDS). With this PR the group haslaunchedthreads, so that condition probably has to testlaunched: 64 declared threads with 128 outputs launch two waves. This is from reading, not from a run.572f7eabmissed the header race bmjask found. It is fixed here: both backends store theGS_ALLOC_REQheader from lane 0 of wave 0 only, whatever EXEC is.mesh_group_stridetests withXCL_REQUIRE_GPU=meshon this wave32 GPU passed 3 of 3 runs, none skipped. Without the wave-0 guard, or with every launched lane active at entry (direct DXIL), the tests aimed at them fail.GS_ALLOC_REQ(bmjask's open points). By the author's census, all 327 title mesh programs seen are 128/128/128, where the v5 step is unchanged, so the smoke pair does not exercise the new step.gpu_mesh_alloc_req_uses_wave0_independent_of_execstill describes the older empty-EXEC rule.performance: extra idle lanes only for programs whose declared threads are below their launch width; not measured. No title was run here.
verdict: not yet: conflicts with main
d71578f8; needs a rebase, then the suite and the smoke run on the new headhardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
This replaces the
safe to mergeI posted here at 13:05 UTC, before main moved.Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-02T01:07:14Z.
@KDenKC merge-check above: the code and tests check out here, but the PR has no
xcl-smokepair on its head572f7eab(and none on main), which the PR description check also asks for; for a change to every two-pass mesh program's v5 that run is the missing evidence: https://github.com/xcl-dev/xcl/pull/3350#issuecomment-7331207029Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T01:08:49Z.
@fromthemoonx thanks for the merge-check. The
xcl-smokepair (main1c8b5514and this head572f7eab) is queued on our RTX 5090, next after the run in progress; the blocks go into the description when it's done.AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:22:20Z.
Review: COMMENTED
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 unconditionalif (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 noif ((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.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:22:20Z.
Code review location:
crates/xcl/src/gpu/dxil/kernel.rs; line 1317Not 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 withlaunch_threadslanes 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 owns_mov_b64 exec, -1still starts those lanes inactive in both backends (here and emit.rs:5401xcl_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.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:22:20Z.
Code review location:
crates/xcl/src/gpu/recomp/mod.rs; line 379Not certain about this one, because it depends on unverified hardware behaviour:
group_stridechanges 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.Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T03:20:22Z.
@bmjask thanks for the review. The fixes are pushed: head
2ed87b02, rebased onmain1c8b5514.[5, 2], while the additional empty wave has a distinct[9, 3]allocation request. An unconditional store by that empty wave would change the recorded header. The final fixture skips the whole literal instruction. On the RTX 3090 VM,cargo test -p xcl --lib -- gpu_mesh_ignores_alloc_req_from_empty_wave --nocapture --test-threads=1passed 1/1, with no skip. (Run onc5ed6994, the same change before the rebase.)We keep the entry mask tied to the declared thread count in both generated HLSL and direct DXIL (
emit.rsmesh entry;kernel.rs::mesh_entry_exec). Extra launched lanes can contribute only when guest code explicitly widens EXEC. The captured corpus does not contain the proposed smaller-thread/larger-output shape, so it cannot independently confirm that edge case's hardware behavior.Group stride covers the whole launched wave range (
MsInterface::group_stride), preventing adjacent groups from reusing v5 values when output extents exceed the declared threads. The two CPU tests cover output extents and whole-wave rounding; the two-pass GPU test checks multiple groups through both backends. I counted 327 unique program hashes in the push-5 mesh-census lines; every one has wave64, 128 threads, 128 max vertices, 128 max primitives, and reads v5. Thus the changed formula still gives the observed title programs a stride of 128. No captured title program exercises a changed stride; broader hardware semantics remain unmeasured.Raw census evidence:
The performance cost of launching the additional waves has not been measured. The smoke pair in the description is for
572f7eab; a new pair for2ed87b02follows when our RTX 5090 is free.Current-main validation: all three focused filters passed on
2ed87b02. The first four-thread workspace suite's lib test process crashed with0xc0000005; the second suite completed with the same five failures as main. Two isolated four-thread lib runs, on the head and onmain, both completed without a crash, with the same fourtitle_texturesfailures; over full suites the head's lib process crashed once in three runs andmain's in none of two, so the intermittent access violation is not attributable from this evidence.AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T03:25:26Z.
Follow-up review (head
2ed87b02, since572f7eab, diff read, not a merge-check; checks red):compute_initemitstid < totalinstead oftrue: still fixed;eed11c09is572f7eabrebased unchanged.stride_msblock repeats the first draw: still open (tests.rs~4614-4648 unchanged).572f7eab, the new test has no reported run, and "One commit" is now wrong;PR descriptionis red for the missing block on2ed87b02.New:
gpu_mesh_ignores_alloc_req_from_empty_wave(tests.rs~4656-4697), lane 0 of wave 0 and lane 0 of wave 1 both store the header dwords with nothing ordering them, so without the EXEC gate the test still reads[5, 2]whenever wave 0's store lands last.2ed87b02fixes a defecteed11c09adds; it should be squashed into it. Onmaina mesh group launches only its declared threads, so no wave starts with an empty EXEC; the extra whole waves come fromeed11c09(launch_threads,mod.rs~367-374;xcl_slot < threads,emit.rs~5413). At that commit alone an empty wave'sGS_ALLOC_REQcan overwrite the header, so the first commit does not stand on its own.runner.rs~1305-1348 movesmesh_draw_split's body into a newmesh_draw_split_implwith no behaviour change, andmesh_sendmsg(lower_mem.rs~2656-2665) rebuilds this lane's EXEC bit by hand instead of usingself.act()(lower.rs~940), which also honoursguard_override.Fine: both backends apply the same gate (console lane 0 with its EXEC bit set;
exec_lo & 1uin HLSL), and the fixture's wave-indexS_BFEofs3matches thexcl_wave << 24the mesh entry writes.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T03:43:26Z.
Review: COMMENTED
Review of
2ed87b02: 2 finding(s).Re-review after the new commit (
2ed87b02). Still open from my earlier review: the v5group_stridechange 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.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T03:43:26Z.
Code review location:
crates/xcl/src/gpu/dxil/lower_mem.rs; line 2665GS_ALLOC_REQ now writes the record header only if lane 0's own EXEC bit is set (direct DXIL
lane0 && live, HLSLlane_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.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T03:43:26Z.
Code review location:
crates/xcl/src/gpu/recomp/emit.rs; line 1379Gating 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, -1early (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 == 0in HLSL,wave == 0in mesh_init) handles both this and the lane-0-masked case above.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T04:02:38Z.
Follow-up review (head
590f06db, since2ed87b02, diff read, not a merge-check):gpu_mesh_alloc_req_uses_wave0_independent_of_exec(gpu/recomp/tests.rs~4659) orders the two waves' stores with anS_BARRIER(wave 0 stores before it with an empty EXEC, wave 1 widens EXEC and stores after it), and a negative control without the wave-0 guard reads wave 1's header.lower_mem.rs~2655-2660,emit.rs~1378), on both backends.mesh_draw_split_impland the hand-rolled EXEC test are gone.gpu_mesh_mode_two_passesdraws the split pass-through with its own 128/128/128MsInterface(~4641-4651) and assertssplit == 4again.590f06dbis pending (the reasonPR descriptionis red).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.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T04:03:32Z.
@bmjask thanks for the follow-up. The fixes are pushed in
590f06dbonmain1c8b5514.GS_ALLOC_REQis a per-group header write, so wave 0 is the sole sender, independent of EXEC. The direct-DXIL path retains the console wave index in the mesh context; HLSL usesxcl_wave. The GPU fixture narrows EXEC to zero in wave 0 before its send, then widens EXEC in wave 1 before its later send. A group barrier orders those writes. The in-test unguarded HLSL control deterministically leaves[9, 3]; the guarded HLSL and direct-DXIL paths leave[5, 2].The wave-0 condition handles both cases in one fixture: the declared wave still writes after narrowing EXEC, and the extra wave cannot overwrite the header after widening EXEC. This avoids using EXEC as the sender predicate.
The corpus count is 327 distinct mesh programs: all 327 are wave64 with 128 threads, 128 max vertices and 128 max primitives, and all read v5. Their stride remains 128, so none exercises a changed v5 step. No 32/32/32 program was present in this census; on wave64 that shape now uses stride 64, and its title behavior remains unobserved. The extra-wave performance cost also remains unmeasured.
On the RTX 3090 VM,
mesh_group_stridepassed 2/2,gpu_mesh_alloc_req_uses_wave0_independent_of_execpassed 1/1, andgpu_mesh_mode_two_passespassed 1/1, with no skips. The workspace suite completed with 2,905 passed, 5 failed and 51 ignored; its five failures were the same fourtitle_texturestests andtest_title_runs_and_game_folder_is_untouchedseen on main1c8b5514. No binary crashed.The existing smoke blocks remain labeled as
572f7eab; a new pair for590f06dbis pending while the 5090 rig is paused.AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T04:19:48Z.
Review: COMMENTED
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. Thegroup_stridechange 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.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T04:19:49Z.
Code review location:
crates/xcl/src/gpu/dxil/lower_mem.rs; line 2659Not 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.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T04:39:09Z.
@bmjask the ISA does not state that
GS_ALLOC_REQmust come from wave 0 or be issued in group-uniform control flow. It defines message 0x09 and its vertex/primitive counts; the allocation response is broadcast to the workgroup. NGG lowering sends the request before exports, with a wave-ID argument. Wave 0 as the sole writer is xcl's record-header convention, not an ISA requirement. AMD RDNA 3 ISA, Send Message Types (the RDNA 2 document defines the same message) AMD GPUOpen mesh shader optimizationThe 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
best3-retire0dump set, there are 301 mesh disassembly files (78 distinct MS hashes); each has ones_sendmsg 0x9. A control-flow-range scan found no SCC/VCC branch or loop back-edge enclosing it. Each is under the generated EXEC-zero lane-0 election guard, e.g.:v_cmpx_eq_u32 0, v0keeps only the lane whose thread ID (v0) is 0, i.e. lane 0 of wave 0, so in these programs the title itself sendsGS_ALLOC_REQfrom wave 0 only, which is the case the wave-0 rule follows; it is the lane election around the message, not a guest branch or loop that could skip the allocation in wave 0. I found no corpus evidence requiring another code change. The 327-wide claim remains unverified until we have disassemblies keyed to those census records; please treat the current evidence as limited to the 301 dumped files.AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T05:00:51Z.
@fromthemoonx the
xcl-smokepair is in the description now, for the final head590f06db(bmjask's and Foniass's points folded in):main1c8b55141724 frames, head 1964 frames, no device removal or crash in either, peak commit 47,581 vs 48,740 MB;PR descriptionis green.AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-02T13:27:07Z.
@KDenKC thanks for the smoke pair.
590f06dbpassed here on the main of an hour ago, but main has since moved (b0b44546, mesh producers as dispatch chains) and the PR now conflicts inkernel.rs. When you rebase, main's newms.threads % 64condition probably needs your launched thread count instead. Details in the updated report: https://github.com/xcl-dev/xcl/pull/3350#issuecomment-7331207029AI use: Claude Code (Claude Opus 5.5) ran the checks and wrote this.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.