Commit Graph

5744 Commits

Author SHA1 Message Date
2f44380590 docs: state blob A's colour-target registers, measured over the library (RT-SLOT57-BLEND-STATE)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 08:41:48 +01:00
b71c0a61b8 rdna2_isa_tables: add gfx1013 VOP3 0x16b v_mul_lo_i32 (BUILD-1529) 2026-11-25 12:30:57 +05:00
b3ce84b33f rdna2spirv: the exact re-anchor keeps a signed-byte dot's stored op_sel_hi (SHADER-DOT4-SEL-EXACT-ANCHOR)
A listing that reports rejected words with llvm-mc's own offsets is
re-anchored exactly, and that path never tried restore_dot4_inline_sel,
which the forward search and check_printed_encodings already use. A
v_dot4_i32_i8 with an inline-integer S1 and stored op_sel_hi 5 (printed
as the default 7) was marked normalized and its whole program refused
("reachable instruction with normalized encoding"). One FidelityFX DLL
program has that form; without it the title's slot 67 fails and the
run crashes inside the upscaler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 01:29:27 -06:00
f0611b752f Remove the title's executable addresses #984 brought in; read them from the environment
#984 (273b3bdf9) put RVAs and file offsets of the retail executable into code, docs and scripts.
The code paths that need one now read it from an environment variable and are off when it is
unset; the docs and examples say the location is measured locally.

- runtime/src/main.cpp: the hang-watchdog kick takes its trap and kick RVAs from
  LEONIDA_TITLE_WATCHDOG_KICK="<trap RVA>,<kick RVA>" (hex), still only when the trap
  instruction is at the first one. Unset, the watchdog stays armed, as before by default;
  LEONIDA_TITLE_WATCHDOG=1 keeps it armed, and LEONIDA_TITLE_WATCHDOG=0 without the RVAs says
  once that it needs them. The LEONIDA_PEEK example uses placeholders.
- runtime/shims/startup_trace.h: the transient-pool dump fires at the int3 that
  LEONIDA_POOL_DIAG_AT names (`<module>+0x<offset>`, as the trace prints it), off when unset.
- scripts/windows-boot/boot.ps1: LEONIDA_PEEK's default comes from LEONIDA_GAME_STATE_RVA and
  LEONIDA_SESSION_STATE_RVA (no peek when unset), and the RESULT digest matches those values;
  the examples and README use placeholders.
- runtime/README.md documents LEONIDA_TITLE_WATCHDOG_KICK and LEONIDA_POOL_DIAG_AT.
- docs/fspx.md, docs/d3d12_vulkan.md, docs/movies.md, docs/embedded_shaders.md and a comment in
  runtime/shims/d3d12_xs_alloc_size.h drop the addresses and offsets.

This follows the same change on the earlier integration branch (#1495).
2026-11-25 01:00:37 -05:00
bb0b8848dd s_bitreplicate_b64_b32 of a lane-mask half into data: test and contract-table sentence
#998 added the rule (a 32-bit EXEC/VCC half as S0, read through Gen.wave_mask) without a test
or a design.md entry. test_lane_mask_bitreplicate_flbit.py now runs it on every lane of a
wave64 in the CPU interpreter, from exec_lo/exec_hi and from a compare's vcc_lo/vcc_hi, against
the ISA pseudocode. design.md says it is interpreter-checked only, not measured on hardware, and
that a VCC destination stays wave64-only (#984's rule).
2026-11-25 00:54:41 -05:00
7f08453da7 runtime: the first-run UI keyboard pad reads keys only with focus (RT-FIRST-RUN-PAD-FOCUS)
gta6rt --first-run-ui defaulted LEONIDA_KEYBOARD_PAD to always, so keys
typed into another program reached the title's consent pages (#1552,
hazard 1). Default to the focused mode 1; scripted presses still run
while the window is unfocused. tiny_game checks the default under
run_tiny_first_run_ui, which now clears the caller's setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:54:31 -06:00
62d8f38ae9 rdna2spirv: a v_dot4_i32_i8 printed with default op_sel takes the stored fields
llvm-mc decodes a VOP3P v_dot4_i32_i8 whose op_sel_hi is not [1,1,1] (op_sel bit 1 clear) but
prints and re-encodes it with op_sel 0 / op_sel_hi 7, so translate() refused it as a dropped
field. When those two fields are the only difference between the stored and the printed bytes,
they are now read from the blob, in check_printed_encodings and in both re-anchoring paths, and
the v_dot4_i32_i8 rule applies them as measured on gfx1036 (a non-default S2 half stays
refused). Any other difference is still refused.

This replaces #984's restore_dot4_inline_sel, which took one case of the same form (op_sel_hi
[1,0,1] with an inline integer S1); that case is covered by the general check. The words llvm-mc
rejects (op_sel 2 / op_sel_hi 5) are printed by shader_disasm.py (#1317) and recovered from the
blob by skipped_form. The approach comes from luizwidmer/palmetto (GPL-3.0).

Test: tests/semantic/test_dot4_printed_op_sel.py, hand-built words; design.md contract row and
docs/fspx.md updated.
2026-11-25 00:51:57 -05:00
970837c753 d3d12_xs: null-resource texture barriers and null-view RTV clears on the console list
List slot 146 (Barrier -> GCL7 80): a texture barrier with no resource, which
the console takes as a global barrier, is forwarded as a D3D12_GLOBAL_BARRIER
with the same sync and access; a mixed texture group is split into runs in
order, in storage that lives for the call. Calls with nothing to convert keep
the title's pointer. A group array that cannot be read safely (null with a
nonzero count, an unknown group type, absurd counts) is refused whole and
logged once per reason.

