Commit Graph

5744 Commits

Author SHA1 Message Date
16cea91e30 Merge pull request #1948 from Luiz Neves 2026-11-22 10:39:40 -05:00
84c7067f2f bvh.md: the dehydrated BLAS rehydrate, with their packing and source geometry
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.
2026-11-22 16:39:39 +01:00
14fc271bd2 Merge pull request #1941 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 10:39:37 -05:00
72a38ad24d Merge remote-tracking branch 'origin/main' into shader-33-vs-inputs
# Conflicts:
#	docs/design.md
2026-11-22 16:39:33 +01:00
dd91fbe6ff Merge pull request #1935 from Tao Battarel 2026-11-22 10:39:33 -05:00
8b50505220 Merge pull request #1931 from Vonsek 2026-11-22 10:39:31 -05:00
e89156dc85 Merge pull request #1922 from YaBulochka 2026-11-22 10:39:28 -05:00
00a0f7f993 docs: how the console list's inline root-argument header word is built
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.
2026-11-22 15:39:25 +00:00
a5e776f72f Merge pull request #1913 from Jan Trencansky 2026-11-22 10:39:24 -05:00
4c2800bd27 Merge pull request #1912 from Nolan Cotter
# Conflicts:
#	docs/README.md
#	docs/d3d12_vulkan.md
#	docs/i18n/README.md
2026-11-22 10:39:23 -05:00
96dcddb6fb Merge pull request #1911 from Jan Trencansky 2026-11-22 10:39:21 -05:00
98e9acfb91 Merge pull request #1908 from Jolymmiles 2026-11-22 10:39:19 -05:00
0ef287bec3 Merge pull request #1906 from SuarezPM 2026-11-22 10:39:18 -05:00
95f60f970e Merge pull request #1904 from edwin042331-hue 2026-11-22 10:39:18 -05:00
507dfe884d Merge pull request #1903 from Luiz Neves
# Conflicts:
#	docs/design.md
2026-11-22 10:39:17 -05:00
3b5ac8f1c1 Merge pull request #1900 from Tim Elery 2026-11-22 10:39:15 -05:00
12bad64c53 Merge pull request #1899 from Hadagalberto Junior 2026-11-22 10:39:15 -05:00
911ed91fae Merge pull request #1893 from liang-kai-shui
# Conflicts:
#	docs/design.md
2026-11-22 10:39:13 -05:00
6380eb73fd docs: correct the character texture-slot roles 2026-11-22 15:39:08 +00:00
de8278f673 Merge pull request #1882 from Tomgamer 2026-11-22 10:39:08 -05:00
7a47f8b1b9 Merge pull request #1878 from CLHelper
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 10:39:06 -05:00
607c668dbf Merge pull request #1871 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 10:39:04 -05:00
84c143f95d Merge pull request #1860 from Kam471 2026-11-22 10:39:01 -05:00
ff0b3747d4 Merge pull request #1844 from romainveurrier 2026-11-22 10:38:58 -05:00
2b37b6a5c3 Merge pull request #1825 from richardsenra 2026-11-22 10:38:57 -05:00
9fb466a137 Merge pull request #1820 from Tomgamer 2026-11-22 10:38:57 -05:00
33625dba3c Merge pull request #1808 from Taffyyy-ops 2026-11-22 10:38:56 -05:00
0093aa9097 Merge pull request #1799 from Dominik 2026-11-22 10:38:54 -05:00
fd936d2d35 Merge pull request #1792 from Luiz Neves 2026-11-22 10:38:53 -05:00
9299c04dec Merge pull request #1534 from Kam471 2026-11-22 10:38:50 -05:00
ae2a4a1705 Merge pull request #987 from gabrielsteglich 2026-11-22 10:38:46 -05:00
1e48c3f463 Merge pull request #760 from 0xTehuti 2026-11-22 10:38:41 -05:00
5e284e7714 Merge pull request #736 from VictorJulianiR 2026-11-22 10:38:40 -05:00
e403590204 Merge pull request #718 from fearkov 2026-11-22 10:38:40 -05:00
81e520c327 Merge pull request #409 from JustDown 2026-11-22 10:38:36 -05:00
a0e8229a55 Tests: don't judge cs_signed_zero_nan's 0 * inf check on llvmpipe
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>
2026-11-22 15:38:11 +00:00
fc4b7992e0 docs: note the --limit range for the world lights tool 2026-11-22 21:07:55 +05:30
35953169c9 Merge main into D3D-209 and resolve M3 documentation and test registration conflicts
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.
2026-11-22 12:36:58 -03:00
6c73872cad first_light: draw the real model through the D3D12 layer
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>
2026-11-22 12:36:51 -03:00
cb4a761dd9 docs/design: mark the EXEC and 64-bit scalar bitwise rows hardware-verified 2026-11-22 18:36:40 +03:00
d8a66eebaf rdna2spirv: avoid undefined FClamp on NaN in v_med3_f32 / v_med3_f16 2026-11-22 16:36:17 +01:00
c20586fc58 pknorm_probe: v_cvt_pknorm_* give 0 for NaN on RDNA2, but round the exact product once (SHADER-339)
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.
2026-11-22 18:35:49 +03:00
be94645977 Translator: border address modes in the image_gather4_l emulation (SHADER-348)
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>
2026-11-22 18:35:23 +03:00
bd8fb7c9f5 Translator: declare SignedZeroInfNanPreserve so drivers keep NaN, inf and -0
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>
2026-11-22 15:35:13 +00:00
94412c4bff docs: note the narrow UINT/SINT codes that main added in parallel
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 16:33:28 +01:00
eb35aed2e7 Merge origin/main into shader-309-wave64-lds-limit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:32:05 +01:00
b378fd38e0 docs(design): the f16 transcendentals ignore FP_ROUND, measured
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.
2026-11-22 23:30:54 +08:00
b26688fed1 rdna2spirv: emit the typed-store encode once per module
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>
2026-11-22 16:30:31 +01:00
5d4285f383 rbf0_encode: write an rbf0_tree document back to bytes, with a round-trip check
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.
2026-11-22 12:30:26 -03:00
b5b650186b rdna2spirv: decode and encode every GFX10 buffer data format
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>
2026-11-22 16:30:00 +01:00