The explicit image_sample_lz rows at bias +0.5, 0 and -0.5 all read level 0,
which is what tools/sampler_lod_probe.py's Vulkan nearest rule gives at lambda
0 for each of them, so those rows stand. The implicit-sample parenthetical was
measured on a derivative lambda, not the explicit-LOD path this sentence is
about, and read a level neither model predicts there; it is removed instead of
being documented as part of the rule.
38 cases on gfx1100 match the exact-rational model for both widths, including the half order, the clamp and
the infinity behaviour: an infinity saturates exactly like an out-of-range finite, to +-1 before scaling, so
-inf gives -32767 (i16) and 0 (u16) rather than the end of the range.
Row 242 was CPU-checked and NVIDIA-tested but explicitly not measured on AMD
hardware. Running the four sub-dword loads and FORMAT code 5 as raw compute
kernels on a Radeon RX 7900 XTX pins the zero-/sign-extension, the
dword-crossing ushort at offset 3, the element-size end check at NUM_RECORDS 8,
and the 1-byte end check on the typed 8_UINT path, so the row no longer carries
the "Not GPU-verified" marker.
docs/testing.md said AMD's Windows driver reports 128 bytes of push
constants on RDNA2 iGPUs, as a property of the chips. A Radeon 610M on
AMD 26.11.2 (Windows 32.0.21045.29003) reports 256, and the GPU suite
runs there without the "need 144 push constant bytes" skip. Name the
driver versions the 128 figure was measured on, in docs/testing.md,
the --pc-tail-ubo row of docs/design.md and the D3D-14 paragraph of
docs/d3d12_vulkan.md, and add the 26.11.2 measurement.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
16 cases on gfx1100 use the output buffer as scratch memory: byte and short stores change only the addressed
bytes, the d16_hi forms take the data VGPR's high half, both dword-crossing accesses are exact, and the d16
loads fill one half of vdst and keep the other, with ubyte zero-extending and sbyte sign-extending.
The doc's full walk had stopped at 72%, so story000.rpf was described from 256 MiB windows. A full
tools/story_index.py run now completes in about 10 minutes: 141,385 streams, 51.1% of the span readable,
9.61 GB unread (the raw RSC8 region), and no zlib candidate past 512 MiB. Adds the per-GiB table and the
class totals, and corrects two sampled conclusions: GiB 13 is not part of the empty RSC8 stretch (31,714
streams; only GiB 5-12 are empty), and GiB 15 is not Bink 2 only (3,702 0DRP page directories).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The summary now says, per category, how many sites have a some-paths read
before the next call in program order and how many have them all after a
later call. strip() also drops the saved-mask SGPRs, so a mask saved in one
pass of an inner loop cannot place a read in the next. The docs quote the
split instead of guessing causes, name the integer mnemonics, and no longer
mention word 0 (the base field belongs to #3794).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
d3d12_pipeline_library_host_test runs 46 CreatePipelineLibrary /
ID3D12PipelineLibrary1 calls that need no pipeline state object on the
Vulkan-backed device and on the host runtime, and compares each HRESULT and
what happened to the output pointer (74 values). On the host every call runs
in a child process with a fresh device: a call that faults there leaves the
runtime broken, and in-process the next call failed fast (0xC0000409). On main 25 values differed (RTX
3060, driver 610.88); now none do:
- A foreign, truncated or corrupt blob, the other device's serialized
library, or a null pointer with a size is E_INVALIDARG, and the output
pointer is left as it was (the layer answered DRIVER_VERSION_MISMATCH and
nulled it). One of the layer's own blobs from another format version stays
D3D12_ERROR_DRIVER_VERSION_MISMATCH.
- A pipeline library is a device child, not a pageable object:
QueryInterface(ID3D12Pageable) is E_NOINTERFACE.
- Load*Pipeline with a null output is E_INVALIDARG, not E_POINTER.
Not compared, and printed as such: the serialized size and bytes (each
device's own), and the calls the host faults on (Serialize(nullptr, n),
StorePipeline with a null PSO, Load* with a null name or description), which
the layer answers E_INVALIDARG.
d3d12_pipeline_library_test expected DRIVER_VERSION_MISMATCH for a foreign or
tiny blob; it now expects E_INVALIDARG, and DRIVER_VERSION_MISMATCH for one of
ours from another version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/design.md, Ray tracing row: the tie rule as measured with x, y and z dominant; that the first fit was
confounded (winding vs the sign of d[kz]) and wrong in the cells it never measured; that the rule was read off the
x/y rows post hoc and then predicted the z-dominant bridge kernel before it ran (32/32, 10 rows discriminating); the
256 new rows; which equal-|d| sign patterns the measured rows tell apart (all consistent with the translator's
>= order). Still gfx1030 only and dyadic inputs. docs/bvh.md 7a: one paragraph on the tie rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gta6rt reads mods/<folder>/mod.json next to gta6rt.exe (or --mods DIR), checks each and logs it. An archetype swap
names two models the game has (by joaat name or 0x hash): when the game asks for `from` it gets `to`. The swaps
are loaded into leonida::mods::active(); they apply once the game's archetype lookup is hooked, which needs the
executable's address for it (docs/modding.md, Day one).
mods/mandy_prison_intro swaps Lucia's player model player_story000_00 (0xE472B687) for cs_mandy (0xD7C0CDFF), the
ids measured in the packs tables; mods_test checks joaat reproduces both. Conditions narrower than "always" are
refused until a hook provides mission state. No game data in either.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under Wine the host D3D12 is vkd3d and under Proton vkd3d-proton, and
Proton's EnumWarpAdapter returns the hardware adapter, so the host and
WARP references six tests compare with are not Microsoft's runtime:
d3d12_r9g9b9e5_uav, d3d12_method_variants and d3d12_sampler2 fail under
Proton (the last two crash inside vkd3d-proton), d3d12_fence_timing and
d3d12_subresource_copy under both, d3d12_private_data under Wine.
The six skip the host comparison there with hostwine::host_is_wine() and
check the layer against Microsoft's answers recorded in the test instead,
so Wine and Proton still check values. d3d12_r9g9b9e5_uav gets WARP's
words for its six clear cases, from the packing rule in
docs/d3d12_vulkan.md. d3d12_subresource_copy and d3d12_private_data get
answer tables, taken from the records that Windows runs on NVIDIA and AMD
compared with Microsoft's runtime with no mismatches; LEONIDA_D3D49_DUMP=1
prints the host's record on Windows to regenerate them. The other three
already had recorded answers. Windows still compares with the live
runtime too.
docs/design.md: the triangle sentences of the Ray tracing row now give the rule measured on an RX 6800 (gfx1030,
AMD 26.11.2, 2026-11-22, the kernels tools/bvh_tri_probe.py builds, 1,204 results): the invalid-ray result, the shear from the
direction, k = |d[kz]|^3 times (T, det, b_i, b_j), the miss words, t >= 0 without an extent test, +0 and
0xFFC00000, RDNA2's tie rule, how the translator computes them, what a consumer dividing by word 1 sees and where
the earlier normalised words differed, and what was not measured. The box sentences are unchanged.
docs/bvh.md 7a: the translator's triangle words against the software step's. cs_bvh32.asm: the derivation of the
scene's triangle words follows the measured rule; the words are unchanged (k = 1 and |det| = 1 there).
Co-Authored-By: Claude Opus <noreply@anthropic.com>
create_arena clamped LEONIDA_ARENA_MB to 16..4095 MiB and never read the device's buffer limits. The RX 6800
(AMD 26.11.2) reports 2 GiB for both, so LEONIDA_ARENA_MB=3000 made d3d12_compute_test fail under
LEONIDA_VK_VALIDATION=1: one vkAllocateMemory over maxMemoryAllocationSize per device. The size is now decided by
src/arena_size.h (min of the request, maxBufferSize and, for the buffer's memory requirement, maxMemoryAllocationSize,
rounded down to MiB), read with the device's other Vulkan 1.3 properties into VulkanDeviceInfo (0: query; a test sets
a smaller one), and logged once when a limit cuts the request. arena_size_test checks the decision on the CPU;
d3d12_compute_test checks the arena against the real limits and a simulated 32 MiB maxMemoryAllocationSize. Tested
on an RX 6800, Windows 11, AMD 26.11.2: ctest 133/133, and the 3000 MiB validation run now passes with no errors.
Co-Authored-By: Claude Opus <noreply@anthropic.com>
The Inputs and outputs row said exp mrtN goes to location N. Counted over
the 1.0.2.1 corpus (counts only):
- 10,500 pixel shaders have SV_Target outputs, and every one of the 29,290
targets keeps register = semantic index.
- 221 of them declare non-consecutive targets, and all 221 export
mrt0..mrt(k-1). The k-th export is the k-th declared target, never
register N.
The row now states the rule, the count and the test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/design.md already says a high 16-bit half is read with `>> 16` alone, with
no narrowing after it, because AMD's Windows LLPC miscompiles that combination
(#1506). The three packed 16-bit shifts were the exception: they took the shift
amount with `OpBitFieldUExtract(s0, 16, 4)` and the value with
`OpBitField{S,U}Extract(s1, 16, 16)`. An AMD Windows driver 25.10.36 on a
gfx1036 reads a field extract at offset 16 with the offset taken mod 16, so both
result halves got the low half of the source - 5 of 2000 wave32 programs of
`tools/valu_fuzz.py --family f16 --programs 2000 --seed 1` (@Darkz0rz, SHADER-777
in the coordination issue). The same 2000 programs match 2000/2000 on a second
gfx1036 (Radeon iGPU of a Ryzen 7 7800X3D, Windows driver 31.0.24002.92), and
the SPIR-V that run produced does contain those offset-16 extracts. So this is a
lowering that survives both drivers, not a value change: BitField{S,U}Extract(x,
16, 16) equals `x >> 16` with the matching right shift, and BitFieldUExtract(x,
16, 4) equals `(x >> 16) & 15`; checked over 200,010 inputs including 0, 1,
0xFFFF, 0x10000, 0x80000000, 0xFFFFFFFF, 0x7FFFFFFF and 0x8000. Extracts at
offset 0 are left as they were.
Coordinated as SHADER-784 in #4571, verifying SHADER-777. Counted over all 26 503
listings: 1 v_pk_lshlrev_b16 in 1 compute listing and 1 v_pk_lshrrev_b16 in another,
no v_pk_ashrrev_i16 and no
_sdwa form. Translating the corpus before and after with the same flags gives
26 503 translated and 26 473 valid in both, with 26 471 of the .spv identical
in size and SHA-256; the two that change are the two holding those instructions,
and their differences are only the replaced extracts. ps_ops4 and ps_ops6 pass
on that gfx1036 iGPU and on an NVIDIA RTX 4090 (driver 32.0.16.2124).
mem_diff found one class of mismatch: a 16_FLOAT/16_16_FLOAT/16_16_16_16_FLOAT
typed buffer load of a half NaN. Measured natively on RDNA2 (gfx1036) with the new
tools/f16_widen_probe.py, wave32 and wave64, MUBUF and MTBUF, formats 13, 29 and 71:
the hardware widens a half NaN to f32 as sign | 0x7F800000 | (payload << 13), keeping
the sign and the quiet bit exactly as the half has them (0x7ddb -> 0x7fbb6000,
0x7fe6 -> 0x7ffcc000, 0xffb2 -> 0xfff64000).
Gen.decode_format decoded every half with UnpackHalf2x16, whose NaN result is
undefined and which the interpreter canonicalises to 0x7fc00000, so the payload was
lost. It now uses UnpackHalf2x16 for the non-NaN halves (an exact widening) and builds
the NaN word from the bits with integer ops. v_cvt_f32_f16 was measured too: it quiets
an sNaN with the payload kept (0x7ffb6000), which the typed load does not.
mem_diff's reference used struct's '<e', which keeps the payload only from Python 3.14;
f16_to_f32 pins the measured rule so the fuzzer is version independent.
tests/semantic/test_buffer_f16_widen_hw.py pins the ten measured words for MUBUF and
MTBUF and formats 13/29/71; tests/test_f16_widen_probe.py covers the probe (models,
fake oracle, CLI); mem_diff --self-test now pins the rule too.
An in-order alignment finds five different 4 MiB data/ttdb chunks reappearing for 65.8-97.5% of their bytes
in the 6 and 32 MiB streams, in short runs with hundreds of gaps (8.6% for the 12 MiB stream). Recorded as
shared runs, not a copy: five chunks aligning this well says they resemble each other.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up on #4536 (CHANGES_REQUESTED by Flyander; coverage note by kapitche).
- --oracle hw no longer always exits 77. It opens tools/hw_oracle (same pattern as
tools/fmisc_diff.py), runs each program as a one-lane wave32 raw kernel in the game's
inferred MODE, honours --hw-arch, and compares the four words with the reference. 77 is
returned only when the oracle is unavailable. v_rcp/v_rsq/v_sqrt_f64 are counted skips
there (native results are approximations, PROC-216); the translator-only known-divergence
exclusions do not apply to hardware.
- add_bits: an exact zero sum now follows IEEE 754-2019 6.3. +0 + +0 stays +0 in every
mode; only opposite-signed zeros and x + (-x) give -0 when rounding toward negative.
Before, every exact zero was -0 in that mode.
- tests: direct table tests for compare (16 conditions x 28 operand pairs), class (10
classes plus boundaries), div_fixup, frexp and add_bits (NaN, inf, zero signs in all four
modes), plus fake-oracle tests for hw routing, --hw-arch, exit 77, skips and shrinking.
Mutating lt to <=, add_bits NaN to 0, or dropping the signed-zero rule now fails them.
- docs/shader_validation.md describes the hw contract. No AMD hardware run has been done.
KNOWN_DIVERGENCES keeps div-fixup-nan-s0 (it waits for TEST-983 to reach main).
AI-assisted (OpenBot team).
Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
The Known problems row named RADV on Mesa 25.2/25.3 and llvmpipe. It adds
the measurements since: RADV 25.0.7 on an RX 7800 XT (@mrbean56, #4421),
ANV 25.2.8 on an Intel UHD 630 (@theswiss24, #4571), and llvmpipe on Mesa
26.0.8, which still gives word 5 = 0 (not judged there by check.py). The
cs_w32_salu64 half is ACO's, so only RADV has it.
#525 (D3D-45) renamed the test and widened it, but this paragraph kept the
old name and its "seven input sets on all three formats". It now names the
test, its eleven integer input sets on the UINT/SINT formats, and that ctest
runs only its --rgb9e5 mode until #521 lands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/psocache_usersig.py resolves a graphics PSO to the chunk records its
stage record names, decodes each 0x41 entry (kind, offset, key, count,
space/base/size) and each 0x42 slot word (SS, II, RR), and computes the
32-dword cost as constants + 2 tables and as constants + 1 table. --limit N
summarises the first N graphics PSOs, --entry N prints one, --json dumps the
same report. It reuses the cache parser from psocache_inspect and never
prints a hash.
docs/pso_cache.md maps the graphics records to descriptor tables, ranges and
32-bit constants with a confidence per claim, gives the measured fit numbers
and sketches how a CreateGraphicsPipelineState path would consume them.
tests/test_psocache_usersig.py builds a two-PSO cache that covers SRV, UAV,
CBV, Sampler, constants, a record that does not fit 32 dwords and extra
slots, and checks the summary, the entry listing, --limit, --json and the
error paths.
op_sel:[FI, BOUND_CTRL] decides what a lane gets when the lane it reads is off in EXEC (or absent from a
workgroup smaller than the wave): FI=1 reads its value, FI=0 keeps the destination (BOUND_CTRL=0) or writes 0
(BOUND_CTRL=1). Measured on RDNA2 (issue #374). The activity of the source lane is shuffled with absent lanes
redirected first, as ds_lane_read does, and the old destination is a plain load, as dst() does.
cs_w32_permlane_fi (GPU) and test_permlane_fi (CPU); the shuffle-count and destination-select controls of
test_valu_permlane16 follow the extra activity shuffle on the FI=0 path.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ricardotanaka asked for the wrapped scan as a tool. Writing its tests showed the
doc's "static tiles are no control" was wrong: a 128 m tile's step is 128/65535,
not 1/512, so only 18.75% of its levels land on a 1/32 m grid. All 137 sampled
static tiles fit 0.0625 (none fits 0.0325), so the 0.0325 meshes are what ties
the local-space meshes to the CVehiclePoints documents.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
find_local_exec_folds built the region's sub-CFG from edges inside the region only. An s_cbranch_scc0/scc1 (or any branch) from inside the region straight to the join lost that edge, so cfg_structure.structure placed the next block without a %pc guard and emit_folded_region ran it on the exit path too. Edges to the join now go to an exit node that is dropped from the tree. Test and design.md row added. AI-assisted.