Skip to content

docs/testing: record the two ps_* KosmicKrisp NaN cases - #2602

Open
EvgHaze wants to merge 1 commit into
ProjectLeonida:mainfrom
EvgHaze:docs/kosmickrisp-nan-rows
Open

EvgHaze wants to merge 1 commit into
ProjectLeonida:mainfrom
EvgHaze:docs/kosmickrisp-nan-rows

Conversation

@EvgHaze

@EvgHaze EvgHaze commented Nov 29, 2026

Copy link
Copy Markdown

Claimed in the coordination issue as KOSMICKRISP-NAN-ROWS (#2570 (comment)).

What and why

docs/testing.md already records that KosmicKrisp's nir_to_msl prints any float-typed 32-bit constant in the IEEE-754 NaN range as (NAN) (0x7fc00000), with cs_bvh / cs_bvh32 as the example. Two more GPU tests fail on that same path and are not listed, so a reader on a Mac sees six red tests and cannot tell which of them is the driver:

  • ps_cndmask_sign_mods — all 4096 pixels differ, (0,0) reads 0x7fc00000, 0x7fc00000, 0x80000001, 0x7fc00000, want 0xff800001, 0x7f800001, 0x80000001, 0x7f800001.
  • ps_valu16_mad_sel — all 4096 pixels differ, (0,0) reads 0x8003, 0xdb880000, 0x7fc00000, 0x80000000, want 0x8003, 0xdb880000, 0xffffffff, 0x80000000.

Both write a value the GPU stores as 0xffffffff or as a non-canonical NaN, and both read back the canonical 0x7fc00000. The entry names the cause and the two drivers that pass, so the next person does not re-derive it.

Testing

Apple M3 (Mac15,13), 8 cores, macOS 27.0 (26A5406e):

  • ps_cndmask_sign_mods: fails 0/1 on KosmicKrisp (Mesa 26.3.1), passes 1/1 on llvmpipe (same Mesa build) and on MoltenVK 1.4.2.
  • ps_valu16_mad_sel: same three results.

Each test was run alone through scripts/run_gpu_tests.py --filter with VK_DRIVER_FILES naming one ICD at a time, on the same build.

Documentation only: no code, no fixtures, no test changes. python -I scripts/check_no_game_data.py docs/testing.md passes.

AI-assisted.

ps_cndmask_sign_mods and ps_valu16_mad_sel fail 4096/4096 on KosmicKrisp
(Mesa 26.3.1) and pass on llvmpipe with the same Mesa and on MoltenVK
1.4.2; both read back 0x7fc00000 where the shader wrote a non-canonical
NaN or 0xffffffff, the same nir_to_msl constant path already recorded
for cs_bvh. Measured on an Apple M3, macOS 27.0.
@EvgHaze

EvgHaze commented Nov 29, 2026

Copy link
Copy Markdown
Author

Filed upstream: the same nir_to_msl constant path is now reported to Mesa as https://gitlab.freedesktop.org/mesa/mesa/-/issues/17056 (NaN-range f32 constants printed as (NAN), so 0xffffffff and non-canonical NaNs read back as 0x7fc00000).

@TheGeogeo

Copy link
Copy Markdown
Contributor

Tested 3c1f549fd merged (no commit) with main ef3299584: Python 3.12.4, Windows 11 10.0.26300, CPU only. Docs only, so no test is expected.

  • The 15 docs test files (tests/test_docs_*.py, test_i18n_index.py, test_navmesh_links.py) give the same results on plain main and on the merge. test_docs_cli_flags.py and test_docs_links.py fail the same way on both, unrelated to this change. check_no_game_data.py is clean.
  • The rows match the tests: ps_cndmask_sign_mods expects 0xff800001, 0x7f800001, 0x80000001, 0x7f800001 and ps_valu16_mad_sel expects 0x8003, 0xdb880000, 0xffffffff, 0x80000000 (runtime/test/shaders/check.py:884 and :890, scripts/run_gpu_tests.py:1587 and :1592). I could not check the Mac readings themselves here.
  • Overlap: docs/testing.md: three more KosmicKrisp failures from its (NAN) constant printing #2229 (docs/testing.md: three more KosmicKrisp failures from its (NAN) constant printing) adds one row for ps_cndmask_sign_mods, ps_valu16_mad_sel and cs_fmt_all at the same place, after the cs_bvh row. The two PRs conflict, and once one of them lands the other is mostly a duplicate. Only one of the two should go in, or the second should be reduced to what the first lacks.

No other finding. AI-assisted (Claude Code).

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.

2 participants