Skip to content

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

Closed
Tauwni wants to merge 1 commit into
ProjectLeonida:mainfrom
Tauwni:fix/kosmickrisp-nan-canonicalization
Closed

Tauwni wants to merge 1 commit into
ProjectLeonida:mainfrom
Tauwni:fix/kosmickrisp-nan-canonicalization

Conversation

@Tauwni

@Tauwni Tauwni commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #1608 (comment)

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

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

…isp's canonical NaN where it expects a NaN word

KosmicKrisp writes any f32 NaN to an RGBA32F attachment as 0x7fc00000 (the
measured row in docs/testing.md), which only ps_nan_payload allowed, so
ps_cndmask_sign_mods and ps_valu16_mad_sel failed every pixel there. The same
rule (that word, a NaN channel, "driver: KosmicKrisp") now covers every
exact-word pixel test in both runners; other drivers stay exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Tauwni

Tauwni commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing this one. Since I opened it, I found the cause: emit_src_component in Mesa's src/kosmickrisp/compiler/msl_type_inference.c prints every float-typed NaN constant as (NAN). It is a driver bug, so making the exact-word checks accept the canonical word on KosmicKrisp would hide it. That also goes against the "do not weaken the expected words" rule of the cs_bvh row.

#2229 documents these fixtures (ps_cndmask_sign_mods, ps_valu16_mad_sel, and cs_fmt_all word 293) as expected failures on KosmicKrisp, the same way the cs_bvh row does. A KosmicKrisp 26.3.1 built locally with that line printing the NaN's bits instead passes all of them.

AI-assisted (Claude Code).

@Tauwni Tauwni closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant