Found by @jeremygold02 in #2519 and reproduced on three records of the same
shaders.rpf. The run-time choice of technique and pass, and a general locator
for effect records, stay open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A material's shader hash (rpf9dump manifest Materials[].Shader) is the joaat of its effect name, and the
carve index names every compute program <effect>:<entry>, so a material reaches its effect and that
effect's RaytracingResolve programs: 3,211 of data.rpf's 3,340 materials (8 of 18 hashes). The 23,619
graphics programs carry no effect name, are not stored grouped by effect, and their 8-hex suffix neither is
a joaat of the name nor matches the effect-named programs' suffixes, so effect -> technique -> VS/PS is not
recoverable from the package (presumably in the executable, RT-5). Measured on a 1.0.2.1 copy, counts only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GFX10 places the separate literal dword above 32 zero bits for a binary64 source. Use the same source interpretation for reciprocal, square root and exponent decomposition so literal and register-pair forms produce the same color.
llvmpipe has no VK_KHR_fragment_shader_barycentric, so the native llvmpipe run skips ps_bary,
ps_uniform_branch and ps_scc_mask32, and nothing in CI drew a pixel shader through the --bary-fallback
geometry shader (tools/bary_fallback_gs.py). A third llvmpipe run sets LEONIDA_BARY_FALLBACK=1 and fails
unless every shader that got a fallback geometry shader passes, not just runs: a run where the fallback
builds no geometry shader, or one of them skips, is an error.
docs/testing.md: list the third run, and correct the f16 tests' line: with the f16 interpolation
fallback (on by itself without the extension) ps_interp_f16_high and ms_f16_pack run under the bary
fallback too, and natively on llvmpipe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 363 mesh shaders with a 16_16_16_16_UINT load pick each stream's load from its type (low four bits of
a per-slot descriptor word): slot 6 type 6 as 8_8_8_8_UNORM, else four raw dwords; slot 8 type 5 as
8_8_8_8_UINT, else 16_16_16_16_UINT. 198 of them read slot 17's first 8 bytes as a flag bit and element
index plus three unorm16 coordinates blended trilinearly over the element's eight points. On the data,
slot 17's width follows the influence count (338/338 and 121/121 blocks); the coordinate fit holds in the
few shared elements (39) but those are too few to confirm the reading, and the doc says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The matcher could identify the drawable's geometries but had no way to hand them to tools/bvh_rehydrate.py,
so the recipe §4a implies could not be followed end to end. --write DIR now writes one float3 buffer and one
uint32 index buffer per matched geometry plus an export.json (the instance transform recorded, not applied to
the vertices), which is the shape bvh_rehydrate.py already takes.
docs/bvh.md §7 gains the four steps to rebuild the sample set from the user's own copy - bvh_index, a
levels.rpf window, bvh_match with --write, bvh_rehydrate - with the counts to check them against, and the root
parent-table entry the runtime layout must hold (0xFFFFFFFF, as the GPU builder writes and #2625 validates).
Nothing of the samples enters the repository; the two excluded shader hashes stay with the user.
Checked on the sample pack: --write on one identified sample produced buffers of the same sizes as the earlier
reference export of that BLAS (732/816, 2,736/2,808, 492/576 bytes), and rehydrating them with the recorded
transform gave the declared 18,880 bytes. Synthetic tests: two cases added (the buffers and export.json; nothing
written when no candidate is consistent), 18 in total.
The later row still says the runtime/console side is open; the row above it answers the shader side with the full 26,503-shader scan. One row per question.
docs/boot.md: the 24 device words print only when --trace-d3d12 is off, so
the Q1 row says to run once without it; the D3D12 outcomes come from the
Vulkan backend and LEONIDA_UNIMPLEMENTED does not affect them; the Windows
command sets LEONIDA_D3D12 and writes the traces to %TEMP%; the page cites
the real runtime/README.md headings; refused has its own triage step; the
CheckFeatureSupport and PIX rows say what is actually logged.
tools/boot_trace.py: a method name with spaces no longer drops the line;
the outcome is taken as the last field. refused joins the failure buckets.
Exceptions print their access/address and a C++ throw as such. A file with
no [d3d12-trace] line exits 2 instead of reporting zero calls, a UTF-16 log
is named with the PowerShell fix, and a UTF-8 BOM is stripped. The tests
cover each of those shapes.
The mesh shaders fetch tag 0x27 as BUF_FMT_2_10_10_10_UNORM, map each component by v*2-1, transform xyz
like the normal and cross it with the normal scaled by w. tangent_0x27 is that read, and tangent27_checks
counts per 0x27 slot: unit length, perpendicular to the face normal, along dP/du of each 0x28 stream, and
the side w gives the bitangent. docs/restofworld.md records the counts (levels slot 11: 100% unit, 96.7%
along u of stream 4, w side 99.8%).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the row ended up with two Source: paragraphs, a pasted half-sentence
fragment and "the translator (bfe_width) already did this" three times,
ending "RDNA2 is not measured" right after the gfx1035/gfx1036
measurements it lists (PROC-132, found by @CLHelper).
- keep the pre-merge superset row: one Source: with the gfx1150, gfx1201,
gfx1035 (SHADER-137) and gfx1036 measurements, the constantFoldBFE
sentence kept, the fragment, the duplicates and the "RDNA2 is not
measured" tail dropped.
Slots 8/9 may store four u32 words per vertex with the joint index in bits 0..11. Convert that to the same 4 x u8 rows as 0x25, rejecting an index above 255 and a stream shorter than 16 bytes per vertex.
Add synthetic coverage for the decode, an out-of-range index and a short stream; document the layout beside 0x25.
GFX10 keeps the offset in a separate full-width word before the packed UV and LOD. Accept that address layout so packed gathers can read the same four taps as their full-width counterparts.
@pwu2775-dev found on #2533 that the tests' WKPDID_D3DDebugObjectNameW was
mistyped ({4cca5fd8-921f-42c8-8599-d2866a3e5f7e}, the layer's old constant)
instead of d3dcommon.h's {4cca5fd8-921f-42c8-8566-70caf2a9b741}. Measured with
the right key, the host runtime does what D3D12 documents: SetName is
SetPrivateData with that key and the name with its terminator, GetPrivateData
reads it back (an empty name is a 2-byte entry), and the narrow key is not
touched. SetName(nullptr) faults in the host and leaves the name as it was.
So the name goes back into the private data, now under the right GUID, and the
separate name_ / debug_name() are gone. SetName(nullptr) answers E_INVALIDARG
and changes nothing. d3d12_private_data_test: 667 steps compared, 0 mismatches
(RTX 3060, driver 610.88); d3d12_debug_markers_test checks the name again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A queue's ExecuteCommandLists is replayed against one LayoutTracker in call order, so a batch that waits (cross-queue) for a Signal submitted later was
recorded against layouts from before the work it waits for. Track, per fence, the highest Signal value submitted (CPU Signal and the creation value
count); a queue holds a batch, and what follows it, while a Wait names a higher value, and the thread that submits the satisfying Signal releases the
held work in dependency order on its own VkQueue. Reports a queue destroyed with held work and a fence released under a waiter; nothing blocks.
Adds d3d12_queue_handover_test (27 queue-type assignments x 6 submission orders, two producers, CPU Signal cases, never-signaled and released fences,
byte-exact against the host runtime) and updates docs section 4.4 and the M4 row. Two existing tests that used an unsignaled Wait as a GPU gate or
expected a synchronous submit failure under a pending Wait now declare the Signal first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row says it is hardware-verified (gfx1036, and gfx1035 since) and then
'Not GPU-verified.' from before the measurement. The new all-NaN rows are named.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--disasm now scans tools/fspx_unpack.py output for the user SGPRs a program reads, the one it zero-extends into an
s_load base and the pairs it copies whole. Over the 29 containers that puts the two tables at s4 and s5 one dword
each and the root CBVs at whole pairs from s6, which is the one-dword-per-table model, so docs/d3d12_vulkan.md states
the mapping instead of calling it merely consistent.
Every distinct SDWA form in the 26,503 listings (79,307 instructions) was run
natively on gfx1036 through tools/hw_oracle in the game's MODE, 21,204 cases.
18,885 match the translator. The rest are the 16-bit dst_sel:DWORD high half
(#2187), NaN sign/payload (as in the f16 transcendentals row), div:2 on -0
(the output-modifier rows) and 160 cases undefined in SPIR-V.
test_alu_sdwa_hw.py replays 624 matching words, up to four per form; it
fails when sext() or UNUSED_PRESERVE handling is broken.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With LEONIDA_PC_TAIL_UBO=1, build.py and run_gpu_tests.py translate with --pc-tail-ubo, and the test
programs (vk_compute_test, vk_store_test, vk_harness, vk_texture_test, vk_sampler_test, vk_bindless_test)
declare and push 128 bytes and, when a stage declares set 1, bind the tail block there
(runtime/test/vk_pc_tail.h: a host-visible buffer with one slot per dispatch or draw, bound as a dynamic
uniform buffer). vk_harness refuses --mesh-compute with the flag (exit 77): mesh_compute_vs.py's vertex
shader still reads its address from push constants. Without the variable nothing changes.
Step 2 of the uniform-buffer tail claimed in #1902.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recounted with main 49475796 on the 1.0.2.1 package (counts only): 52/52 unpack,
42 clean and 10 with invalid words in the disassembly, 51 translate and pass
spirv-val. The four rules embedded_shaders.md listed are three since 427c1376
(#1968); Box16Rehydration stops at buffer_store_short (#1864). d3d12_vulkan.md
and the docs index quoted 41/42 and four rules in seven places.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The store keeps the game as one .xvc file, an XVD container whose contents
are encrypted. Pointed at it with --game, the build said "Game folder not
found"; pointed at a folder holding only that file it said "doesn't look
like a supported version"; --find skipped it silently.
Read the plain 4 KiB header (msft-xvd magic at 0x200, VolumeFlags,
ContentType, XvcDataLength, PackageVersion) and say what the file is and
that the build needs the folder holding MicrosoftGame.Config. Nothing is
decrypted and no key field is read. --find lists such files as "not
usable"; the not-found message, the pasted-folder prompt and --pick's
warning name the containers they saw.
Merge rounds left rows 16, 19 and 20 of section 8.2 twice and row 10 after
13. Row 16 keeps the shader answer (feature_scan over the corpus) and the
runtime-side status; row 19's copies were identical; row 20 keeps both
counts (52 containers with FSSM and Xbox DXIL, the 53 compute PSO
creations bvh_builder_test sees), both questions (a reference match, the 31
raw-address shaders) and both methods. Row 10 moves back between 9 and 11.
Rows 16, 19 and 20 appeared twice with partially different text; keep every
fact in one row each. Row 10 sat after row 13; put it back in numeric order.
No game data, no code or test behaviour change.
Co-Authored-By: Claude <noreply@anthropic.com>
VulkanContext::buffer_at walked every registered resource, images included,
for each vertex-buffer slot, index buffer and WriteBufferImmediate of every
draw. It now asks a BufferVaIndex of the addressable buffers (no image, a
VkBuffer, a VA and bytes: what the scan accepted), kept in step with
resources_ by add_resource, add_sparse_buffer and remove_resource; a
re-registered ID drops its old range first.
Where placed buffers alias, the scan returned whichever matched first in
unordered_map order; the index returns the range that starts closest below
the VA. docs/d3d12_vulkan.md drops the "Lookups" known gap.
- Compose pass decodes every texel to linear (premultiplied) before filtering, converts the plane to the output's linear
working space (Rec.2020 nits for HDR10, Rec.709 relative to SDR white for SDR), blends there and encodes once.
- SDR EOTF is piecewise sRGB by default (community-sourced Windows behaviour), gamma 2.2 by
XboxPresentation::set_sdr_eotf or LEONIDA_SDR_EOTF=gamma22.
- SDR white: set_sdr_white_nits override, else DISPLAYCONFIG_SDR_WHITE_LEVEL of the window's output while HDR10 is
active, else 203 nits (BT.2408).
- HDR10 on an SDR output: extended Reinhard on luminance (white point at the content peak, default 1000 nits) instead of a
hard clip.
- HDR metadata stays unsent; docs section 4.5 documents the decisions and cites the sources.
- CPU reference model and xbox_present_test updated (linear model, EOTF option, 50% overlay, tone map, white level query).
- present_compose.inc rebuilt with glslc 2026.4 (byte-reproducible, spirv-val clean).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>