Merging.
**Why merged:** OLD-10012: d3d12_xs exports D3D12CreateVersionedRootSignatureDeserializer and ordinal #7, forwarding to the host with the Xbox RTS0 flags cleared on a copy (the existing copy_rts0_blob_clear_xbox_flags guard). d3d12_xs_surface.md is updated. SweatierKey verified an earlier head, and trigger337's redundant-checksum finding is fixed in this head, with a zero-hash test.
**Why it's good:** root_sig passes both plain and under validation.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 66d4f5aa3, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative of this batch (13 PRs) on main 0b45fdc21: the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The only failures are main's: d3d12_depth_resolve (pre-existing) and d3d12_close_parity (the #510 regression, fixed by #1286). All d3d12_* tests under validation show 0 VUIDs. git merge-tree against current main 6261ca916: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** SHADER-VOPC-DPP decodes and translates VOPC compares in DPP16/DPP8 form. `shader_disasm` gets a second llvm-mc pass that patches the word llvm-mc rejects to a `v_max_f32` stand-in, then restores the name and encoding. KernelSmoker approved it, Timon360SB ran it on Blackwell native and w64, and kawaii-shakal ran all 2,684 CS programs of the real library through it.
**Why it's good:** on the RTX 4070 SUPER, `scripts/run_gpu_tests.py --filter cs_dpp`:
- native: 9/10 pass, and `cs_dpp_w64` is skipped (no 64-wide compute subgroup on this device);
- with `LEONIDA_W64_EMULATE=1` under the Khronos validation layer: 10/10 pass, with no VUIDs;
- `cs_dpp_cmp` reads the expected `3 2 3 2 1 0 1 0`, and all 10 shaders pass spirv-val.
Own tests (dpp_compare, dpp_eager_subgroup, rdna2_decode, shader_disasm, run_gpu_tests*, docs): 207 passed, 0 skipped. The llvm-mc cases ran with a real AMDGPU llvm-mc.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 66d4f5aa3. With it in, the repo-consistency set gives 573 passed / 5 skipped / 0 failed, and check_no_game_data is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: decoder and translator branches plus the tool changes above, with no binaries, downloads, network calls or CI changes. Heads-up from the PR body: this conflicts with #281 in `shader_disasm.py`, so #281 will need a rebase.
AI-assisted (Claude Code, Claude Opus 5.5).
Describe the marker-derived keys and add a local checker that reports
title and artist coverage for a single text table. Use hand-built
fixtures to verify aggregation and path-free errors.
The translator suite reproduced two upstream baseline failures.
Co-Authored-By: Codex <codex@openai.com>
Compute shaders using direct resource indexing received a zero heap
pointer. Snapshot each bound heap offset after the explicit inline root
arguments on direct and indirect dispatches, so each command retains the
bindings it had when recorded. When the explicit arguments leave no
SGPR, keep them and report the missing heap slot once.
The placement is a hypothesis with partial evidence. Of 2,959
direct-indexing compute entries, seven could be paired with recorded
layouts. All seven resource reads agree with the predicted slot. The
other 2,952 have no paired layout, and no paired sampler read
establishes the relative heap order. tools/compute_heap_layout_census.py
reproduces the count, with synthetic tests for agreement, disagreement
and missing evidence.
Built gta6rt and d3d12_compute_test with clang-cl. The Proton Vulkan
fixture passed 64 buffer reads and 64 null controls on an RTX 4070. With
the rollback switch, all 128 controls read zero. Both runs check the
recorded arguments for bundle inheritance, indirect heap rebinding and
the last inline SGPR. The synthetic SPIR-V fixture passed validation.
AI-assisted (Codex and Claude Code agents).
Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
One conflict, runtime/test/xs_proxy_mock_test.cpp, neighbours added on both
sides, both kept: the mock's `held` (this branch, slot 5 private data for the
committed-resource leases) next to main's `max_level` (FEATURE_LEVELS answer),
and this branch's five checks in main()'s list before main's
check_presentation_wiring().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merging.
**Why merged:** RT-INPUT-SCRIPT-LENGTH: the shim's env() reader now handles values of any length (64 characters or more used to read as unset). The PR also adds the LEONIDA_INPUT_SCRIPT keyboard-pad scheduler (`button@seconds`, 300 ms presses), documented in docs/gameinput.md. That's a second topic, but the body says so, and both parts were reviewed. sodove checked 14/14 runs across lengths, with the control failing 12/12, and kawaii-shakal's harness follow-ups were addressed.
**Why it's good:** gameinput_host, gameinput and the new gameinput_script pass; with validation, gameinput_script passes and logs "8 accepted / 11 rejected". The parsing is bounded (strtod with end-pointer and finiteness checks) and reads only its own env var.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d9698 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d9698 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
The session script ran wineboot and wineserver from PATH while
run_wine_tests.py runs the tests with $WINE. With WINE set to Proton's or
UMU-Proton's files/bin/wine, the prefix was initialized by another Wine, or
the script stopped at 'wineboot: command not found' on a host without a
system Wine, and the exit trap stopped the wrong wineserver.
Run "$WINE" wineboot --init and stop $WINESERVER, else the wineserver next
to $WINE, else wineserver on PATH; report a missing $WINE with status 127.
With CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED / SAMPLER_HEAP_DIRECTLY_INDEXED a console program reads the
resource heap's address in the dword after its root arguments and the sampler heap's in the next,
from s8 in VS/PS/GS and s16 in mesh shaders (DadaCap, issue #14 comment 7143020922), as #1064 does
for compute. DrawInstanced, DrawIndexedInstanced and DispatchMesh now record them at
RootArgumentLayout::graphics_arguments_end; a mesh shader reads the same push dwords through the
#974 window. Nothing is written for a signature with parameters in the argument block or under
LEONIDA_GRAPHICS_ROOT_LAYOUT=pc (no slot is measured there); LEONIDA_GRAPHICS_DIRECT_HEAPS=0 restores
the previous arguments. d3d12_mesh_test checks a vertex and a mesh draw, a rebind, a signature ending
at s30 and a spilled one.
AMD proprietary 26.11.2 (LLPC), Windows 11. run_gpu_tests.py 236/252 pass, 16 skipped, 0 failed, native
and with LEONIDA_W64_EMULATE=1 (261 shaders translated and spirv-val clean). build.py exits 0 and
check.py passes 219 of 222 with 3 mesh fixtures skipped, both ways. ms_wave_info_s3, which the
2026-11-23 record had failing on every native run, passes with 4096/4096 exact pixels in the full
runs and in 3 of 3 isolated reruns each way.
A clothing part whose weighted cloth or accessory bones are not in the master skeleton was refused whole. Each such hash now becomes a joint bone_0x<hash> under the skeleton root with identity local transform and the root's inverse bind, so the rest pose is unchanged; clips can still drive it.
animation.md repeated the whole `MoVE` state-machine section, gbuffer.md
repeated the `OSG1` census table and section 2 (leaving a `## 3` heading whose
body began mid-sentence), and testing.md repeated the 128-byte push-constant
section back to back after a list item. The copy dropped in each page is the
older one: the surviving `MoVE` text adds "747 child states total" and the
surviving `### Arithmetic` text carries the 256-of-256 / 2-of-256 round trip.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
#596 walks only reachable offsets. The resync after a restored tuple now runs inside that walk, follows swallowed
branches, and drops the rest of a run when a branch targets an instruction's interior. decode_bytes gets the
program's wave size, so a swallowed VOP3 compare writes an SGPR pair in wave64 (reported on #674).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ClearRenderTargetView on R8G8B8A8_UNORM_SRGB and B8G8R8A8_UNORM_SRGB handed the linear float to
vkCmdClearColorImage or vkCmdClearAttachments and the GPU encoded it. D3D permits FLOAT -> SRGB 0.6 of a step of
tolerance and each implementation puts the steps between two codes somewhere else, so the byte depended on the GPU:
against WARP, d3d12_clear_formats differed in 10 clears and d3d12_srgb_uav in 2 on an Intel Iris Xe (0.5 is bb
there and bc on WARP), and an RTX 4060 passed because the five colours miss the values it encodes differently (3 648
of 60 000 random ones; the Iris Xe 6 649, never more than one code).
render_target_clear_color now encodes the colour channels itself (srgb8_from_linear) the way WARP was measured to:
the value to 12 bits with x * 4095 in single precision rounded half up, then the nearest code of the sRGB curve. All
255 floats at which WARP's byte changes are the ones this gives, and 84 582 further values agree. Vulkan gets the
linear value of that code (srgb8_linear), which both GPUs store as that code for all 256. Alpha is unchanged.
A GPU's own D3D12 driver encodes as its Vulkan driver does, so the layer now differs from that driver where it
differs from WARP, as it does for UNORM ties and D24. d3d12_state_sweep_test compares with that driver and cleared
its sRGB targets to 0.2, 0.4 and 0.6 (0.2 is 124 on WARP, 123 on the Iris Xe); it now starts them from the values of
codes 124, 170 and 203.
clear_color_test pins 38 values to WARP's bytes, the round trip of every code and the result under each rounding
mode. d3d12_clear_formats_test clears the sRGB formats to the value of every code and of every place halfway
between two codes as well: 178 of 352 cases differed from WARP on the Iris Xe and 170 on the RTX 4060 before, none
after.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Compute shaders using direct resource indexing received a zero heap
pointer. Snapshot each bound heap offset after the explicit inline root
arguments on direct and indirect dispatches, so each command retains the
bindings it had when recorded. When the explicit arguments leave no
SGPR, keep them and report the missing heap slot once.
The placement is a hypothesis with partial evidence. Of 2,959
direct-indexing compute entries, seven could be paired with recorded
layouts. All seven resource reads agree with the predicted slot. The
other 2,952 have no paired layout, and no paired sampler read
establishes the relative heap order. tools/compute_heap_layout_census.py
reproduces the count, with synthetic tests for agreement, disagreement
and missing evidence.
Built gta6rt and d3d12_compute_test with clang-cl. The Proton Vulkan
fixture passed 64 buffer reads and 64 null controls on an RTX 4070. With
the rollback switch, all 128 controls read zero. Both runs check the
recorded arguments for bundle inheritance, indirect heap rebinding and
the last inline SGPR. The synthetic SPIR-V fixture passed validation.
AI-assisted (Codex and Claude Code agents).
Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Measured the executable's indirect calls through device slot 15
(offset 0x78): 943 sites, 10 of which reach the device global; all five
D3D12_DESCRIPTOR_HEAP_TYPE values are passed and sizes, divisions and
GPU handle strides are derived from the return. Records the table and
the consequence for the layer: return the host increment, not a
constant. Keeps the numeric console values Open.
D3D12-DESCRIPTOR-INCREMENTS
run_gpu_tests.py: 235/252 passed, 17 skipped, no failures, native and
with LEONIDA_W64_EMULATE=1; the two imgload tfe fixtures pass since #892.
ctest: 292 passed, 12 skipped, 4 failed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main had no keyboard pad script scheduler. Add timed button presses with
a full-length environment reader so entries beyond byte 63 reach the pad.
Combine scheduled and physical presses. Reject malformed entries and
report their count when the script is read on the first pad update.
Build gta6rt and gameinput_test. Exercise a long script, rejected items,
focus loss, configuration reload and release under Wine. Restore only the
old environment reader to reproduce the missing presses.
Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
AI-assisted (Codex and Claude Code agents).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
On the console the parameter that does not fit and every one after it go to the argument block behind
s[0:1], the ones before stay inline. No VS, PS or GS of 1.0.2.1 reads s[0:1] as an address
(root_spill_census), so the graphics bind point now lays the inline part out from s8 and stores nothing
for the rest (rt::rootsig::Spill::block), instead of giving the whole signature the PC layout. A write
to such a parameter is dropped before kNoSgpr plus an offset could wrap to dword 0. The retail start-up
signatures (25 and 30 dwords, every parameter visible to every stage, #974 review) are the case; the
per-visibility log line is gone, LEONIDA_GRAPHICS_ROOT_LAYOUT=pc stays. Compute still refuses a spill.
Carry the full deficit across an empty budgeted block and preserve overlap state across empty blocks without a budget. Read packet payloads through views for metadata-only scans, and stop measuring packet durations at the declared budget.
Cover both empty-block cases and the packet-copy and duration-scan regressions.
Co-authored-by: OpenAI Codex <codex@openai.com>
main gained its own Part K in vk_command_replay_test and a sentence in the
same bullet of docs/d3d12_vulkan.md (D3D-838, pull request 751). Both stay as
they are on main; this branch's release test becomes Part L, and the doc
bullet for LayoutAfter = UNDEFINED names it so.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add gpu-test-results/RX6600.txt and its row in docs/gpu_test_results.md:
run_gpu_tests.py on the AMD proprietary Windows driver 26.11.2, native
and with LEONIDA_W64_EMULATE=1, measured at 8f05e09e2.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
No fixture in runtime/test/shaders ran s_sub_i32, s_andn2_b32, s_orn2_b32, s_xor_b32, s_ashr_i32, s_mul_hi_u32,
s_lshl3_add_u32, s_lshl4_add_u32, s_pack_ll_b32_b16, s_pack_hh_b32_b16, s_abs_i32, s_bcnt0_i32_b32, s_bitset0_b32,
s_bitset1_b32, s_brev_b32, s_flbit_i32, s_flbit_i32_b32, s_sext_i32_i8, the six s_cmp_*_i32, s_cmp_gt_u32,
s_cmp_le_u32, s_bitcmp0_b32, s_bitcmp1_b32, s_addk_i32, s_mulk_i32, s_cmovk_i32, s_ashr_i64, s_lshl_b64, s_lshr_b64,
s_bcnt0_i32_b64, s_bitset0_b64, s_cmov_b64 or s_ff0_i32_b64.
cs_w32_salu_ext gets sixteen operand words in s4..s19 from VKC_SGPRS, so each op reaches the driver as SPIR-V and
is not folded by the translator as an op on literals is. One thread stores every destination and four words of SCC
bits: SCC after each op that writes it, run on operands that set it and on operands that clear it, each compare
both ways, and SCC after each op that must keep it, set to 1 and to 0 in turn before them.
The 73 expected words are literals in check.py, derived in the fixture's header. tests/test_gpu_salu_ext.py
recomputes them from the fixture's own instruction lines with the reference of tools/salu_diff.py, checks that
every op that writes SCC is seen with both values, and checks the readback and both runners' verdicts.
The fixture is the first in the folder with bit 15 set in the immediate of a signed SOPK op (s_addk_i32 s52,
0x8000). tools/rdna2_decode.py gives that immediate sign-extended and llvm-mc 23.1.4 prints the same word as
0x8000, so test_parity_with_llvm_mc_on_shader_fixtures failed on it. That test now compares the immediates of the
ten signed SOPK ops as the 16 bits they are, as it already does for SOPP branch offsets, and a hand-encoded test
pins which of the sixteen ops the decoder sign-extends.
No translator, decoder or runtime change.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merging.
**Why merged:** OLD-10048: SYNC_COPY maps to COPY|CLEAR, so WriteBufferImmediate (vkCmdUpdateBuffer) and the query zero-fill are ordered before later copies. moffington reproduced the read-after-write hazard on the base, and Timon360SB and SweatierKey checked it independently. Part K of vk_command_replay_test covers it.
**Why it's good:** vk_command_replay, d3d12_state_map and replay_query_edges pass both plain and under validation.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 32950551e, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be34. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e224: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** D3D-CLEAR-DEPTH-RANGE: enables VK_EXT_depth_range_unrestricted where the device has it, so depth clears outside [0,1] (and NaN) behave like D3D12 instead of being clamped. Without the extension it keeps clamping, and NaN becomes 0. Four independent passes; on AMD (660M, 7900 XTX), d3d12_clear still fails only on the NaN rows, which is the driver issue tracked in #307, not this PR.
**Why it's good:** On the 4070 SUPER with validation on, main's d3d12_clear_test exits 1 with 4x VUID-VkClearDepthStencilValue-depth-00022. With this PR it exits 0 with no VUIDs, and the 1.5 / -0.5 / NaN clears match WARP. The new d3d12_clear_restricted_depth passes, and so do d3d12_clear and d3d12_clear_formats.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 32950551e, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be34. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e224: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
The pacing statistics are recorded at PresentX, before the frame is queued, so a frame replaced in a full queue
(never shown) still counts as a present with its real present-to-present interval; the replacement adds and removes
no interval. frame_pacer_test pins that at latency 1: four presents, two replaced, three intervals with known
nearest-rank percentiles and mean, two origin-to-present latencies (the replaced token included), and the shown
frames keep their vblanks. docs/d3d12_vulkan.md says the intervals are between PresentX calls, not frames shown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
# runtime/src/frame_pacer.h
Both branches added a private helper in the same place: queue_flip_locked (the bounded queue) and
record_present_timing_locked (BL-6 pacing statistics). Both are kept; note_untokened_present records its timing
first and then queues through queue_flip_locked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xapu.dll moves out of xapu_chad.cpp into xapu.cpp; chad.dll is unchanged.
The signatures, structure layouts, command kinds, option bits and error
codes come from Marvisak/VIctory (GPL-3.0-or-later,
crates/victory-hle/src/modules/apu.rs at ffe310e), which runs the retail
executable through these calls. Only facts are used, no code
(docs/related_projects.md). They settle what the old header left open:
XApuConnect's first argument is an input (processing kind, streams,
commands per stream, memory bytes, frames per output, options), and the
dword the title reads at +0x34 of a result is its output byte count.
- XApuConnect validates the input, allocates the memory the title asks
for (zeroed) and, with option 0x8, an auto-reset result event; any
processing kind but Opus decoding is E_NOTIMPL.
- Each accepted command gives one result in command order, with the
console's error codes; an unknown kind, a stream out of range or a full
stream is refused with no result.
- A process result carries the frame count of the Opus packet's TOC byte
(RFC 6716, section 3.1), clipped from first_frame, to frame_count and to
the output, and zeros in the output. Nothing is decoded.
- xapu_chad_test covers result order, the full queue, the error codes,
frame counts, silence and the event.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vulkan transfer writes can overlap a later read or write when D3D12 submits
plain buffer copies in sequence.
Emit the transfer memory dependency from natterman12's #354 (GPL-3.0) before
every plain buffer copy. Allow an explicit rollback for comparison, and
record the access masks in the synthetic replay fixture.
The base failed both copy-ordering assertions. The child passed both replay
fixtures, and the rollback control observed no ordering barrier.
AI-assisted (Codex and Claude Code agents).
Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
rpf9dump models and rpf9dump textures save a full-scan index through
RecoveryIndexCache in third_party/rpf9-explorer. On Linux, when the local
application-data folder does not exist, .NET returns an empty path for it
and the index is written to RpfPreview/Indexes under the current directory.
The index holds the archive's full path and the names of its recovered
entries, so from the repository root it is untracked game data.
Ignore RpfPreview/ and say in docs/design.md where the index goes.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>