Commit Graph

528 Commits

Author SHA1 Message Date
188207a9d4 run_gpu_tests: ps_m15_dual is run by d3d12_translated_draw_test, like ps_m15 (RT-DUAL-SOURCE-BLEND review)
The generic pixel-shader harness picked up the new fixture and lost the device on an RTX 4060: it has no second
colour target and no SRC1 blend. d3d12_translated_draw_test --dual-source owns that draw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 12:08:24 +01:00
0819cfec80 Merge main (3ff2a2adc) into the #939 merge
Fourteen commits main gained after #968: #413, #1114, #1090 and #1491. Two conflicts, both in the shader check lists: scripts/run_gpu_tests.py imports both sides' cases, and tests/test_shader_checks.py counts eight cases next to COMPUTE (main's cs_w32_salu_ext) and #939's IMAGE_STORE_CASES table in place of main's fixed seven store shaders.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:23:42 -05:00
871e4b8b99 Merge pull request #1090 from milk4sale/test-w64-sdst-pair-gpu
tests: a GPU fixture and whole-corpus counts for one-register wave64 mask destinations (TEST-W64-SDST-PAIR-GPU)
2026-11-24 20:50:01 -05:00
8a57b3b1d3 Merge pull request #1114 from milk4sale/gpu-test/salu-ext
tests: GPU readback for 38 scalar ALU ops on run-time operands (GPU-SALU-EXT)
2026-11-24 20:49:40 -05:00
154e4ec034 Merge the #984 result (main + RT-PROTON-STORY-LOAD) into #939
The base is 8a242efeb, the merge of main and #984. 68 files conflicted; they were resolved in seven groups by
one rule: the same change in two forms keeps the base's form, everything only #939 has is kept, and where the
two solve one problem in two ways the base's is the frame and #939's plugs into it.

A, the Xbox proxy (d3d12_xs_device.cpp/.h, d3d12_xs.cpp, d3d12_xs_pso_stream.cpp/.h, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, device_proxy_test.cpp, queue_proxy_test.cpp): the base's files with #939's additions
ported in. Device slot 57 asks #939's NativeGraphicsFactory first and falls back to the base's
proxy_create_graphics_pipeline_from_native_code on E_NOTIMPL. Kept from #939: the providers (texture lease,
raw texture view, resource by address, constant view, descriptor mapping, depth-stencil UAV, texture pages),
the title-backed descriptor mirror, slot 13's feature answers, GPU labels on list slots 71/72. Dropped: #939's
duplicates of the boot ladder routes, its fallback window, its slot 133 stand-in.

A2 (xs_proxy_mock_test.cpp): the base's test with #939's slot 70 raw-buffer case; presentation cases follow
#939's rule that a device which ever had a handler has no queue fallback.

B1, the Vulkan device (d3d12_vulkan_device.cpp, d3d12_com.cpp/.h, shader_library.h, queue_families.h,
pipeline_cache_file.h, startup_trace.h): one lazy-pipeline mechanism, the base's; #939's pending_base_compile
and first_use_backend_pipelines dropped, prepare_on_bind and cold_graphics_compile kept. create_texture keeps
the base's signature; #939's deferred backing is folded into the base's placed-memory binder. #939's quad
lists as triangle indices.

B2, the D3D12 tests (d3d12_existing_heap, a8_dimensions, pipeline_cache_seed, title_va, rect_list,
shader_library, loader_tls_index0, draw, compute, xmem_placed, shader_library_corpus): the base's tests where
both carry the same case, #939's cases added (rebound tables, linear texture map, large vertex batch,
executable shaders, default A8 views).

C, the backend (vulkan_replay.h, vulkan_backend.h, vulkan_bindless.h, vulkan_scratch.h, vulkan_present.h,
rect_list_geometry.h, vk_test_device.h, vk_pipeline_check.cpp, vk_store_test.cpp, bindless_sizing_test.cpp,
replay_texture_barrier_test.cpp): the base's prepare_draw and lazy compute, its #1055 release rule and its
rectangle generator; #939's rectangle variants, GPU quad index expansion, 1D/3D and depth-stencil UAVs, the
label fence on the base's submit.

