[PR #2110] [CLOSED] check.py, run_gpu_tests.py: exact-word pixel tests accept KosmicKrisp's canonical NaN (TEST-KOSMICKRISP-CANONICAL-NAN) #2118

Closed
opened 2026-11-26 21:20:06 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2110
Author: @Tauwni
Created: 11/25/2026
Status: ❌ Closed

Base: main ← Head: fix/kosmickrisp-nan-canonicalization


📝 Commits (1)

  • a259480 check.py, run_gpu_tests.py: an exact-word pixel test accepts KosmicKrisp's canonical NaN where it expects a NaN word

📊 Changes

4 files changed (+62 additions, -6 deletions)

View changed files

📝 docs/testing.md (+1 -1)
📝 runtime/test/shaders/check.py (+25 -2)
📝 scripts/run_gpu_tests.py (+8 -3)
📝 tests/test_shader_checks.py (+28 -0)

📄 Description

Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7174641023

What and why

KosmicKrisp (Mesa 26.3.1) writes any f32 NaN to an RGBA32F attachment as 0x7fc00000. That is the measured row in docs/testing.md, and until now only ps_nan_payload allowed it. So ps_cndmask_sign_mods and ps_valu16_mad_sel, which expect non-canonical NaN words (0xff800001, 0x7f800001, 0xffffffff), failed every pixel on KosmicKrisp while passing on MoltenVK and llvmpipe (the finding in #1608).

The same rule now covers every exact-word pixel test, in check.py and in run_gpu_tests.py (check_pixel_const): the canonical word is accepted only in a channel that expects an f32 NaN, and only when vk_harness reports driver: KosmicKrisp. Finite channels and other drivers stay exact. The Known problems row names the two fixtures.

Tested

Apple M3, macOS 26.5.1, test programs built from this branch:

ps_cndmask_sign_mods ps_valu16_mad_sel ps_nan_payload
MoltenVK 1.4.2 PASS, exact PASS, exact PASS
KosmicKrisp (Mesa 26.3.1) FAIL on main, PASS ("exact but for KosmicKrisp's canonical NaN") same PASS
llvmpipe (Mesa 26.3.1) PASS, exact PASS, exact PASS
  • Full run_gpu_tests.py on all three: no new failure. KosmicKrisp's remaining ones are cs_bvh / cs_bvh32 (#1212) and cs_imgatomic_ext (#1518).
  • check.py (with #1444 applied locally so build.py runs): the same two pass on KosmicKrisp.
  • New unit tests in tests/test_shader_checks.py (KosmicKrispCanonicalNaN): canonical NaN accepted on KosmicKrisp only, only that word, only in a NaN channel.
  • Not covered: cs_fmt_all on KosmicKrisp. Its two mismatches (word 293, an f16 sNaN stored quiet, and word 312, an 11/11/10 float with a changed finite G) aren't this canonicalization, so they stay a finding.

GPUs tested: Apple M3 (10-core GPU) with MoltenVK 1.4.2, KosmicKrisp (Mesa 26.3.1) and llvmpipe (Mesa 26.3.1), macOS 26.5.1

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • No translator rule.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2110 **Author:** [@Tauwni](https://github.com/Tauwni) **Created:** 11/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/kosmickrisp-nan-canonicalization` --- ### 📝 Commits (1) - [`a259480`](https://github.com/ubiquitarianism/leonida/commit/a259480cdfb8499897871f8436eb2dbc0af4ae47) check.py, run_gpu_tests.py: an exact-word pixel test accepts KosmicKrisp's canonical NaN where it expects a NaN word ### 📊 Changes **4 files changed** (+62 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/testing.md` (+1 -1) 📝 `runtime/test/shaders/check.py` (+25 -2) 📝 `scripts/run_gpu_tests.py` (+8 -3) 📝 `tests/test_shader_checks.py` (+28 -0) </details> ### 📄 Description Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7174641023 ### What and why KosmicKrisp (Mesa 26.3.1) writes any f32 NaN to an RGBA32F attachment as `0x7fc00000`. That is the measured row in `docs/testing.md`, and until now only `ps_nan_payload` allowed it. So `ps_cndmask_sign_mods` and `ps_valu16_mad_sel`, which expect non-canonical NaN words (`0xff800001`, `0x7f800001`, `0xffffffff`), failed every pixel on KosmicKrisp while passing on MoltenVK and llvmpipe (the finding in #1608). The same rule now covers every exact-word pixel test, in `check.py` and in `run_gpu_tests.py` (`check_pixel_const`): the canonical word is accepted only in a channel that expects an f32 NaN, and only when `vk_harness` reports `driver: KosmicKrisp`. Finite channels and other drivers stay exact. The Known problems row names the two fixtures. ### Tested Apple M3, macOS 26.5.1, test programs built from this branch: | | `ps_cndmask_sign_mods` | `ps_valu16_mad_sel` | `ps_nan_payload` | |---|---|---|---| | MoltenVK 1.4.2 | PASS, exact | PASS, exact | PASS | | KosmicKrisp (Mesa 26.3.1) | FAIL on `main`, PASS ("exact but for KosmicKrisp's canonical NaN") | same | PASS | | llvmpipe (Mesa 26.3.1) | PASS, exact | PASS, exact | PASS | - Full `run_gpu_tests.py` on all three: no new failure. KosmicKrisp's remaining ones are `cs_bvh` / `cs_bvh32` (#1212) and `cs_imgatomic_ext` (#1518). - `check.py` (with #1444 applied locally so `build.py` runs): the same two pass on KosmicKrisp. - New unit tests in `tests/test_shader_checks.py` (`KosmicKrispCanonicalNaN`): canonical NaN accepted on KosmicKrisp only, only that word, only in a NaN channel. - Not covered: `cs_fmt_all` on KosmicKrisp. Its two mismatches (word 293, an f16 sNaN stored quiet, and word 312, an 11/11/10 float with a changed finite G) aren't this canonicalization, so they stay a finding. GPUs tested: Apple M3 (10-core GPU) with MoltenVK 1.4.2, KosmicKrisp (Mesa 26.3.1) and llvmpipe (Mesa 26.3.1), macOS 26.5.1 AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] No translator rule. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:06 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2118
No description provided.