Commit Graph

5744 Commits

Author SHA1 Message Date
fa49ee5d42 docs: count the PS system-input layout over every PS, not a 3,000 sample
The "PS system inputs" row said the v2.. = SV_Position layout was verified on
2,531 of 3,000 PS. Over all 11,983 PS listings of 1.0.2.1, with the
translator's own read_before_write_vgprs and ISG1 read masks, 11,980 match
exactly once front face counts only when its read mask is non-zero: the 1,639
that declare SV_IsFrontFace with read mask 0 never read that slot (it is last,
so nothing moves). 3 read fewer position components than their mask says.
The front-face pairs become 130 (xy) and 141 (x/y/w), and the reads past the
layout (372 PS) all follow a branch, 363 of them loop-carried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:44:51 +01:00
bf7fc223fb hw_oracle: a launcher quarantined by Windows Defender (WinError 225) is Unavailable with an exclusion hint, plus a Known problems row (BUILD-1127) 2026-11-22 23:44:24 +01:00
108e07fce4 rdna2spirv: an FSPX program's wave size comes from its dispatch state
A program with no FSSM sidecar got its wave size from the code heuristic, which also counts any _b64 op on vcc or
exec as wave64. The FidelityFX DLL's wave32 programs move vcc as an ordinary SGPR pair with s_mov_b64, so three of
them were translated as wave64, and one wave64 program with no marker as wave32 (4 of the 26 translated on main
aa2988cc).

- The wave size of an FSPX program is now the `wave32` field fspx_unpack.py writes from kind 0 word 4 bit 20, as the
  FSSM header's flag is for the game's shaders. Only the strict markers contradict it (WAVE64_RE against wave32,
  WAVE32_RE against wave64) and refuse the translation; without the field the heuristic stays. Nothing changes for
  a shader with an FSSM sidecar.
- Evidence for the bit, over the 29 programs: strict markers never contradict it, the RSRC1 VGPR granule fits it in
  all 21 programs that decode cleanly, and PSV0's lane counts agree in all 5 that state one (docs/fspx.md).
- tests/semantic/test_fspx_wave_size.py: the rule and its refusals with hand-written listings, and a
  v_readlane_b32 whose result differs between the two wave sizes.
