Commit Graph

386 Commits

Author SHA1 Message Date
1c80759bca Merge pull request #1768 from AlxcBTW 2026-11-22 09:15:12 -05:00
c6e12d342d Merge pull request #1733 from Alex Arenas 2026-11-22 09:14:56 -05:00
f0cddb90f8 Merge pull request #1578 from Dominik 2026-11-22 09:14:47 -05:00
a178a06b34 salu_diff: s_nand/s_nor/s_xnor_b64 in the generator; hardware-checked nand/nor/xnor
The translator already handles s_nand/nor/xnor_b32 and _b64 (rdna2spirv.py,
tests/semantic), so no translator change. What was missing: the _b64 forms in
salu_diff's generator, a GPU test of the translated output, and a hardware
comparison. Adds the three _b64 ops to salu_diff (and LANE_MASK_OPS),
ps_scc_logic32/64.asm (values and SCC by hand) registered in check.py and
run_gpu_tests.py, and a docs/design.md row with the hardware counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:00:17 +01:00
52c3a88947 GPU test: image atomics in a pixel shader (ps_imgatomic)
1,018 of the corpus's 1,038 image-atomic shaders are pixel shaders, but every GPU test of image atomics ran in a
compute shader (found by @aslan2142). ps_imgatomic does the corpus's forms in a pixel shader: image_atomic_umax,
umin and or on three 8x8 2D r32ui images (64 pixels contend for each texel) and umax on a 4x4x4 3D image, each
found through its own T# in the descriptor table and the set-0 r32ui storage arrays. Odd pixels are discarded
after their atomics, which must still count.

