On Windows, spirv-as, spirv-val and the GPU test programs read their command line in the ANSI code page, so a folder
name with a character outside it (a Cyrillic or CJK user name, as under %TEMP%) reached them as '?' and every shader
failed with "file does not exist": run_gpu_tests.py's default work folder broke for such users, and so did
make_game.py's shaders stage under such a work folder.
- assemble_spirv pipes the .spvasm into `spirv-as -` and runs both tools in the output folder with the staging file's
bare name, so no path reaches them.
- run_gpu_tests.py runs the suite in the work folder's 8.3 short name when its path doesn't fit the code page, and
stops with one error line when the volume keeps no short names.
- tests/test_native_tool_paths.py: 8 tests with a private-use character in the folder name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 64-bit fold itself landed with #1948. This adds what #1938 still carries:
two semantic tests (a constant sOFF of -4 is out of bounds, not a 32-bit
wrap; a constant sOFF of 2^20 is not sign-extended) and the GPU fixture
cs_smem_sconst_off. Its run-time sOFF is now in range (4): an out-of-range
run-time sOFF made llvmpipe do the guarded load and segfault (review on
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match RDNA2 mode-0 denormal semantics and legacy zero override; flush product before output scaling and normalize modifier zeros. Add synthetic semantic/GPU fixtures and documentation. AI-assisted (GPT-6).
A compute program that reads its inputs from memory (a root table, descriptors,
data) needs them in the heap before it runs; VKC_SGPRS only reaches s4..s31.
VKC_HEAP_INIT=<file> copies the file to Xbox VA 0 after the default fill. A file
larger than the buffer, or one that can't be read, is refused (exit 2).
cs_heap_init.asm loads four words the file put at 0x100 and stores them at 0;
check.py and run_gpu_tests.py write the file and check the words and the
file's zeros past them. First part of TEST-594 (the BVH builder's programs read
their root table from the heap).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two wave32 GPU tests, cs_w32_lds_subdword (ds_write_b8/_b16 and their
_d16_hi forms, ds_read_u8/_i8/_u16/_i16) and cs_w32_lds_wide
(ds_write/ds_read _b64/_b96/_b128, ds_read2st64_b32), and a semantic
test that runs them in the SPIR-V interpreter against a byte-level LDS
model of the ISA rules, with three SPIR-V sabotages as negative
controls. These ops were checked only by lds_fuzz.py, which needs a GPU.
No translator change. RTX 4070 SUPER, driver 610.88: both dumps match.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
image_sample_c / image_sample_c_b (and their _o forms) were Unsupported. In a
pixel shader they are OpImageSampleDrefImplicitLod (Bias for _c_b); LOD 0 for
_c elsewhere. The _c_b address order is bias then z-compare (the parser read
the compare first). vk_texture_test now honours LEONIDA_VK_DEVICE. GPU tests
ps_sample_c and ps_sample_c_b, semantic tests, design.md row.
AI-assisted.
Collapsed interpolation could satisfy the comparison between the raw and interpolated results. Use the known full-screen triangle gradient to verify their agreement is meaningful.
The docs/design.md "Sub-dword MUBUF loads and GFX10_FORMAT_8_UINT" row was
CPU-checked only. Two single-thread compute fixtures in run_gpu_tests.py's
dump list now run the translated loads through Vulkan:
cs_buf_load_sub: buffer_load_ubyte/sbyte/ushort/sshort zero- and
sign-extended, the dword-crossing ushort at offset 3, and the RAW end check
by element size (a ubyte at 8 and a ushort at 7 of 8 bytes read 0; a
start-only check would read 0xeefe from the 0xee filler).
cs_buf_fmt8: tbuffer_load_format_x format:[BUF_FMT_8_UINT] at offsets 0..3,
one byte past the end, an INVALID V# format (0), and buffer_load_format_xyzw
with V# format 8_UINT and DST_SEL (X, 0, 1, 1), whose w is integer 1.
Both pass on an RTX 3070 Ti (driver 610.88); the expected words follow the
CPU test's byte table and rules. The row now says so; AMD hardware is still
unmeasured.
ps_far_branch runs s_getpc_b64 / s_add_u32|s_sub_u32 / s_addc_u32|s_subb_u32 /
s_setpc_b64: two forward jumps, a sub/subb loop, an add/addc -1 loop and a
conditional far jump, with K derived by hand. fold_far_branches now folds the
idiom only when its instructions have encodings, so a listing without them
gives Unsupported instead of a TypeError.
AI-assisted.
Two pixel tests, ps_vcmpx_f16 (e32) and ps_vcmpx_f16_e64 (swapped operands),
on the operand pairs of ps_vcmp_f16: the EXEC result of each predicate, VCC
kept, and EXEC only ANDed. Words derived by hand in the headers; semantic
fixture and test added.
AI-assisted.
Two pixel tests, ps_vcmp_f16 (e32, VCC) and ps_vcmp_f16_e64 (SGPR destination,
swapped operands), with NaN, +-0, +-inf, f16 denormals and junk high halves.
Words derived by hand in the headers; semantic fixture and test added.
AI-assisted.
ps_texoff_forms runs the three forms on vk_texture_test's texture with ps_texoff's per-pixel offset (all 64 pairs in
-4..3). check.py and run_gpu_tests.py judge it with texoff_words(..., "ps_texoff_forms"); unit tests check that a
dropped or swapped offset fails. 4096/4096 pixels exact on an RTX 4090 and on a gfx1036 iGPU.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under `python -I` on Windows a redirected stdout is strict ANSI, so printing a path with a character outside the
code page raised UnicodeEncodeError. tools/ guards against it at the start of every __main__ block and
tests/test_tool_stdout_encoding.py enforces that, but only for tools/. viewer/serve.py died before it started
serving and scripts/audit_shader4_regs.py exited 1 after writing its report; bench_wave64.py and run_gpu_tests.py
print the same kind of output unguarded. All four get the guard, and the check now covers scripts/ and viewer/.
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ABh36DZ2sZNq3ChN6EZJs
cs_barrier_loop is a wave32 fixture (subgroup_size 32 in index.json): its
expected words are four waves of 32 lanes. run_gpu_tests.py pinned the size
through VKC_SUBGROUP_SIZE but, unlike check.py, judged the dump when
vk_compute_test reported "compute subgroup size: 32 not available" and ran it
at 64 lanes anyway. A device with 64..64 compute subgroups (GCN3/GCN4 on RADV)
therefore reported a failure that is really an unpinnable wave size: 139/180
passed with 1 failed, where check.py reported 0 failed on the same work folder.
Reuse check.py's unpinned_subgroup_skip for cs_barrier_loop only. The other
pinned dumps are still judged at the device's own width, which is how cs_store
and the cs_w32_* fixtures keep being tested on a 64-only device (skipping all
of them cost 12 passes: 128/180).
RX 570 (gfx803, RADV Mesa 26.2.6, Vulkan 1.4.354), commit 4947579:
run_gpu_tests 139/180 passed, 41 skipped, 0 failed; check.py 0 failed.
Use the existing SPIR-V capability scan to request the feature before creating the Vulkan device, or report an unsupported-device skip. Add a synthetic compute case that checks both words of a binary64 result.
With LEONIDA_PC_TAIL_UBO=1, build.py and run_gpu_tests.py translate with --pc-tail-ubo, and the test
programs (vk_compute_test, vk_store_test, vk_harness, vk_texture_test, vk_sampler_test, vk_bindless_test)
declare and push 128 bytes and, when a stage declares set 1, bind the tail block there
(runtime/test/vk_pc_tail.h: a host-visible buffer with one slot per dispatch or draw, bound as a dynamic
uniform buffer). vk_harness refuses --mesh-compute with the flag (exit 77): mesh_compute_vs.py's vertex
shader still reads its address from push constants. Without the variable nothing changes.
Step 2 of the uniform-buffer tail claimed in #1902.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>