Commit Graph

323 Commits

Author SHA1 Message Date
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
70e495343c Merge pull request #1528 from bbareth 2026-11-22 07:08:03 -05:00
1a616a9478 Merge pull request #1526 from Emre Demir 2026-11-22 07:08:03 -05:00
497597353c Merge pull request #1521 from Luiz Neves 2026-11-22 07:08:01 -05:00
0acb7399b5 Merge pull request #1505 from DomasUrbonas 2026-11-22 07:07:56 -05:00
fdb0e84fb0 Merge pull request #1490 from Vonsek 2026-11-22 07:07:53 -05:00
33985fc88e Merge pull request #1481 from bbareth 2026-11-22 07:07:50 -05:00
db6c5790dc Merge pull request #319 from Vonsek 2026-11-22 07:07:44 -05:00
f94fc77ac2 Merge main into test/ssharp-mip-fields (#319)
Conflicts were list/registration hunks in runtime/CMakeLists.txt, check.py, run_gpu_tests.py and tests/test_shader_checks.py; kept main's side and re-added vk_sampler_test, ps_ssharp and the TOTAL count.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:02:26 +01:00
50179c110b bench_wave64.py: require positive launch counts 2026-11-22 12:58:28 +01:00
6d642f40f9 GPU test cs_w32_salu64: 64-bit scalar data ops and v_mad_u64_u32
s_brev_b64, s_bfe_u64/i64, s_bitset1_b64, s_flbit_i32_b64/i64, s_cmov_b32
(with s_sext_i32_i16) and v_mad_u64_u32 were added with semantic tests
only. cs_w32_salu64.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_salu64_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 08:58:01 -03:00
a3969c3a2c build_llvm_mc: check out LLVM with core.longpaths, so a deep -Temp works
Some llvm/docs paths are about 150 characters. With a -Temp of about 100
characters the sparse checkout failed with "Filename too long" (Windows'
260-character limit) and the script stopped at "git sparse-checkout
failed.". The clone now sets core.longpaths=true in its own config only;
the user's global git config is untouched.
2026-11-22 14:53:13 +03:00
5624023225 test: avoid NaN-sensitive framebuffer outputs (TEST-206) 2026-11-22 13:45:51 +02:00
2ea73b2522 GPU test for v_mad_u32_u16, v_mad_i32_i16 and v_subrev_f16
Two pixel tests for ops that had CPU checks only. ps_valu16_mad: the u16
product plus S2 wraps at 32 bits, i16 sign-extends (also op_sel high
halves), and the destination dword is overwritten. ps_valu16_subrev:
S1 - S0 in _e32 and _e64 (neg, clamp) with the destination high half
kept. Registered in check.py and run_gpu_tests.py and added as semantic
fixtures with hand constants and a Python reference.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:43:47 +01:00
07cf61c659 Wine tests: reject invalid launch commands and non-finite timeouts 2026-11-22 12:40:50 +01:00
71192b2e51 Merge pull request #1463 from bbareth 2026-11-22 06:38:10 -05:00
f4e0f706e1 Merge pull request #1407 from Hamza 2026-11-22 06:37:56 -05:00
923993c1c7 Merge pull request #1405 from Vonsek 2026-11-22 06:37:55 -05:00
5ba8667c9b Wine tests: treat host-signal termination as a failure 2026-11-22 12:33:16 +01:00
1681f3dc1e Translator: --f16-interp-fallback reads f16 halves without PerVertexKHR (SHADER-196)
MoltenVK can't compile PerVertexKHR to MSL, so ps_interp_f16_high failed at
pipeline creation on every Mac. With --f16-interp-fallback every VS/mesh param
(and the --mesh-compute VS) also exports its two f16 halves decoded to f32,
low halves at location 29 - 2N and high halves at 30 - 2N, and a PS *_f16 read
takes them as ordinary smooth inputs. A producer skips halves that would land
on its own params; a PS whose half location is also an attribute is rejected.
The index records f16_halves on both sides.

tools/vk_subgroup_info.py reports per_vertex_inputs (false without
fragmentShaderBarycentric or on MoltenVK); make_game.py and run_gpu_tests.py
turn the flag on where it is false. Without the flag all 139 GPU-test modules
are byte-identical to main's, so NVIDIA/AMD keep the exact per-vertex path.

Apple A18 Pro, macOS 26.6.2, MoltenVK 1.4.2: ps_interp_f16_high passes, all
4096 pixels bit-exact; run_gpu_tests.py 84 pass/50 skip/1 fail -> 85/50/0
native, 112/22/1 -> 113/22/0 with wave64 emulation; ms_f16_pack passes through
--mesh-compute. Semantic suite 1194 -> 1203 OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI-assisted
2026-11-22 14:32:28 +03:00
4def9b297b GPU test cs_w32_int_ext: integer ops that only had CPU checks
s_absdiff_i32, s_lshl2_add_u32 (and the SCC of s_lshl1_add_u32),
s_pack_lh_b32_b16, s_mul_hi_i32, v_mul_hi_i32_i24, v_sad_u8 and v_lerp_u8 were
added with semantic tests only. cs_w32_int_ext.asm has lane 0 of a wave32
group store one result 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_int_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 08:29:52 -03:00
1387865c3a merge: cover wide sample inputs after D16 saturation reaches main
Use the current common image packer and its boundary-value fixture for the sample shader. Keep the merged explicit-gather paths and the headless presentation skip.
2026-11-22 12:29:49 +01:00
4d75d961af Merge pull request #1394 from Vonsek 2026-11-22 06:08:11 -05:00
5e9a2dc58d Merge pull request #1393 from DomasUrbonas 2026-11-22 06:08:10 -05:00
fa7626dbb3 Merge pull request #1384 from Dominik 2026-11-22 06:08:08 -05:00
a45d7bf397 Merge pull request #1374 from zneel 2026-11-22 06:08:05 -05:00
53f9e87620 Merge pull request #1367 from Vonsek 2026-11-22 06:08:03 -05:00
0aa78efe0f Merge pull request #1366 from undeadhuman37 2026-11-22 06:08:03 -05:00
286f5e1bbe Merge pull request #1364 from AlxcBTW 2026-11-22 06:08:02 -05:00
05922b71ff merge: retain the high half when saturating odd D16 image loads
Current main now preserves an odd load's leftover VGPR half. Apply the signed or unsigned range conversion before that shared half-word write so both behaviors survive the integration.
2026-11-22 12:06:27 +01:00
a180cf3a10 fix(translator): read 2D level-zero samples through typed views
Nearest sampling an integer image through a float view violates Vulkan's numeric-type rule. For D16 the subsequent float-to-half conversion also destroys the sampled integers, including every texel in the synthetic signed/unsigned sum.
2026-11-22 12:00:59 +01:00
53e08a76b4 Merge remote-tracking branch 'origin/main' into fma-khr
# Conflicts:
#	runtime/test/vk_test_device.h
2026-11-22 11:58:52 +01:00
6f5b59ea81 runtime: serve LoadLibrary/GetProcAddress of shim-owned modules; xgameruntime.lib's run-time entry points
The package's GDK modules don't import xgameruntime.dll. libHttpClient.GDK.dll and XCurl.dll have no import
entry for it, but both carry the wide string "xgameruntime.dll" and the names InitializeApiImpl[Ex|Ex2],
QueryApiImpl and UninitializeApiImpl next to a statically linked XGameRuntimeInitialize: xgameruntime.lib's
thunks LoadLibraryW the runtime and GetProcAddress those names. Bound to the host, that bypasses the offline
shim. The executable is very likely built the same way.

- library_loader.cpp: LoadLibrary*/GetModuleHandle*/GetProcAddress/FreeLibrary for kernel32, kernelbase and the
  api-ms-win-core-libraryloader sets. A module the registry owns (rt::shims::owns_dll) gets a pseudo-handle and
  GetProcAddress resolves through the registry; an unserved name is NULL with ERROR_PROC_NOT_FOUND. Every other
  module goes to the host.
- xgameruntime.cpp: the five entry points, with the signatures and the unknown-class error documented by
  xodus-gaming/xgameruntime-docs (GPL-3.0, facts only). QueryApiImpl logs the class and interface ids and refuses
  them, so the first boot with the executable names the COM interfaces to implement.
- xgameruntime_test drives the path through XCurl.dll's api-set binding; docs/runtime_imports.md records the
  measurement and the new dry-run counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:58:12 +00:00
554b1d165d test(shader): exercise BGRA stores through the GPU runner
Use the final two readback words to make both packed view formats reproducible through the existing filtered test. Give the paired RGBA cases real identity selectors.
2026-11-22 11:58:01 +01:00
da3ebde8ca test: decouple clipping tests from NaN-sensitive fragment output 2026-11-22 12:48:59 +02:00
dc0cd5debc Merge main into the constant lane-mask fix
Conflicts with main's DPP and TEST-175 entries in check.py,
run_gpu_tests.py and regen_fixtures.py: main's lists with
cs_w32_mask_imm / cs_w64_mask_imm added back.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:38:22 +01:00
bfa0565b11 Tests: the 14 v_cmpx forms no test ran, GPU and CPU
v_cmpx_{eq,gt,le,lt,ngt,nle}_f32, v_cmpx_f_i32, v_cmpx_t_u32,
v_cmpx_{eq,gt,le}_i64 and v_cmpx_{ge,lt,ne}_u64 are translated but
appeared in no test, fixture or fuzzer table.

ps_vcmpx_forms runs each in the e32 encoding, and the f32 ones,
f_i32, t_u32, gt_i64 and ge_u64 in e64 too, on operands read from
memory: NaN on either side, signed zeros, -infinity, and 64-bit pairs
that only the low word, only the high word or the sign tells apart. It
also checks that an empty EXEC stays empty and that VCC is kept. The
four words are derived from the ISA in the .asm header.

test_vcmpx_forms.py re-derives those words, runs every form in both
encodings on a table of operands, and runs each on a 16-lane wave with
one lane switched off beforehand.

No translator change: all of them pass.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 11:37:54 +01:00
c4db02a1c8 Merge pull request #1334 from ezwinxdlmao
# Conflicts:
#	docs/design.md
2026-11-22 05:37:46 -05:00
1cf18b0c12 run_gpu_tests: reject malformed or non-finite pixel readbacks (TEST-29)
662752cc made check_bary, check_grad and check_wqm fail a short or NaN
frame. The other pixel checks could still pass one:

- read_raw_rgba32f / read_raw_u32 dropped a trailing partial pixel, so a
  readback ending mid-pixel still looked like a full frame; it now reads
  as no frame.
- check_uniform_branch (ps_uniform_branch, ps_scc_mask32) took any frame
  length and a NaN barycentric i passed both range tests.
- check_flat raised ValueError on an empty readback and could pass NaN UVs.
- check_bitmask_perm passed a frame of any length with one good pixel.
- check_clip_half let NaN through on the covered half.

All of them now go through frame_problem(). The UniformBranchCheck
fixtures repeat their rows over a full 64x64 frame instead of 3 pixels.

Tested on an RTX 4070 SUPER (Windows 11, NVIDIA 32.0.16.2101):
run_gpu_tests.py 105/133 passed, 28 skipped, 0 failed before and after
(same per-test results); with LEONIDA_W64_EMULATE=1 133/133 before and
after. tests/semantic 1178 OK; the new tests fail on the old runner.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:36:29 +03:00
43d578f3cf Translator: a constant lane mask gives lane L its bit L
Gen.mask_src turned an immediate lane-mask operand into bit 0 of the
constant for every lane, so s_and_saveexec_b32 s7, 0xff00 with all lanes
on left none on and an inline 5 left all 32 on. Lane L now takes bit L:
of the 64-bit value for the 64-bit forms (inline constants sign-extended,
literals with a zero high word, as src64_data) and of the 32-bit value at
L mod 32 for s_*_saveexec_b32 and s_andn2_wrexec_b32. 0 and -1 stay
constants. s_bcnt0/1_i32_b64 of a constant now counts the constant's bits
(scalar data, like s_ff1_i32_b64) instead of this lane's mask copy.
SGPR operands are unchanged.

GPU tests cs_w32_mask_imm.asm and cs_w64_mask_imm.asm, words derived in
their headers, failed on main on an RTX 5080 and an RDNA2 iGPU and pass
now; LaneMaskConstants runs both across every lane in the semantic suite.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:33:18 +01:00
d5c0e16319 Tests: GPU test for the xy/xyz typed buffer loads and stores (TEST-185)
buffer_load_format_xy/xyz, tbuffer_load_format_xy/xyz and
buffer_store_format_xy/xyz were checked only on the CPU. The new
cs_fmt_xy_xyz.asm runs 12 loads and 9 stores on one thread, and
check.py and run_gpu_tests.py compare 128 dumped words.

Every expected word was measured by running the same body natively on a
Radeon 680M (gfx1035, RDNA2), through tools/hw_oracle's kernel wrapper
with s[0:3] set to the V# vk_compute_test passes. Wave32 and wave64 gave
the same words. What the hardware does:
- Loads write only their 2 or 3 VGPRs. A missing channel repeats one the
  format has (SHADER-86), and tbuffer loads take the instruction's format.
- Bounds: the whole element must end inside num_records, even when the
  loaded components do. Such a load reads 0, and such a store writes
  nothing.
- A store with fewer components than its format writes the whole
  element, with 0 for the rest. Into a one-channel format only x is
  written.

The translation already does all of this. The test catches a store that
fills the missing components with anything but 0, a bounds check on the
first dword only, and an xy/xyz load that writes four VGPRs: each of
these, made in a scratch copy of the translator, failed 6, 16 and 18
words.

check.py's dump comparison becomes dump_test, shared with
fmt_1010102_test, whose messages are unchanged. docs/design.md records
the measured rules in the typed-load, format-store and bounds rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:31:42 +02:00
e256a2547c Translator: --fma khr emits OpFmaKHR for fused multiply-adds
GLSL.std.450 Fma may be split into two roundings by a driver (Vulkan
environment: inherited from OpFMul followed by OpFAdd); RDNA2 v_fma_* round
once. --fma khr (default stays glsl) emits OpFmaKHR with capability FMAKHR and
SPV_KHR_fma and lists shaderFmaFloat32 in the index. Runtime device creation
and the vk_* test programs enable VK_KHR_shader_fma when present; cs_fma_fused
tests single rounding; the mini interpreter learns OpFmaKHR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:25:37 +01:00
f5c427716f fix(translator): saturate packed integer image reads
Native gfx1036 clamps out-of-range channels from signed and unsigned RGBA32 views before packing D16 results. Exercise both limits in the existing GPU readback fixture so wrapping at either boundary is observable.
2026-11-22 11:23:18 +01:00
1b88414e61 Tests: s_andn2_saveexec_b64 and s_andn2_wrexec_b64 on wave64, GPU and CPU
Neither instruction had a test (the _b32 forms are in #1299). The translator
needs no change: both pass.

- runtime/test/shaders/cs_w64x_andn2_exec.asm: one 64-lane wave. Each result
  has lanes in one half of the wave only, so an EXEC or an SCC taken from the
  other half alone shows; D is checked to be the old EXEC for saveexec and the
  new one for wrexec. In check.py and run_gpu_tests.py as a wave64 dump.
- tests/semantic/test_andn2_exec_b64.py: 12 pairs of S0 and EXEC for each
  instruction on all 64 lanes, against the ISA's definition written as
  integers; also runs the GPU test's fixture.

Run on an RX 9070 XT (AMD 26.11.2, Windows 11): passes natively 64-wide and
with LEONIDA_W64_EMULATE=1; the whole GPU suite is 127/127 both ways and the
semantic suite 1175 tests OK. Breaking either instruction in the translator
(D of wrexec = the old EXEC, D of saveexec = the new one, andn2 as and) fails
the GPU test and 13 CPU subtests.

AI-assisted (Claude Code).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 11:22:13 +01:00
f85582e23d Merge pull request #1318 from Freem 2026-11-22 05:08:05 -05:00
5b5f82a409 Merge pull request #1296 from Flyander 2026-11-22 05:07:55 -05:00
f0aa5c9693 Merge pull request #1293 from cxchhh 2026-11-22 05:07:54 -05:00
5f9ed5f458 Skip ps_bitmask_perm when fragment shaders run narrower than 32 lanes 2026-11-22 11:00:52 +01:00
311c37d059 Close remaining files in GPU test runner 2026-11-22 10:55:15 +01:00
220fa73744 GPU tests: cover non-mov DPP with bound_ctrl
Lane 0 of cs_dpp_bound has an invalid row_shr source and bound_ctrl:1, so it writes op(0, 10)=10; this pins the zero-filled src0 path for a VOP2 op. out[0..7] is 10 10 11 12 13 14 15 16 on the RTX 3070.
2026-11-22 09:51:36 +00:00