Skip to content

GPU test: v_frexp_mant_f16, v_frexp_exp_i16_f16, v_ldexp_f16 on every f16 input (SHADER-354) - #2171

Open
Krashgamer wants to merge 12 commits into
ItsNotRexed:mainfrom
Krashgamer:test/f16-frexp-ldexp-gpu
Open

Krashgamer wants to merge 12 commits into
ItsNotRexed:mainfrom
Krashgamer:test/f16-frexp-ldexp-gpu

Conversation

@Krashgamer

@Krashgamer Krashgamer commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Item: SHADER-354 (claimed in #1902: #1902 (comment)).

Builds on #1931 (merged), whose f16 denormal rule this tests on the GPU.

What and why

No GPU test or fuzzer generates v_frexp_mant_f16, v_frexp_exp_i16_f16 or v_ldexp_f16 (#1931's description says so too), so run_gpu_tests.py passes whatever the translator emits for them. #1931 changes how they handle f16 denormals, measured on RDNA2 through tools/hw_oracle. Those are raw native kernels, though, not the translated SPIR-V. This adds a GPU test that runs the translated program on each tester's GPU and checks every f16 input.

The change

  • runtime/test/shaders/cs_f16_frexp_ldexp.asm: each of the 65,536 binary16 encodings gets its own thread (1024 groups of 64). Each thread stores frexp_mant(x), frexp_exp(x), ldexp(x, s4) and x. Every destination starts as 0x5a5a5a5a, so the kept high half is checked too. The header quotes the gfx1036 words from docs/design.md.

  • runtime/test/shaders/check.py: f16_frexp_ldexp_test runs it once per S1 of F16_FREXP_LDEXP_EXPONENTS, 21 values:

    • zero and the ends of the normal range;
    • the denormal and flush edges (-14, -15, -24, -25, -30);
    • the clamp to [-64, 64] from both sides (±64, ±65, 0x8000, 0x7FFF);
    • S1 words whose high bits must be ignored (0x00010003, 0xFFFF0005).

    It compares all 262,144 words of each dump with a model of the rule in docs/design.md. The expected dump is built once per S1 and compared as bytes, and a word-by-word scan only runs on a mismatch. A failure names the number of wrong words per op and the first one.

  • scripts/run_gpu_tests.py: calls the same function.

  • tests/test_shader_checks.py: the fake harness answers the new shader (TOTAL + 1). New tests check that:

    • every exponent is sent;
    • one wrong word is reported by input and exponent;
    • a translator that reads f16 denormals as zero fails;
    • the model gives the gfx1036 words quoted in docs/design.md;
    • the model agrees with tests/semantic/test_alu_frexp_ldexp_f16.py's ref_mant / ref_exp / ref_ldexp on every input and exponent. Its functions and constants are read with ast, as test_inputs_match_the_interpreter_test does, so the translator isn't imported.
  • docs/design.md: the f16 trio's row names the GPU test.

Tested

NVIDIA GeForce RTX 3080 (Ampere), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 25H2, MSVC 14.51.36231 (VS 2026 Build Tools), Vulkan SDK 1.4.363.0, llvm-mc 21.1.8 (built with scripts/build_llvm_mc.ps1). No game files.

After merging main (4f61cba9f, 2026-11-23). The merge resolved three conflicts:

Re-run on the merged tree, RTX 3080, NVIDIA 610.88:

  • run_gpu_tests.py --filter cs_f16_frexp_ldexp: 65536 inputs x 21 exponents, every word exact.
  • tests/test_shader_checks.py: 87 tests OK (pytest: 91 passed).
  • tests/semantic/test_alu_frexp_ldexp_f16.py: 25 tests OK; all frexp/ldexp semantic tests: 246 OK.
  • test_run_gpu_tests.py, test_ci_registration.py and the docs tests: OK.

Second merge of main (3b849d7a6). One conflict, in the same docs/design.md area: main rewrote the neighbouring v_frexp_mant_f64 row; that row is now main's, and the f16 row keeps this PR's GPU sentence. Re-run: run_gpu_tests.py --filter cs_f16_frexp_ldexp with a rebuilt runtime: every word exact again; tests/test_shader_checks.py (pytest): 93 passed; the 11 frexp/ldexp semantic test files: OK.

Third merge of main (c9d4c2c4d). One conflict, in run_gpu_tests.py: main routes cs_lds and the other direct vk_compute_test runs through compute_result(); cs_f16_frexp_ldexp keeps the check.py-helper form that main's cs_fmt_* tests use. Re-run: run_gpu_tests.py --filter cs_f16_frexp_ldexp with a rebuilt runtime: every word exact; test_shader_checks.py + test_run_gpu_tests.py (pytest): 151 passed; test_ci_registration.py: OK.

Fourth merge of main (e5ef73839). Conflicts in check.py (main's PK_MUL_LO_WORDS next to this PR's constants) and TOTAL, now + 16): main's 15 plus cs_f16_frexp_ldexp. cs_f16_frexp_ldexp on the GPU with a rebuilt runtime: every word exact. test_shader_checks.py has 15 errors on this head and on plain main alike, from #6833's ps_table_fetch mock (fix in #7094). With #7094's test change applied on top (and TOTAL at 17), 151 passed (pytest) and python -I tests/test_shader_checks.py is OK.

The counts above this section are from the original head.

Not covered here: a native 64-wide run (no such subgroup on NVIDIA). SlopTart has since run it natively at wave64 on an AMD RX 7900 XT (RADV), exact (comment).

Overlap

@Vonsek has claimed the f32 trio's GPU test (EGEN-GPU-FREXP32, #1902). It covers different opcodes, but it will likely add a check at the same places in check.py, run_gpu_tests.py and TOTAL in tests/test_shader_checks.py. Whichever lands second only needs to add its line next to the other and bump TOTAL once more.

Checklist

AI-assisted: the code, the tests and this description were written by Claude Code at my request, and it ran them on my PC.

🤖 Generated with Claude Code

… f16 input

No GPU test or fuzzer generated these three opcodes, so run_gpu_tests.py passed
whatever the translator emitted for them. cs_f16_frexp_ldexp gives each of the
65,536 binary16 encodings its own thread (1024 groups of 64) and stores
frexp_mant, frexp_exp, ldexp(x, s4) and x, each destination preloaded with
0x5a5a5a5a so the kept high half is checked too.

check.py's f16_frexp_ldexp_test dispatches it once per S1 of
F16_FREXP_LDEXP_EXPONENTS (21 values: the denormal and flush edges, the clamp
to [-64, 64] from both sides, S1 words whose high bits must be ignored) and
compares all 262,144 words of each dump with a model of the rule ItsNotRexed#1931
measured on gfx1036 (f16 denormals kept). run_gpu_tests.py calls the same
function.

tests/test_shader_checks.py: the fake harness answers the new shader; new
tests check that every exponent is sent, that one wrong word is named, that
a translator reading f16 denormals as zero fails, that the model gives the
gfx1036 words quoted in docs/design.md, and that it agrees with
tests/semantic/test_alu_frexp_ldexp_f16.py's reference on every input.

Depends on ItsNotRexed#1931: with main's translator the test fails on every f16
denormal (2,046 inputs per dispatch).

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

Copy link
Copy Markdown
Contributor

Independent Radeon review (AI-assisted with Codex) of 36027d4f against main 4eb6155d, including #1931 at 31579b9c.

  • Stock cs_f16_frexp_ldexp translated SPIR-V on the Ryzen 7 9800X3D Radeon iGPU (PCI 1002:13c0, Windows 11 build 26200, AMD 25.10.30.02, Vulkan 1.4.315). Native translation and driver-default subgroup 64. 21 dispatches x 1,024 groups x 64 invocations, 5,505,024/5,505,024 words exact (65,536 inputs x 21 S1 values x 4 words). The stock checker took 2.707 s wall time, including 1.885 s across the harness processes.
  • Single AMD ICD, empty implicit-layer path. Khronos core and synchronization validation confirmed active in all 21 launches, with zero validation errors or warnings. The exact module passed spirv-val --target-env vulkan1.2. Built only vk_compute_test with MSVC 19.38.33145 and Windows SDK 10.0.26100.0. Vulkan SDK 1.4.363.0, uv CPython 3.12.13, WSL llvm-mc 21.1.8 for assembly. Stock f16 semantic tests 23/23, shader checker tests 65/65. Synthetic fixture only.
  • Small header nit in cs_f16_frexp_ldexp.asm:6. The three opcode results preserve high half 0x5a5a. The fourth word is the raw input index and has high half zero, as the checker correctly expects.

The header said all four words carry 0x5a5a in the high half; only the three
opcode results do. The checker already expected x as is. Comment only.

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

Copy link
Copy Markdown
Contributor Author

Thanks @whattheflop. That's the first AMD run, and at subgroup 64, which my NVIDIA card can't do. So the "not covered: native 64-wide" line in the description is covered now too.

Header nit fixed in 956d02e: the three opcode results carry 0x5a5a in the high half, then x itself with high half 0. Comment only; cs_f16_frexp_ldexp still passes here.

AI-assisted (Claude Code).

@Flyander Flyander left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current diff and the reported full-domain GPU sweep. The half-precision frexp/ldexp coverage is exhaustive over all 65,536 input encodings, and the independent AMD run confirms the wave64 case. The documentation comment was corrected at this head. I found no remaining blocker.

# Conflicts:
#	runtime/test/shaders/check.py
#	tests/test_shader_checks.py
@ricarmandoagent

Copy link
Copy Markdown

Tested 62a490b1 on NVIDIA GeForce RTX 4060 (Ada, AD107; Vulkan subgroupSize 32..32), NVIDIA 620.70.06, Vulkan 1.4.357, Bazzite 45 / Linux 7.3.4 (Wayland).

Test programs built from 4947579 (this PR changes no runtime/ C++), shaders translated with this PR's tools/rdna2spirv.py:

python -I scripts/run_gpu_tests.py --build runtime/build/linux --filter cs_f16_frexp

  PASS  cs_f16_frexp_ldexp    65536 inputs x 21 exponents, every word exact

1/1 passed

.spv passed spirv-val (LLVM 23.1.5); tests/test_shader_checks.py: 65 tests OK.

AI-assisted run on a contributor machine.

Conflicts: docs/design.md (main dropped duplicated rows and rewrote the f16
frexp/ldexp row; kept main's row and re-added the GPU test sentence) and the
check import in scripts/run_gpu_tests.py (both sides' names).

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

Copy link
Copy Markdown

Tested 62a490b on NVIDIA GeForce RTX 4060 Ti, driver 621.01, Windows 11 Home (build 26300): pass

Ran: python -I scripts/run_gpu_tests.py --llvm-mc "wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc" --build --filter cs_f16_frexp_ldexp

Result: 1 shader translated, 1 passes spirv-val. cs_f16_frexp_ldexp: PASS (65536 inputs x 21 exponents, every word exact), 1/1 passed.

Also ran tests/test_shader_checks.py: 65 tests OK.

Notes:

  • The runtime test programs were built from a ZIP download of main, not from this PR's branch. The PR only touches the test shader, check.py and docs, so this should not matter.
  • llvm-mc is 21.1.8 via WSL Ubuntu.
  • The runner does not print which Vulkan device it used. The system lists the NVIDIA driver (621.01) first.

@jigglephysic0

Copy link
Copy Markdown

Tested 55071e6 on NVIDIA GeForce RTX 4060 Ti, driver 621.01, Windows 11 Home (build 26300): pass

Ran: python -I scripts/run_gpu_tests.py --llvm-mc "wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc" --build --filter cs_w32_dot4_carry

Result: 1 shader translated, 1 passes spirv-val. cs_w32_dot4_carry: PASS (456/456 dumped words exact), 1/1 passed.

CPU checks on this branch: tests/test_shader_checks.py 60 tests OK; python -m unittest discover -s tests/semantic -v: 2569 tests OK.

Notes:

  • The runtime test programs were built from a ZIP download of main, not from this PR's branch. The PR only touches the test shader, fixtures, check.py and docs, so this should not matter.
  • llvm-mc is 21.1.8 via WSL Ubuntu.
  • The runner does not print which Vulkan device it used. The system lists the NVIDIA driver first.

@jigglephysic0

Copy link
Copy Markdown

Tested 1d93f77 on NVIDIA GeForce RTX 4060 Ti, driver 621.01, Windows 11 Home (build 26300): pass

Ran: python -I scripts/run_gpu_tests.py --llvm-mc "wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc" --build --filter cs_w32_ds_wrxchg_b64

Result: 1 shader translated, 1 passes spirv-val. cs_w32_ds_wrxchg_b64: PASS, 1/1 passed. The runner printed these words for the test: 2165396956 6702799 3666541181 1331365576 260283320 3557905690 3800037791 286488446

CPU checks on this branch: tests/test_shader_checks.py 59 tests OK; python -m unittest discover -s tests/semantic -v: 1648 tests OK.

Notes:

  • The runtime test programs were built from a ZIP download of main, not from this PR's branch. This PR's branch is older than that main, so the binaries are newer than the PR's base. The PR only touches the test shader, fixtures, check.py and docs, so this should not matter, but it is not a build from the PR's own code.
  • llvm-mc is 21.1.8 via WSL Ubuntu.
  • The runner does not print which Vulkan device it used. The system lists the NVIDIA driver first.

@Krashgamer

Copy link
Copy Markdown
Contributor Author

@jigglephysic0 Thanks for the 4060 Ti run of this one. Your second and third comments here are for other pull requests: 55071e6b / cs_w32_dot4_carry is #2311, and 1d93f777 / cs_w32_ds_wrxchg_b64 is #2003. Reposting them there would let those authors and reviewers see them.

AI-assisted (Claude Code).

@jigglephysic0

Copy link
Copy Markdown

Tested ffcd045 on NVIDIA GeForce RTX 4060 Ti, driver 621.01, Windows 11 Home (build 26300): pass

Ran: python -I scripts/run_gpu_tests.py --llvm-mc "wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc" --build --filter cs_lds

Result: 2 shaders translated, 2 pass spirv-val. cs_lds: PASS (device: NVIDIA GeForce RTX 4060 Ti, subgroup 32..32). cs_lds_b64_cmpst: PASS. 2/2 passed. The changed runner still reports normally on a passing run.

CPU checks on this branch: tests/test_run_gpu_tests.py 38 tests OK; tests/test_shader_checks.py 60 tests OK; python -m unittest discover -s tests/semantic -v: 2567 tests OK.

Notes:

  • The runtime test programs were built from a ZIP download of main, not from this PR's branch. This PR only changes scripts/run_gpu_tests.py and its test, so the binaries do not depend on it.
  • Running with --filter cs_f16_frexp_ldexp (a test that is not on this branch) printed "error: --filter 'cs_f16_frexp_ldexp' matched no GPU test cases" and exited, which was clear.
  • I did not exercise the new "no judgeable result" message itself.
  • llvm-mc is 21.1.8 via WSL Ubuntu.

Conflict: the fixture count in tests/test_shader_checks.py, which main
raised to 12 for vs_base_ids and this branch to 12 for cs_f16_frexp_ldexp;
it is 13 with both.

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

zneel commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 854bc3a7 on AMD Radeon RX 9070 XT (RDNA4, subgroup 32..64), AMD 26.11.2, Windows 11 Pro 10.0.26300, AMD Ryzen 7 9800X3D CPU (64 GB RAM), Python 3.12.10: pass.

Runtime and test programs built from this head (MSVC 14.51, Ninja, RelWithDebInfo), native Windows llvm-mc 21.1.8, Vulkan SDK 1.4.363.0. No game files.

run result
run_gpu_tests.py (whole suite, native wave64) 186/200, 14 skipped, 0 failed (main 49475796: 170/185)
same with LEONIDA_W64_EMULATE=1 186/200, 14 skipped, 0 failed
pytest tests/test_shader_checks.py tests/test_run_gpu_tests.py 117 passed, 266 subtests passed in 5.69s

This PR's shaders:

  • native: PASS cs_f16_frexp_ldexp 65536 inputs x 21 exponents, every word exact; emulated: PASS cs_f16_frexp_ldexp 65536 inputs x 21 exponents, every word exact

On RDNA4, cs_f16_frexp_ldexp is exact for all 65,536 f16 inputs × 21 exponents, native and emulated, f16 denormals included. So with #1931's denormal handling, the AMD RDNA4 Windows driver agrees with the RDNA2 measurements.

AI-assisted (Claude Code); I checked the results.

Krashgamer and others added 2 commits November 22, 2026 23:02
Conflicts with ItsNotRexed#1518 (cs_fma_fused) and the cs_fmt_d16_xyz / cs_heap_init
dumps: both sides' lines kept in check.py and run_gpu_tests.py, main's
f16 frexp/ldexp row (now with VOP3 clamp) plus the GPU test sentence, and
the fixture count is 14 with both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every new GPU test appends to the end of the check import, the elif chain
in run_gpu_tests.py and check.py's results list, so this branch conflicted
with each merge round. The import gets its own line, and the two
registrations sit next to cs_lds and cs_wavemask, which rarely change.
Same behaviour.

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

Copy link
Copy Markdown
Contributor

Tested 069ff43 merged into main aa2988cc (clean merge) on AMD Radeon RX 6700 XT (Navi 22, gfx1031, subgroup 32..64), RADV Mesa 26.3.1, CachyOS, Linux 7.3.5, GCC 16.2.1, llvm-mc 23.1.5: pass.

  • New test passes natively: cs_f16_frexp_ldexp (65536 inputs x 21 exponents, every word exact).
  • Whole run_gpu_tests.py: 197/211 native, 197/211 with LEONIDA_W64_EMULATE=1 (the skips are the D3D12-only fixtures and ps_w64x_readlane, as on main). ctest 47/47.
  • tests/test_shader_checks.py: 84 passed, 230 subtests passed.

No game files. AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Tested 069ff43 merged with main 2d3369a on Linux (Python 3.12.16) and Windows 11 (Python 3.13.1): pass (CPU side only).

  • pytest tests/test_shader_checks.py 88 passed (Linux); Windows unittest 88 OK; tests/test_run_gpu_tests.py 41; tests/test_docs_*.py pass; tests/semantic/test_alu_frexp_ldexp_f16.py 25 OK on Windows (the test here checks the GPU model against it).
  • Negative control: runtime/test/shaders/check.py and scripts/run_gpu_tests.py taken from main: 18 failures (the F16FrexpLdexpSweep tests and the case-count test). Reverted afterwards.
  • Docs: the design.md row says 21 exponents and F16_FREXP_LDEXP_EXPONENTS has 21 entries; 65,536 x 4 = 262,144 words matches F16_FREXP_LDEXP_WORDS. I did not reproduce "exact on an RTX 3080": the GPU dispatch was not run here. Separately, that row still contains duplicated sentences from earlier edits ("Zero gives a signed zero..." twice, and "Zero and denormals (read as zero)" next to "f16 denormals are kept"), which this PR could tidy.

@Krashgamer

Copy link
Copy Markdown
Contributor Author

Thanks @kapitche. The repeated and conflicting sentences in that row are already on main ("…give the input unchanged and exponent 0." twice, and "zero and denormals (read as zero)" next to "f16 denormals are kept"). #2171 only extends the row's last sentence. I'm leaving the tidy-up out here: it would widen the approved diff, and #4311 rewrites the modifier sentences of the same cell. I've posted it as a finding so it's done once both have landed.

Conflicts after ItsNotRexed#4311 and main's cs_fmt_all:
- docs/design.md: keep main's f16 frexp/ldexp row (ItsNotRexed#4311) and extend its last
  sentence with this PR's GPU check.
- scripts/run_gpu_tests.py: main's verdict_line() for the case above, plus the
  cs_f16_frexp_ldexp branch.
- tests/test_shader_checks.py: both sides added one case to TOTAL (13 -> 14),
  so the merged total is 15.

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

gertify commented Nov 23, 2026

Copy link
Copy Markdown

Tested 069ff43 on Intel UHD Graphics 630 (CFL GT2): run_gpu_tests.py --filter cs_f16_frexp_ldexp with LEONIDA_VK_DEVICE=Intel passes 1/1, "PASS cs_f16_frexp_ldexp 65536 inputs x 21 exponents, every word exact". With LEONIDA_VK_DEVICE=NoSuchDevice the same filter fails with "no Vulkan physical device matches". tests/test_shader_checks.py ran 84 tests OK (the description says 64) and tests/semantic/test_alu_frexp_ldexp_f16.py ran 25 tests OK (the description says 23). This device runs the fixture at subgroup size 32 (range 8..32), so the 64-wide cases are not covered. The control with main's rdna2spirv.py was not run.

AI-assisted.

@Mortify7612

Copy link
Copy Markdown

Tested 3b849d7a merged onto main 1cc6e3c1 (clean) on AMD Radeon RX 9060 XT (RDNA4, GFX1200, subgroup 32..64), RADV Mesa 25.0.7, Debian 12 Linux, llvm-mc 23.1.6: pass. I ran run_gpu_tests.py --filter <fixture> for the fixture(s) this PR adds or changes, not the full suite:

PASS cs_f16_frexp_ldexp 65536 inputs x 21 exponents, every word exact

AI-assisted (Claude Code).

Krashgamer and others added 2 commits November 23, 2026 16:39
run_gpu_tests.py: cs_lds takes main's compute_result(); the
cs_f16_frexp_ldexp branch keeps the check.py-helper form main's
cs_fmt_* tests use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
check.py: keep main's PK_MUL_LO_WORDS next to the f16 frexp/ldexp
constants. TOTAL in test_shader_checks.py is 16: main's 15 plus
cs_f16_frexp_ldexp.

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

Copy link
Copy Markdown
Contributor

Tested e5ef73839efb5dabd0a5d276a6558b2939700d0c on NVIDIA GeForce RTX 5090, 595.99.02 (Linux).

The filtered synthetic fixture passed on Linux for all 65,536 binary16 encodings at each of the 21 exponent settings. Every readback word matched.

I also tested whether the checker detects damage to the preserved upper half of the destination at the very last encoding. In a temporary fixture, immediately before the store, I flipped bit 16 of the ldexp result only when the input was 0xffff. Both shaders passed SPIR-V validation. The modified run exited 1 and attributed exactly 21 mismatches to ldexp, one per exponent. For exponent zero it reported 0x5a5bffff instead of 0x5a5affff. This confirms the checker observes the preserved bit even when the low 16 result bits still match.

AI-assisted verification.

@ErayOzdayioglu

Copy link
Copy Markdown

Tested the current head e5ef738 on Windows 11 26200, including an RDNA2 gfx1036-class GPU through AMD's Windows driver: the chip family the expected words were measured on, now running the translated SPIR-V. Setup: MSVC 14.51 (VS 2026), Vulkan SDK 1.4.363, llvm-mc 23.1.6, test programs built from this head. pass

run_gpu_tests.py --filter cs_f16_frexp_ldexp gives PASS cs_f16_frexp_ldexp 65536 inputs x 21 exponents, every word exact (1/1, spirv-val OK) on all four runs:

GPU native LEONIDA_W64_EMULATE=1
Radeon iGPU, Ryzen 5 7600 (RDNA2, 32.0.21042.62) pass pass
RTX 5070 (617.42) pass pass

A side note, not caused by this PR: python -I tests/test_shader_checks.py gives 15 errors at this head (harness() got an unexpected keyword argument 'cwd' in Wave64Checks). The same 15 errors happen on current main 14b2e44 without this PR. They come from run_readback(..., cwd=spirv) in runtime/test/shaders/check.py, which arrived with #6833, while the test doubles in tests/test_shader_checks.py don't take cwd.

AI-assisted: yes

@LukeOsland1

Copy link
Copy Markdown

Tested e5ef73839e on Windows 11 build 26300, NVIDIA RTX 4070 Ti SUPER, driver 610.88. I used the PR’s GPU runner with LLVM 23.1.6 and the MSVC-built harness from the tested sources. The Vulkan loader was restricted to the NVIDIA ICD.

  • cs_f16_frexp_ldexp — 65536 inputs x 21 exponents, every word exact.

Xbox 1.0.2.1 coverage: 0 of 26,503 local shaders.rpf listings contain at least one of the following mnemonics. Static instruction counts (combining e32/e64 spellings): v_frexp_mant_f16 0, v_frexp_exp_i16_f16 0, v_ldexp_f16 0. The counts describe opcode presence. The GPU readback above uses the hand-written fixture. AI-assisted with Codex.

@mexht

mexht commented Nov 23, 2026

Copy link
Copy Markdown

Tested e5ef73839 on AMD Radeon RX 7800 XT (RDNA3, Navi 32), RADV / Mesa 26.3.1-arch3.5, Vulkan 1.4.363, Linux 7.3.5: pass.

python -I scripts/run_gpu_tests.py --filter cs_f16_frexp_ldexp
  PASS  cs_f16_frexp_ldexp  65536 inputs x 21 exponents, every word exact

Harness from a RelWithDebInfo build of main (this PR changes no C++), translator and check.py from this head. tests/test_run_gpu_tests.py passes. tests/test_shader_checks.py still has the 15 pre-existing cwd errors from the stale mock (#7094), unrelated to this PR.

No game files; synthetic fixture.

@bobcatchris

Copy link
Copy Markdown
Contributor

Tested e5ef738 on Apple M2 with MoltenVK 1.4.2 (macOS 26.4, subgroup 4..32, device Vulkan 1.4.357): cs_f16_frexp_ldexp passes — 65536 inputs x 21 exponents, every word exact; full suite 179/240 passed, 59 skipped, 2 failed vs base 0805d30 178/239, 59 skipped, 2 failed A/B; no regression.

Both builds used the same harness binary. Per-test comparison: the only difference is the new fixture, which passes; both heads have the same two known failures (cs_fma_fused, ps_ssharp). This gives the RDNA2-measured f16 frexp/ldexp denormal rules their first run through translated SPIR-V on an Apple driver, and they hold here.

pytest -q tests/test_shader_checks.py on this head gives 88 passed / 15 errors — those 15 are the pre-existing harness-cwd mock regression already covered by open #7094, and the file's new cases pass. llvm-mc 21.1.8, Python 3.13.18. No code changes of my own; no game data.

AI-assisted.

@TG0000

TG0000 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested e5ef738 on AMD Radeon RX 6800 (RDNA2 gfx1030, AMD 26.11.2, Windows 11): pass

Trial merge onto main b2801e2.

  • python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_f16_frexp_ldexp: 1 shader, 1 translated, 1 passes spirv-val. PASS cs_f16_frexp_ldexp: 65536 inputs x 21 exponents, every word exact.
  • python -I scripts/run_gpu_tests.py --build runtime/build (full suite): 247 shaders, 247 translated, 247 pass spirv-val. 223/241 passed, 17 skipped, 1 failed. The one GPU failure is ms_wave_info_s3 (at (0,0): got (-1,-1,-1,-1), want (0.0078,0.0078,0.5,1.0)), which is known to be flaky on bare main on this RX 6800. This PR does not touch it.
  • python -m pytest tests/test_shader_checks.py: 88 passed, 15 failed. The same 15 fail on bare main b2801e2 (83 passed, 15 failed): TypeError: Wave64Checks.run_checks.<locals>.harness() got an unexpected keyword argument 'cwd'. The PR adds 5 tests and all 5 pass.

Toolchain: llvm-mingw 20261117 clang, CMake 4.5.1 + Ninja, -DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF (Vulkan test targets only), llvm-mc from llvm-mingw, Python 3.12. No game files used.

@carlos-seiffert

Copy link
Copy Markdown

Tested e5ef738 (merged onto main 86a7807) on NVIDIA GeForce RTX 2060 (Turing), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 (10.0.26300), subgroup size 32: pass

What I ran: python -I scripts/run_gpu_tests.py with the Vulkan tools built from 86a7807 (llvm-mingw + Ninja, -DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF, Vulkan-Headers 6802bb47), llvm-mc 23.1.6 and SPIRV-Tools from conda-forge.

main 86a7807 this PR on main
full GPU suite 191/240 passed, 48 skipped, 1 fail 192/241 passed, 48 skipped, 1 fail

The new GPU test runs and passes: cs_f16_frexp_ldexp — 65536 inputs x 21 exponents, every word exact.

tests/test_shader_checks.py (15 errors), tests/test_f64_conversion.py (6 failures) and tests/test_f64_output_modifiers.py (7 failures) fail the same way on main 86a7807 without this PR, so they are not counted against it.

The one failure on both sides is ms_wave_info_s3, which fails on main on this GPU (10/10 runs) and is fixed by #7136 / #5741 / #5855; it is unrelated to this PR.

AI-assisted run (Claude Code); the numbers are from my machine.

@SlopTart

SlopTart commented Nov 23, 2026 •

Copy link
Copy Markdown

Row: head e5ef73839 — Linux (Arch), AMD Radeon RX 7900 XT (RADV NAVI31), Mesa 26.2.5, native wave64 (subgroup 32..64 — first row here on a 64-wide device; prior rows are M2 4..32, RX 6800 RDNA2, RTX 2060), llvm-mc 23.1.3, SPIRV-Tools 2026.4. Head merged cleanly onto main 042c5f378.

Synthetic shaders only. Posted by Hermes (agent).

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.