Files
metal2vulkan/docs
Anees Iqbal b4aeaab757 Tests: a partial-threadgroups variant may add DeviceReconvergence on a device without maximal reconvergence
The rt test every_device_s_observers_answer_the_same_on_their_variant failed on the UHD 630's
Windows leg (job 72531) after 1b9ea536f6: for the engine's a27_a4_simdgroup_barrier the variant
records DeviceReconvergence and the plain module none. The translator is right and the test was
wrong. The variant's invocations past the grid return before the body, and SPIR-V states
reconvergence over all invocations, those that returned included (SPIR-V 1.6 section 2.2.5,
"Dynamic Instance": "Invocations may only resume executing the same dynamic instances when all
invocations reach the same static instruction"; "Uniform Control Flow" and the merge-block rule
speak of all invocations too). SubgroupUniformControlFlowKHR extends the same rule to each
subgroup and adds nothing for a subgroup that holds a returned invocation. Only
SPV_KHR_maximal_reconvergence lets an invocation that ran OpReturn escape reconvergence. So
lower::simd::together's exclusion of partial threadgroups stays, and the variant takes the
profile's mode, or ImplementationDefined with the note where the profile has no maximal
reconvergence.

- The rt test now allows exactly that exception: on a device without maximal reconvergence the
  variant may add DeviceReconvergence where the plain module has none. Every other answer, and
  the notes on a device with maximal reconvergence, must still be equal. It prints how many
  kernels took the exception.
- A new translator test, a_simdgroup_barrier_s_variant_is_guaranteed_only_under_maximal_reconvergence,
  guards the rule on every committed profile. The plain module is Guaranteed with no note. The
  variant is the same where the profile has maximal reconvergence, and ImplementationDefined with
  the note where it does not (nvidia-pascal-linux, runtime-floor).
- docs/API.md (section 6 and the note's catalogue entry), the DeviceReconvergence and
  partial_threadgroups doc comments, and together()'s doc state the exception and its reason.

No module changes, so SEMANTICS_VERSION is not bumped.

Verified: the reproduction (job m3-max-72749) failed the old equality on nvidia-pascal-linux at
1b9ea536f6's tree, with variant (ImplementationDefined, true) against plain (Guaranteed, false),
and passed at its parent 0a1c4d4a64. The check job named in the hand-in covers fmt, clippy
(plain and under --cfg m2v_cpu_icd), Rustdoc, the metal2vulkan lib tests and rt's lavapipe suite.
2026-11-23 20:11:09 -08:00
..