D, memory, services, presentation (xmem.cpp/.h, xg_xs.cpp, xg_xs_test.cpp, title_va_alias.h and its test,
main.cpp, frame_pacer.h, xbox_present.cpp/.h; xgameruntime_offline.cpp for one comment): the base's xmem with
#939's label hooks, file-backed sections and pin_mapped_data; both texture computers in xg_xs.cpp, the base's
answering first; --first-run-ui kept without host speech in its profile.

E, build, tools, docs (runtime/CMakeLists.txt, make_game.py, tools/rdna2spirv.py, tools/shader_disasm.py,
scripts, tests, docs; docs/README.md and tests/test_exe_shaders_stage.py beyond the conflicts): the base's
v_dot4 decode, #281's disassembler form and tests/semantic/test_fspx_dot4_op_sel_disasm.py dropped; the
base's executable-shader step with #939's cache fix; 366 registered tests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:26:00 -05:00
1bedab24c3 Merge pull request #1000 from Okachamie/gpu-pin-exit-status
Merging.

**Why merged:** GPU-PIN-EXIT-STATUS: in check.py and run_gpu_tests, a helper that exits non-zero is always a failure, never a subgroup-pin SKIP, so a crashing helper can't hide as a skip. KernelSmoker approved it after an RTX 3090 GPU run, and the author compared it against #125.

