ps_bitmask_perm is skipped when a driver runs the wave32 pixel shader narrower
than 32 lanes (#1318), because the "pippi" pattern reads lanes 16-31, which
then do not run and have no defined value. The skip excused the whole test,
including the sources that do run: at 16 lanes wide every lane reads lane ^ 9,
which is inside the running lanes for lanes 0-7, so a wrong word there went
unnoticed on Intel.
The skip now excuses only the sources that are not there. Where the source
lane runs, its word has to be right, so a narrow run is judged instead of
skipped. At 8 lanes wide every "pippi" source is lane 8 or above, nothing can
be judged, and the test still skips.
The translator change this depends on is #2780: a source lane that is not
running reads 0 instead of an undefined value, which is what makes the narrow
run judgeable at all. Until it lands the note in docs/testing.md describes a
behaviour that main does not have yet.
Tested: python -I tests/test_shader_checks.py (70 tests, OK, on main
16282101). No GPU, no game files.
AI-assisted.
loader_test, test_pe_loader_bounds and unimplemented_policy_test build relocation-less images fixed at
0x140000000..0x1a0000000. Under arm64 Wine (CrossOver on Apple Silicon) the process's own allocations sit at
0x100000000 and up and macOS maps its shared region at 0x180000000 (RT-22), so the loader rejected those images
with "preferred base is taken" before the checks ran: loader stopped after 31 checks with 3 failures,
pe_loader_bounds failed 13 checks and unimplemented_policy failed.
New test/free_image_base.h: on Windows it returns the constants unchanged. Under Wine (ntdll exports
wine_get_version) it moves the whole 0x140000000..0x200000000 span to a free window picked top-down, away from
the heap, so each constant keeps its offset and images loaded together still get different bases. The init
image reads its TLS callback addresses from its own ImageBase instead of a constant.
AI-assisted. No game files.
The main index keeps its FSPX-keyed entry, but only entries loaded from fspx/index.json are reported as FSPX; a broken or missing sub-index resets the count.
The 24 translated FidelityFX programs are in <shaders>/fspx/index.json, not in the RPF containers this test walks. Compare reached entries against the RPF total and report the FSPX count separately.
ShaderLibrary::size() includes entries loaded from <dir>/fspx/index.json, which a corpus of RPF containers never reaches. Expose fspx_size() so callers can compare reached entries with the right total.
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>
A write-open of a package file copied it straight to its overlay name with
no lock. A process killed mid-copy left a truncated file there that every
later read preferred over the package; two threads write-opening the same
package file both copied, and the second copy_file failed on the taken name,
so that open failed.
write_target now copies into <overlay>\.gta6rt-copy under a private name and
renames it into place, under a mutex that only copy-ups take. Listings hide
the staging folder like .gta6rt-deleted. Without the mutex, copy-then-rename
alone still failed about 2 in 100 runs: a losing rename onto the existing
name briefly holds it, and the winner's open got ERROR_SHARING_VIOLATION.
file_system_test: two threads write-open one 256 KiB package file, 50 rounds;
both opens succeed and the overlay copy matches (fails 3 of 3 runs on the
old code, passes 200 of 200 with this); no staging file is left; a crash
leftover is hidden from a GAME: listing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hw_oracle launches compute kernels only. vk_harness can now write a
pipeline's VK_KHR_pipeline_binary data and build a pipeline from it
(VKH_BINARY_OUT / VKH_BINARY_IN). ps_oracle.py puts assembled ISA in
place of _amdgpu_ps_main in the driver's PAL ELF, raises the pixel
stage's register counts in the msgpack metadata, optionally changes
other metadata entries, and draws with it, reading every pixel's mrt0
words back.
Checked on gfx1036 (driver 26.10.1): v_interp of a varying and the
parameter words P0 / P10 come back as expected. Tests in
tests/test_ps_oracle.py, docs in docs/shader_validation.md.
AI-assisted.
The clamp, the component after the coordinates, becomes MinLod on the
implicit-LOD sample (after Bias and Offset in mask order); outside the pixel
stage the LOD is max(0, clamp). a16 and --texel-offset-fallback (Grad|MinLod)
included. GPU tests ps_texture_cl and ps_texture_b_cl on the two-mip texture,
semantic tests, design.md row. Stacked on the image_sample_c change.
AI-assisted.
ps_sdwa_f16_const read mrt0 lane y as 0x0000 instead of 0x1c00 on NVIDIA: the
_sdwa src0_sel:BYTE_1 selects the f16 denormal 0x0040 (2^-18), and the driver
flushed it on the way into f32 because the module declared no 16-bit denormal
mode. The translator models f16 arithmetic in f32 with integer narrowing, so no
f32 denormal is involved and that conversion is what the 16-bit mode governs.
Every module now also emits OpExecutionMode %main DenormPreserve 16 with the
matching capability (core since SPIR-V 1.4, so no extension), and the index
lists shaderDenormPreserveFloat16, which vk_pipeline_check requires and
--no-float-controls still drops along with the 32-bit mode.
Tested on an RTX 4070 SUPER (driver 610.88, validation layers on): the GPU test
goes from 4096/4096 mismatches to 4096/4096 pixels exact, and the full GPU suite
from 142/189 to 143/189 passed with 0 failures and the same 46 skips.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The bound that stops a lookup's walk only grew: once a large buffer was
freed, every later miss still walked back as far as that buffer had
reached. With 20 000 buffers of 256 bytes, a 1 GiB range added then
removed left a miss past the last buffer at 250-600 us instead of ~50 ns
(found by @padhossein in review of #2823).
A multiset of the indexed sizes keeps the bound at the longest range
indexed now; insert and erase stay O(log n), find is unchanged. Inserting
the same (va, id) again replaces its size instead of leaving the old one
in the bound.
buffer_va_index_test checks the bound after erases (same sizes and a
smaller re-registration included), against the longest live range in all
200 random tables, and times the review's miss-after-free case.
Measured by kapitche: Intel UHD 770 reports gl_SubgroupSize 32 in the fragment stage but runs 16 live invocations, so tiers A and B (32 or 64 live lanes) cannot hold. The skip keeps its condition (minimum subgroup below 32); deriving it from a measured live width is a follow-up.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reporter corrected the probe: Intel UHD 770 reports a subgroup size of 32, so its tier A failures have an unknown cause and must not be skipped; only a device whose largest subgroup is below 32 (llvmpipe) is.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Intel UHD 770 reports fragment subgroup 8..32 but runs pixel shaders 16 wide and cannot be held to 32, so reads
across 16 lanes (permlane, swizzle, bpermute) fail there. Tiers A and B mean exact on 32- or 64-lane subgroups.
The SHADER-10 row also loses the stale text the merge of #2260 left in it: the pre-TEST-319 A list (bpermute and
permlane "not GPU-tested here"), "Corpus coverage is not measured here", "the corpus ones are wave32", "geometry
shaders are not tested" and a repeated sentence, which the census and the GS fixtures (TEST-251) now contradict.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows 11 23H2 in-box d3d12.dll (10.0.22621.5415) AVs with 0xC0000005 when passed nullptr for SAL _In_/_Inout_ parameters (pDesc, pKey, pValue, pValueSize) without the debug layer (reported by @CharlyRien on #2167). Keep all null-pointer checks on the Vulkan layer, skip only raw nullptr _In_/_Inout_ calls on the host comparison, and disable stdout buffering so progress lines flush immediately.
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.
Review of #2910: host_adapter.h said it follows the same rule as
d3d12_copy_compare.h, with the variable read and the adapter name matched in
both. hostadapter::wanted() and hostadapter::named() now do that once, and
copycmp::try_create_host calls them, so the two cannot come to read the
variable differently.
No change in behaviour: d3d12_vulkan_device, d3d12_buffer_uav, d3d12_shader_cache
and d3d12_stencil_copy give the same exit codes as main with the variable unset,
naming either GPU in any case, "warp" and a name that matches nothing.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`gta6rt --run game.exe`, started from the game folder, set the game folder to the image's parent path, which is
empty for a bare name: the run printed `console paths: GAME: -> , writes -> overlay` and every GAME: open failed
with ERROR_PATH_NOT_FOUND. A relative --game-dir or --overlay worked only until the title changed its current
directory. main.cpp now makes both absolute at startup (keeping the path as given if absolute() fails).
New CTest run_tiny_game_dir: tiny_game's opt-in `game-file` check moves its current directory, then reads
GAME:\tiny_game_probe.txt; check_game_dir.cmake runs it by bare name and with `--game-dir .`. Without the fix both
fail (open errors 3 and 2); with it both pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
map_image records a module in by_name_ before mapping, binding and section
protection can throw. The run-time load path erased only the DLL it was
asked for, so a bundled dependency that failed while being bound stayed
registered with unbound imports, and a later LoadLibrary or GetModuleHandle
of it returned that half-loaded image. load() now erases its own key on any
failure; ~Loader still frees the mapping through order_.
loader_test: a parent imports fail_dep.dll, whose import table names a DLL
outside the image. After the failed load neither name is found and a second
load of either fails again (on the old code the dependency was still found).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A NAME (a game path or a unique part of it) is looked up in the table
tools/bink_play.py keeps, which bink_play builds once if it is missing; the
table also gives the game folder. A windowed run with no movie plays
Stinger/RSG_STINGER.bk2, so double-clicking the executable plays it. A headless
run with no movie still skips (CTest).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Started by double-click, the console closes with the process, so a missing
movie or game folder looked like the player not opening at all.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/test/bink_play.cpp maps the package's Bink2Scarlett.dll with rt::Loader
and plays a .bk2 at its frame rate (GDI window; pause, seek, loop). A movie
inside an archive plays where it is: archive.rpf@OFFSET goes to BinkOpen with
BinkSetFileOffset and the BINKFILEOFFSET flag, so nothing is extracted.
tools/bink_play.py finds the offset from the movie's name (bink_names.py).
CTest runs the headless smoke, which skips without a package and movie.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Other queues' next submission waits on the timeline value of the submission that carries a new generation's table upload; the submit result is committed under tracker_mutex_; at most 8 retired generations are kept before the flush waits for the oldest one's ticket (queue timelines, not the device); a failed new generation leaves the in-use set and the pending writes alone. The churn test gains an async-compute case (no D3D12 fence from compute to the direct queue), a check that a retired generation is pending right after its submit, and a --validated ctest. Docs: only public sources.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2022 now carries main's SHADER-358 / SHADER-364, which did what the stores commit did for the three
older stores: f16 format stores toward zero (Gen.mem_f16), exact NORM rounding (Gen.encode_norm_bits)
and the DST_SEL-dependent routing of a two-component V# store (identity selectors: x, w; the runtime's
X,Y,0,1: x, y; tbuffer: x, y). This merge keeps their translator code, drops the duplicate encoders
(norm_encode_exact, the y-route flag) and what is left of this branch is: the 12 non-FLOAT
10_11_11 / 11_11_10 codes (Gen.FORMATS now holds all 77, gfx1036 validated them: @AwkGrep256, #2022),
the oracle (one store model per path, XY01 store runs, all 77 codes by default on a GFX10 device),
the larger cs_fmt_all fixture, and the docs.
Co-Authored-By: AwkGrep256 <AwkGrep256@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Tone map: identity up to 0.8 of SDR white, extended Reinhard shoulder above it, continuous in value and slope, content
peak maps to 1.0 (SDR-range content is no longer darkened).
- The Windows SDR white level is read by a background thread (about once a second, only while HDR10 is in use);
PresentX reads an atomic. A failed query keeps the last good value; QueryDisplayConfig retries on
ERROR_INSUFFICIENT_BUFFER.
- LEONIDA_SDR_EOTF is case-insensitive, unknown or too long values are logged; setters are atomics; <cwchar> for wcscmp.
- Tests: eight-step HDR10 ramp with hand-calculated bytes, curve properties (monotonic, identity below the knee, peak 1,
slope continuity), HDR10 plane 1 over SDR plane 0 on HDR10 and SDR outputs, hand-calculated 50% overlay bytes, query cost.
- Docs 4.5: shoulder description, query cost, sources marked (KWin claim unverified, vkd3d-proton file partly read, the
measured 80 nits only covers the SDR fallback path).
- present_compose.inc rebuilt with glslc 2026.4 (reproducible, spirv-val clean).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vk_command_replay_test, vk_predicated_copy_test and vk_predicate_capture_test
were built but never registered, so no ctest run executed them. Register them
next to depth24_convert, and have each exit 77 (CTest skip) when the test
device reports no Vulkan device, as depth24_convert_test does, so a machine
without a GPU skips them instead of failing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d3d12_bundle_test calls std::fopen (line 518) and d3d12_first_light_test
calls std::getenv (line 68), so MSVC prints C4996 for each. The other
test targets that use them (bink_decode_test, fsr_dispatch_test,
bvh_builder_test, startup_trace_test, ...) define _CRT_SECURE_NO_WARNINGS;
these two now do as well.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d3d12_copy_xfmt, d3d12_depth_resolve, d3d12_fence_events, d3d12_indirect_zero,
d3d12_node_mask, d3d12_query_rules and d3d12_resource_desc created their hardware
reference with D3D12CreateDevice(nullptr), the default adapter, and did not read
LEONIDA_HOST_ADAPTER. On a PC with two GPUs the layer then ran on one GPU and the
host driver on the other.
runtime/test/host_adapter.h picks the adapter by the rule d3d12_copy_compare.h
already follows for d3d12_vulkan_device: the adapter LEONIDA_HOST_ADAPTER names
(a name that matches none fails the run; "warp" leaves the hardware pass out),
else the adapter behind the Vulkan device (deviceLUID), else the default adapter.
The tests print the adapter's name instead of "the default adapter".
Measured on a Ryzen 7 9700X iGPU (AMD 32.0.21042.62) next to an RTX 3070
(NVIDIA 610.74, the default adapter): d3d12_depth_resolve with the layer on the
Radeon set aside nine resolves as host quirks before and after, but four of them
were NVIDIA's ("D24S8 stencil as X24_G8"); against the Radeon's own driver the
four are D24S8 depth MIN/MAX. The other six tests print the same results against
either adapter.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>