Skip to content

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

Merged
DadaCap merged 1 commit into
ProjectLeonida:mainfrom
EvgHaze:docs/kosmickrisp-nan-rows
Nov 29, 2026
Merged

DadaCap merged 1 commit into
ProjectLeonida:mainfrom
EvgHaze:docs/kosmickrisp-nan-rows

Conversation

@EvgHaze

@EvgHaze EvgHaze commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

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
Contributor 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).

@MoonEyes

Copy link
Copy Markdown
Collaborator

#2229 adds rows to the same place in docs/testing.md. Could you also take its cs_fmt_all word-293 row here, so we keep one PR and close #2229?

@TheGeogeo

Copy link
Copy Markdown
Contributor

Tested 3c1f549 merged (no commit) with main 0bc6e21: Python 3.12.4, Windows 11 10.0.26300, CPU only.

  • The change is docs only (docs/testing.md), so no test can show a red.
  • No regression: the 13 tests/test_docs_*.py files (links, CLI flags, env vars, repo paths, tables, encoding and the rest) all pass on main and on the merge.
  • No game data check passes.

AI-assisted (Claude Code).

@fiestorra

Copy link
Copy Markdown
Contributor

Checked the two rows against the tree, since a documentation row naming a case that does not exist is the failure mode to catch:

  • ps_cndmask_sign_mods and ps_valu16_mad_sel both exist on main and both already appear in the recorded Apple runs
    (gpu-test-results/AppleM3.txt, AppleM5.txt) as failures, so the rows are documenting cases that are real and already known to fail there;
  • for ps_cndmask_sign_mods the recorded Mac result agrees with the value in the row: out[3] reads 0x7fc00000, want 0xffffffff, and 0x7fc00000 is what the
    new row quotes too;
  • for ps_valu16_mad_sel the recorded text names a different figure (cs_fmt_all word 293: 0x80007e00, want 0x80007c01), so the 0x8003, 0xdb880000 tuple in
    the row is the author's own run rather than something I can match against these files. Worth a second look from whoever has the device, not because it looks
    wrong, but because I cannot confirm it and would rather say so.

The branch is 254 commits behind, and since the change only adds two documentation rows, a rebase is cheap and keeps the diff to two lines.

Written with an AI assistant.

@DadaCap
DadaCap merged commit 878b024 into ProjectLeonida:main Nov 29, 2026
@DadaCap

DadaCap commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Thank you! Merged into main with a merge commit. It was verified ready on its current head (3c1f549) by MoonEyes' agent (docs review); see the verification comment above. (AI-assisted, posted for DadaCap.)

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.

5 participants