List slot 52 (ClearRenderTargetView -> PC 48): the device proxy marks the real
handle when CreateRenderTargetView gets no resource (moved by RTV descriptor
copies, cleared by a view made with a resource), and the clear of a marked view
is skipped, as on the console. Other views keep today's path.

Before this, both calls put the PC list in its error state, so Close failed and
ExecuteCommandLists dropped the submission. xs_proxy_mock_test models that
error state in its mock list and covers both paths; the two old slot-146 cases
that passed garbage words now pass valid ones.

The null-resource barrier and null-view clear behaviour were first reported by luizwidmer/palmetto.
2026-11-25 00:51:27 -05:00
f7b4aa7ee2 Merge #1317 (print the v_dot4_i32_i8 op_sel words llvm-mc rejects)
# Conflicts:
#	docs/fspx.md
#	tests/semantic/test_alu_dot4_i8.py
2026-11-25 00:44:37 -05:00
79cf7e78cf Merge #1281 (shader library keeps each compute state, select by code hash) 2026-11-25 00:43:38 -05:00
156a056b85 Merge #583 (FSPX short prologue)
# Conflicts:
#	tools/fspx_unpack.py
#	tools/shader_library.py
2026-11-25 00:43:28 -05:00
0cb367cadd Merge #674 (vcc-tuple-resync): restore_vcc_tuples, the one restore pass 2026-11-25 00:41:01 -05:00
018145b338 runtime: serve the spatial stream on the silent output endpoint
The title activates ISpatialAudioClient on the render device, not IAudioClient (the first
game run with the silent endpoint logged that IID and stopped as before). The silent device
now answers ISpatialAudioClient and ISpatialAudioClient2: a 7.1 static bed, no dynamic
objects, mono 48 kHz float objects, 480 frames a pass. Its ISpatialAudioObjectRenderStream
signals the stream's event every 10 ms while it runs, and its objects write into a
scratch buffer. The periodic event thread is shared with IAudioClient.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:20:54 -05:00
9b74691f74 docs: the console's value-write slots 71 to 74
The four rows of the measured console list slots, with the slot numbers the retail title's trace gives and the attribution of the call shapes and the write model.
2026-11-25 13:17:09 +08:00
d4ce33ed42 runtime: serve a silent output endpoint when the host has none
The title creates its MMDeviceEnumerator through CoCreateInstance. On a host with no
render endpoint, GetDefaultAudioEndpoint(eRender) is 0x80070490, the title's audio device
start leaves its own output-device lock held, the audio engine never mixes, and the boot
stops on an int3 about 47 s in. A console always has an output.

com_shim's CoCreateInstance now hands that class to shims/silent_audio.cpp. A host
enumerator with a default render endpoint is returned unchanged. Otherwise (no endpoint,
no enumerator, or LEONIDA_AUDIO=silent) render questions get an in-process endpoint:
IMMDevice with a read-only property store, IAudioClient/2/3 at 48 kHz float 7.1, and
IAudioRenderClient, IAudioClock, ISimpleAudioVolume and IAudioStreamVolume. A clock drains
the padding in real time and an event-driven stream's event is signalled every 10 ms.
Every sample is discarded; no host audio device is opened. Capture keeps the host's
answer. One [rt] line names the reason when the silent device is first served.