- docs/fspx.md (kind 0 word 4, the evidence, translation status) and the wave-size row of docs/design.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:43:14 -05:00
f8b4f03bb7 Add native Tier 3 inner coverage reference probe
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-22 18:43:12 -04:00
98a9f7eda5 fix(first-light): clip expected UV probes to the visible depth range
Skip clipped fragments when retained mesh depth crosses the near or far plane. Check partial triangles, visibility in draw order, and clear probes with synthetic geometry (TEST-870).
2026-11-22 23:42:42 +01:00
799649865f docs/testing.md: at 128 bits on x86_64 two of the six emulated mesh tests also draw nothing (TEST-782 review)
Measured by @TreXito with Mesa 26.0.3; their cull-store-only change also
makes four of the tests byte-identical to NVIDIA at both widths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:41:19 +03:00
4b4503bcae tests/test_docs_repo_paths: also check docs/, viewer/ and game/ paths (TEST-871)
The check only knew tools/, runtime/, tests/ and scripts/, so a backticked
page, viewer file or package-manifest path that doesn't exist went
unreported. With the three folders added it finds one on main:
docs/audio_config.md:72 named a docs/music.md that was never in the
repository; that sentence now says no tool here matches a mix in the
audio and points at radio_stations.md's "not a start table" section.
third_party/ stays out (submodule files aren't in git ls-files).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:41:01 -03:00
f23b69060c hw_oracle (Linux): run the LDS fuzzers through libdrm
The libdrm launcher refused a kernel whose descriptor has a group segment
and capped its output at 4096 words, so lds_fuzz --oracle hw was exit 77
on Linux and no LDS program ran on RDNA2 outside Windows. Both are now
gone; docs/shader_validation.md records the gfx1036 counts.

- drm.py: program COMPUTE_PGM_RSRC2.LDS_SIZE (bits 15..23, 512-byte
  units) from the descriptor's group segment instead of refusing it. The
  assembler leaves that field 0 (measured: 4096 bytes of LDS give group
  4096 and rsrc2 0x84), so the launcher fills it as the HIP runtime does.
  Only scratch memory (private) and COMPUTE_PGM_RSRC3 stay unsupported.
- hw_oracle_drm.c: the output buffer takes 1..16384 words, matching the
  Windows launcher, so a 64x64 image_fuzz case (16384 words) fits.
- asm.py: a wrapped (non-raw) kernel's LDS goes into its descriptor too,
  so the Linux launcher has a group segment to read.
- lds_fuzz.py: the "more than 4096 words" wording no longer applies.

Tests: test_hw_oracle.py gains a descriptor unit test (group segment to
LDS_SIZE, 65536 ceiling) and two OnHardware tests (a kernel that writes,
barriers and reads back LDS; 8192 words from 1024 threads), plus a check
that LDS reaches the descriptor and metadata of a wrapped kernel. Verified
on the integrated Radeon of a Ryzen 7 7700X (gfx1036, RDNA2, Linux
7.3.5-zen1-1-zen, libdrm 2.4.134, AMD clang 23.1.5): lds_fuzz --oracle hw
--programs 500 --seed 1 matches 0 of 1000 (wave32+wave64) mismatches,
image_fuzz --oracle hw --programs 120 --seed 1 0 of 120.

AI-assisted (OpenCode).
2026-11-22 23:40:40 +01:00
d2e6b31db2 Merge commit 'aa2988cc' into d3d-417-msaa-depth-array-slices 2026-11-23 00:40:34 +02:00
9d36ec83ce d3d12: resolve a depth-only layer above 0 in a render pass (D3D-417)
AMD's Windows driver (32.0.21042.62) resolves a dynamic-rendering depth
attachment from layer 0 of the image when the multisampled view starts at
another layer, so ResolveSubresourceRegion of slice s of a 4x D32 array
gave slice 0. The same views in a VkFramebuffer of a VkRenderPass resolve
the right layer there; NVIDIA does both ways. A depth-only source above
layer 0 now takes the render pass on every GPU. Depth-stencil sources are
unchanged and still wrong on that driver.

d3d12_view_slices_test reads the 4x D32 array back on the layer and adds
views that count their slices.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 00:40:34 +02:00
8744504763 Merge main into ps-helper-lanes (#3061 and #3273 are on main)
docs/design.md: main's versions of the rows next to "Whole-quad mode",
with this branch's edit of that row, once (a both-sides merge listed it
twice; test_docs_design_rows). docs/shader_validation.md: main's file
plus the helper-lane section, nothing else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:40:15 +03:00
9593e78e94 docs/world: the material cross-check covers all five retained fragments (ASSET-305 review)
The five MaterialDataList fragments are contiguous pieces of one stream
without its head. All 14 isDeformableTerrain items are in the first one;
the later fragments hold no flag and no surface-material name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:39:55 +01:00
e710ea4ff0 docs/world: scope the material cross-check to visible flags; widths only (ASSET-305 review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:39:55 +01:00
3759d00007 docs/world: the 16 deformable-surface entries and the deformation map width (ASSET-305)
Measured on a 1.0.2.1 package: 11 defined surfaces and 5 empty slots, their
classes and physics-material counts, the isDeformableTerrain cross-check
against the retained MaterialDataList block, DeformationWorldSpaceWidth 96 m
and ParallaxWorldSpaceWidth 48 m, and the track-type split. The texel
resolution is not in the data files and stays open.

AI-assisted (Claude), on behalf of dev-ewann.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:39:55 +01:00
a59367f75d rdna2spirv: lower v_ldexp_f64 bit-exactly via 32-bit integer ops (gfx1036-measured) 2026-11-22 14:37:53 -08:00
0917b203b8 ps_persp_bary: judge every covered pixel, with exact coverage
Edge functions at doubled pixel-centre coordinates are exact integers, and no centre of vs_persp's triangle lies on
an edge, so the 1e-3 band that left nine covered centres unjudged is not needed. All 1158 covered pixels are now
checked; a centre exactly on an edge would be reported as a test-geometry problem. The smallest perspective/affine
gap over them is 6.4e-3, so the NoPerspective control still fails on every one. Suggested by Vonsek's independent
check in #837.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:37:52 -06:00
16a53cd532 shader_validation.md: cross-lane and DPP sweep hardware results on RDNA4 (gfx1201)
crosslane_fuzz.py --oracle hw on an RX 9070 XT (gfx1201, Adrenalin 26.11.2,
amdhip64_7.dll, AMD clang 23.0.0git from the rocm-sdk wheels):

- --dpp, seeds 1 to 8, 1,000 programs each: all 8,000 match (984 hyp_dpp,
  1,964 hyp_permlane, the counts of the RX 6700 XT run).
- --dpp-sweep --wave both: 14,412 cases, 14,412 match, 0 failing in every family.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
2026-11-23 00:37:22 +02:00
8c799453fb hw_oracle: an amdclang launcher on PATH is followed to the clang it is installed as
The rocm-sdk wheels put `amdclang` in the Python environment's Scripts (bin)
folder. find_clang() takes it first, because it is on PATH and lists the amdgcn
target, but ld.lld and amdgpu-arch sit beside the real clang, in the folder the
launcher reports as InstalledDir. With the wheels in a Python outside the
checkout the oracle then stopped with "no ld.lld next to the AMD clang", also
when HIP_PATH named a complete toolchain, and LEONIDA_AMD_CLANG was the only
way around it.

find_clang() now returns the clang in InstalledDir when the one it found has no
ld.lld beside it. A clang that has its linker is used where it was found, and a
launcher that names a folder without a clang is kept, so every setup that
worked resolves to the same compiler as before.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
2026-11-23 00:37:22 +02:00
1291a6878c GPU tests: raw barycentrics under perspective (ps_persp_bary, vs_persp)
The raw-barycentric tests draw with vs_ids, where clip w = 1 at every vertex, so nothing checked that the raw
i/j (and the attributes) follow perspective-correct weights. vs_persp draws one triangle at screen (5,8),
(57,16), (21,55) with clip w = 1, 2, 4 and per-vertex attr0; ps_persp_bary is ps_bary's code drawn with it.
check.py's bary_persp_problem compares every pixel with CPU weights p_k = (l_k / w_k) / sum(l_m / w_m) from the
screen-space weights l_k, checks that pixels outside stay clear, and requires the affine weights to differ by
more than 100x the tolerance on every judged pixel, so a NoPerspective regression can't pass. run_gpu_tests.py
uses the same reference (PIXEL_VS, DRAWN_WITH). Suggested by Vonsek in #794.

On main it runs the native BaryCoordKHR path (it skips without VK_KHR_fragment_shader_barycentric, like
ps_bary); any barycentric fallback that lands (#804) is exercised by it too. Checked on an RX 5700 XT (RADV)
through a GS fallback: passes at wave32 and wave64; with NoPerspective on the fallback's input, all 1149
covered pixels fail while the interpolated attributes still match. New tests/test_bary_persp_oracle.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:37:21 -06:00
8f119bfb35 rdna2spirv: clear the wave64 exchange buffer with one writer per word (SHADER-708)
Under --wave64-emulate the scheduler cleared parts of %x_buf (Workgroup memory)
with plain stores that several invocations aimed at one word: the zeroing before
the first barrier clamped its index with UMin, so every invocation past the end
of a range stored to its last word, and at the top of each round every
invocation with nothing to free stored 0 to a shared sink word. All stores wrote
0, so results did not depend on it, but it is a data race, and GPU-assisted
validation reports SharedMemoryDataRace-RaceOnStore on every emulated compute
shader.

Invocation i now clears word i of each row, a short last row is stored only by
the invocations that have a word in it, and in a round only lane 0 of a wave
(mask words) and invocation 0 (counts) store, each behind a selection that ends
before the barrier. The last word of %x_buf is no longer written; it stays
allocated so the buffer size does not change. No module changes without
--wave64-emulate.

tests/semantic/test_w64x_clear_single_writer.py runs the scheduler's head for
every invocation at nine workgroup sizes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 00:37:03 +02:00
88d94c75b3 fog_volumes: remove 256 KiB cap, distinguish stored vs distinct records, report 0x7a scan counts 2026-11-22 23:36:55 +01:00
184d789058 Translator: runs of lane-local VALU instructions under one if (active)
With EXEC as a per-invocation flag, dst() writes every VGPR as OpSelect(active, new, old). Outside straight-line
code the driver can't prove the lane active, so both values stay live and each write costs a v_cndmask: a pixel
shader with 8 divergent if/else regions of fma/mul/add/min/max runs 32% slower than the same program written
natively (RX 5700 XT, RADV).

In a shader that may write EXEC, a run of two or more lane-local VALU instructions now goes inside one
OpSelectionMerge / OpBranchConditional %active and writes its VGPRs directly. Each invocation is one lane, so
skipping the run in an inactive lane keeps the old value of everything it writes, as the selects did; the driver
then predicates it with its own EXEC. Lane-local leaves out cross-lane reads (DPP, readlane, writelane, permlane,
mbcnt), lane-mask, SCC and EXEC writes (v_cmp*), carry and other scalar results written in every lane (_co_,
div_scale, mad_u64), v_interp, and masks passing through a VGPR. Inside a run, an instruction that emits anything
but VGPR stores (a vote, a barrier, an image op, a store to VCC/SCC/an SGPR, ...) fails the translation instead of
losing its EXEC behaviour. Shaders that never write EXEC translate as before, and --wave64-emulate is unchanged.

RX 5700 XT, that bench: 0.851 -> 0.693 ms (native 0.647), VGPRs 80 -> 64, 12 -> 16 waves, same image.
tests/semantic/test_active_runs.py runs a wave32 and a wave64 if/else on every lane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:36:43 -06:00
602a404849 Merge main into docs-gfx1013-opcodes (#3517)
docs/design.md

AI-assisted.
2026-11-22 23:36:31 +01:00
3d9a378005 docs/design.md: wave64 graphics tier census as measured on main f847748c
The census in the "Wave64 graphics: partition invariance" row still
counts 11,405 wave64 graphics shaders (code-marker wave size; both the
TEST-319 run and its re-run with the GS ring rule), and keeps the stale
TEST-319 figures as a second, unlabelled census after the re-run.
wave64_halves.py --census over all 26,503 shaders translated at
f847748c gives 13,405 shaders (2,236 VS, 10,974 PS, 195 GS, the FSSM
header's wave size); A 4,033, B 85, C 9,287; GS 195/0/0. Both earlier
runs stay as one history clause. The idiom figures are tags on any
tier, which the row now says.

Three sentences still said the corpus GS are wave32 or all tier C. The
Geometry shaders row said wave64 was inferred, not confirmed: the FSSM
header flag and the index say wave64 for 195 of 195. Its stale duplicate
sentence that still said wave32, and a repeated clause, are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:36:02 +00:00
e2c7d8f3d7 Docs: no game CS takes the SHADER-309 LDS bounds check; drop the stale hypothesis
The Workgroup memory limit row still opened with "Hypothesis, not yet
counted over the corpus: the 16 of 486 LDS-using CS ...", directly
before towade's count (#1882) that answers it, and the count pointed at
the Compute shaders row, which no longer has the figure. The comment at
the CS RSRC2 block in rdna2spirv.py still said 470 of 486 stay below
LDS_SIZE.

One statement now: no game shader takes the path. Recounted at
aa2988cc by running translate() on all 2,689 CS of a 1.0.2.1 corpus
(counts only): 485 access LDS, all with an RSRC2 allocation; none
reaches past it with a constant offset and none is shrunk, natively or
with --wave64-emulate. The old offset + 4-dword bound flags 37 of the
485, all inside their allocation. The code comment says the same.
Comment and docs only: a 200-shader slice translates byte-identically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:35:59 -03:00
7a4e8d7be6 d3d12: Detile step for console-tiled layout 0x101 textures (D3D-316)
Implement GFX10 SW_64KB_D 64 KiB detiling and tiling from Mesa addrlib swizzle equations (GFX10_SW_64K_D_RBPLUS_PATINFO) with compile-time LUT coordinate evaluation. Add synthetic round-trip unit tests in resource_detile_test covering 1, 2, 4, 8, 16 BPP, sub-tile and BCn formats. Update docs/d3d12_vulkan.md.
2026-11-22 23:35:47 +01:00
35f19f4373 SHADER-650: BVH box slab distances round toward zero, as measured
Native gfx1030 rounds both (plane - origin) and the multiply by the
inverse direction toward zero: 811 measured cases (800 randomized slabs
far from the origin plus 11 ties), round-to-nearest predicts 769,
round-toward-zero all 811. kacper-serewis's inverted box at
origin.x = -2^25 is a hit on hardware for this reason.

The translator emulates it exactly: TwoSum error for the subtraction,
a Dekker split of the scaled mantissas for the product's error sign,
one ulp back toward zero when the nearest result went away from zero,
finite overflow to +-FLT_MAX. 50 of the rounding cases are added to
test_image_bvh_box_hw.py.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:35:38 +01:00
c79a05339d docs/gamedata: zero is the most frequent second number; meaning and blend stay open (ASSET-310)
The keyframe-range control (kacper-serewis on #3880): among the 25,732
keyframe-matched pairs with a 0 second number, the first number is also
outside the keyframe range in 15,183, so the comparison does not tell
what either number means.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:35:12 +01:00
d08064b979 rdna2spirv: nearest mip level as floor + (fraction >= 0.5), ties up
ceil(lod + 0.5) - 1 rounds the sum in binary32: 0x3f000001 + 0.5 is 1.0, so
it picked mip 0 where the RTX 5070 samples mip 1, and the exact tie 0.5 went
down where the GPU rounds it up (review on #3882). floor(lod) and
lod - floor(lod) are exact, so compare the fraction with 0.5. The test's
evaluator now rounds float results to binary32 and covers 0x3effffff, 0.5,
0x3f000001 and 0x3f000002.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:34:50 -06:00
37eb4f2808 fix(tools): retain character texture resource IDs in reports
Keep the display name or hash and carry the separate 64-bit asset key through each output so the binding can be joined to a texture pool.

Refs: #3918
2026-11-22 17:34:18 -05:00
4a9c4a17ca docs/movies.md: say what bink_audio_test asserts and how PCM was counted
Review of #3563: the test checks that the maximum size covers the
header's (not equality), and checks whole 16-bit samples only when a
track returned PCM; it does not fail on a track that returns none. The
229 of 229 tracks with PCM come from the byte count each run prints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:34:17 +00:00
b42efa1b49 docs: clarify that LLVM 19 satisfies stock CI fixtures while valu_fuzz f16 requires LLVM 21+ 2026-11-22 23:31:24 +01:00
0fdc443260 CI: upgrade linux-gpu-tools job to llvm-19 (BUILD-923)
In .github/workflows/runtime.yml, the `linux-gpu-tools` job pinned `llvm-18`'s
`llvm-mc`, which rejects the new `ps_sdwa_f16_const` fixture
(`v_cvt_f16_u16_sdwa v5, 1.0` inline float constant on an integer-source SDWA op)
introduced in d78546fc, causing scripts/run_gpu_tests.py to abort before
reporting GPU test results.

Upgrade the pinned assembler path from `llvm-18` to `llvm-19` across package
installation and the native & wave64 emulation test steps. Also update
documentation in docs/testing.md to reflect that llvm-18 rejects
ps_sdwa_f16_const and that llvm-19+ is required.

Claim: https://github.com/ItsNotRexed/Leonida/issues/3047#issuecomment-7084706031
Fixes: BUILD-923
2026-11-22 23:31:23 +01:00
b2e888f52e runtime: raise SIGABRT from the guest's abort() when a handler is installed
game_abort() ended the run directly, so a title's own SIGABRT handler never ran. Raise SIGABRT only when a handler is registered (the guest's signal() import binds to the host CRT), leaving the default and ignored cases ending with code 3 so the host is never killed. Add a synthetic fixture with handler, returning-handler, ignore and default modes plus a native-vs-loader exit-code test.

AI-assisted (OpenCode)
2026-11-23 01:31:08 +03:00
cec49b014a Tests: vk_overlapping_occlusion executes only the lists it closed (TEST-859, fails on MoltenVK)
Without pipelineStatisticsQuery the test never records or closes its two
statistics lists, but it handed them to execute(), which returns list_open.
The lists are now left out there. --no-statistics runs the test as such a
device does, and the new ctest entry vk_overlapping_occlusion_no_statistics
uses it, so the path is run on devices that have the feature.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 00:30:55 +02:00
c2f3eaa308 XDXR builder: a spare unit after BOX16 nodes (translator reads 112 bytes per box node)
tools/rdna2spirv.py's image_bvh_intersect_ray loads a box node's BOX32
bounds (112 bytes) before it selects BOX16 or BOX32, and the root is the
last node, so a BOX16 root was read 48 bytes past the structure. A BOX16
layout now ends with one zeroed 64-byte unit (MODE_INIT clears it); the
D3D12 test's BOX16 BLAS is 39,040 bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:30:14 +01:00
649a26064e XDXR builder: second review pass (refuse updates without ALLOW_UPDATE, rotation coverage, docs)
- xdxr_check refuses PERFORM_UPDATE without ALLOW_UPDATE (D3D12 requires
  it): a structure built without it may be paired, and a refit would leave
  its TRI1 children reading wrong vertices.
- blas_paired_rotations: a grid whose triangles start at varied vertices,
  so pairs use all nine (TRI0, TRI1) rotations; check-build asserts it
  ("all_rotations"). Before, the sibling rotation kd = 1 never occurred.
- BOX32 cases now say "box16": false, so a stray BOX16 is caught too.
- docs/bvh.md cites the one traced BOX16-related datum (docs/xdxr.md: a
  bottom-level path needing MINIMIZE_MEMORY and a stream value above 10),
  notes that world-space BLASes only get looser boxes; README says pairing
  saves no memory yet and the BOX16 switch is assumed; comments rewrapped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:30:14 +01:00
b8c07f8ccf XDXR builder: pair sibling triangles into TRI0/TRI1 leaves
A bottom-level build without ALLOW_UPDATE now pairs triangles, as the
console builder does in its offline BLASes. The pass that writes the nodes
above the leaves pairs a triangle with a later sibling (among that node's at
most four children) that shares an edge in the opposite direction (the same
vertex bits), from the same geometry, both active. The first triangle is
rotated to put the shared edge in slots 1 -> 2, the sibling's third vertex
goes in slot 3, its primitive in PrimitiveIndex2, and each node type's remap
byte returns D3D12's barycentrics for its own vertex order.

The node keeps one child per triangle with its own box, so the tree, the
layout and the sizes do not change; the TRI1 child points at the first
leaf and the sibling's leaf is left unused. Pairs never cross nodes: one
thread owns each rewritten leaf and each parent-table entry. A refit
rewrites the leaves one triangle each, so the layer does not pair builds
with ALLOW_UPDATE (xdxr_pair), and record_blas ignores `pair` for updates.

check-build now compares barycentrics as well as hits, and checks a case's
"pairs" field: at least one TRI1 node, or none. New cases: paired grids
(BOX32 and BOX16), a transform, a mixed scene, the radix path, and two that
must not pair (pairs split across geometries, edges shared in the same
direction), plus a D3D12 BLAS without ALLOW_UPDATE. Mutating the geometry or
the direction rule, or the remap byte, fails check-build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:30:06 +01:00
00c63805c2 XDXR builder: BOX16 inner nodes for MINIMIZE_MEMORY bottom-level builds
A bottom-level BuildRaytracingAccelerationStructure with MINIMIZE_MEMORY now
writes BOX16 inner nodes (64 bytes, half boxes) instead of BOX32 (128 bytes):
the same tree, about a fifth smaller. Prebuild info, the build and its refits
take the choice from the same flags (xdxr_box16), so the sizes stay exact.
Top-level builds keep BOX32 (world space: a half's step is 2 m at 2 km).

Each child box is rounded outward from the exact box kept in scratch, in
integer code (packHalf2x16's rounding is implementation-defined; AMD rounds
toward zero). Past the half range a bound goes to +-inf outward and +-65504
inward, so empty slots stay empty; below the smallest normal half it goes to
0 or +-2^-14, never a denormal a flushing decoder would shrink.
tools/xdxr_bvh.py half_round gets the same denormal rule, and check-build now
compares every BOX16 word bit for bit with encode_box16 of the exact box of
the triangles under it.

Tests: five blas_box16_* cases in vk_xdxr_build_test (radix and small sort,
an inactive triangle, values past 65504 and below 2^-14, a refit), and a
MINIMIZE_MEMORY BLAS plus its in-place update through the D3D12 API in
d3d12_xdxr_rt_test (prebuild and postbuild sizes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:29:47 +01:00
fcfed3996b world_interior_names: apply placement scale, guard --out, count duplicates
Address review on #3813:
- scale interior and room boxes by each placement's scaleXY/scaleZ before
  measuring (negative scales reorder the bounds); 6 of 2,590 placements are
  scaled, which moves two room hits per convention and no distances
- refuse an --out that names the archive, the --names file or a path in the
  carved folder (exit 2, one line, nothing written)
- count placed interiors only among known definitions; report placed names
  with no definition, duplicate interior definitions and repeated JSON keys
  (repeated keys keep all their items)
- emit the limbo first-room and a261e0a9 room-key counts the docs quote
- take the median from the already sorted list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:28:40 -05:00
c3c1048f95 docs(contracts): split docs/design.md contract table into docs/contracts/*.json with generator 2026-11-23 02:27:42 +04:00
c4e16231dc ASSET-312: local-space distances are unknown; proximity is not containment
Review of #3888: the 7 origin volumes have only local offsets, so their
distance to interior points is unknown without the parent transform; point
proximity cannot establish containment; and the 385 pack records of #3873 are
record occurrences, not independent placement evidence.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 23:27:02 +01:00
f8259cc4b8 docs/models.md: levels.rpf fragments, bone-bound and triangles from a full export
The e293917 re-count table marked the levels.rpf fragment, bone-bound
and triangle cells (and the mesh, vertex and embedded-texture figures)
"not independently reproduced": levels.rpf had a recovery count from
count.exe but no rpf9dump manifest.

A full `rpf9dump models` export of levels.rpf at e293917 reproduces the
recovery count to the row (235,330 candidates, 71 not recovered,
343,327 entries, fail=0; Drawable set on 130,239, null on 213,088) and
gives 50,731 fragments, 59,544 bone-bound, 2,509,947,536 triangles,
3,854,587 meshes, 2,364,218,711 vertices and 1,293 embedded textures.
The same counting reproduces the data.rpf row from a fresh export.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 22:27:00 +00:00
34c130c36c docs: slot 67 passes the dispatch state on; what pipeline slot 11 does with 0, measured (RT-99)
- d3d12_command_objects.md section 3.5a: slot 67 now passes all four pairs; for slot 11, what the DLL does on failure
  and with 0 (measured in its code), the object's shape, why no program needs a scratch size (measured over the 29),
  what is implemented and what stays open.
- fspx.md: the slot-67 payload and its checks, and slot 11.
- d3d12_vulkan.md and runtime/README.md: the new parts of d3d12_fspx_compute_test; the DLL's own dispatch was not run
  here (fsr_dispatch_test needs MSVC structured exception handling).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:26:34 -05:00
9cf2350779 Merge origin/main into asset-303-awc-chunk-bd
main gained the 0xbd cue-record decoder in rsc8_audio.py (4cf7e3e7). The
section in docs/audio_config.md now points at docs/rsc8_audio.md for the
record layout and keeps what is specific to the music banks; a test holds
awc_markers.events() to rsc8_audio.decode_marker_records().

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 00:25:57 +02:00
23abaa681f story.md: ASSET-294 pairing counts rerun on the merged tree (all 7,577 story000 pages parse now)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:25:50 +01:00
dea102da9c PROC-190: the interpolation labels are stored metadata; the command exports JSON
Review of #3850: the runtime's interval selection and its use of the
interpolation_type label are not verified, and gamedata_reader prints summary
counts while the sample records go to the JSON export.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 23:25:15 +01:00
cde3ef9271 Merge remote-tracking branch 'upstream/main' into shader-340-rdna1-denorm
# Conflicts:
#	docs/design.md
2026-11-22 19:23:31 -03:00
3302d4ec81 docs(first-light): clarify shader selection in the index and CLI
Refs: #3350
2026-11-22 17:23:28 -05:00
30475df3ae Merge main aa2988cc into #3806 2026-11-22 23:22:14 +01:00