From 2c8949a353e8c889333fa77d2607e7279535f20e Mon Sep 17 00:00:00 2001 From: Tauwni <102470988+Tauwni@users.noreply.github.com> Date: Thu, 26 Nov 2026 09:27:31 +0100 Subject: [PATCH] docs/testing.md: ps_cndmask_sign_mods, ps_valu16_mad_sel and cs_fmt_all on KosmicKrisp are its (NAN) constant printing Co-Authored-By: Claude Opus 5.5 --- docs/testing.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/testing.md b/docs/testing.md index 671c5548c9..9fb917b356 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -796,6 +796,7 @@ game's device ignores it`, so leaving them set cannot slow a game down (`run_tin | On a Mac, `valu_fuzz.py --family f16` reads `+0` where the model wants `-0`, from a multiply whose exact product is -0 (`v_mul_f16`, `v_pk_mul_f16`) or from an FMA whose product and addend are both -0 (`v_fma_f16`, `v_fmac_f16`, `v_pk_fma_f16`) | MoltenVK computes a `NoContraction` multiply as `fma(l, r, +0)`, which drops the sign. MoltenVK 1.4.2 and `main` up to at least `5189f8de` are affected (SHADER-182, [design notes](design.md#translator-status-and-runtime-contract)) | Expected with these MoltenVK versions. To run the rest of the fuzzer clean, add `--skip-op` for each of the five ops. To see them match, install Homebrew's `mesa` and use its KosmicKrisp driver: `LEONIDA_VULKAN_LOADER=/opt/homebrew/opt/vulkan-loader/lib/libvulkan.1.dylib VK_DRIVER_FILES=/opt/homebrew/share/vulkan/icd.d/kosmickrisp_mesa_icd.aarch64.json python3 -I tools/valu_fuzz.py --family f16 --build runtime/build/linux`. Or build MoltenVK with SPIRV-Cross `300681bb` or newer in `ExternalRevisions/SPIRV-Cross_repo_revision`, and point `LEONIDA_VULKAN_LOADER` at its `libMoltenVK.dylib` | | A pixel shader exporting non-canonical f32 NaNs reads back `0x7fc00000` from an RGBA32F color attachment | KosmicKrisp (Mesa 26.3.1), reproduced on Apple M3 Max, M2 Ultra and M1 Pro ([#3125](https://github.com/ItsNotRexed/Leonida/issues/3125)): `nir_to_msl` emits `(NAN)` for `float`-typed NaN constants (`MESA_KK_DEBUG=msl`); MoltenVK 1.4.2 preserved both tested payloads on the same hardware | `ps_nan_payload` allows the measured canonical word only for the NaN channels and only when `vk_harness` reports `driver: KosmicKrisp`. Finite channels and other drivers still require exact words. Integer or storage-buffer readback still canonicalizes constants that NIR infers as `float` (see the `cs_bvh` row below). | | `cs_bvh` and `cs_bvh32` fail on a Mac with KosmicKrisp: `out[3]` reads `0x7fc00000`, want `0xffffffff` | KosmicKrisp's `nir_to_msl` compiler (Mesa 26.3.1, measured on Apple M2 Ultra, macOS 27.3), not the translator or the buffer format. The triangle branch writes bitcast `float` words and the box branch writes `OpSelect %uint` with `0xffffffff` (`-1`) into the same VGPRs; NIR erases `OpBitcast`, type inference marks the shared register and `bcsel` as `float`, and `nir_to_msl` prints any `float`-typed 32-bit constant in the IEEE-754 NaN range (`0x7f800001..0x7fffffff`, `0xff800001..0xffffffff`) as `(NAN)` (`0x7fc00000`) | Expected with KosmicKrisp in Mesa 26.3.1; MoltenVK 1.4.2 and llvmpipe (Mesa 26.3.1) return `0xffffffff` on the same machine. Do not weaken `vk_compute_test`'s expected BVH words | +| `ps_cndmask_sign_mods`, `ps_valu16_mad_sel` and `cs_fmt_all` (word 293) fail on a Mac with KosmicKrisp: a NaN word reads back `0x7fc00000` (`ps_cndmask_sign_mods` (0,0): `0x7fc00000 0x7fc00000 0x80000001 0x7fc00000`, want `0xff800001 0x7f800001 0x80000001 0x7f800001`; `ps_valu16_mad_sel` channel 2: `0x7fc00000`, want `0xffffffff`; `cs_fmt_all` word 293: `0x80007e00`, want `0x80007c01`) | The `(NAN)` printing of the two rows above, which is still in Mesa `main`: `emit_src_component` in `src/kosmickrisp/compiler/msl_type_inference.c` prints every `float`-typed NaN constant as `(NAN)`, dropping its payload and sign. In the two pixel shaders NIR folds the export to a constant (`MESA_KK_DEBUG=msl`: `float4((NAN), (NAN), float(-1.40129846432481707e-45), (NAN))` and `float4(..., (NAN), float(-0.0))`); in `cs_fmt_all` the input `0x7f800001` of a 16-bit float store becomes `0x7fc00000`, which narrows to `0x7e00` instead of `0x7c01`. Measured on an Apple M3 (macOS 26.5.1) with Mesa 26.3.1 at `main` `a73a57e13`; MoltenVK 1.4.2 and llvmpipe (Mesa 26.3.1) pass all three on the same machine | Expected with KosmicKrisp; do not weaken the expected words | | CMake stops with "needs the Windows SDK 10.0.26100 or newer", or MSVC reports `'Desc_1_2': is not a member of 'D3D12_VERSIONED_ROOT_SIGNATURE_DESC'` | A Windows SDK older than 10.0.26100 (10.0.22621 is the common one), which has no version 1.2 root signatures | `winget install Microsoft.WindowsSDK.10.0.26100`, or add it in the Visual Studio Installer, then delete `runtime/build` and configure again | | `scripts/build_runtime.ps1` stops at once: "The checkout path ... contains '%'" (`build_llvm_mc.ps1`: "-Temp ... contains '%'") | A `%` in the checkout's path (or in `-Temp`). cmd.exe expands `%...%` in the generated `_build.cmd` (twice on a `CALL` line), and even with that escaped, `cl` rejects a `%` in the path-valued `/D` definitions of the test targets (`D8038: invalid argument`) however it is quoted. Older scripts failed in configure or a few hundred steps into Ninja instead | Move or clone the checkout (or choose a `-Temp`) in a folder without `%` in its path | | `ctest` lists `fsr_dispatch` and `bvh_builder` as failed (`Not Run`) after clang-cl hits an internal compiler error in `fsr_dispatch_test.cpp` and `bvh_builder_test.cpp` | clang-cl 22.1.8 on Fedora (Linux cross-build) and Windows, plus 22.1.7 on Windows | Use clang-cl 23.1.6 (both files compile on Windows) |