quote() escaped quotes but ignored CommandLineToArgvW's backslash rules,
so GetCommandLineA/W and __argv disagreed for an argument ending in a
backslash ("C:\My Games\" next" parsed back as 2 arguments, not 3) or
holding a backslash before a quote. A backslash run before a quote, or
before the closing quote, is now doubled.
widen() decoded the arguments as UTF-8, but main.cpp passes
std::filesystem::path::string(), which is ANSI code page text, so cafe
with an accent reached __wargv as caf\uFFFD. It widens from CP_ACP now;
under a UTF-8 activeCodePage that is the same thing.
New process_cmdline_test (ctest process_cmdline) checks that
GetCommandLineW parses back to __wargv.
cost and dword_count + dwords were 32-bit. With {Constants 1, Constants
0xFFFFFFFF} both wrap to 0, so the 64-dword cost check and the 32-SGPR
check pass and the loop writes past PackResult::dwords[32] (the test
binary dies with 0xC0000409). parse_rts0 copies Num32BitValues from a
blob unchecked, so a malformed RTS0 reaches this. Both sums are now
64-bit; root_signature_test gets the wrapping case.
The GPU tools picked a device with the shared ranker but never applied the
name filter the D3D12 tests have used since #861. Filter candidates through
vulkan_device_wanted in vk_device_pick.h, report a filter that matches nothing
instead of dereferencing a null device, and cover the filter cases in the
picker test. docs/testing.md no longer says the tools ignore it.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Keep the creation-time castable list on the resource, reject an SRV format
that is neither the resource format nor listed, and allow listed same-size
cross-family casts such as R8G8B8A8_UINT to R32_UINT.
vulkan_device_filter.h decides which Vulkan GPU the runtime and its tests
take, but nothing tested its edge cases. Add a CPU-only test for unset/empty
matching everything, case-insensitive substrings (including spaces), no-match,
and null/empty names under both settings, and restore the environment after.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
What was wrong (tools/rdna2spirv.py):
- s_load* / s_buffer_load* added base + soffset + imm unaligned; hardware truncates each of the three to a
multiple of 4 before adding them.
- s_buffer_load* had no bound at all and read past NUM_RECORDS.
- s_load* zero-extended a negative immediate from 32 bits (soffset 8 + imm -4 read ptr + 4 GiB + 4).
- raw buffer_load_dword* checked only the start (offset < num_records), so a dword at NR-1..NR-3 and the tail
of a multi-dword load returned data where hardware returns 0.
Hardware evidence: AMD Radeon RX 6800 (gfx1030, driver 32.0.21045.29003), raw compute kernels, wave32 and
wave64, 155 runs, every result 0 or the stored data, wave32 = wave64 in every dword. Decisive rows:
s_buffer_load imm 0x10 with NR 18 -> 0; imm 0x13 with NR 21 -> data@0x10; soffset 0xe + imm 2 with NR 16 ->
data@0xc; x4 at 0xc with NR 21 -> data, data, 0, 0; stride 4 with NR 5: 0x10 data, 0x14 0; stride 1 with NR 17:
0x10 -> 0; base & 3 = 1 with imm 3 -> data@0. s_load soffset 8 + imm -4 -> @4, soffset 0xb + imm -1 -> @4.
buffer_load_dword at 0xf with NR 18 -> 0; x4 at 3 with NR 18 -> d0..d2 data, d3 0.
Now: off = (soff & ~3) + (imm & ~3), dword i at (base & ~3) + off + 4i. s_buffer_load dword i is 0 and not
loaded (its own selection construct + OpPhi) when off + 4i + 4 > limit, limit = NR * stride or NR (stride 0).
s_load: imm sign-extended from 21 bits, 64-bit sum, no bound. Raw (stride 0, no idxen) buffer_load: dword i
loaded iff O + 4i + 4 <= NR. Structured, idxen, stores, atomics and format loads keep their old first-byte
check (not measured).
Inferred, not measured: s_load with soffset + imm < 0 (64-bit signed sum), s_buffer_load x16 and buffer_load
x3 (same rule), an s_buffer_load immediate with bit 20 set or negative. OOB_SELECT (V# word3[29:28]) changes
vector-load results on hardware (2 probes) and is recorded in docs/design.md, not modelled.
Tests: tests/semantic SmemHardwareRuleTests (evaluator follows branches/phis), RawBufferTailBounds and
MeasuredBoundsShaders assert values and the exact addresses read; 19 fail with main's translator. New GPU
tests cs_smem_bounds, cs_smem_stride_align, cs_smem_sload_neg, cs_buf_tail (expected words derived by hand
from the model) in check.py and scripts/run_gpu_tests.py. test_heap_base_is_added_once now gives its V# a
NUM_RECORDS (it had 0, which the measured bound turns into a load of nothing).
Tested on AMD Radeon RX 6800 / Windows / driver 26.11.2 (Vulkan), on main d937b7f: run_gpu_tests 62/62 passed;
check.py 56 of 56; unittest tests/semantic 460 OK; pytest 1796 passed, 7 skipped, 1 xfailed. The three new tests
that are safe to run with main's translator fail with it on the GPU; cs_smem_sload_neg was not run with it (it
would read 4 GiB past the heap). Indexed (idxen) buffer loads keep their single selection construct.
AI-assisted.
Rebased onto main 8df277f: since 2e8101b the semantic mini interpreter raises on a PhysicalStorageBuffer access that
is not 4-byte aligned, so RawBufferTailBounds rows that load at an unaligned O now set base_low so that base + O is
aligned (the bound sees only O, so the measured O / NR pairs are kept); the base & 3 = 3 row uses offset 5 as a
stand-in for the measured offset 3. Byte-exact data at an unaligned address is no longer asserted there.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route both four-tap gather paths through the existing binary16 conversion so explicit LOD and offsets keep the two-word result and the following register intact.
Intel's Windows driver (UHD 770 / Xe-LP, 32.0.101.6129) evaluates OpBitFieldUExtract
of a constant that fits in 16 bits with the offset taken mod 16, so s_mov_b32
exec_lo, 0xffff ran all 32 lanes and lanes 16-31 copied the EXEC bits of lanes 0-15.
That is what broke cs_w32_permute case C and lds_fuzz w32 programs 24 and 26 there.
(K >> lane) & 1 gives the same bit on every driver. cs_exec_const.asm checks four
constant masks, three of them 16-bit, in both GPU runners.
Every image went to the fixed %TEMP%\leonida_pe_bounds_test, so two copies
running at once (two build trees, parallel CI jobs on one runner, several
ctest runs on one PC) overwrote each other's pe_bound_N.bin and deleted
the folder under each other at exit. The loser failed with "not an MZ
image", or case 4 loaded the other process's HIGHLOW image and saw a
delta that didn't fit. pe_loader_test and loader_tls_test already add the
process id; this does the same. LEONIDA_TEST_DIR still wins.
#895's CBV/SRV/UAV views write placeholder tags (1, 2, 3) into the descriptor heap, and its new check in
d3d12_vulkan_device_test expects an SRV's first dword to be 2. main's SRVs are GFX10 T# words (D3D-72 and the
descriptor table), so the device test failed at line 2211. The PR needs a rebase onto main's descriptor model.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
prepare() gates every optional ReplayFunctions entry except the two image
clears, so a whole-view render-target, depth-stencil or texture UAV clear,
or the zero-clear detail::initialize runs on an image the tracker holds in
UNDEFINED, called a null pointer when the caller left them unset. The
whole-view clears are now checked in prepare(); the zero-clear, which depends
on the tracker, in replay() before emit. Both return unsupported.
(cherry picked from commit 86e6ca72d9748206476c31cb61f9d1e3f43952bd)
d3d12_clear, d3d12_com, d3d12_descriptor, d3d12_method_variants,
d3d12_resource_desc, d3d12_sampler2, d3d12_typeless_rtv and d3d12_uav_clear were
built but never added with add_test, so ctest and CI never ran them. Each now
exits 77 when there is no Vulkan GPU (DeviceStatus::unavailable), as
d3d12_vulkan_device_test does, and is registered with SKIP_RETURN_CODE 77.
(cherry picked from commit 2af37e5da368dd130ba23db385e812635cb1a768)
The host D3D12 runtime reports NodeMask 1 for a direct, compute or copy
queue created with 0 on a single adapter, as #838 made descriptor heaps and
resources do. d3d12_node_mask_test now compares the six queue cases with
the default adapter and WARP.
NumFeatureLevels 0 returned DXGI_ERROR_UNSUPPORTED, and a null
pFeatureLevelsRequested with a count was read. The host D3D12 runtime
(NVIDIA and WARP) returns E_INVALIDARG for both. When no requested level
is supported the host also writes MaxSupportedFeatureLevel 0 next to
DXGI_ERROR_UNSUPPORTED; the layer left the field as it was.
prepare_buffer_uav_clear gave vkCmdFillBuffer/UpdateBuffer/CopyBuffer the
view's offset, which is relative to the resource, without the binding's
buffer_offset. ResourceBinding documents that a buffer may be a range of a
larger VkBuffer (the GPU address arena holds many), and copies, atomic
copies and buffer_at already add it; a clear of such a resource wrote from
the start of the VkBuffer, over whatever lives there. Latent on main (the
device binds buffer_offset 0), live once buffers sit in the arena.
The offset is added after the D3D12 alignment check (relative to the view)
and before the transfer alignment, which needs the absolute offset.
replay_uav_clear_offset_test checks raw, R8, RGBA32 and rectangle clears
with fake transfer functions; no GPU.