Skip to content

GPU tests: v_cvt_f16_i16/u16, v_cvt_i16/u16_f16, v_cvt_f32_ubyte0..3, v_cvt_f32_f64 (EGEN-GPU-CVT16) - #2291

Open
Vonsek wants to merge 7 commits into
ItsNotRexed:mainfrom
Vonsek:test/gpu-cvt16
Open

Vonsek wants to merge 7 commits into
ItsNotRexed:mainfrom
Vonsek:test/gpu-cvt16

Conversation

@Vonsek

@Vonsek Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Requested by Lucas · project thread

Claimed in the coordination issue as: EGEN-GPU-CVT16 (claim comment)

What and why

v_cvt_f16_i16, v_cvt_f16_u16, v_cvt_i16_f16, v_cvt_u16_f16, v_cvt_f32_ubyte0..3 and v_cvt_f32_f64 were checked on the CPU or by hardware probes only. This adds GPU tests and semantic fixtures for them. Translator and rules are unchanged.

Tested

  • scripts/run_gpu_tests.py --filter cvt: cs_cvt16 64/64 dumped words exact, ps_cvt_f32_f64 4096/4096 pixels exact, on NVIDIA GeForce RTX 5080 (driver 616.92) and on the AMD Radeon RDNA2 iGPU (driver 26.10.1, wave64), Windows 11.
  • Negative controls (both GPUs and the interpreter test fail, then reverted): swapping ubyte1/ubyte2 in the translator gives word 21: expected 0x434d0000, got 0x432b0000; zero-extending the i16 in v_cvt_f16_i16 gives word 2: expected 0xaaaae800, got 0xaaaa7bc0.
  • python -m unittest discover -s tests/semantic, python tests/semantic/regen_fixtures.py --check, python -I tests/test_shader_checks.py: OK.

AI-assisted.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No new rule; the existing rows now cite the GPU tests.)

…and v_cvt_f32_f64

cs_cvt16 dumps 24 words: i16/u16 to f16 ties to even and sign extension,
f16 to i16/u16 truncation, saturation and NaN, the kept destination high
half, and the four ubyte selections. ps_cvt_f32_f64 checks f64 to f32
round to nearest even and overflow to infinity. Expected words are derived
by hand in the .asm headers; semantic fixtures and tests added, and the two
docs/design.md rows name the tests.

AI-assisted.
Conflicts:
	docs/design.md
	runtime/test/shaders/check.py
	scripts/run_gpu_tests.py
	tests/semantic/regen_fixtures.py

AI-assisted.
@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Merged main (62b7576) again; CPU checks and the PR's GPU tests pass on Radeon RDNA2 iGPU. AI-assisted.

@tylerstraub

Copy link
Copy Markdown
Contributor

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

Independent synthetic Vulkan check of 62b7576bd212342ed04889b65d22b2c12c89ef77 on Linux 7.0.0-43 (RTX 5090, NVIDIA 595.99.02, LLVM 21.1.8, SPIRV-Tools 2026.1).

  • cs_cvt16 matched all 24 conversion words and preserved all 40 fill words.
  • ps_cvt_f32_f64 matched all 4,096 pixels. Each contained 3f800000 3f800001 3f800002 ff800000 for the two ties, the value just above a tie, and negative overflow in fixture order (tie, above tie, tie, overflow).
  • As a scratch control, moving the above-tie input down to the exact midpoint changed only the second word from 3f800001 to 3f800000 at every pixel. The runner flagged all 4,096 pixels.
  • SPIR-V validation, both targeted semantic tests, and fixture regeneration passed.

AI-assisted verification.

@yagoviccari1-spec

Copy link
Copy Markdown

Tested 62b7576 on Windows 11 build 26200.9974, NVIDIA RTX 5060 Ti / driver 621.24 (Vulkan 1.4.357), MSVC 19.44.35207, llvm-mc 21.1.8 (scripts/build_llvm_mc.ps1), SPIRV-Tools v2026.4, CMake 4.5.1 + Ninja 1.13.2. No game files.

  • Full run_gpu_tests.py on the PR head: 192 shaders translated, 192 pass spirv-val; 141/187 passed, 46 skipped, 0 failed. Device line from the run: cs_bvh device: NVIDIA GeForce RTX 5060 Ti (subgroup 32..32).
  • Same command on main 4947579 on this machine: 190 shaders translated, 190 pass spirv-val; 139/185 passed, 46 skipped, 0 failed. So this PR adds exactly 2 shaders, 2 tests and 2 passes, with the skip count unchanged.
  • --filter cvt run twice on the PR head: cs_cvt16 64/64 dumped words exact both times, ps_cvt_f32_f64 4096/4096 pixels exact both times. The other cvt tests in that filter (cs_cvt_f32_sat, cs_cvt_pk_u8, ps_cvt_off) pass too.

This is a Blackwell / 32-wide-subgroup data point; the PR already reports RTX 5080 and an RDNA2 iGPU. Ran with an AI agent on my machine.

@emirduran707

Copy link
Copy Markdown
Contributor

