Files
metal2vulkan/scripts
Anees Iqbal 7fcd661645 Validation cases: Metal's answer for mul24 and mad24 in and outside their 24-bit range (red)
Two authored cases over engine/int24_products, 12 threads, out filled with 0xAB: operands in the
range the Metal Shading Language specification gives mul24 (section 6.4, after Table 6.2:
[0, 2^24 - 1] unsigned, [-2^23, 2^23 - 1] signed), and operands outside it, each beside small
in-range partners, where the specification calls the product implementation-defined. The addends
are full 32-bit words in both. Installed with corpus-case-check (m3-max-82243) and qualified on
Metal on the Apple M3 Max, three executions each (m3-max-82247).

Metal's outputs against the kernel computed on the CPU, word for word (480 words each):
- in range: equal to the 32-bit product of the operands, and equal to the product of their low
  24 bits (zero-extended unsigned, sign-extended signed), which agree there;
- outside the range: equal to the product of the operands' low 24 bits at all 480 words; the
  32-bit product of the whole operands differs at 386 of them.

scripts/qualify-public-cases runs both on lavapipe against those rows. They are red until the
family is lowered: today the translator refuses the kernel as UnknownIntrinsic.
2026-12-02 23:17:08 -08:00
..