silent_audio_test covers stand-in hosts with and without an endpoint, no host, a render
stream over a few periods, and the CoCreateInstance hook with LEONIDA_AUDIO=silent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:05:32 -05:00
3cf0a41bc5 d3d12_xs: make a D16S8 depth texture without UAV when the depth provider refuses it
Since #939, slots 76 and 133 hand a depth-stencil texture with unordered access
to the depth provider. On a GPU with D24S8 attachments (every NVIDIA card) the
Vulkan layer's pc_format() makes D16_UNORM_S8_UINT (format 118) as
D24_UNORM_S8_UINT, and Resource::enable_depth_stencil_uav accepts only
R16_TYPELESS, 118 and R32G8X24_TYPELESS, so it answers E_INVALIDARG. Slot 133
passed that on for a 1280x720 format 118 texture with ALLOW_DEPTH_STENCIL |
ALLOW_UNORDERED_ACCESS (all-ones layout), and the boot stopped on an int3.

When the provider refuses (E_INVALIDARG or E_NOTIMPL from the provider call
itself), slot 76 now makes the committed texture without unordered access and
slot 133 goes on to its stand-in (the title-placed texture, else the committed
one), as both did before the provider. The first refusal per slot is logged.
Any other failure is passed on as before: the provider out of memory, the
backing's own CreateCommittedResource, a refused placement or description.
The refused backing is released and no placement range is registered.

