Commit Graph

803 Commits

Author SHA1 Message Date
d11e39bb39 Merge pull request #599 from LuanFreitas 2026-11-21 20:38:54 -05:00
2452a5b89a Merge pull request #575 from IAmNotSiob 2026-11-21 20:38:53 -05:00
ab9c9bcbb8 Merge pull request #527 from dcastell1 2026-11-21 20:38:50 -05:00
e5d9f28a4f Merge pull request #489 from eIBart0 2026-11-21 20:38:47 -05:00
b95f0f8b25 Merge pull request #398 from troythedecoyx 2026-11-21 20:38:43 -05:00
dbb3319681 Shader: pack d16 image sample/gather results with integer f32->f16 RTE
Work around an amdvlk64 pipeline-creation crash (0xC0000005 on RX 9070 XT)
triggered when GLSL.std.450 PackHalf2x16 on an OpImageSampleExplicitLod d16
result feeds a structured loop (OpLoopMerge inside OpSelectionMerge) using
OpGroupNonUniformAny.

Replace PackHalf2x16 at the two d16 image_gather4*/image_sample* sites in
tools/rdna2spirv.py with a branchless pure-integer IEEE-754 binary16 RTE
packer (Gen.f32_to_f16_int / Gen.pack_f16_pair_int). Leave all other
PackHalf2x16 call sites unchanged.

