Files
mandy/tests
NotRexed 2269728203 translator: emulate only tier C wave64 compute and mesh shaders (SHADER-10)
With --wave64-emulate, rdna2spirv.compute_halves now runs tools/wave64_halves.py
on every wave64 CS/MS and keeps the workgroup-memory emulation for tier C. Tiers
A and B run natively, one console half per subgroup:

- the thread index is relabelled from the subgroup (SubgroupId * SubgroupSize +
  SubgroupLocalInvocationId), so a subgroup holds threads 32k..32k+31 whatever
  order the host gives; it feeds v0..v2, a mesh shader's v5 / s3, the lane and
  the mesh export slot;
- an LDS access after a conflicting one of the wave (RAW / WAR / WAW, which the
  console's lockstep ordered with no barrier) and a scalar load after a store
  get a workgroup barrier in front, in blocks every invocation runs;
- with no memory write at all, s_barrier is left out;
- the index entry gets wave64_compute (+ reasons / idioms) and subgroup_size 32.

--wave64-emulate-all keeps the old behaviour (module flag WAVE64_TIERS).

The analysis learns the compute rules (exact lane id, the first lane's wave base
of D + lane, one-half EXEC regions, barrier and memory-order checks, group
size) and, for every stage, forms after VIctory's exact idioms: loads from
uniform addresses, all-or-none masks (s_cselect_b64 exec / 0 and their mixes),
uniform compares under a narrowed EXEC where no running half has it empty,
stale scalars only across a vote edge the read does not depend on, the
s_andn2_wrexec waterfall and loads through the waterfall descriptor.

tests/semantic: test_wave64_compute_tiers.py (fixtures cs_w64_half_local,
cs_w64_lds_swap, ms_w64_skeleton; native modules at 32 and 64 lanes, shuffled
placement, subgroups run one after another; negative controls) and
test_wave64_halves_victory.py; spirv_mini_interp gains OpUDiv / OpUMod and
run_workgroup(subgroup_order=...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:14:29 -05:00
..
2026-11-23 17:08:32 -05:00
2026-11-23 17:08:52 -05:00
2026-11-23 17:08:54 -05:00