Tested 62b7576 on AMD Radeon RX 9060 XT (RDNA4), AMD driver 26.10.44 (LLPC, Vulkan driver 2.0.395), Windows 11 Pro 10.0.26300, subgroup 32..64: pass. The check above is NVIDIA on Linux; this one is AMD on Windows, with native 64-wide subgroups.

  • run_gpu_tests.py --filter cs_cvt16: PASS cs_cvt16 64/64 dumped words exact. --filter ps_cvt_f32_f64: PASS ps_cvt_f32_f64 4096/4096 pixels exact. Both the same with LEONIDA_W64_EMULATE=1.
  • Whole suite (native wave64): 192 shaders translated, 192 pass spirv-val; 172/187 passed, 15 skipped, 0 failed (main 4947579 here: 170/185, 15 skipped). The skips are the 14 fixtures the d3d12_* tests run, and ps_w64x_readlane (see check.py: judge ps_w64x_readlane where vk_harness required 64 (its line has no "required") #2085).
  • build.py + check.py: 206 shaders translated, 206 pass spirv-val; 161 of 165 pass, 4 skipped; both new tests ok.
  • CPU: python -I -m unittest discover -s tests/semantic -p test_value_semantics.py 33 OK, tests/test_shader_checks.py 60 OK, tests/test_run_gpu_tests.py 30 OK, tests/semantic/regen_fixtures.py --check clean.

Test programs: an MSVC 14.44 build of 4947579, this PR's base; the PR changes no C++ or CMake. llvm-mc 21.1.8 (native), Vulkan SDK 1.4.363.0. No negative control run here. No game files. AI-assisted (Claude Code).

@zneel

zneel commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 62b7576b 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) 172/187, 15 skipped, 0 failed (main 49475796: 170/185)
same with LEONIDA_W64_EMULATE=1 172/187, 15 skipped, 0 failed
pytest tests/test_shader_checks.py tests/test_run_gpu_tests.py 92 passed, 232 subtests passed in 2.29s
unittest discover -s tests/semantic -p test_value_semantics.py 33 OK
tests/semantic/regen_fixtures.py --check clean

This PR's shaders:

  • native: PASS cs_cvt16 64/64 dumped words exact; emulated: PASS cs_cvt16 64/64 dumped words exact
  • native: PASS ps_cvt_f32_f64 4096/4096 pixels exact; emulated: PASS ps_cvt_f32_f64 4096/4096 pixels exact

First RDNA4 run here, after the RTX 5080 and the RDNA2 iGPU in the description.

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

docs/design.md
runtime/test/shaders/check.py
scripts/run_gpu_tests.py
tests/semantic/test_value_semantics.py
tests/test_shader_checks.py

AI-assisted.
docs/design.md
tests/test_shader_checks.py

AI-assisted.
scripts/run_gpu_tests.py
tests/semantic/regen_fixtures.py
tests/semantic/test_value_semantics.py
tests/test_shader_checks.py

AI-assisted.
@TreXito

TreXito commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested ee3ce81d (the rebased head) on NVIDIA GeForce RTX 3060 Ti (subgroup 32..32), driver 580.173.02, Linux (kernel 6.18), Python 3.14: pass.

  • scripts/run_gpu_tests.py: 166/212 passed, 46 skipped, 0 failed. Both new tests pass: cs_cvt16 (64/64 dumped words exact) and ps_cvt_f32_f64 (4096/4096 pixels exact).
  • ctest: 47/47 passed.
  • pytest tests/semantic/test_value_semantics.py tests/test_shader_checks.py: 120 passed, 512 subtests passed.

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

@tedin7

tedin7 commented Nov 23, 2026 •

Copy link
Copy Markdown

Tested 014eff9 (merge base 7b7d73f) on NVIDIA GeForce RTX 5080, Linux 580.65.06: pass

Tested the PR head merged with current main 7b7d73f8 (clean merge, not pushed). Runtime harnesses built from main 7b7d73f8, llvm-mc 21, Python 3.13, Vulkan SDK 1.4.363, Linux native.

Check main 7b7d73f8 this PR
run_gpu_tests.py native 170/217 passed, 47 skipped 172/219 passed, 47 skipped
run_gpu_tests.py with LEONIDA_W64_EMULATE=1 201/217 passed, 16 skipped 203/219 passed, 16 skipped
failed (native / emulated) 0 / 0 0 / 0
tests/semantic/regen_fixtures.py --check ok ok
pytest tests/semantic/test_value_semantics.py tests/test_find_hash_lookup.py tests/test_first_look_shim_report.py tests/test_shader_checks.py tests/test_shader_checks.py tests/test_run_gpu_tests.py tests/test_cf_diff.py 162 passed, 315 subtests passed (3 shared files) 207 passed, 1 skipped, 598 subtests passed in 5.74s

Line-by-line against my main run (results that differ from main):

  • native:
    • cs_cvt16 main: - pr: PASS 64/64 dumped words exact
    • ps_cvt_f32_f64 main: - pr: PASS 4096/4096 pixels exact
  • emulated:
    • cs_cvt16 main: - pr: PASS 64/64 dumped words exact
    • ps_cvt_f32_f64 main: - pr: PASS 4096/4096 pixels exact

Not run: the full unittest discover -s tests/semantic (about 6 minutes, and main alone has failures there); only the test files this PR touches plus the shared checker tests ran. No other GPU vendor, no Windows. No game files.

AI-assisted (Claude Code).

@amarovndres

Copy link
Copy Markdown

Tested ee3ce81d on AMD Radeon RX 9060 XT (RDNA4, discrete, subgroup 32..64), AMD 26.10.1 (32.0.32015.7029, LLPC, Vulkan 1.4.359), Windows 11 Pro (build 26200): pass.

  • scripts/run_gpu_tests.py (full suite; test programs built from this head with llvm-mingw, llvm-mc 23.1.6): 198/212 passed, 14 skipped, 0 failed. main d0835dd9 on the same machine: 196/210 passed, 14 skipped.
    • PASS cs_cvt16 64/64 dumped words exact
    • PASS ps_cvt_f32_f64 4096/4096 pixels exact
  • tests/semantic/test_value_semantics.py: 41 tests, OK
  • tests/test_shader_checks.py: 75 tests, OK

AI-assisted (Claude Code). Synthetic shaders only, no game files.

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.

8 participants