The packs are XboxBvhBuilder's rehydrate inputs: RehydrateRaytracingAccelerationStructureX returns S_OK on a PC (CPU path, buffers mapped at their GPU virtual addresses), and a CPU model of the packing gives the same bytes on 8 samples. New section 4a records the element and box packing, the leaf frame from compressionParams, the instance descriptor's 3x4 as the geometry transform, where the triangles come from (drawables in levels.rpf, minus the geometries of two shaders), and four checks that verify a geometry match. The two shader name hashes stay out per section 8.
The header word is the root parameter's entry at +0x344 + 4*root. For
several 32-bit constants the builder adds (count - 1) << 16 (0x120000 for
19, 0x70000 for 8, 0x30000 for 4); for one constant at a non-zero offset
it adds 4 * destOffset (0xc at 0x19fca, 0x14 at 0x1a346, matching their
slot-37 fallbacks (2, value, 3) and (2, value, 5)). Descriptor tables and
root CBV/SRV/UAV write the entry unchanged, then 4 bytes or the full
8-byte address. Every reader tests the entry against 0xC0000000 (98 sites
in the builder, 7 in the FSR DLL) and sets +0x140 only when both bits are
clear.
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>
Keep the upstream M4 and buffer-UAV targets and the new fence measurements alongside the single-output M3 query probe and first-pass test. Retested on Intel UHD and RTX 3050 with validation; the pre-existing Intel post-pass Int64 capability error remains visible. AI-assisted with Codex.
d3d12_first_light (package-gated by LEONIDA_FIRST_LIGHT_DIR, exit 77 when
unset) draws the mesh and translated VS/PS that tools/first_light.py wrote
through the Xbox-ABI device proxy: CreateGraphicsPipelineState gets the
game's own containers and finds both stages by FSSM hash, the input layout
feeds POSITION/TEXCOORD, DEFAULT vertex/index buffers, one
DrawIndexedInstanced, CopyTextureRegion readback. It checks vk_harness's
oracle (coverage window, clear corner, centre UV) with the rows flipped
for the y-up viewport, and compares every pixel with vk_harness's
image.raw.
first_light.py now also writes vs.dxbc, ps.dxbc and index.json (the
translator entries keyed vs/ps) to the output folder.
RTX 3060, driver 616.64: 12,804/16,384 covered, centre
(0.49756, 0.49634, 0, 1), as vk_harness; 16,383 pixels bit-exact and one
one f16 step apart (the PS exports with v_cvt_pkrtz_f16_f32; vk_harness
with the mesh mirrored in y matches the D3D12 image bit for bit).
Clean under LEONIDA_VK_VALIDATION=1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/pknorm_probe.py runs v_cvt_pknorm_i16_f32 / v_cvt_pknorm_u16_f32 through the translator on the CPU interpreter
and, with --oracle hw, natively through tools/hw_oracle in wave32 and wave64 under five MODEs. On an RDNA2 iGPU
(gfx1036) every NaN half (74 of 74: quiet, signalling, both signs, payloads, in S0 and S1) gives 0, as the translator
assumes, whatever IEEE, DX10_CLAMP and the f32 denormal mode are.
The rounding does not match: the hardware rounds the exact product x * 32767 (or 65535) once, while the translator
rounds the f32 OpFMul product and then RoundEven, one off on 28 of 28 near-tie inputs in both directions. Recorded in
docs/design.md and docs/shader_validation.md; the translator is not changed here. tests/test_pknorm_probe.py checks
four near-tie words against a hand derivation and the translator side's double rounding and NaN zero.
Since #1567 made the game's S# words literals, 16 corpus gathers with
CLAMP mode 6 (clamp border) failed as Unsupported. Modes 6 and 7 (mirror
once border) now give a tap outside [0, n-1] the S# border colour's
channel (BORDER_COLOR_TYPE, word 3 [31:30]: transparent black, opaque
black, opaque white), for literal and run-time S#s; a table border
colour stays Unsupported on a literal S#, and half-border modes 4 and 5
keep their old handling. GPU test ps_gather_border, translator tests and
the contract row.
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>
The Known approximations row still said v_cos_f16, v_exp_f16 and
v_log_f16 were unmeasured, although the f16 transcendentals row from
#1310 (FUZZ-29) records that the f16 field of FP_ROUND is ignored by
all seven transcendentals. Cite that row instead; the translator
already treats them the same, so no code change.
main currently carries this row three times after the merge round, so
the sentence is fixed in each copy.
Every buffer_store_format_* site inlined the encode arm of every format, so the larger format
table tripled the dynamic-store sites (cs_store 169 KB -> 503 KB), the kind of growth that hit
the SPIR-V id bound for loads (#884, dcd8ecf). The encode is now one function and the element
size another, each store site a call plus the dword stores, like the shared decode.
Semantics are unchanged (GPU fixtures cs_store, cs_fmt_*, cs_oob_tail, cs_oob_select and
cs_fmt_all pass on a Radeon 880M and an RTX 5070; the semantic suite and the hardware model
checks pass). Sizes: cs_store 169 KB -> 90 KB, cs_fmt_sint32 256 -> 269 KB, cs_fmt_1010102
113 -> 163 KB, cs_fmt_xy_xyz 468 -> 406 KB, cs_oob_tail 71 -> 96 KB (load decode arms).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
docs/rbf0.md called the tree output "a rendering, not a round-trip" and
nothing wrote RBF0. encode(doc) rebuilds the record stream from the tree
rbf0_tree.parse_resource returns, in both layouts: descriptor names at
first use, element words 0, 0, attribute count, attributes then content
in tree order, text and strings with their recorded NUL.
It fails closed, with a reason, when the tree cannot hold the original:
an incomplete parse, invalid UTF-8 the decoder replaced, a NaN float
(infinities are exact), an attribute after content, a descriptor out of
order, or a string or text whose byte length changed.
--check decodes, encodes and compares every resource of a carve and
prints counts only. A report-and-directory form writes the resources of
an rbf0_tree.py JSON report (possibly edited) as .rbf files.
Measured on the 1,263 data.rpf resources: 1,240 byte-identical, 0
different, 23 refused, all for invalid UTF-8. They are the resources
holding the 26 invalid payloads docs/rbf0.md already lists. Counts are
in docs/rbf0.md 9.6.
tests/test_rbf0_encode.py: synthetic streams only. Every record type in
both widths, infinities, narrow float bits, the largest integers, the
JSON report form, an edited tree, each refusal reason, and the CLI with
a resource split over two 64 KiB streams.
Gen.FORMATS now holds 65 of the 77 codes a V# or MTBUF can carry. Added: 8/16-bit UINT and SINT,
every USCALED and SSCALED, SINT of the wider families, 10_11_11_FLOAT and 11_11_10_FLOAT
(unsigned 5-bit-exponent floats), and the SNORM / SCALED / UINT / SINT members of the 10_10_10_2
and 2_10_10_10 families. The twelve non-FLOAT 10_11_11 / 11_11_10 codes stay unsupported: GFX11 has
none, so nothing measures them.
Stores follow what the Radeon 880M did (RDNA3.5, not RDNA2): SINT and UINT saturate, NORM stores
round the exact product (Gen.norm_encode_exact), a SCALED store converts as its NORM format, the
small floats round toward zero and saturate to the largest finite value (Gen.ufloat_encode_bits),
and a half rounds away from zero in a 2-bit SNORM field. Existing formats keep their emission:
with the table cut back to its old 32 codes the output for all 182 runtime/test/shaders is
byte-identical to before.
tests/semantic/test_buffer_formats_all.py holds the translation to the hardware model for every
added format (loads through the V# and tbuffer, stores, hand-worked values) and pins two older
stores that differ from the hardware as expected failures. cs_fmt_all.asm is the GPU fixture (28
loads, 15 stores; AMD Radeon 880M and NVIDIA RTX 5070). docs/design.md gets the contract row.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>