vk_bindless_test runs it when given ps_imgatomic.spv: it enables fragmentStoresAndAtomics (exit 77 without it),
clears the images (umin to all ones), draws, and checks all 256 texels against a model of the 4096 pixels and the
render target's discarded columns. run_gpu_tests.py and check.py run it next to ps_tex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:42:22 +00:00
ddd4b7a8b5 scripts/build_runtime.ps1: switch to UTF-8 (chcp 65001) so Ninja /showIncludes tracks headers on non-English Windows 2026-11-22 14:41:41 +01:00
61a8499b85 Merge pull request #1701 from Jolymmiles 2026-11-22 08:38:34 -05:00
5f76cc2b27 Merge pull request #1680 from abilliontokens 2026-11-22 08:38:21 -05:00
a9c0d3bfb9 Merge pull request #1659 from Anira
# Conflicts:
#	docs/design.md
2026-11-22 08:38:17 -05:00
42512eec28 Merge pull request #1549 from tylerstraub 2026-11-22 08:38:03 -05:00
bb0ecfc089 Merge pull request #906 from AlxcBTW 2026-11-22 08:37:59 -05:00
b7201d7147 Merge pull request #616 from SirAmong
# Conflicts:
#	docs/design.md
2026-11-22 08:37:58 -05:00
64d41a89a6 Translator: v_sin/v_cos reduce with x - RoundEven(x), contract row and GPU test (SHADER-88 follow-up to #1283)
#1283 reduced the angle in turns with Fract. For a negative argument Fract is
1 - |x|, which rounds in binary32: sin(-2**-26 turns) became +0 and the
absolute error was up to ~1.7e-7 at -0.1 turns. x - RoundEven(x) is exact in
binary32 for every finite x and keeps the angle in [-pi, pi]. The change is
inside turn_angle (shared by the f32 and f16 forms), with the variable names
of the line that test_mutations.py anchors on kept.

- tests/semantic/test_alu_sincos.py: f32/f16 against sin/cos(2*pi*x) in
  double, tiny arguments (fails on main), whole turns of either sign (+0, as
  measured on an RX 6800 by shelbykb2), +-0, inf/NaN, modifiers.
- runtime/test/shaders/cs_w32_sincos.asm: wave32 GPU regression guard
  (tolerance 1e-3, the driver Sin is only good to 2^-11), registered in
  check.py and run_gpu_tests.py.
- docs/design.md: contract row with the RX 6800 measurement and what is not
  matched (half/quarter turns, the small-x constant, inf/NaN words).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 08:34:03 -05:00
1062df5154 Shader: accept abs on v_pack_b32_f16 (a sign clear of the packed half)
Follow-up to #1570, which took the `neg` half of SHADER-260 and left `abs`
refused. `abs` is the ISA's absolute value of the operand: a clear of the
sign bit, on the 16-bit half the operand contributes and applied before
`neg` (which #1570 emits as a bit 15 flip). The instruction already moved
each half unchanged, so the translator emitted nothing for `abs` and threw
`Unsupported("v_pack_b32_f16 abs modifier")` for any shader that used it.

Emit the clear instead: OpBitwiseAnd 0x7FFF on the selected half, before
the `neg` xor. No hardware run of this instruction with `abs` exists, so
the docs row says the rule is ISA-derived and unmeasured rather than
quoting a measurement.

Tests: exact-bit CPU cases in tests/semantic/test_pack_b32_f16_mods.py and
tests/test_values.py (both halves, op_sel, an sNaN payload, neg+abs order),
the interpreter-run GPU fixture ps_f16_pack_mods with its words derived
from the rule, and the row in docs/design.md.

SHADER-260, Depends on: #1570
2026-11-22 15:23:17 +02:00
44288b3033 Merge remote-tracking branch 'origin/main' into w-pso4
# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
#	runtime/test/shaders/check.py
#	runtime/test/vk_test_device.h
#	scripts/run_gpu_tests.py
2026-11-22 14:19:31 +01:00
b0c587ea27 Wine tests: ship generated test shaders and map the build checkout's drive
d3d12_compute, d3d12_draw, d3d12_r9g9b9e5_uav, d3d12_descriptor and d3d12_indirect_rt open their GLSL test
shaders through absolute paths compiled into them (LEONIDA_TEST_*_SPV, D:/a/Leonida/Leonida/runtime/build/
generated/*.spv). The runtime-windows artifact didn't carry generated/*.spv and Wine has no such D: drive, so
they failed under Wine (copy_file threw, exit 3, or the shader read failed).

The artifact now includes runtime/build/generated/*.spv, and run_wine_tests.py points the drive of
--windows-root at --root in the Wine prefix for the run (a dosdevices link to a scratch folder), leaving a
drive the prefix already has untouched and removing both links afterwards.
2026-11-22 17:15:41 +04:00
cfcc1de491 GPU runners: ps_ij_computed SKIPs, not FAILs, without PerVertexKHR inputs
Follow-up to #1545 (SHADER-177). Under --bary-fallback and --f16-interp-fallback the translator refuses a
computed I/J pair, so ps_ij_computed has no .spv, and both runners reported "missing .spv" instead of SKIP:
9018411c's bary skip in run_gpu_tests sits inside the PIXEL_VERTEX branch (ps_ij_computed is not in it) and
after the missing-.spv check, check.py's skip came after its .spv check too, and neither knew the f16
fallback, which run_gpu_tests turns on by default where PerVertexKHR doesn't compile (MoltenVK). Both runners
now skip it first, under either fallback; a missing .spv without a fallback is still a failure.
tests/test_run_gpu_tests.py covers both runners.

Co-authored-by: crastinator <qvaras@proton.me>
2026-11-22 05:11:19 -08:00
806ca614e3 Merge pull request #1665 from Vonsek 2026-11-22 08:08:36 -05:00
1676a01a80 Merge pull request #1641 from Vonsek 2026-11-22 08:08:22 -05:00
dc93d39ce9 Merge pull request #1606 from Vonsek 2026-11-22 08:08:09 -05:00
36dbff0049 Merge pull request #1561 from Zebraine 2026-11-22 08:08:04 -05:00
1043dac503 Support GFX10 signed 32-bit typed buffer formats (SHADER-257) 2026-11-22 05:06:13 -08:00
0a1b235854 Merge remote-tracking branch 'upstream/main' into codex/implicit-typed-mips
# Conflicts:
#	scripts/run_gpu_tests.py
2026-11-22 14:05:00 +01:00
fa34cc023a Merge remote-tracking branch 'upstream/main' into codex/array-image-query-size
# Conflicts:
#	tests/test_shader_checks.py
2026-11-22 14:04:59 +01:00
c2251c16ce Tests: s_and/s_or/s_andn2_saveexec_b64 and s_andn2_wrexec_b64 with VCC and SGPR-pair sources in wave64
cs_w64x_saveexec_b64 checks the new EXEC per lane, D (old or new EXEC) and SCC, with old EXEC and S0
different in each 32-lane half. test_saveexec_b64.py runs the four ops on all 64 lanes for both sources
against the ISA lines, and the fixture.

AI-assisted.
2026-11-22 14:02:17 +01:00
9018411c74 run_gpu_tests checks ps_ij_computed with check.py's rule
#1545 added ps_ij_computed and its check to check.py only, so run_gpu_tests.py failed it with "no checker defined".
The check is now check.ij_computed_problem, used by both runners; run_gpu_tests also skips it under
--bary-fallback like check.py. Passes in both GPU runs on an RTX 4060 Ti.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:49:48 -05:00
e5f9661dac fix(translator): preserve implicit mip selection for typed 2D samples
Sampling an integer image through a float view makes D16 convert the wrong numeric values. Compute the quad derivatives before branching to the matching view so implicit minification still chooses the correct level.
2026-11-22 13:47:51 +01:00
3c6380c22e fix(test): preserve the upstream lane-select comment 2026-11-22 13:47:51 +01:00
19fcbb2027 Treat scalar CTest output expressions as single patterns 2026-11-22 20:45:05 +08:00
e1703a1c60 Merge pull request #1609 from Luiz Neves 2026-11-22 07:38:32 -05:00
19b1ec0af4 Merge pull request #1585 from LuanFreitas 2026-11-22 07:38:23 -05:00
868f3f8153 Merge pull request #1584 from AlxcBTW 2026-11-22 07:38:23 -05:00
cdbacc418d Merge pull request #1571 from liang-kai-shui 2026-11-22 07:38:17 -05:00
bb1b86d2a1 Merge pull request #1568 from bbareth 2026-11-22 07:38:16 -05:00
4717f13f7c Merge pull request #1565 from Vyral1978
# Conflicts:
#	docs/design.md
2026-11-22 07:38:15 -05:00
622d58b763 Merge pull request #1561 from Zebraine 2026-11-22 07:38:12 -05:00
c7dfd34fda Merge pull request #1552 from Luiz Neves 2026-11-22 07:38:08 -05:00
12eab0b570 Merge pull request #1489 from AlxcBTW 2026-11-22 07:38:00 -05:00
7173782f05 GPU test cs_w32_new_ops: ops merged today with CPU-only checks
s_quadmask_b32/b64, s_bitreplicate_b64_b32, v_cvt_pknorm_i16/u16_f32,
ds_wrxchg2_rtn_b32 and the ds_nop / v_clrexcp no-ops were merged with
semantic tests only. cs_w32_new_ops.asm has lane 0 of a wave32 group
store one word of each; check.py and run_gpu_tests.py expect the eight
words (derived in the .asm header), so CI runs it on llvmpipe.

tests/semantic/test_new_ops_fixture.py runs the fixture on the CPU,
checks the words against values computed from the ISA definitions, and
that both GPU runners expect the same words.
2026-11-22 09:35:20 -03:00
444de13ca4 GPU test cs_w32_misc_ext: more ops that only had CPU checks
s_nand_b64, s_xnor_b64, v_cvt_pk_u16_u32, v_cvt_pk_i16_i32,
v_mad_u32_u16, v_mad_i32_i16, ds_cmpst_rtn_b32 and ds_write2_b64 /
ds_read2_b64 were added with semantic tests only. cs_w32_misc_ext.asm has
lane 0 of a wave32 group store one word of each; check.py and
run_gpu_tests.py expect the eight words (derived in the .asm header), so
CI runs it on llvmpipe.

tests/semantic/test_misc_ext_fixture.py runs the fixture on the CPU,
checks the words against values computed from the ISA definitions, and
that both GPU runners expect the same words.
2026-11-22 09:35:20 -03:00
d63d9c9a05 Merge origin/main into pso-subgroup-size-v2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 13:34:03 +01:00
67c8ffe45c fix(shader): query dimensions from 2D array image views
Array resource queries need the array at the descriptor index so the third component reports the view's layer count. Check the returned dimensions through a draw against the existing 12-layer texture.
2026-11-22 13:33:58 +01:00
9f681772df Tests: skip ps_vcmpx_forms when fragment subgroups may run narrower than 32 (TEST-205)
On devices with minSubgroupSize under 32, vk_harness cannot pin fragment (#1318), so the
v_cmpx EXEC packing in ps_vcmpx_forms is not comparable to the 32-lane expectation.
2026-11-22 09:33:33 -03:00
f3977cac42 Merge main into test-184-image-ops
main is at 41f44826. Two conflicts, both sides kept:

- docs/design.md: both sides edited the one-line "Ray tracing" row. Main's
  row (the triangle node types and their vertex slots), with this branch's
  sentence about cs_bvh32 where it stood.
- tests/test_shader_checks.py: main counts ps_ssharp (9 -> 10) and patches
  sampler_test on the lines next to this branch's STORE_WORDS / GET_LOD_TESTS
  terms and its get_lod_test patch. All four lines.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 07:33:23 -05:00
21a8e07168 Fix what the merge round broke: w64_graphics fixtures, the R24G8 FORMAT_SUPPORT check, four tools' stdout
- run_gpu_tests.py: #1541's wave64 pixel fixtures (runtime/test/shaders/w64_graphics.py FIXTURES, tiers A-C) are
  checked by that runner; run_gpu_tests picked up their .asm and failed 14 of them with "no checker defined".
  It now leaves w64_graphics.FIXTURES to that runner.
- d3d12_d24_support_test (#1493): expected DEPTH_STENCIL in FORMAT_SUPPORT for R24G8_TYPELESS. Measured here, the
  host D3D12 (RTX 4060 Ti and WARP) reports 0x001010b0 for R24G8_TYPELESS and 0x003110b0 (DEPTH_STENCIL) only for
  D24_UNORM_S8_UINT, which #1511's per-format rules follow; the check now expects the bit for the typed format only.
- fma_mix_probe, text_tables, wave64_halves, xdxr_bvh: new tools without #1428's stdout errors='replace' guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:29:31 -05:00
07aac8aa68 run_wine_tests: create the summary folder and report an unwritable summary
--summary was opened after the whole run, so a missing folder ended the
job in a FileNotFoundError and an unwritable path raised as well. Create
the folder before writing and report an unwritable summary as one ERROR
line with exit 1 after the results, as the other report writers do.
Extend tests/test_run_wine_tests.py with both cases.
2026-11-22 20:19:11 +08:00
324b814a38 shader_stats.py: diagnose missing statistics CSV columns 2026-11-22 13:18:55 +01:00
1a156425c7 Merge fork/m2-textured-draw into m3-synthetic-gate
# Conflicts:
#	scripts/run_gpu_tests.py
2026-11-22 13:18:51 +01:00
47e1ea7393 Honor CTest output expressions in the Wine test runner 2026-11-22 20:14:39 +08:00
e4f1093278 M2 test: sampler control (ps_m2_uoff, WRAP left / CLAMP right, CPU-predicted pixels)
With U in range, a POINT/CLAMP sampler, a POINT/WRAP one and the fallback sampler give the same pixels, so the
first pass cannot tell which sampler a draw used. The control adds 1 to U before image_sample and picks the sampler
per half through the sampler table: 4096 of 4096 pixels match the CPU prediction and 1536 differ from the plain pass.

Sampler control suggested and measured by @Vonsek in #1489.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:10:05 +01:00