#1825's single-output M3 occlusion shader is drawn by the ctest d3d12_m3_frame_test; run_gpu_tests picked it up
and failed it with "no checker defined".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The listing parser represents image address lists separately from ordinary register ranges. Include their highest register so the reported original span is comparable with the driver count.
A test-specific setting can select a different adapter or feature. Pass the CTest environment to its subprocess so Wine covers the same settings and sibling tests still inherit the runner environment.
The texture harness needs a shader working directory, so two branches launched it directly and bypassed the configured deadline. Pass the working directory through the shared launcher so those cases time out and the suite can continue.
`-h`/`--help` printed the usage to stderr with exit code 1, and any other `--` option was dropped without a
word: `--detail` (a typo for `--details`) printed the summary with exit code 0. Help now goes to stdout with
exit code 0, and an unknown option or a wrong argument count is a usage error with exit code 2, as in the
other hand-parsed tools.
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ABh36DZ2sZNq3ChN6EZJs
A compute fixture loads through the nine narrow integer formats (DST_SEL
XYZW, X011 and d16) and stores edge values through each with the
runtime's selectors. check.py's 136 expected words are the same program's
output run natively on gfx1036 (tools/hw_oracle, wave32 and wave64), and
the interpreter test runs the fixture against them too.
Depends on #1871.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed GPU configuration already makes the benchmark exit unsuccessfully, but the final line still claims all outputs match. Identify missing results in the summary so the text agrees with the outcome.
CTest marks disabled entries as skipped even when the command is unavailable. Check the property before resolving or starting the Windows test so the Wine report gives the same result.
Mesa llvmpipe returns 0 for out[5], the NaN check of 0 * inf with an
inline-constant 0, with or without SignedZeroInfNanPreserve, while its
other NaN checks give 1 (a run on #664, Mesa with LLVM 21.1.8). The CI
runs scripts/run_gpu_tests.py on llvmpipe, so the test would fail there.
APPLE_UNJUDGED_WORDS becomes UNJUDGED_WORDS, keyed by the first word of
the device name on vk_compute_test's "device:" line. Apple keeps words
0, 2 and 3, and llvmpipe gets word 5. Every other device still judges
all eight words.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MoltenVK returns +0 for -0 products with or without SignedZeroInfNanPreserve,
in out[0] (v_mul_f32), out[2] (v_pk_mul_f16) and out[3] (v_mul_f16). The mode
still fixes the three NaN checks on Apple. Seen on an Apple A18 Pro and an Apple
Paravirtual device in #664, tracked as #1203 / SHADER-182.
- check.py: judged_words() leaves those three words of cs_signed_zero_nan
unjudged when vk_compute_test's device line names an Apple GPU, and
words_match() compares the rest. The other five words still have to match,
and every other device judges all eight.
- run_gpu_tests.py: uses the same two functions and says which words weren't
judged.
- tests/test_shader_checks.py: tests for the Apple and non-Apple cases, the
NaN checks still judged on Apple, and run_gpu_tests' judge_cs_dump.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RDNA2 float ops return NaN, +-inf and -0 as computed. Without float controls,
Vulkan lets the driver assume none of them occur, and AMD's compiler does. On
an RX 9070 XT (26.11.2), x != x NaN checks fold to false and -0 products come
back +0. With integer f16 narrowing (#575), NaN results are never stored.
- rdna2spirv.py: every module declares the SignedZeroInfNanPreserve capability
and OpExecutionMode SignedZeroInfNanPreserve 32. The index entry lists the
property it needs (float_controls). --no-float-controls leaves both out.
- vk_pipeline_check: reads float_controls and skips a shader on a device
without shaderSignedZeroInfNanPreserveFloat32.
- GPU test cs_signed_zero_nan (check.py, run_gpu_tests.py): without the mode,
out[4..7] are 0 on AMD; with it, all eight words match.
- tests/test_translate.py: covers the mode, the index entry and the opt-out.
- docs/design.md: a "Float controls" contract row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_gpu_tests.py skipped ps_interp_f16_high and ms_f16_pack whenever
LEONIDA_BARY_FALLBACK was set, and check.py skipped ps_interp_f16_high the
same way. The skip predates --f16-interp-fallback: --bary-fallback alone has
no PerVertexKHR inputs, so the f16 halves can't be interpolated. With
--f16-interp-fallback as well, which run_gpu_tests.py turns on by itself on a
device without fragmentShaderBarycentric (the usual reason for the bary
fallback), the pixel shader reads the decoded halves its producer exports,
and both tests run. Skip only when the bary fallback is on without it.
On llvmpipe (Mesa 26.0.8, no VK_KHR_fragment_shader_barycentric) with
LEONIDA_BARY_FALLBACK=1, both tests went from SKIP to PASS. Under the bary
fallback alone they would still fail (f16 halves off by 0.984), so that skip
stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes M2's open item "texture formats other than R8G8B8A8_UNORM, mips and arrays
through a PSO". d3d12_m2_formats_test samples, through the M2 descriptor path
(heap slots 9/10, CreateShaderResourceView, CreateSampler, two root tables,
translated vs_m2/ps_m2): an 8x8 BC1 and an 8x8 BC7 texture with 4 mips each and
an R8G8B8A8 2D array of 3 slices (new ps_m2_array.asm). Every subresource is
uploaded at its GetCopyableFootprints layout; POINT samplers with MinLOD = MaxLOD
pin each level; a view from mip 1 and two array views check that level and slice
are relative to the view. Blocks use endpoint colours only, so all 12 cases are
compared with the CPU byte for byte (error 0). Validation clean on RTX 4070 Ti
SUPER; no layer change was needed. Synthetic data only, no game files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PiKMETzszqwfnV8QQyzocY
Measured natively on an RDNA2 iGPU (gfx1036): v_cvt_pk_u8_f32 rounds to
nearest even, clamps to [0, 255] and gives 0 for NaN. The RoundEven rule
was right; NaN reached FClamp, which is undefined for a NaN operand, so it
is now replaced by +0 first.
cs_cvt_pk_u8.asm holds eight hardware words (four byte selects), checked
by check.py and run_gpu_tests.py, and bit-for-bit on the CPU by
tests/semantic/test_cvt_pk_u8.py. Contract-table row added.
Fixes#358
CreateUnorderedAccessView on a buffer with a typed Format writes a typed V# (GFX10_FORMAT code, element size as
stride, element count, OOB_SELECT structured, the format's own DST_SEL), and a structured view with pCounterResource +
CounterOffsetInBytes writes a second raw 4-byte V# in the upper 16 bytes of the slot (a hypothesis for the console
contract, documented in section 3.4). The combinations D3D12 documents as invalid leave a null slot.
d3d12_buffer_uav_test runs two hand-written RDNA2 compute shaders through the translator (typed store/load/atomic on
five formats with NUM_RECORDS as the bound; append by 256 lanes and consume by 128 on a counter at offset 4096, read
back with CopyBufferRegion) against a CPU reference, then compares typed-buffer and counter clears with the host D3D12
runtime on the same adapter (LUID).
Depends on: #1791
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tbuffer_store_format_* and its d16 forms were Unsupported, though every
tbuffer_load_format_* form translates. They now go through buffer_store
with the instruction's format, as the loads go through
buffer_load_format:
- only that format is encoded, with no branch on the V#'s FORMAT;
- the bounds check uses its element size;
- a V# whose FORMAT is 0 (INVALID) still disables the store, as measured.
(@Vonsek covers the MTBUF loads and @opit80 the raw MUBUF accesses
through such a V#.)
The format parsing the loads did inline becomes mtbuf_format(), shared by
both: no modifier is GFX10's default BUF_FMT_8_UNORM, and a format
FORMATS has no encoder for stays Unsupported. read_before_write_vgprs
now counts a tbuffer store's data VGPRs as reads, as for buffer_store.
cs_tbuffer_store.asm stores into 13 sentinel-filled regions through V#s
whose format differs from the instruction's or is 0, and reads them
back. Every
expected word was measured by running the same body natively on a
Radeon 680M (gfx1035, RDNA2); wave32 and wave64 gave the same 52 words:
- the instruction's format decides the encoding, the element and the
bounds;
- components the format has but the store doesn't give are 0, and extra
ones are dropped;
- the default format is one byte, and its neighbours are kept;
- a FORMAT-0 V# leaves the region untouched.
check.py and run_gpu_tests.py compare the dump. The semantic fixture
runs through the interpreter in tests/semantic/test_tbuffer_store.py,
which fails on the old translator (Unsupported). It also fails on
versions that take the bounds from the V#'s element (5 words differ),
take the format from the V#, fill missing components with anything
but 0 (1 word), or drop the FORMAT-0 guard (2 words).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pixel shader that iterates z = z^2 + c per lane until it escapes or 64
rounds pass. Escaped lanes drop out of EXEC, s_cbranch_execz leaves the loop
once all lanes are out, and EXEC is restored before the export. check.py and
run_gpu_tests.py compare every pixel's iteration count with a pure-Python
float32 model (mul/add/sub only, no FMA, so the model is exact).
Tested on main 003e7812: run_gpu_tests.py 131/171 on RTX 5070 Ti (40
skipped) and 162/171 on AMD Radeon integrated graphics (9 skipped, run by
the d3d12 draw tests). AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.
AI-assisted (Claude), on behalf of dev-ewann.
d3d12_m4_compute_test, through the proxy with D3D12 API only and two
translator-output compute shaders (cs_m4_fill.asm, cs_m4_indirect.asm):
a COPY queue streams an input buffer in, a COMPUTE queue waits on it and runs a
compute PSO over a UAV table (structured buffer, raw buffers, an R32_UINT
RWTexture2D), then ExecuteIndirect of a second PSO from arguments the first
wrote (with a transition to INDIRECT_ARGUMENT and UAV barriers), and a COPY
queue behind a cross-queue fence reads the results back. 1,924 words match the
CPU reference with error 0.
Layer gaps the test found, fixed:
- CreateUnorderedAccessView of a buffer was a stub: structured and raw views are
now a V# in the slot.
- ExecuteIndirect of a dispatch ran whatever pipeline and root arguments the
command buffer had bound; the command now carries the list's, as Dispatch does.
- An image created in UNORDERED_ACCESS and first used by a shader was
zero-filled by the first barrier or copy that named it, losing the shader's
writes; images with a UAV view are now moved to GENERAL (zeroed) at the next
submission.
- COMPUTE and COPY command lists no longer log "unimplemented".
Test infrastructure: vk_test_device.h can create more than one VkQueue;
build.py gives a compute shader's FSSM program extra words (fssm-at/fssm-data
from 0x148) so two compute shaders with the same group size get distinct hashes,
and honours LEONIDA_SPIRV_TOOLS (as #1679) so the target builds under the Visual
Studio generator. docs/d3d12_vulkan.md section 6: M4 synthetic part met; M3 row
credits @whattheflop's #1584 measurement of fences in flight.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>