**Why it's good:** run_gpu_tests, shader_checks and run_gpu_tests_paths: 177 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 0f98d193c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 18:22:17 -05:00
2376e7d56b Merge pull request #1063 from milk4sale/gpu-test/frexp-ldexp
tests, rdna2spirv: GPU readback for frexp and ldexp, and their neg/abs sources move the sign bit (GPU-FREXP-LDEXP, SHADER-FREXP-LDEXP-SIGN-MODS)
2026-11-25 00:20:58 +01:00
0c3acdc030 Merge main into gpu-test/salu-ext
Brings the branch up to date with main 68d1331e5. No conflicts; the merged tree was tested before the push (every standalone
test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since #930).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 16:31:08 -06:00
89f6c264ed Merge main into test-w64-sdst-pair-gpu
Brings the branch up to date with main 68d1331e5. No conflicts; the merged tree was tested before the push (every standalone
test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since #930).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 16:31:08 -06:00
2eb49b1a6f Merge main into gpu-test/frexp-ldexp
Brings the branch up to date with main 68d1331e5. No conflicts; the merged tree was tested before the push (every standalone
test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since #930).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 16:31:07 -06:00
7998d65400 Merge main into shader/round-f64-specials
Brings the branch up to date with main 68d1331e5. No conflicts; the merged tree was tested before the push (every standalone
test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since #930).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 16:31:06 -06:00
6261ca916e Merge pull request #957 from quartz-heron-58/vopc-dpp
Merging.

**Why merged:** SHADER-VOPC-DPP decodes and translates VOPC compares in DPP16/DPP8 form. `shader_disasm` gets a second llvm-mc pass that patches the word llvm-mc rejects to a `v_max_f32` stand-in, then restores the name and encoding. KernelSmoker approved it, Timon360SB ran it on Blackwell native and w64, and kawaii-shakal ran all 2,684 CS programs of the real library through it.

**Why it's good:** on the RTX 4070 SUPER, `scripts/run_gpu_tests.py --filter cs_dpp`:
- native: 9/10 pass, and `cs_dpp_w64` is skipped (no 64-wide compute subgroup on this device);
- with `LEONIDA_W64_EMULATE=1` under the Khronos validation layer: 10/10 pass, with no VUIDs;
- `cs_dpp_cmp` reads the expected `3 2 3 2 1 0 1 0`, and all 10 shaders pass spirv-val.

Own tests (dpp_compare, dpp_eager_subgroup, rdna2_decode, shader_disasm, run_gpu_tests*, docs): 207 passed, 0 skipped. The llvm-mc cases ran with a real AMDGPU llvm-mc.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 66d4f5aa3. With it in, the repo-consistency set gives 573 passed / 5 skipped / 0 failed, and check_no_game_data is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: decoder and translator branches plus the tool changes above, with no binaries, downloads, network calls or CI changes. Heads-up from the PR body: this conflicts with #281 in `shader_disasm.py`, so #281 will need a rebase.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 16:04:56 -05:00
cec2c7074c tests: GPU readback for 38 scalar ALU ops on run-time operands (GPU-SALU-EXT)
No fixture in runtime/test/shaders ran s_sub_i32, s_andn2_b32, s_orn2_b32, s_xor_b32, s_ashr_i32, s_mul_hi_u32,
s_lshl3_add_u32, s_lshl4_add_u32, s_pack_ll_b32_b16, s_pack_hh_b32_b16, s_abs_i32, s_bcnt0_i32_b32, s_bitset0_b32,
s_bitset1_b32, s_brev_b32, s_flbit_i32, s_flbit_i32_b32, s_sext_i32_i8, the six s_cmp_*_i32, s_cmp_gt_u32,
s_cmp_le_u32, s_bitcmp0_b32, s_bitcmp1_b32, s_addk_i32, s_mulk_i32, s_cmovk_i32, s_ashr_i64, s_lshl_b64, s_lshr_b64,
s_bcnt0_i32_b64, s_bitset0_b64, s_cmov_b64 or s_ff0_i32_b64.

cs_w32_salu_ext gets sixteen operand words in s4..s19 from VKC_SGPRS, so each op reaches the driver as SPIR-V and
is not folded by the translator as an op on literals is. One thread stores every destination and four words of SCC
bits: SCC after each op that writes it, run on operands that set it and on operands that clear it, each compare
both ways, and SCC after each op that must keep it, set to 1 and to 0 in turn before them.

The 73 expected words are literals in check.py, derived in the fixture's header. tests/test_gpu_salu_ext.py
recomputes them from the fixture's own instruction lines with the reference of tools/salu_diff.py, checks that
every op that writes SCC is seen with both values, and checks the readback and both runners' verdicts.

The fixture is the first in the folder with bit 15 set in the immediate of a signed SOPK op (s_addk_i32 s52,
0x8000). tools/rdna2_decode.py gives that immediate sign-extended and llvm-mc 23.1.4 prints the same word as
0x8000, so test_parity_with_llvm_mc_on_shader_fixtures failed on it. That test now compares the immediates of the
ten signed SOPK ops as the 16 bits they are, as it already does for SOPP branch offsets, and a hand-encoded test
pins which of the sixteen ops the decoder sign-extends.

No translator, decoder or runtime change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 12:40:29 -06:00
9f1a072f70 tests: a GPU fixture and whole-corpus counts for one-register wave64 mask destinations (TEST-W64-SDST-PAIR-GPU)
SHADER-W64-SDST-PAIR makes the SGPR a wave64 VALU instruction names for a lane mask the pair it is on hardware. Its
own test compares the two printed forms on the interpreter; this adds what it does not have.

cs_w64x_cmp_sdst is written like the game's listings (no mattr line, so llvm-mc prints one register): six compares
and a carry-out whose pairs are read back across both halves by s_and_b64, s_or_b64, s_xor_b64, s_andn2_b64,
s_and_saveexec_b64, s_mov_b64 exec, s_bcnt1 / s_ff1 and SCC. RTX 4070 Ti (620.70.06, subgroup 32) under
LEONIDA_W64_EMULATE=1: the eight words its header derives; main before the rule gave none of them.

docs/design.md gets the counts over all 26,503 shaders: every one of the 292,733 one-register compares in wave64
code names an even register, 13,314 wave64 shaders read such a pair back, the rule's full translation passes
spirv-val 26,503 of 26,503, and 504 wave64 VS/PS leave SHADER-10 tier C (8,245 to 7,741).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:47:35 -06:00
5f063e5812 tests, rdna2spirv: GPU readback for frexp and ldexp, and their neg/abs sources move the sign bit (GPU-FREXP-LDEXP, SHADER-FREXP-LDEXP-SIGN-MODS)
v_frexp_mant_f32, v_frexp_exp_i32_f32, v_ldexp_f32, v_frexp_mant_f64 and v_frexp_exp_i32_f64 are lowered with
integer ops on the float's words, and no fixture in runtime/test/shaders ran any of them.

cs_w32_frexp_ldexp is memory-fed, like cs_w32_shift64: check.py seeds 64 records of a binary32 value, an ldexp
exponent and a binary64 value, and each thread loads one at run time and stores the five results, v_frexp_mant_f32
with a neg source, and v_ldexp_f32 with an abs source run with the odd threads turned off. The records cover the
exponent clamp, overflow and underflow, binary32 denormals, binary64 subnormals on both sides of the dword boundary,
zeros, infinities and NaNs. The expected words come from an oracle written from the rows of docs/design.md, checked
against math.frexp and math.ldexp in tests/test_gpu_frexp_ldexp.py.

On an RTX 4070 Ti (NVIDIA 620.70.06) six words were wrong: every NaN source under neg or abs came back as
0x7fffffff, the driver's default NaN. The binary32 branch applied the modifiers as FAbs and OpFNegate, from which
Vulkan lets a driver return any NaN. The three ops only move bits, so the branch now reads its source through
Gen.src_u_sign_mods, as the min/max family does. tests/semantic/test_alu_frexp_ldexp.py checks that the modifiers
are emitted as sign-bit ops. With that the fixture's 768 words are exact on the RTX 4070 Ti and on llvmpipe.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:32:48 -06:00
26d010b41d rdna2spirv: the binary64 roundings keep a NaN's bits and round a subnormal without the driver (SHADER-ROUND-F64-SPECIALS)
v_trunc_f64, v_ceil_f64, v_rndne_f64 and v_floor_f64 hand their source to the driver's double-precision Trunc,
Ceil, RoundEven and Floor. Vulkan lets a driver return any NaN for a NaN operand and, with no DenormPreserve for
64 bits, read a subnormal as zero, and cs_w32_round_f64 measured both: a signalling NaN came back quiet on an RTX
4070 Ti (NVIDIA 620.70.06) and on llvmpipe, and llvmpipe read the smallest subnormals as zero, so v_ceil_f64 of the
positive one gave +0. RDNA2 returns a NaN unchanged and keeps subnormals: that ceil is 1.

The two kinds of source are now selected with integer ops on the words, after the source modifiers and before the
output ones. A NaN's words pass through. A subnormal gives a zero of its sign, or 1 with its sign where the op
rounds that sign away from zero (ceil of a positive one, floor of a negative one). Every other source still takes
the driver's result.

cs_w32_round_f64 now compares all 1152 words exactly, on both devices. tests/semantic/test_f64_round.py runs the
four ops under a model of a driver that quiets a NaN and reads a subnormal as zero; without the change that class
fails for the signalling NaNs and for ceil and floor of a subnormal. The row in docs/design.md describes the rule
and how it was confirmed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:15:37 -06:00
355c8c9c2d tests: GPU readback for the binary64 roundings, v_trunc_f64, v_ceil_f64, v_rndne_f64 and v_floor_f64 (GPU-ROUND-F64)
The translator gives the four ops to the driver's double-precision Trunc, Ceil, RoundEven and Floor, and no
fixture in runtime/test/shaders ran them, so what a driver does with ties, the largest value below 0.5, values at
and above 2^52, signed zeros, subnormals, infinities and NaNs had never gone through the GPU suite.

cs_w32_round_f64 is memory-fed, like cs_w32_shift64 and cs_w32_cmp_f64: check.py seeds 64 inputs and each thread
loads one at run time and stores eight results: the four roundings, v_trunc_f64 with a neg source, v_ceil_f64 with
an abs source, a v_floor_f64 whose destination pair overlaps its source pair, and a v_rndne_f64 run with the odd
threads turned off, whose destination must keep the pair it held. The expected words come from Python floats
(exact IEEE-754, the result keeping its source's sign) and are checked against exact rational rounding in
tests/test_gpu_round_f64.py.

Two kinds of input are judged by what Vulkan lets a driver do, not by RDNA2: a NaN may come back as another NaN,
and a subnormal may be read as a zero of its sign, since the module declares no DenormPreserve for 64 bits. That is
what the fixture measured: on an RTX 4070 Ti a signalling NaN comes back quiet, and on llvmpipe the smallest
subnormals are also read as zero. The row in docs/design.md records both as an approximation. dump_test takes an
optional judge for such a readback.

No translator or runtime change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:04:58 -06:00
e55b3be88a tests: fail when a subgroup warning precedes a dispatch error 2026-11-24 11:43:12 -05:00
50407827cd tests: GPU readback for the binary64 vector compares, v_cmp_*_f64 and v_cmpx_*_f64 (GPU-CMP-F64)
The v_cmp_*_f64 / v_cmpx_*_f64 row of docs/design.md was CPU-checked and measured on native gfx1100, and no
fixture in runtime/test/shaders used a binary64 compare, so the SPIR-V those 32 ops translate to had not run on a
driver.

cs_w32_cmp_f64 is memory-fed, like cs_w32_shift64: check.py seeds 256 operand pairs, the product of 16 values
(+-inf, +-max, the 1-ULP neighbours of +-1, the smallest subnormals, +-0, the smallest normal, a NaN whose payload
is only in the low dword, a negative quiet NaN), and each of 128 threads loads two of them at run time. Per pair it
stores a v_cmp_ word (through VCC) and a v_cmpx_ word (through EXEC): one bit per predicate in opcode order, a bit
for tru run with the odd threads turned off (an inactive lane gets VCC 0 and stays off through v_cmpx_), and two
bits for lt and nge with VOP3 abs/neg. The expected words come from Python floats. Both GPU runners compare all
1536 heap words, the unchanged inputs included.

tests/test_gpu_cmp_f64.py checks, without a GPU, the oracle against an independent restatement of the 16
predicates, a few words worked out by hand, that the assembly gives every predicate the oracle's bit, and the
readback and runner verdicts. docs/testing.md describes the fixture and the row names it.

No translator or runtime change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 10:41:43 -06:00
98a977b4b7 Merge pull request #335 from milk4sale/gpu-test/cube-store
Tested 0d27fdcf9 merged locally onto main 1504c1af6: cs_imgstore_cube passes everywhere, and nothing else changes state.

Devices: RADV, Mesa 26.3.1, Linux:
- AMD Radeon RX 7900 XTX (RDNA3, gfx1100);
- Ryzen 9 7950X3D iGPU (RDNA2, gfx1036);
- llvmpipe.

New fixture, 10 runs each with run_gpu_tests.py --filter cs_imgstore_cube --require-pass:
- 10/10 natively and 10/10 with LEONIDA_W64_EMULATE=1 on all three devices, 0 bad for all three cube images;
- the validation layer, with sync validation on, reports nothing on either AMD GPU.

Regressions, main vs main + #335:
- Full run_gpu_tests.py on both GPUs, native and emulated: 232/250 → 233/251. The only change is the new PASS.
- Every existing vk_store_test fixture keeps its state.
- tests/test_shader_checks.py and tests/semantic/test_image_cube_store_glc.py pass on both trees.

CI: this head's checks are still queued on GitHub, so I ran the Linux jobs locally. They give the same result on both trees. The only failures are already on main:
- cs_imgload_tfe and cs_imgload_d16_tfe (#31, fixed by #892);
- tests/test_tool_stdout_encoding.py.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 17:21:28 +01:00
d4b3a001d2 Merge pull request #572 from DeSunShine/fma64-rt
rdna2spirv, docs: NVIDIA splits a binary64 Fma only when folding an all-constant one; add cs_div_fmas_f64_rt (FMA64-RT)
2026-11-24 10:50:14 -05:00
d046559435 rdna2spirv, shader_disasm: VOPC compares in DPP form (SHADER-VOPC-DPP)
Three pipeline-library compute programs of 1.0.2.1 hold v_cmp_gt_f32 with a
DPP16 or DPP8 src0. llvm-mc has no gfx10 decoding for the pair, so the
listing dropped the words and the programs were refused.

shader_disasm.py prints the pair through a VOP2 stand-in that takes the same
DPP word, rdna2_decode.py decodes it directly, and Gen.dpp_insn translates
the compare for the forms where every lane writes its bit. Other forms and
v_cmpx are refused: what an unwritten lane does to VCC is not measured.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 23:41:08 +08:00
99168a5fae Run the VCC scalar-address readback through the standard GPU checks
Seed eight words in the synthetic shader and check them in both GPU runners. Keep the desktop TFE load cases registered alongside the volume-view cases.
2026-11-24 21:59:18 +08:00
aa8be9aef2 Integrate the offline first-run UI runtime with current main and the published renderer fixes
Use the tagged pipeline variants and indexed quad expansion from #722 and #682 with the shared shader cache. Retain title-backed index uploads, cross-queue scratch sharing, amd64 console return conventions and the PC/console caller discriminator. The local shader build indexes native containers and includes the executable's embedded stages.
2026-11-24 21:26:25 +08:00
db19bbd345 runtime: connect native pipelines and title resources to the offline first-run UI
Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic.

The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
2026-11-24 21:19:30 +08:00
be767b6889 Integrate #682 for the Windows first-run UI 2026-11-24 21:17:26 +08:00
51f3160923 Merge pull request #590 from JiyouProt/codex/gpu-valu64-shifts
tests: GPU readback for dynamic 64-bit vector shifts (GPU-VALU64-SHIFTS)
2026-11-24 07:47:23 -05:00
6ce66cf219 d3d12: GPU test for indexed quad lists: both index sizes, a base vertex, flat inputs, overlapping instances (d3d12_quad_index)
d3d12_rect_list draws its quads without an index buffer, so it could not see what #207's
review measured on indexed ones. d3d12_quad_index_test draws six 64x64 frames through
DrawIndexedInstanced with IASetPrimitiveTopology(19) and compares every pixel bit for bit:

  0  non-indexed control
  1  16-bit indices, a quad whose corners all differ: the first vertex's colour everywhere
  2  32-bit indices from StartIndexLocation 3
  3  16-bit indices from StartIndexLocation 5 (an address of 2 modulo 4), BaseVertexLocation 3
  4  two quads and two instances whose quads overlap: the later instance on top
  5  a view that ends inside the second quad: its last two indices read 0

The index buffer is in a DEFAULT heap and filled by a copy in the first list, so only the
GPU can read it. Two translated fixtures, like vs_m15 and ps_m15: vs_quad_inst.asm reads
the instance id (v3) to move and recolour each later instance, ps_quad_flat.asm reads its
colour with v_interp_mov, which makes the input Flat.

RTX 4070 SUPER (621.24), Windows 11, LEONIDA_VK_VALIDATION=1:
  on the six commits of #207: frames 1, 2, 3 and 5 match in 0 of 4096 pixels (black and
  blue, the second and third vertex), frame 4 in 2048, frame 0 in 4096; exit 1
  with the expansion: 4096 of 4096 in all six, 0 validation errors

run_gpu_tests.py lists the two fixtures as run by this test, and docs/testing.md names the
test (and d3d12_rect_list) among those that need llvm-mc and the SPIR-V tools.

AI-assisted (Claude Code; Claude Opus 5.5 and Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-24 05:10:19 -05:00
078d0144ad run_gpu_tests: report a missing spirv-as instead of a traceback (RUN-GPU-SPIRVAS-MISSING)
spirv_as ran spirv-as without handling OSError, so a missing spirv-as
ended the run with a raw FileNotFoundError after the assemble and
translate steps. It now raises the RuntimeError a failed assembly
already raises, with "spirv-as not found on PATH" (or the OSError text
for other failures to start the tool).

Tests cover the missing-tool and other-OSError messages, a stubbed
successful run, and a nonzero exit with stderr.
2026-11-24 10:55:40 +01:00
49d904fef6 tests: GPU readback for dynamic 64-bit vector shifts (GPU-VALU64-SHIFTS)
Exercise boundary counts and overlapping destination registers with runtime inputs.
AI-assisted with Codex.
2026-11-24 10:15:23 +01:00
10b0052e57 cs_div_fmas_f64_rt: the run-time-operand twin, and name the measured GPUs
Review of #8750: the fused half of the claim had no fixture. The new
cs_div_fmas_f64_rt reads the same a and c from s4..s7 (VKC_SGPRS), so the
driver cannot fold the Fma; it is fused under the default GLSL Fma on the
RTX 4090 here. design.md now names the measured GPUs: the all-constant
Fma is split on the RTX 4090, RTX 3070 and Quadro RTX 4000 (Turing,
Linux) and fused on an RTX 5060 Laptop (Blackwell).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:41:59 +03:00
ce75f144c7 docs/design.md, rdna2spirv: NVIDIA splits a binary64 Fma only when it folds an all-constant one
Correcting #6635's wording. On an RTX 4090 (621.24) the split 0 of the
fma(a, a, c) probe comes from the driver folding an all-constant GLSL Fma
while compiling the pipeline: cs_div_fmas_f64's operands are literals.
The same values read at run time from user SGPRs (VKC_SGPRS) give the
fused 2^-60, as #4536 saw on an RTX 4070. --fma khr is still what makes
both single-rounded. Wording only in design.md's floating-point row,
cs_div_fmas_f64.asm's header, Gen.emit_fma64's docstring, the runner's
split note and test_fma_khr_f64's docstring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:41:59 +03:00
0d27fdcf9a GPU fixture cs_imgstore_cube: image_store on dim:SQ_RSRC_IMG_CUBE (GPU-CUBE-STORE)
The "Typed image stores" contract row said a cube storage image was
CPU-checked only (test_image_cube_store_glc.py) and that no GPU fixture
covered it. This adds one:

- runtime/test/shaders/cs_imgstore_cube.asm: rgba8 unorm, r32 uint and
  r32 sint T#s (word3 TYPE = SQ_RSRC_IMG_CUBE); 64 threads store to every
  texel of all six faces, with per-face values so a wrong layer shows.
- vk_store_test "cube": three cube-compatible 8x8 six-layer images bound
  as six-layer 2D-array storage views at bindings 11/12/13, as the
  runtime binds a cube UAV; checks every texel of every layer.
- run_gpu_tests.py and check.py run it; test_shader_checks.py counts it.
- docs/design.md: the row names the fixture and the GPUs it passes on.
  Builds on #44, which rewrote that row.

Passes on an RTX 4070 Ti (NVIDIA 620.70.06) and a Radeon 610M (gfx1036,
RADV Mesa 26.2.6), native and LEONIDA_W64_EMULATE=1. The same fixture
with the face held at 0 fails on both (320/384/384 bad texels).

AI-assisted. No game files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 01:47:49 -06:00
b35b222df1 Keep the GPU helper verdict ahead of the device banner 2026-11-24 14:02:53 +08:00
8b63b583ae Merge remote-tracking branch 'origin/pr/8995'
# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
2026-11-23 17:41:48 -05:00
0fdb6c375f Merge remote-tracking branch 'origin/pr/8968' 2026-11-23 17:41:01 -05:00
65a84a39a4 Merge remote-tracking branch 'origin/pr/8975' 2026-11-23 17:41:00 -05:00
c925ac7f79 Merge remote-tracking branch 'origin/pr/9494'
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
2026-11-23 17:36:51 -05:00
97230ed64f Merge remote-tracking branch 'origin/pr/9491' 2026-11-23 17:32:53 -05:00
21714399e8 Merge remote-tracking branch 'origin/pr/9761'
# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
2026-11-23 17:30:03 -05:00
d578b4806e Tests: GPU coverage for ds_wrxchg*_rtn_b64, ds_or_rtn_b64, ds_min_f32 and ds_max_rtn_f32
docs/design.md marks the 64-bit LDS exchanges not GPU-verified, and
cs_lds_atomics_ext.asm (#9494) leaves ds_or_b64 and the f32 min/max
forms out. cs_lds_xchg64_ext.asm runs one lane through
ds_wrxchg_rtn_b64 (both dwords left and the returned pair),
ds_wrxchg2_rtn_b64 at offsets 0/2 (four old and four new dwords),
ds_wrxchg2st64_rtn_b64 at offsets 1/2 (512-byte steps), ds_or_rtn_b64,
ds_min_f32 with a quiet NaN in memory and ds_max_rtn_f32 ordering -0.0
below +0.0. The eight expected words are derived in its header from
the rows. Registered in check.py and run_gpu_tests.py next to
cs_lds_b64_cmpst; the wrxchg row notes the GPU check (the min/max and
bitwise b64 rows get theirs in #9494, to keep the two PRs apart).
2026-11-23 14:09:15 -08:00
98d99cfca0 Merge PR #9570 2026-11-23 17:08:03 -05:00
e597d90c12 GPU test cs_w32_partial_permute: ds_permute_b32 in a partial wave32
A 20-thread group is one wave32 with lanes 20-31 never launched. A launched
lane whose source lane is missing gets 0, and a send to a missing lane is
lost. cs_w32_permute and cs_w64x_permute run full waves only. The expected
words are measured with a raw 20-thread hw_oracle kernel on gfx1036.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:32:20 +01:00
aa2dc43f70 Test fragment color modulation through a constant buffer descriptor table 2026-11-24 05:22:56 +08:00
cb242d0209 run_gpu_tests: ps_heap_index is run by d3d12_heap_index_test, so skip it there
The heap-indexing pixel fixture reads the bound CBV/SRV/UAV heap's base from
its root arguments and loads through s[24:27], which vk_harness cannot give it:
it needs a D3D12 device, the layer's root arguments and the code base. Without
an OTHER_HARNESS entry the pixel fallback in the judging loop reaches its
"no checker defined" branch, so the suite reports

  FAIL  ps_heap_index  no checker defined

and exits 1 on every host, Linux included, even though the shader translates
and spirv-val accepts it. ps_heap_index.asm (runtime/test/shaders) names
d3d12_heap_index_test as its owner, as the other OTHER_HARNESS entries do.
2026-11-23 22:14:53 +01:00
a443ab5574 Tests: GPU coverage for ds_mskor, ds_and/xor_b64, ds_add_rtn_f32 and ds_inc/dec/rsub_u32
docs/design.md lists these LDS atomics as not GPU-verified: the
instructions were measured with tools/hw_oracle and the translations
CPU-checked, but the translated SPIR-V never ran on a GPU.
cs_lds_atomics_ext.asm runs one lane through ds_mskor_b32 (DATA2 bits
outside DATA ORed in), ds_mskor_rtn_b32, ds_xor_rtn_b64 then ds_and_b64
on the same element, ds_add_rtn_f32 (1.5 + 2.25), and ds_inc_rtn_u32,
ds_dec_u32 and ds_rsub_u32 at their edge cases. The eight expected
words are derived in its header from the design.md rows. The fixture
is registered in check.py and run_gpu_tests.py next to
cs_lds_b64_cmpst, and the four rows note the GPU check.
2026-11-23 13:14:04 -08:00
0e4dd78f82 tests: GPU fixture cs_imgload_d16_tfe, the d16 form of cs_imgload_tfe
Under d16 one component fills one VGPR and the tfe status follows it, so vdata is v[7:8] / v[11:12]. Same 1000 seeds and the same check as cs_imgload_d16 (vk_store_test load-d16, saturation row included). Suggested by nnonno91, who ran this companion on gfx1036 and an RTX 5090.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:45:09 -03:00
30173c3cfa run_gpu_tests: report cs_fmt_d16_xyz once
run_suite appended two results for cs_fmt_d16_xyz, "80/80 dumped words
exact" and "128/128 dumped words exact", from one fmt_d16_xyz_test call.
The fixture has 80 words (len(FMT_D16_XYZ_WORDS)), so the 128/128 line
was a leftover: the test printed twice and the suite counted one test
too many (241 instead of 240).
2026-11-23 20:53:27 +01:00
9c4c5f92a8 tests: GPU fixture cs_imgload_tfe for the tfe status VGPR on image_load (SHADER-1266)
No GPU fixture set tfe or lwe, so run_gpu_tests.py never reached the
status write a SHADER-1266 fix adds. cs_imgload_tfe is cs_imgload with
tfe on both image_loads: each status VGPR is seeded with 1000 and added
into the stored sum, so a stale status moves every texel by 2000 while a
correct one (0, every texel resident) gives cs_imgload's result, checked
by vk_store_test's unchanged load mode.

Registered next to cs_imgload in check.py and run_gpu_tests.py, and in
the two unit tests that list the vk_store_test fixtures. Red on main
until a SHADER-1266 fix lands; green with #8771's change on an RTX 4060.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:51:28 -03:00
717f011a00 GPU fixtures for computed writes to exec_lo / exec_hi (SHADER-1264) 2026-11-23 20:45:50 +01:00