On a real boot (Windows 11, RTX 4070 SUPER, driver 621.24), on 0bc810504 with
an earlier form of this change that fell back on any failure of the depth path
(the only one that occurred was the provider's): the fallback fires once
(slot 133, format 118, hr=0x80070057), no int3, 6,187 PresentX ok and 0
failed, 69/69 captures non-black, and the boot reaches the first-run pages.
Without it, 3 of 3 boots stopped on the int3 after 182-362 PresentX.

Tests:
- xs_proxy_mock: a mock provider refusing a format 118 texture (E_INVALIDARG,
  E_NOTIMPL) through slots 76 and 133 gets S_OK and the stand-in, with the
  refused backing released; E_OUTOFMEMORY from the provider, a failing backing
  and a refused placement are passed on with no stand-in.
- xbox_d16s8_refused_uav (Vulkan, LEONIDA_CONSOLE_D16S8=d24): slots 76 and 133
  return a depth-stencil texture without unordered access.
Both fail without the change (slot 76 and slot 133 each checked on its own).

Follow-up: teach enable_depth_stencil_uav the D24S8-made form of format 118,
so these textures keep their UAVs on NVIDIA too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-24 23:34:00 -05:00
eb39d2765e rdna2spirv: flush v_exp_f32 denormal results 2026-11-25 05:33:06 +01:00
a05f1f3cdb gameinput: queue only events a callback wants, so a later pad's connect is not stuck behind a backlog (RT-GAMEINPUT-LATE-PAD)
A pad connected after the title started was seen by the shim but not by the
title, while pads present at start worked. Pads present at start reach a title
through blocking enumeration, which runs synchronously in RegisterDeviceCallback.
A later pad reaches it only through a queued connect event. queue_event queued
every reading and guide change whether or not any callback listened. With a
dispatcher held, a title that runs one item a frame (Dispatch(0), the pattern
Microsoft's Dispatch page suggests) falls further behind every frame, because a
moving stick or a sensor pad's 125 Hz stream queues items faster. The later
pad's connect event then never comes out of the queue.

queue_event now drops an event no registered callback matches, as GameInput has
no work to dispatch then. The first few RegisterDeviceCallback calls and the
first CreateDispatcher and Dispatch calls are logged, so a retail run shows
whether the title holds a dispatcher (not yet confirmed for the retail title).

Test: test_late_pad_behind_dispatcher. A title with a dispatcher registers its
device callback with no pad, a first pad moves on every poll, and a pad attached
later must reach the callback within ten frames of Dispatch(0). Without the fix
it fails (2 of 371 checks); with it, 371 checks pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:29:04 +05:00
a6b851dff5 Merge origin/main into vcc-tuple-resync: one recovery function for the forms llvm-mc skips
main got restore_skipped_instructions with #984: an earlier form of this branch's
restore_vcc_tuples that also takes two more forms from the blob (a VOPC f32 compare
in DPP form, the measured v_dot4_i32_i8). restore_vcc_tuples stays the one function
and takes those two forms through skipped_form(), as #1495 resolved the same
conflict (the helper is that pull request's). main's tests that called the earlier
function by name call this one; the hand-built listing entry of the DPP recovery
test gets the fields a printed instruction has.

Translator suite: 487 files, 6297 tests, 0 failed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 05:03:05 +01:00
f9792cc56d Merge remote-tracking branch 'ubiq/main' into feat/gdk-lifecycle-window-hook
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-25 00:58:58 -03:00
d16eb1ff0a d3d12: give a depth placement inside another one's PC extent its own image
The slot-133 depth/UAV registry recorded each placement's extent as the PC
allocation size and refused, with E_NOTIMPL, any placement that started
inside another live range. On RADV the PC size of a large D16 target is
above the block the title placed it in, so the title's next block starts
inside the previous range: its first depth target was refused, no trace
line showed it, and the title stopped on its own assert and crash reporter
about 30 s into the boot (Game Init, frame 0) on an RDNA2 iGPU.

Overlapping placements at different addresses never shared a backing, so
between two opaque layouts the inner one now gets an image of its own, as
D3D12 leaves an alias's contents undefined until it is reinitialized. A
non-opaque layout is still refused there, and the same-address rules are
unchanged. A refused depth placement is now logged.

d3d12_depth_stencil_uav_test places a texture one alignment step inside
another one: refused for the tiled Xbox layout, its own backing for the
opaque one, and the outer placement still finds its shared backing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:52:55 -05:00
3e1c49e1bd d3d12: compile a submission's pipelines on worker threads (RT-PIPELINE-COMPILE-WORKERS)
prepare() leaves the pipelines that are not built yet to PipelineCompiles, once per pipeline and variant. VulkanQueue::execute_now compiles them together on the device's workers with the resource lock held, places them in the prepared commands and then writes the command buffer, so every draw and dispatch has its own pipeline. A refused compile gives the result prepare() alone would have given. LEONIDA_PIPELINE_THREADS=0 keeps the path of before. Graphics pipelines of 1 MiB of SPIR-V or more and compute pipelines over 128 KiB compile one after another, and LEONIDA_ASYNC_PIPELINES keeps its own worker.
2026-11-25 04:46:33 +01:00
570db1d58f shader_library: keep each state of a compute program, select by code hash (TOOLS-LIBRARY-COMPUTE-BY-HASH)
The run time finds a pipeline-library compute program by the SHA-256 of
its code and of its record's state blob. shader_library.py kept one
state per program, the last record's, so when two compute records used
one program with different state blobs only one of the two pairs got an
entry and a .state file.

Each distinct state of a program is now written: the first under the
program's name, each further one as <name>_state_<blob index>, with its
own .code, .json, .state, listing and index entry. library.json names
the entry of each record. A program with one state, the case of every
program in the measured 1.0.2.1 library, is written exactly as before.

--compute-hashes FILE writes only the compute programs whose code has
one of the SHA-256 digests listed in FILE, with every state they are
used with. It cannot be combined with --stages, and a digest no compute
program has is an error before anything is written.

tests/test_shader_library.py gets three tests on a synthetic library;
all three fail on the base. The standard-library tests and the
translator suite add no failing file. No retail library was read for
this change.

AI-assisted (Claude Code).

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:39:34 -06:00
6e3a44259c tests: draw the First Light perspective camera through Xbox D3D12 2026-11-25 11:39:12 +08:00
d4d969a1fd make_game, gameinput: controller, keyboard and mouse input out of the box (INPUT-OUT-OF-THE-BOX)
A build made with make_game.py on Windows had no input at all. The runtime
stage ran scripts/build_runtime.ps1 without -FetchSdl3, so on a machine without
an installed SDL3 the GameInput shim was not built. gta6rt then logged "served
without SDL3 (no devices)", and a connected DualSense or Xbox pad did nothing.

- make_game.py: the Windows runtime stage passes -FetchSdl3 (the pinned SDL3
  3.4.20, SHA-256 checked by CMake). --no-sdl3 leaves the download out. The
  docstring's "what it downloads" sentence names it.
- gameinput: LEONIDA_KEYBOARD_PAD defaults to the focused mode, so a player
  without a pad still has the keyboard and mouse. Keys count only while the
  game window has focus. "off" or "0" removes the pad.
- gameinput_test: the other cases set LEONIDA_KEYBOARD_PAD=off, as they count
  only their own virtual pads. The keyboard pad case checks the new default.
- docs/gameinput.md: default and make_game behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 08:31:50 +05:00
bfef489cb6 Merge pull request #1232 from iFeyz/feat/direct-heap-graphics
d3d12: graphics draws supply the directly indexed heaps after their root arguments (RT-DIRECT-HEAP-GRAPHICS)
2026-11-25 04:26:54 +01:00
98efc22ca3 Merge pull request #1064 from Moriz82/split/rt-direct-heap-compute
d3d12: supply directly indexed heaps to compute dispatches (RT-DIRECT-HEAP-COMPUTE)
2026-11-25 04:25:38 +01:00
275cb01456 Merge main into carry/old-9921-ms-compressed-exports (after #1197)
- tools/rdna2spirv.py, mesh_export: #1197's misc-vector return for pos1
  (Layer/ViewportIndex) comes first, then this pull request's compressed
  components; both kept.
- docs/design.md, "Mesh shaders" row: main's row (with #1197's sentence)
  plus this pull request's compressed-export sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:14:11 -05:00
3ee0037fd3 Merge main into RT-DIRECT-HEAP-GRAPHICS (#1232)
This merges #1064 as prepared (its head + a merge of main), so it brings #1232 up to date with main and
with #1064. #1232's branch carried #974 (merged into main since) and an older head of #1064 (7c47fd946).

main already supplies the directly indexed heaps to graphics draws (integration #984):
graphics_user_data() on DrawInstanced, DrawIndexedInstanced and DispatchMesh, at
RootArgumentLayout::graphics_arguments_end (pack_stage(Stage::Pixel)'s end_sgpr, set when the console
layout places the signature), LEONIDA_GRAPHICS_DIRECT_HEAPS=0, its notes for a signature on the s0
layout or one that fills s31, and d3d12_graphics_direct_heaps_test (recorded draws and the VS/PS GPU
reads). That form stays. What this pull request adds beyond it is carried onto it: the mesh case.

Conflicts (all taken from #1064's merged branch, then the PR's mesh parts carried over):
- runtime/shims/d3d12_com.cpp: main's graphics_user_data()/with_direct_heaps() and notes. The PR's own
  graphics_user_data(), GetEnvironmentVariableA switch and no-room notes are main's in another form and
  dropped. Carried: the comment says a mesh shader reads push dword d as s(d + 8) through #974's window,
  so it gets the heaps after its arguments from s16 (main's comment still said the mesh stage gets none);
  and DispatchMesh reports once when a heap falls past the mesh window (push dword 24 and up, s32 for the
  mesh shader), the case raised in the review of #1232 (mesh_ok accepts arguments up to push dword 24).
- runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: main's (graphics_arguments_end from
  pixel.end_sgpr; the PR set it from its Spill::block form, which main did not take from #974).
- runtime/test/glsl/cs_user_data.comp: main's (identical direct-indexing mode).
- docs/d3d12_vulkan.md: main's section 3.4 with #1064's compute paragraph; the graphics paragraph's
  "a mesh shader ... is not modelled" replaced by the mesh window position, cited to issue #14 comment
  7143020922 as a report not reproduced here, the window-overflow note and the mesh test.
- runtime/test/d3d12_mesh_test.cpp (no conflict): the PR's recorded-argument checks kept (vertex and mesh
  draw with 4 constants, resource-only rebind, 23 constants, 30 constants); the 30-constant comment now
  says it keeps pack()'s s0 layout on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:13:02 -05:00
e950f8582f docs: contract row for mesh-shader Layer and ViewportIndex
Add the rule this pull request introduces to the "Mesh shaders" row of
docs/design.md: Layer and ViewportIndex from the pos1 misc vector become
per-primitive members of %ms_cull, each lane writing the primitive with
its own index. That is exact when the value is the same for all vertices
of a primitive; whether the hardware takes the provoking vertex's value
instead is not measured. None of the 1,906 mesh shaders of the
maintainer's corpus that export pos1 writes either output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:10:50 -05:00
5115f08879 Merge main into RT-DIRECT-HEAP-COMPUTE (#1064)
main already supplies the directly indexed heaps to compute dispatches (integration #984, the tree this
pull request was split from): with_direct_heaps()/compute_user_data() on Dispatch and the ExecuteIndirect
dispatch path, RootArgumentLayout::compute_arguments_end (kNoSgpr for a spilled signature),
LEONIDA_COMPUTE_DIRECT_HEAPS=0, and the first form of this test (direct dispatch, indirect after a
resource-only rebind, the GPU read through the heap). That form stays. What this pull request adds beyond
it is carried onto it: the review-round reports, the extra recorded-argument checks, the census tool and
its evidence.

Conflicts:
- runtime/shims/d3d12_com.cpp: main's with_direct_heaps()/compute_user_data() and its one-argument
  note_direct_heap_indexing(). Carried: compute_user_data() makes the note itself, so an ExecuteIndirect
  dispatch with no heap bound is reported too (record_dispatch's own call removed), and a heap with no
  inline dword left is reported once per heap kind ("compute root arguments leave no inline SGPR for the
  resource/sampler heap"); a spilled signature (main: kNoSgpr) gets one note of its own. Dropped: the PR's
  GetEnvironmentVariableA switch (main's direct_heaps_enabled) and its "graphics heap-base SGPR is not
  supplied" notes (main supplies the graphics heaps).
- runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: main's (compute_arguments_end and
  graphics_arguments_end with their comment; compute_arguments_end only when the compute arguments do
  not spill).
- runtime/test/glsl/cs_user_data.comp: main's; its direct-indexing mode (s5 = 0xFFFFFFFC, heap at s9)
  is this pull request's, byte for byte.
- runtime/test/d3d12_compute_test.cpp: the PR's block replaces main's earlier form of it (a superset:
  adds the bundle dispatch that inherits the parent's heaps, an indirect dispatch with only the sampler
  heap, signatures ending at s30 and s31, and the LEONIDA_COMPUTE_DIRECT_HEAPS=0 expectations).
- docs/d3d12_vulkan.md: main's section 3.4 (the BatchCull s7 and PreSkin s9 evidence), with the PR's
  census paragraph (tools/compute_heap_layout_census.py, the seven paired layouts, the heap order as a
  hypothesis) and the no-room and spill reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:09:38 -05:00
b07b9ecb09 Merge pull request #974 from iFeyz/feat/d3d448-graphics-root-layout
D3D-448-GRAPHICS: graphics root arguments in the console layout, mesh shaders through a window
2026-11-25 04:00:46 +01:00
50740a1bc5 Merge main into carry/old-9921-ms-compressed-exports
The "Mesh shaders" row of docs/design.md changed on main (#802); the
compressed-export sentence is added to main's version of the row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:55:03 -05:00
e39adc942c docs: contract row for compressed mesh-shader exports
Add the rule this pull request introduces to the "Mesh shaders" row of
docs/design.md: compressed exports unpack their two f16 pairs the way the
pixel-shader compressed export does (operands 1 and 3, UnpackHalf2x16), an
"off" register leaves its components unwritten, it was refused before, and
it is confirmed by the translator tests. None of the 9,282 mesh shaders of
the maintainer's shader corpus uses one, so the game's translation does not
change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:52:40 -05:00
f78385646c Merge pull request #802 from whoalin1/shader-ms-clip-iface
rdna2spirv: list %ms_cull before %ms_out_vtx in OpEntryPoint MeshEXT (AMD LLPC crash, SHADER-MS-CLIP-IFACE)
2026-11-25 03:46:59 +01:00
b8563e949e Merge main into D3D-448-GRAPHICS (#974)
main already lays graphics root arguments out in the console layout (from s8, one dword per table: #939's
graphics-root-layout patch in #984's form, pack_stage(Stage::Pixel), RootArgumentLayout::graphics_console,
graphics_arguments_end, LEONIDA_GRAPHICS_STAGE_LAYOUT=0 for pack()). That form stays. What this pull request adds
beyond it is carried onto it: the mesh-shader root window (translator, index "root_window", mesh_ok, the two
refusals) and its tests. Its own graphics spill handling (Spill::block) and LEONIDA_GRAPHICS_ROOT_LAYOUT=pc are not
carried: main keeps pack()'s s0 layout for a graphics signature past s31, and its switch does what =pc did.

Conflicts:
- runtime/src/root_signature.h, root_signature.cpp: main's pack_stage (compute spill array, spill_dword); the
  Spill enum, first_spilled and spilled_dwords dropped. The header keeps the PR's evidence note, with Stage::Pixel.
- runtime/shims/d3d12_com.h: main's comment and members, with the mesh window described; mesh_ok added (false by
  default, set only for a console-layout signature that Stage::Mesh also places); the PR's second graphics_console
  dropped.
- runtime/shims/d3d12_vulkan_device.cpp (CreateRootSignature): main's pixel/packed form; the PR's Stage::Mesh pack
  and its log line added, mesh_ok = pixel.ok && mesh.ok. The mesh-shader refusal without "root_window" (no
  conflict) stays.
- runtime/shims/d3d12_com.cpp: DispatchMesh keeps main's any_nonempty_viewport() and graphics_user_data() after the
  PR's mesh_ok check; address() keeps main's comment. The PR's kNoSgpr guard in constants()/address() stays,
  reworded: in main a spilled compute parameter has first_sgpr kNoSgpr, and kNoSgpr + offset wrapped round to s0.
- runtime/src/shader_library.h: both (main's wave64_graphics, the PR's root_window).
- runtime/test/d3d12_mesh_test.cpp: main's mesh shader-kind byte on both containers (also the PR's ms_old); the
  PR's two-parameter signature replaces main's 25-dword padding onto the s0 layout; both test blocks kept (the
  PR's window refusals, main's DISPATCH_MESH command signature), each in its own scope. The =pc case is dropped
  (main's switch is read once per process).
- runtime/CMakeLists.txt (no conflict): the mesh test uses ps_draw.spv again; the ps_draw_s0.spv rule is gone.
- runtime/test/glsl/ps_draw.frag, vs_depth.vert, vs_draw.vert, vs_draw_int.vert, ps_depth_write.frag and
  runtime/test/shaders/ps_m15, ps_m2, ps_m2_array, ps_m2_literal, ps_m2_uoff, ps_m3, ps_m3_post, ps_m3_query,
  vs_m15, vs_m3 (.asm): main's (the same s8 rewrite done twice); ps_draw.frag's mesh-test note updated.
- runtime/test/root_signature_test.cpp (no conflict): the Spill::block cases dropped, the window cases kept.
- docs/design.md: main's rows (loop guard, direct resource heap) and the PR's user-data row.
- docs/d3d12_vulkan.md (no conflict): section 3.5 and the CreateRootSignature bullet rewritten for main's form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:44:23 -05:00
052883fba8 docs: the mesh interface order crash is one driver report, not every AMD driver
The contract row stated the LLPC crash as a general fact. It was seen on
driver 24.10.24 on one Ryzen 5 7600 iGPU; driver 32.0.32029.2010 on an RX
9070 XT and an RX 7900 XT accepts either order. Say so, and that the order
costs nothing elsewhere because it has no meaning in SPIR-V.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:41:13 -05:00
2213d5cb8f Merge pull request #1287 from anonymechab-droid/fix/literal-mad-denorm
rdna2spirv: flush literal MAD denormals (SHADER-LITERAL-MAD-DENORM)
2026-11-25 03:38:58 +01:00
85ece68470 Merge pull request #1400 from Okachamie/fix/dpp-absent-source
rdna2spirv: guard native DPP FI=0 shuffle source (SHADER-DPP-ABSENT-SOURCE)
2026-11-25 03:37:13 +01:00
a2de554e56 Merge pull request #1353 from robot00f/fix/rootsig-heap-flags
Merging.

**Why merged:** on Windows 10, the in-box `d3d12.dll` refuses root-signature flags `0xC00` (heap directly indexed) in its serializer, so the title is left with a null program and stops about 15 s in (`exe+0xb5a5f8`, a read of `0x68`); testers on Windows 10 hit this every boot. This retries only after the host has refused, and only when `0xC00` is in the description. It covers both the versioned and the legacy `D3D12SerializeRootSignature`, patches the flags back into `RTS0` after checking the container hash (failing closed), and it's claimed as D3D12-SET-HEAPS-BLOB. It's the better of the two PRs for this. #683 does the same for the versioned path only, by probing each bit through a static that captures the first serializer pointer.

**Why it's good:** on this Windows 11 host the real serializer accepts the flags, so I also checked the refusal path independently with a harness: a fake serializer that refuses `0xC00` and forwards everything else to the real Windows 11 serializer, on the RTX 4070 SUPER's hardware D3D12 device. #1353's wrappers (versioned 1.0 and 1.1, legacy 1.0) return S_OK after exactly one refusal; the flags read back as `0xc01` through the host deserializer; hardware `CreateRootSignature` succeeds; an unrelated failure is passed through; and a host that accepts the flags gets a byte-identical blob, 16/16. root_sig, root_signature, root_signature_oracle, d3d12_set_descriptor_heaps, d3d12_xs_root_signature, d3d12_draw, bundle, device_proxy and xs_proxy_mock* pass 14/14, both plain and with `LEONIDA_VK_VALIDATION=1`. The repository-consistency set gives 578/5/0. It merges cleanly onto main after #984 (neither #984 nor DadaCap's prototype carries this fix). Minor note: it returns S_FALSE ("flags lost") if a blob can't be patched, which is fine.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 21:35:06 -05:00
0819cfec80 Merge main (3ff2a2adc) into the #939 merge
Fourteen commits main gained after #968: #413, #1114, #1090 and #1491. Two conflicts, both in the shader check lists: scripts/run_gpu_tests.py imports both sides' cases, and tests/test_shader_checks.py counts eight cases next to COMPUTE (main's cs_w32_salu_ext) and #939's IMAGE_STORE_CASES table in place of main's fixed seven store shaders.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:23:42 -05:00
7ea226e65b Merge main (0aecc5efa: #984 and #968) into the #939 merge
main now holds the #984 merge (18a22c1ae) and #968, queue slot 31 as CopyPageMappingsBatchX. Two conflicts: the include list of d3d12_xs_device.cpp (both includes kept) and the call order in xmem_test.cpp (the two page-mapping tests of #968 run after test_physical_pages, after the early return of #939's file-pools mode). The slot 31 dispatch of #968 stays ahead of the presentation routes, so #939's rule for queue slots 30 to 32 on a device that had a presentation handler does not reach it where xmem is linked.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:09:27 -05:00
e0106f3ba3 docs: one contract for v_div_fixup in design.md, matching the gfx1036 measurement (DOC-DIV-FIXUP-ROW)
The v_div_fixup_f16/f64 row stated the rules twice. The first half (overflow
at >= 16 / >= 1024, underflow at <= -1075, quieted NaN sources, NaN(S0)
keeping its payload) is the old model; the second half, which cites the
gfx1036 measurement, is what the translator and test_alu_div_fixup.py
implement. Keep one rule set and state the NaN source order once. The test
module docstring carried the same stale lines and is updated. No behaviour
changes.
2026-11-24 23:08:20 -03:00
52ef7df72f docs/embedded_shaders.md: twelve executable programs, and the AMD pipeline check of the ten plain ones
The merged pe_shader_containers.py is the base's: it extracts the ten plain containers and the two packed pixel shaders, so the base's count of 12 (1 VS, 11 PS) is what the merged tool gives and stays. The measurement #939 made with its own extractor (the ten plain containers: translation with and without wave64 emulation, the shader library lookup, vk_pipeline_check 10/10 on an RX 9070 XT and a Ryzen integrated GPU under RADV) is added as a second measurement and says that the two packed shaders were not in it. No hash is changed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:07:46 -05:00
4770a7673c Attribution: the VIctory port is GPL-3.0-or-later, translated from Rust and changed
runtime/src/console_texture_layout.h, the second computer in runtime/shims/xg_xs.cpp and its test said GPL-3.0 for Marvisak/VIctory. The project is GPL-3.0-or-later, and the notices now also say that the code was translated from Rust to C++ and changed for Leonida. docs/runtime_imports.md follows. Comments only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:05:22 -05:00
a3d4db807c Attribution: four patches of graphics-runtime-patches at d9a0bc1b (GPL-3.0, smg)
graphics-root-layout, descriptor-table-refresh, descriptor-write-through and sampler-table-refresh of Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches are in #939 almost as published, about 390 lines, and only one sentence of docs/first_run_ui.md said so. That sentence now names the four, their licence and author and the files they are in, and each code region carries a comment naming its patch. Comments and one doc paragraph only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:05:02 -05:00
7067ec7ced docs: the switches of the merged tree, and the first-run profile without host speech
runtime/README.md gains the twelve variables the merged code reads and no doc named (tests/test_docs_env_vars.py): LEONIDA_PIPELINE_COMPILE, LEONIDA_GRAPHICS_STAGE_LAYOUT, LEONIDA_FRAME_PACING, LEONIDA_GPU_LABELS, LEONIDA_LINEAR_MAP_FIRST, LEONIDA_CONSOLE_D16S8, LEONIDA_RGBA4_COPY_REFUSE, LEONIDA_DESC_MIRROR, LEONIDA_SLOT70_TITLE, LEONIDA_WINDOW, LEONIDA_PRESENT_DUMP and LEONIDA_LOCAL_SPEECH, each with the default the merge gives it. docs/first_run_ui.md no longer lists local speech among what the profile selects: it is off unless LEONIDA_LOCAL_SPEECH is 1.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:01:35 -05:00
3ff2a2adcd Merge pull request #1491 from madhyn/feat/xma2-prebuilt-lib
runtime: accept prebuilt XMA2 decoder via -DLEONIDA_XMA2_DECODER_LIB (BUILD-XMA2-PREBUILT-LIB)
2026-11-25 03:00:08 +01:00
46e078824d docs: build the prebuilt XMA2 decoder yourself, from this checkout
Configure checks only that the file passed with -DLEONIDA_XMA2_DECODER_LIB
exists, not which source, version or target it was built from. Say so, and
give the command that builds the library from this checkout's
runtime/xma_decoder for x86_64-pc-windows-msvc, where it lands, that it
needs only the Rust target (so it works on Linux), that the option stops
CMake from rebuilding the decoder after source changes, and that a
relative path given with -D is resolved against the directory CMake runs in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:59:12 -05:00
871e4b8b99 Merge pull request #1090 from milk4sale/test-w64-sdst-pair-gpu
tests: a GPU fixture and whole-corpus counts for one-register wave64 mask destinations (TEST-W64-SDST-PAIR-GPU)
2026-11-24 20:50:01 -05:00