Add unit tests covering edge cases and a 58,368-value sweep across all 256
exponents (tests/test_d16_pack.py), SPIR-V translation/validation tests for
d16 image_sample and image_gather4 (tests/test_translate.py), and a synthetic
GPU sample shader (runtime/test/shaders/ps_texture_sample_d16.asm).
2026-11-21 22:24:31 -03:00
14d81dd093 SHADER-86: align mem_diff reference with RX 6700 typed-buffer decode
Repeat missing channels, drop the old norm-ulp1/missing-w32 splits, and allow DST_SEL 1 in the fuzzer.
2026-11-21 22:23:22 -03:00
baa6beed3a SHADER-86: match RX 6700 typed buffer decode (repeat, OpFDiv, DST_SEL 1)
Missing channels use c mod n, UNORM/SNORM divide by (2^n-1), and DST_SEL 1 is integer 1 for UINT formats.
2026-11-21 22:23:21 -03:00
b3688332f2 Merge origin/main into fuzz-3-f32-valu (regen_fixtures.py: keep ps_f32_mods and ps_f64_mods)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:22:45 +01:00
6f4bd2a9bb Merge remote-tracking branch 'origin/main' into shader-55-56
# Conflicts:
#	docs/design.md
#	tests/spirv_interp.py
#	tools/rdna2spirv.py
2026-11-22 02:22:31 +01:00
b92801178b GPU tests: run #300's cs_cvt_f32_sat on every input through VKC_SGPRS
cs_cvt_f32_sat (#300) takes its binary32 input in s4, so neither runner
ran it. Now both do: one dispatch per input of
tests/semantic/test_float_to_int.py (check.CVT_F32_SAT_CASES), each
judged on both words (v_cvt_u32_f32 in out[0], v_cvt_i32_f32 in out[1]).

- check.cvt_f32_sat_test() and the run_gpu_tests.py branch report
  "16/16 inputs exact", or how many were wrong and the first one.
- tests/test_shader_checks.py: the fake device answers from the word in
  VKC_SGPRS; every input must be sent, one wrong input must fail and be
  named, and the table must equal the interpreter test's CASES.

On NVIDIA this checks the fixed translation, but it cannot catch the old
bug: with the translator from before #300 (273e53c^1) the RTX 4060 Ti
also gives 16/16, since SPIR-V leaves an out-of-range conversion
undefined and this hardware saturates anyway. A driver that does not
(@EchoTD's RADV case on #300, constant inputs) is where it can fail;
tests/semantic/test_float_to_int.py pins the rule itself.

AI-assisted (Claude Code). Tested on NVIDIA GeForce RTX 4060 Ti (Ada,
subgroup 32), driver 32.0.16.2124, Windows 11, on main d937b7f:
run_gpu_tests.py cs_cvt_f32_sat "16/16 inputs exact" natively and with
LEONIDA_W64_EMULATE=1; check.py cs_cvt_f32_sat ok;
tests/test_shader_checks.py 18/18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:22:13 -06:00
95ab84432d vk_compute_test: seed s4.. from VKC_SGPRS, so a compute test can take an input word
vk_compute_test always put the output V# in s[0:3] and zero in every
other user SGPR, so a compute test shader could not be given an input
word: #300's cs_cvt_f32_sat reads its float from s4 and could only be
checked on a GPU by building one shader variant per input by hand.

- VKC_SGPRS=w4,w5,... sets s4, s5, ... up to s31 (s[0:3] stay the output
  V#), with the same syntax and checks as vk_harness's VKH_SGPRS: decimal
  or 0x hex, no sign, nothing above 32 bits, no trailing comma, at most
  28 words; anything else exits 2 with a message.
- cs_user_sgprs.asm declares eight user SGPRs (RSRC2 0x8090) and stores
  s4..s7 back. Both runners seed it with 0x4f000000,0xdeadbeef,7,
  0xffffffff (check.USER_SGPRS) and expect those words, then the
  0xEEEEEEEE fill.
- check.compute_test() takes an env for vk_compute_test.
- tests/test_shader_checks.py: the fake harness only answers
  cs_user_sgprs with the seeded words when VKC_SGPRS was passed, and no
  other test may get VKC_SGPRS.

AI-assisted (Claude Code). Tested on NVIDIA GeForce RTX 4060 Ti (Ada,
subgroup 32), driver 32.0.16.2124, Windows 11, on main d937b7f:
- run_gpu_tests.py cs_user_sgprs PASS natively and with
  LEONIDA_W64_EMULATE=1; check.py cs_user_sgprs ok
- vk_compute_test directly: unset -> s4..s7 read 0; "5" sets s4 only;
  28 words accepted; "1,2,", "-1", "0x1ffffffff", "abc" and 29 words
  exit 2
- test_shader_checks.py fails (7) if check.py stops passing VKC_SGPRS
- full suite: see the PR

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:22:03 -06:00
8521b0b465 Merge origin/main into fuzz-3-f32-valu
spirv_mini_interp.py: keep main's _F32 (sNaN bits, #533) and its vector-aware
RoundEven/Floor/Ceil/Trunc; keep this branch's fma_f32, OpFDiv and
Exp2/Log2/Sqrt/InverseSqrt. regen_fixtures.py: both sides' shaders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:21:00 +01:00
ddef80130d fix(tests): keep one PIXEL_TESTS registry and run each pixel shader once
check.py assigned PIXEL_TESTS four times while the merge round landed;
the last assignment lost ps_texoff, so a standalone run could be green
without exercising texel offsets. Replace the chain with one tuple that
keeps every pixel fixture (ps_texoff, ps_wqm, ps_scc_mask32) and drop the
duplicate pixels() call that ran the harness twice and could hide a
first-call failure behind the second.

Adds CPU registry and single-invocation regression tests.
2026-11-22 02:17:55 +01:00
6e1efe8929 Merge pull request #596 from bbareth 2026-11-21 20:09:29 -05:00
29b3af57f7 Merge pull request #595 from bbareth 2026-11-21 20:09:28 -05:00
4c61012539 Merge pull request #593 from bbareth 2026-11-21 20:09:28 -05:00
905b6afb9a Merge pull request #591 from bbareth 2026-11-21 20:09:28 -05:00
60e196519b Merge pull request #588 from andretuta 2026-11-21 20:09:27 -05:00
19902b0a8e Merge pull request #586 from bbareth 2026-11-21 20:09:27 -05:00
52a477ec94 Merge pull request #585 from eIBart0 2026-11-21 20:09:26 -05:00
77cab3ba26 Merge pull request #584 from bbareth 2026-11-21 20:09:26 -05:00
8b47705e69 Merge pull request #583 from bbareth 2026-11-21 20:09:26 -05:00
5fd6399fba Merge pull request #578 from bbareth 2026-11-21 20:09:25 -05:00
16a9d64e1f Merge pull request #577 from NRXM 2026-11-21 20:09:25 -05:00
1a6078b6d7 Merge pull request #574 from bbareth 2026-11-21 20:09:25 -05:00
767e716dd6 Merge pull request #571 from bbareth 2026-11-21 20:09:24 -05:00
44ea12da0e Merge pull request #570 from eIBart0 2026-11-21 20:09:24 -05:00
a409452f03 Merge pull request #569 from bbareth 2026-11-21 20:09:24 -05:00
d73829f87b Merge pull request #568 from Ritolino 2026-11-21 20:09:24 -05:00
492b63034c Merge pull request #563 from VictorJulianiR 2026-11-21 20:09:23 -05:00
00ddff632e Merge pull request #560 from VictorJulianiR 2026-11-21 20:09:22 -05:00
b5cc84cac2 Merge pull request #559 from Ritolino 2026-11-21 20:09:22 -05:00
56e2551cdc Merge pull request #557 from bbareth 2026-11-21 20:09:21 -05:00
425d040ec8 Merge pull request #556 from bbareth 2026-11-21 20:09:21 -05:00
e4212556c3 Merge pull request #553 from NRXM 2026-11-21 20:09:20 -05:00
556be0647a Merge pull request #552 from bbareth 2026-11-21 20:09:20 -05:00
298a69da7e Merge pull request #551 from eIBart0 2026-11-21 20:09:19 -05:00
42c9c9a127 Merge pull request #550 from bbareth 2026-11-21 20:09:19 -05:00
81f0bab87c Merge pull request #549 from NRXM 2026-11-21 20:09:19 -05:00
c555b4c2bd Merge pull request #512 from SuarezPM 2026-11-21 20:09:17 -05:00
6a55f981e0 Merge pull request #503 from Tomgamer 2026-11-21 20:09:16 -05:00
2720df12a1 Merge origin/main into f64-output-modifiers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
#	tests/semantic/regen_fixtures.py
2026-11-22 02:07:19 +01:00
6ea9f97aac tests: skip the wave32 lane-mask dumps below 32 lanes (llvmpipe CI)
cs_wqm_w32 (SHADER-34) and cs_w32_lane_wrap (SHADER-52) check 32-lane
EXEC/VCC masks and lane selects. On Mesa llvmpipe, whose compute
subgroups are 8 wide, they can't produce their words, and the
"GPU tests on llvmpipe" step in runtime.yml has failed on main since
91b36cf. Skip them where vk_compute_test reports a widest subgroup
below 32 lanes, the rule ps_bitmask_perm already uses, in check.py and
run_gpu_tests.py (which reuses check.py's helper). Devices with 32 or
more lanes still run and judge them.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
(cherry picked from commit be466779a2a1e988f58803ab1eedca6cc6a07375)
2026-11-21 22:06:49 -03:00
12b6b9fcd2 tests: skip the wave32 lane-mask dumps below 32 lanes (llvmpipe CI)
cs_wqm_w32 (SHADER-34) and cs_w32_lane_wrap (SHADER-52) check 32-lane
EXEC/VCC masks and lane selects. On Mesa llvmpipe, whose compute
subgroups are 8 wide, they can't produce their words, and the
"GPU tests on llvmpipe" step in runtime.yml has failed on main since
91b36cf. Skip them where vk_compute_test reports a widest subgroup
below 32 lanes, the rule ps_bitmask_perm already uses, in check.py and
run_gpu_tests.py (which reuses check.py's helper). Devices with 32 or
more lanes still run and judge them.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
(cherry picked from commit be466779a2a1e988f58803ab1eedca6cc6a07375)
2026-11-21 22:06:35 -03:00
9cc407c84d tests: skip the wave32 lane-mask dumps below 32 lanes (llvmpipe CI)
cs_wqm_w32 (SHADER-34) and cs_w32_lane_wrap (SHADER-52) check 32-lane
EXEC/VCC masks and lane selects. On Mesa llvmpipe, whose compute
subgroups are 8 wide, they can't produce their words, and the
"GPU tests on llvmpipe" step in runtime.yml has failed on main since
91b36cf. Skip them where vk_compute_test reports a widest subgroup
below 32 lanes, the rule ps_bitmask_perm already uses, in check.py and
run_gpu_tests.py (which reuses check.py's helper). Devices with 32 or
more lanes still run and judge them.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
(cherry picked from commit be466779a2a1e988f58803ab1eedca6cc6a07375)
2026-11-21 22:06:20 -03:00
c7ea4b4aaa Merge the upstream two-mip fixture with the a16 gradient test
Keep both texture draws in the standalone checker, the GPU runner and its expected case count.
2026-11-22 02:04:42 +01:00
b6eda1e60c Translator: flush f16 denormals in the quantized interpolant path
AI-assisted. Addresses IAmNotSiob's review on #512 (he is taking the
arithmetic sites under SHADER-56/#513; f16_roundtrip stays here).

SPIR-V's OpQuantizeToF16 returns +0/-0 when the magnitude is too small for a
normal f16, and it pins no rounding mode. The docstring, the design row and the
test's rule text now say "round to nearest, f16 denormals flushed to signed
zero" and warn against reusing the helper where denormals or a rounding mode
matter.

The mini-interpreter used struct.pack('<e'), which keeps f16 subnormals: it was
more precise than any conforming driver, so a test could pass here and fail on a
GPU. It now flushes after float_to_half, and the test's independent oracle does
the same. A new case pins 1e-6 -> +0.0 and -1e-6 -> -0.0 through a translated
flagged shader (PS input 1e-6 is an f16 subnormal, 6.1e-5 is the smallest
normal); without the interpreter flush that test is red.

Existing 1.1 -> 1.099609375 pin and the opcode pin are unchanged.
2026-11-21 22:04:36 -03:00
2a41e7a44c Navmesh: decode 0DRP cover-point pages, 0x00010015 tiles and Band-3 grids (ASSET-22) 2026-11-21 22:03:23 -03:00
97e0b626a5 ab_control_flow.py: --count, --runs and --timeout must be at least 1
select_candidates() checks `len(picked) >= count` after appending, so
--count 0 or a negative count still picked (and ran) one shader.
--runs 0 rendered nothing and classified every shader as "dispatch form
failed to run", and --timeout 0 gave the harness no time at all. The
three options are now positive whole numbers (argparse errors before
the output folder is made), and select_candidates() refuses a count
below 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:03:07 +01:00