[integration] Windows offline boot to the first-run UI (RT-WINDOWS-FIRST-RUN-UI) #939

Manually merged
github merged 145 commits from gh-pr/939/head into gh-pr/939/base 2026-11-26 09:29:26 +00:00
Owner

@⁠Rain156 on GitHub · 2026-11-24 15:19 UTC · original
Rain156:integration/windows-first-run-ui → main · +14089 −953 · 131 files · 145 commits · merged 2026-11-25 02:33 UTC

Claimed in the coordination issue as: RT-WINDOWS-FIRST-RUN-UI (claim).

Depends on: #321, #213, #261, #281, #461, #526, #593, #596, #682, #722, #513, #681, #689.
The last three items overlap on specific code paths: #513 (constant-buffer rows), #681 (on-demand graphics pipelines), #689 (placed depth shapes). The native shader index from #497 is now on main.

What and why

This branch packages the source required to reproduce the offline first-run interface on Windows. The commit history includes the public frame-loop stack, the shader and resource implementations, the responsive presentation window and the rectangle fix. Contributors can build this head directly using their own unpacked Xbox 1.0.2.1 files.

The shader stage generates the native container catalog and translates the executable and library stages as well as the main archive. Native and derived PSOs retain the appropriate shader and root state. The Vulkan paths cover GPU-completed labels, generation-checked title memory, linear and tiled texture uploads, depth/stencil views, and rectangle compositing. Vertex and index data stays alive until its submission completes.

The new gta6rt --first-run-ui <exe> entry point selects the settings for this milestone. The runbook includes external build and work directories, the normal make_game.py command and the launch command. Build and launch from this branch

Tested

  • On the submitted eb6a08cd3 build, the documented --first-run-ui <exe> command displayed the full first-run controller-prompt row on a plain background. This launch used the default overlay and XMem paths, with tracing and internal frame capture off. Windows Graphics Capture independently recorded the game window at 2,856 × 1,464. Its RGB pixels matched previous independent launches. In the readback-enabled runs, the swapchain contained 1,855,276 non-black pixels out of 1,858,304. The runs used a locally supplied Xbox 1.0.2.1 package in a Windows AppContainer with zero network capabilities. Testing stopped at this first-run interface. Gameplay and 3D scenes remain unverified.
  • From an empty external shader workspace, the archive yielded 26,503 translated and SPIR-V-validated primary shaders and 25,321 unique native catalog digests. The auxiliary indexes contain 2,632 of 2,684 library programs, 27 of 29 FidelityFX programs, 52 of 52 BVH programs, and 10 of 10 executable-embedded programs. The normal check,shaders,runtime command regenerated the shaders with the updated assembler. The later catalog CLI help change reproduced the identical native catalog, and the final clean runtime was staged with check,runtime.
  • All 361 registered Windows CTests ran in the standard data-free suite. Across this run and the explicit Khronos validation reruns, 349 passed and 11 skipped. The remaining d3d12_vulkan_device test reported the same three committed-resource flag HRESULT differences (0x200, 0x400) on an unmodified upstream checkout on this adapter. The translated-draw and rectangle tests passed with synchronization validation enabled. A synthetic compute seed now hits the runtime cache after making the checker use the runtime mesh-query features, including for a compute-only batch.
  • The translator suite passed all 6,123 reported tests in 468 files. The VCC pointer fixture returned all eight seeded words on the physical GPU using wave64 emulation on a 32-wide subgroup. The GPU-runner checks passed 88/88 and 67/67. Documentation links passed 16/16 and viewer streaming passed 57/57.
  • Repository game-data and diff checks passed. The source and provenance are described in the runbook. Retail measurements are aggregate counts.

GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 x64 build 26200, MSVC x64 RelWithDebInfo.

AI-assisted: Yes (Codex).

Checklist

  • Based on main and checked for a clean merge.
  • One integration milestone with a repeatable build and launch procedure.
  • Source and synthetic fixtures only. The game-data checks passed.
  • The scalar-load translator change and its verification are recorded in docs/design.md.
**@⁠Rain156** on GitHub · 2026-11-24 15:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939) `Rain156:integration/windows-first-run-ui` → `main` · +14089 −953 · 131 files · 145 commits · merged 2026-11-25 02:33 UTC Claimed in the coordination issue as: RT-WINDOWS-FIRST-RUN-UI ([claim](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14)). Depends on: #321, #213, #261, #281, #461, #526, #593, #596, #682, #722, #513, #681, #689. The last three items overlap on specific code paths: #513 (constant-buffer rows), #681 (on-demand graphics pipelines), #689 (placed depth shapes). The native shader index from #497 is now on main. ### What and why This branch packages the source required to reproduce the offline first-run interface on Windows. The commit history includes the public frame-loop stack, the shader and resource implementations, the responsive presentation window and the rectangle fix. Contributors can build this head directly using their own unpacked Xbox 1.0.2.1 files. The shader stage generates the native container catalog and translates the executable and library stages as well as the main archive. Native and derived PSOs retain the appropriate shader and root state. The Vulkan paths cover GPU-completed labels, generation-checked title memory, linear and tiled texture uploads, depth/stencil views, and rectangle compositing. Vertex and index data stays alive until its submission completes. The new `gta6rt --first-run-ui <exe>` entry point selects the settings for this milestone. The runbook includes external build and work directories, the normal `make_game.py` command and the launch command. [Build and launch from this branch](https://github.com/Rain156/leonida-contrib/blob/eb6a08cd359d98b5777e70d54d0ae8a75879495a/docs/first_run_ui.md) ### Tested - On the submitted `eb6a08cd3` build, the documented `--first-run-ui <exe>` command displayed the full first-run controller-prompt row on a plain background. This launch used the default overlay and XMem paths, with tracing and internal frame capture off. Windows Graphics Capture independently recorded the game window at 2,856 × 1,464. Its RGB pixels matched previous independent launches. In the readback-enabled runs, the swapchain contained 1,855,276 non-black pixels out of 1,858,304. The runs used a locally supplied Xbox 1.0.2.1 package in a Windows AppContainer with zero network capabilities. Testing stopped at this first-run interface. Gameplay and 3D scenes remain unverified. - From an empty external shader workspace, the archive yielded 26,503 translated and SPIR-V-validated primary shaders and 25,321 unique native catalog digests. The auxiliary indexes contain 2,632 of 2,684 library programs, 27 of 29 FidelityFX programs, 52 of 52 BVH programs, and 10 of 10 executable-embedded programs. The normal `check,shaders,runtime` command regenerated the shaders with the updated assembler. The later catalog CLI help change reproduced the identical native catalog, and the final clean runtime was staged with `check,runtime`. - All 361 registered Windows CTests ran in the standard data-free suite. Across this run and the explicit Khronos validation reruns, 349 passed and 11 skipped. The remaining `d3d12_vulkan_device` test reported the same three committed-resource flag HRESULT differences (`0x200`, `0x400`) on an unmodified upstream checkout on this adapter. The translated-draw and rectangle tests passed with synchronization validation enabled. A synthetic compute seed now hits the runtime cache after making the checker use the runtime mesh-query features, including for a compute-only batch. - The translator suite passed all 6,123 reported tests in 468 files. The VCC pointer fixture returned all eight seeded words on the physical GPU using wave64 emulation on a 32-wide subgroup. The GPU-runner checks passed 88/88 and 67/67. Documentation links passed 16/16 and viewer streaming passed 57/57. - Repository game-data and diff checks passed. The source and provenance are described in the runbook. Retail measurements are aggregate counts. GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 x64 build 26200, MSVC x64 RelWithDebInfo. AI-assisted: Yes (Codex). ### Checklist - [x] Based on `main` and checked for a clean merge. - [x] One integration milestone with a repeatable build and launch procedure. - [x] Source and synthetic fixtures only. The game-data checks passed. - [x] The scalar-load translator change and its verification are recorded in `docs/design.md`.
D3D-78: keep storage-only 1D-array bindings separate from upstream multisample SRVs. Validate typed views and W ranges; use sliced storage views with tagged coordinates, typed loads, stores and R32_UINT atomics. Keep clears safe and align the existing descriptor, RGB9E5 and shader regressions with the runtime contract.

Reconstructs bf9201c8 and the implementation portions of the original branch through a56b8589. D3D-63 resource creation already comes from upstream c7d5f8e8.
Register the descriptor smoke test with CTest and run synthetic dispatches against the real bindless set and WARP. Cover sliced-volume atomics, typed mip loads, and runner failure/skip handling; document the ABI, limits, and test procedure.

Reconstructs 6429d472, 8dc50af2, and the test and documentation resolutions through a56b8589.
Coherent 1D and 3D loads and all 1D-array loads can issue OpImageRead on Unknown-format storage views. Require both per-format access bits before registering the view or writing its descriptor, while preserving the formatted RGB9E5 exception.

AI-assisted. Verified the synthetic UAV readback and format refusals with Vulkan validation on RTX 4090 (621.01) and UHD 770 (101.7088).
PSOs a session built were compiled again by the next one. The layer already read the `pipelines` stage's
pipeline_cache.bin beside gta6rt.exe (#367), but never wrote anything back.

Now the runtime keeps its own cache in pipeline_cache.session.bin beside it: vkGetPipelineCacheData on device
teardown, then vkMergePipelineCaches into the cache at the next launch. Vulkan takes one blob per create, so the
offline seed and the session file are two caches merged together rather than one file. They are deliberately
separate files, so a run can never replace the multi-GB corpus cache with the handful of pipelines it compiled.

The write is capped at 256 MiB (LEONIDA_PIPELINE_CACHE_BYTES=<bytes>, 0 turns it off): a cache seeded from the
corpus comes back as the whole union, which is not worth rewriting at every exit; past the cap the previous
session file is left alone. A foreign or truncated session file is ignored with one line, and so is a failed
write (a read-only install directory).

The header check moves to runtime/src/pipeline_cache_store.h, shared with the offline seed and tested without
Vulkan (runtime/test/pipeline_cache_store_test.cpp: the limit parser and the 32-byte
VkPipelineCacheHeaderVersionOne comparison). write_pipeline_cache_file moves from runtime/test to runtime/src so
the runtime and vk_pipeline_check use the same staged write.

Not run: this machine has neither MSVC nor the Windows SDK, so the shim itself is compiled by the Windows job.
The portable test passes here (23/23 ctest on Linux). The end-to-end check needs a Vulkan GPU: run
d3d12_vulkan_device_test twice and look for "wrote N bytes to pipeline_cache.session.bin", then "merged N bytes"
on the second run.
A rectangle list is three corners; the fourth is v2 + v3 - v1 for the position and every interpolant, after the vertex stage. A quad list is four vertices per quad. Vulkan has neither. A PSO with topology type 19 was refused (E_INVALIDARG) and the two list topologies drew as a plain triangle list.

Rectangle list: the PSO becomes a triangle-list pipeline with a generated geometry stage (src/rect_list_geometry.h), built from the vertex shader's own SPIR-V outputs, that emits the strip v1 v2 v3 v4. Quad list: one triangle fan per quad (0 1 2, 0 2 3), drawn with the index values 4q..4q+3 so the translated vertex id (VertexIndex - BaseVertex) is right; non-indexed draws read a shared 0, 1, 2, ... buffer reserved in the arena.

Facts from xvalkyrie (GPL-3.0, commit 53af7df77c10); no code copied.
Depends on: #7384
AI-assisted: yes (Codex)
When VK_EXT_external_memory_host refuses the title's pages (write-combined or uncached pages, pages not committed yet, no extension, or the driver's import budget: about 64 MiB on an RTX 3070 Ti), the fallback was an ordinary DEFAULT buffer with neither the title's VA nor its data, so the title's descriptors resolved to nothing (slot 70 wrote a null SRV) and UI draws sampled nothing.

The fallback is now a host-visible buffer (VRAM through Resizable BAR where upload buffers use it) whose console VA is the title's address, filled from the title's pages at creation and again before every submission of command lists (VulkanContext::set_before_execute, called from VulkanQueue::execute_now). Only committed, readable pages are read; the rest is zero. GPU writes to the shadow are not copied back.

The first per-submission copy of each buffer size is timed and logged. Write-combined pages are read with MOVNTDQA: memcpy read 64 MiB of them in 253 ms on a Core i9-13900K, MOVNTDQA in 13 to 17 ms.

Tests: write-combined, uncached, 64 MiB write-combined and half-committed ranges in d3d12_existing_heap_test, two patterns over two submissions each, 0 validation errors on an RTX 4090.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clang's baseline x64 target cannot inline _mm_stream_load_si128 into copy_guarded. Give only that function the target feature the existing intrinsic requires; keep the MSVC path and global build flags unchanged.

Depends on: #8225. Claimed in #8186, comment7110252121. AI-assisted: yes (Codex).
Xbox device slot 133 places a buffer at the title's own VA, about 1.5 TiB on
Windows, while a translated shader computes heap_base + console VA with
heap_base the arena's device address. A root view or V# naming that VA
missed the buffer. The layer now translates an address inside a
title-placed buffer where it writes it (root CBV/SRV/UAV, CBV and buffer
SRV/UAV V#s): to the arena offset of the slot-133 shadow, which now lives
in the GPU address arena when it fits, or to an import's device address
minus heap_base. New tests: title_va_alias_test, d3d12_title_va_test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A root view or buffer V# may name the title's own memory outside any
slot-133 buffer (a per-frame constant ring, #8862 section 3.5). The
layer now makes a 64 KiB-aligned window of those pages in the GPU
address arena, copies it before every submission like a slot-133
shadow, and names that copy instead: for root views when set, for V#s
the layer writes, and for buffer V#s the title writes into a bound
CBV/SRV/UAV table itself, rewritten in place before each submission.
Counters per kind, LEONIDA_TITLE_WINDOWS_MB caps the windows (64 MiB).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The xmem shims record what they hand the title (XMemAlloc, XMemAllocDefault,
XMemVirtualAlloc, the title's VirtualAlloc); an address outside those ranges
is left as it was and counted. The submit-time scan reads only the
CBV/SRV/UAV slots the bound table's root signature declares, and its cost
is accumulated per ExecuteCommandLists. Section 3.3 describes the three
places addresses are replaced and the two kinds of copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Taken from the follow-up patch of @matheuskshn (930e78a2, tested by them on an RTX 4070 Ti: replay_quad_list_test fails the two non-indexed cases on a6b31d51 and passes with it). Re-run here: replay_quad_list_test and d3d12_rect_list_test exit 0 on the pod (Wine, RTX 4090).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The FidelityFX upscaler programs hold 89 such words in 8 programs (docs/fspx.md); the translator already models the form but the listing could not carry it, so the programs were refused as a fall-through into undecodable words.
The stack is ladder-frame (ASTROWwwW's integration of the retail boot pull requests) with the old pull requests
7604, 7286, 7584, 6446, 8591, 7384, 7535, 7448, 9137 and 9419 and local fixes on top. main carries many of those
commits as ancestors without their content, so the merge was made against main's tree, not its history: nothing
main dropped is dropped again here.

Resolved by hand:
- d3d12_xs_device.cpp and frame_pacer.h: the stack's Xbox-ABI layer, plus main's uncapped pacer and its two new
  registration hooks (set_placed_at_va_pages_hook is called before slot 133's handler; the console descriptor
  heap handler is stored but slot 14 still uses the title-backed heaps of old PR 7021).
- xmem.cpp, xmem_test.cpp: the stack's run-mapped physical pages. main's commit-on-touch xmem with the two
  view-protection fixes it lost (7e8e3c1db, 954fcb106) boots to 50,468 pipelines and then fails a submit with an
  unknown resource, so it is not used here yet.
- acphal.cpp, acphal_test.cpp, vulkan_replay.h (acceleration structure copy), README: main's.
- CMakeLists.txt, build_runtime.ps1, d3d12_com.cpp, d3d12_vulkan_device.cpp, shader_library.h, docs: both sides.

Measured (Linux, Wine 11.21 staging, RTX 5070 Ti, driver 615.78.08, clang-cl 22.1.8 + xwin, own 1.0.2.1 copy,
network off, LEONIDA_GRAPHICS_STAGE_LAYOUT=1, 300 s): 50,470 pipeline states created, 197,998 ExecuteCommandLists
with none failed, 148,467 DrawInstanced, 99,008 PresentX.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
- xmem.cpp: rt::xmem::commit_physical_range and commit_physical_pages exist for the run-mapped xmem too (pages
  are committed when allocated, so they only check the range), and main.cpp registers the slot 133 hook as main
  does.
- vk_test_device.h: VK_EXT_external_memory_host and host_pointer_alignment are back next to the A8 render
  target probe; d3d12_existing_heap_test and d3d12_xmem_placed_test use them.
- xs_proxy_mock_test.cpp: the stack's version, which tests the proxy that is in the tree (the automatic merge
  left two list mocks in one switch).
- d3d12_xs_device.cpp: no include of vulkan_replay.h, which the proxy tests without Vulkan headers could not
  compile, and the diagnostic that needed it is gone.

Every target builds with clang-cl 22.1.8 + xwin.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
d3d12_rect_list passes again. The other rule stays behind the switch as an open question: it is the one that
covers the target for the retail title's full-screen rectangle draws.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
make_game.py and tests/test_library_shaders_stage.py are main's (parallel library translation, the shard plan,
verify_fspx_key_clash), with the exe_shaders call kept. shader_library.h still loads the exe folder after
library; shader_library_test keeps one copy of the library case.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
- The "[rt] localdbg:" lines and the experiment switches are gone: LEONIDA_RECT_GREEN, LEONIDA_RECT_VS,
  LEONIDA_RECT_NOGS, LEONIDA_RECT_NOCULL, LEONIDA_RECT_FORCE, LEONIDA_VTX_TEST and LEONIDA_DEBUG_CLEAR, with the
  hard-coded test shader words. vulkan_replay.h returns unresolved_resource directly again.
- The descriptor write-through and the table mirror for title-backed heaps only copy between committed memory
  they may read and write. A handle that is only a number (xs_proxy_mock's heaps) is left alone; the test
  crashed there before.
- A slot 70 view over memory no buffer holds becomes a raw buffer view only when the title-memory registry
  (title_va_alias.h) holds the whole range, instead of any address below 4 GiB. xs_proxy_mock's null-view case
  passes again.

Still switches: LEONIDA_GRAPHICS_STAGE_LAYOUT, LEONIDA_DESC_MIRROR, LEONIDA_SLOT70_TITLE, LEONIDA_RECT_FOURTH.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
(cherry picked from commit 355201c51e)
The retail title asserts when its first full-screen render targets leave more than 2 MiB of a fixed budget unused (docs/retail_boot_chain.md, #6982). The PC size is about width x height x element bytes; the console takes whole RDNA2 SW_64KB tiles. Slot 25 adds the difference per render target description and never lowers a size. Depends on #6973.

(cherry picked from commit 8897855399)
The title's descriptions carry the Xbox layout word and flag bits above the PC ones. Slot 25 now passes a copy with PC flags and a PC layout; the title's array is not written. Depends on #7078.

(cherry picked from commit c7ca0f2d1c)
(cherry picked from commit 359390833f)
On the console a committed resource's memory is allocated with XMemAlloc, so it goes
through the title's __XMemAllocationHooks__. The retail title budgets its first
full-screen render targets with a per-thread hook that bump-allocates out of a range it
reserved and asserts that less than 2 MiB is left; PC resources never allocated through
the hooks, so the assert always fired. Slots 76 and 127 now allocate the slot-25 size of
each resource through the hooks, held by the resource with SetPrivateDataInterface and
freed when it is destroyed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit ae322dafc5)

Adapted to main by Mumogg: the lease size is the later form of this series (d61755d4d, a render target's console
tile size, else the PC size), since console_render_target_extra is gone after 359390833.
The retail title creates five one-argument command signatures with no root
signature at startup (device slot 41, CreateCommandSignature at its PC
position). One has the console argument type 105 and a 12-byte stride, next
to a DISPATCH and a DISPATCH_MESH of 12 bytes. The PC layer refuses the
unknown type, which is stop 19 of the RT-5 boot measurements.

Read statically from the title's call sites (shapes only): the two
ExecuteIndirect sites of that signature pass MaxCommandCount 1 and an offset
into the same argument buffer as the DISPATCH sites. Right before, they set
the same compute state as the DISPATCH path (pipeline, compute root signature,
tables, constants, SRV and UAV); they record on a second command list of the
title's context. So the argument is taken as a D3D12_DISPATCH_ARGUMENTS.

Slot 41 now has its own handler. A description that holds type 105 is copied
with that type replaced by DISPATCH (logged once). Any other description is
forwarded as the same pointer. What the console does differently for type 105
is left open in docs/d3d12_vulkan.md (section 4.9).

xs_proxy_mock_test: a two-argument description (a root constant, then type
105) reaches the PC slot 41 as a copy with DISPATCH, the same stride, count,
root signature, IID and output, and the caller's description is untouched; a
PC description is passed through unchanged. With main's d3d12_xs_device.cpp
the new check fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4c04c0f4e3)
105 is outside D3D12_INDIRECT_ARGUMENT_TYPE's range [0, 15], so clang-cl
rejects a constant expression that casts it to the enum (reported by
umnitus on #7163). The handler now reads each argument's Type field as a
uint32_t through memcpy and compares it with 105; the test writes and reads
the raw value the same way, and the mock records it the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 084c8c60e7)
The Vulkan layer created signatures for draw, draw-indexed and dispatch only and answered E_NOTIMPL
for DISPATCH_MESH, which the PC runtime creates on any mesh-shader tier 1 device. A title that
creates such a signature at startup and asserts on the result stopped there.

The signature is created when the device has VK_EXT_mesh_shader (MeshShaderTier 1), as a new
IndirectKind::dispatch_mesh (the name and value #3777 uses, so the two merge). ExecuteIndirect with
it records nothing yet and says so once; #3777 replays it as vkCmdDrawMeshTasksIndirectEXT.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit efc347830b)
The retail title calls device slot 61 as CreateSamplerX(desc, dest handle), once
per sampler, after its descriptor heaps exist (stop 20 of the RT-5 boot
measurements in the coordination issue). The generic thunk forwarded it to the
PC slot 61, which is CreateMetaCommand, so the sampler was never written.

Slot 61 now has its own handler, like 62 and 67. It passes the description's
PC D3D12_SAMPLER_DESC prefix and the handle to the PC CreateSampler (slot 22).
That was enough to get the title past this call under Wine. Whatever follows
the prefix in the console description is not known and is not read. A null
description is skipped and logged once. A handle in the title's own heap range
is #7021's translation.

xs_proxy_mock_test: slot 61 reaches the mock's slot 22 with the same two words
and never its slot 61; a null description reaches nothing. With main's
d3d12_xs_device.cpp the new check fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e22994464b)
The proxy also serves host callers: d3d12_vulkan_device_test drives the Vulkan device through it,
and its ID3D12Device5::CreateMetaCommand call (PC slot 61) landed in proxy_create_sampler_x
(found by nullmarsh on #7115: the test stopped at line 5763 instead of main's known line 6574).

Slot 61 now checks the caller's return address with a classifier the runtime installs
(set_console_caller, the name #7490 uses): D3D12XboxCreateDevice installs
rt::shims::mapped_image_base, so only a caller in an image the guest loader mapped gets
CreateSamplerX. Any other caller, and every caller when no classifier is installed, is forwarded
to the PC slot 61.

xs_proxy_mock_test checks all three cases: no classifier (PC slot 61), a guest caller (PC
CreateSampler with the same words; a null description skipped) and a host caller under an
installed classifier (PC slot 61). d3d12_vulkan_device_test again stops at line 6574, as on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 8f756ebe048af042638ce51a61490f35f4f44ee3)
(cherry picked from commit c915e1da45)
The retail title calls slot 74 once; the PC slot 74 reads the first pointer as kinds and returns E_INVALIDARG, so the title hits an int3. The proxy handler does not call the PC device, writes nothing, logs the three words once, and yields to an env slot override that moves a route onto 74.

(cherry picked from commit cdeee35aa8)

Adapted to main by Mumogg: the queue route inside route_xbox_device_slot calls proxy_create_command_queue_xbox
(the 32-byte description of 0cde63d61), as the inline route did before this commit moved the routes into a
function.
The stand-in also took a host's ID3D12Device9::ShaderCacheControl call through the proxy and answered S_OK
without reaching the device (found on native Windows by BadgersMC in the review of this change). Slot 74 now
asks the caller classifier slot 61 uses (set_console_caller): a caller in an image the guest loader mapped gets
the stand-in, any other caller, and every caller when no classifier is installed, is forwarded to the PC slot 74
or refused past the PC device's table.

xs_proxy_mock_test: the guest case under a classifier, and the host case with a classifier and with none, on a
device that has ShaderCacheControl and on one that does not.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
(cherry picked from commit e925b63455)

Adapted to main by Mumogg: main has command-list proxies, so the shared execute function replaces them by their
real lists in a copy of the array (UnwrappedArray), for the console slot 35 as for the PC slot 10, whose test
failed otherwise. The slot 35 mock case passes two mock lists instead of two numbers and checks that they arrive
and that the caller's array is not written.
(cherry picked from commit e29e989980)
The retail title resets its command lists through list slot 139, with (allocator proxy, pipeline state). main's
slot map had no entry for it, so the call was recorded and dropped and the list stayed closed. The map sends it
to the PC slot 10, and the unwrap keys on the PC slot, so console slot 10 and console slot 139 both hand the real
list its real allocator (and a wrapped pipeline state the same way) and re-pin the inline cursor.

The mapping and the unwrap rule are those of ef9d0759d (Nolan Cotter; measured by Pipodi), written again for
main's list proxy, where that commit does not apply. xs_proxy_mock_test checks the map entry and a slot 139 call.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Queue slot 18 is ID3D12CommandQueue::GetDesc on the PC: a struct return that writes a 16-byte description through
the hidden pointer. The retail title calls slot 18 with one pointer to 8 bytes, the shape of
GetTimestampFrequency(UINT64*), which the console queue has there (two methods are inserted at 14/15, so the PC
slots 16 to 18 sit two later). Forwarded as GetDesc, the call wrote a description over the title's 8 bytes and
what follows them; the title then went wrong a little later, after its first submission.

The title's call (set_console_caller, as device slots 61 and 74) now goes to the PC slot 16. A host caller, and
every caller when no classifier is installed, keeps the PC GetDesc.

The reading of slot 18 is that of the console queue work in old PR 2490 (Nolan Cotter), which answers an
undetected slot 18 as the frequency getter because it is the only reading that cannot overrun its argument. That
work's layout detection does not apply to main's queue proxy; this is the one rule the boot needs, written for
it. xs_proxy_mock_test: the guest call reaches the mock queue's slot 16 with its pointer and leaves the words
around it; a host call, with a classifier and with none, reaches slot 18.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
The retail title presents through command-queue slot 32, past the PC queue's 19 slots, so main refused it with
E_NOTIMPL and nothing could be shown. The slot now calls XboxPresentation::PresentX (xbox_present.h) with the
title's plane count, planes and parameters. The first call on a device builds a window and the Vulkan layer's
presenter for it, once; a device that cannot present answers S_OK and shows nothing, so the title's frame loop
runs either way. The mock and COM builds of this file have no presenter and answer S_OK.

The wiring follows old PR 2490's (Nolan Cotter, 2be25cee2), written again for main's queue proxy, where that
commit does not apply. Not carried over: the queue layout detection (the older layout has PresentX at slot 30)
and presenting into the title's own window (old PR 8591); the window here is one this layer creates.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Device slot 80 (WaitFrameEventX, from #6935) numbered its tokens with a
counter of its own, while XboxPresentation's pacer refuses any token above
the ones it issued itself. A title that waits through the device and
presents through the device's XboxPresentation therefore had every
PresentX refused with E_INVALIDARG once its tokens ran ahead of the
pacer's.

leonida::FrameTokenSource is now the counter both use: a pacer takes an
optional shared source (a standalone pacer still owns its own and numbers
as before), the device proxy owns one and exposes it through
rt::d3d12_xs::device_frame_tokens, and XboxPresentation passes a given
source to its pacer. A token that was never issued is still refused.

Reported by rafaelpssz in #7496.

(cherry picked from commit afb14d56c6)

Adapted to main by Mumogg: main's uncapped pacer path issues its token from the shared source too, the device
proxy keeps the PresentX state next to the token source, and the queue's PresentX hands the device's source to
its XboxPresentation, which is what makes the title's tokens valid there.
The coverage gate asks for every queue slot to have been called, and skips the overridden ones in its sweep of
the refused tail. Slot 32 is overridden since the PresentX wiring, so nothing called it and the gate failed
("queue slot 32 never called"). The test now calls it where it calls the console ExecuteCommandLists slot: this
build of the proxy has no presenter, so the answer is S_OK.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
XGSuggestSwizzleMode and every texture-computer slot returned E_NOTIMPL, so the
title's texture layout and copy calls did nothing. They now run on a model of
the GFX10 texture layouts (runtime/src/console_texture_layout.h, AMD addrlib's
rules for the linear, 256 B, 4 KiB and 64 KiB modes): the suggested mode, the
layout structure (slot 2), element offsets (slot 6), copies into and out of a
subresource (slots 8 and 9) and the 64 KiB tiling (slot 10).

A description the model cannot lay out still gets a computer in *out (with
E_INVALIDARG), as before, because two measured callers use *out without
checking the HRESULT. Not modelled: compression metadata planes and the XOR
and MSAA modes' addressing (E_NOTIMPL).

The layout model, the computer's method table and the layout structure are
ported from Marvisak/VIctory (GPL-3.0), crates/victory-formats/src/texture.rs
and crates/victory-hle/src/modules/xg.rs at d2a4bae1f, credited in the files;
the addrlib notice is kept. xg_xs_test now checks the model (hand-checked
addresses, mip tails, a two-plane depth-stencil, a bijection and round trip
over every element of ten layouts) and the shim's slots: 106 checks, MSVC /W4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Create and dispatch the Win32 window on its own thread. Shut that thread down after the presenter has released the surface and test window messages and closure independently of the submitting thread.
- s_bitreplicate_b64_b32 with a VCC destination: lane L gets S0 bit L // 2,
  stored as mov64 stores a mask into VCC (EXEC already took this path).
- s_flbit_i32_b64 of a lane mask reads the wave's whole mask (wave_mask), as
  s_ff1_i32_b64 does; s_flbit_i32_i64 of a mask stays Unsupported.

Both occur in pipeline-library compute programs that the retail boot creates.
Tests: tests/semantic/test_lane_mask_bitreplicate_flbit.py runs both on every
lane of a wave64 (run_workgroup); docs/design.md contract rows updated.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
llvm-mc skips the first word of s_buffer_load_dwordx8 into s[100:107], an image resource in s[100:107] or a buffer resource in s[104:107] and leaves the second word as junk, so translate() refused those shaders (reachable instruction with normalized encoding) or translated them without the load. restore_vcc_tuples reads the uncovered words of the code range with rdna2_decode and keeps only instructions whose operands hold a VCCTuple list, the form the translator already takes. Other undecodable words are unchanged.
Clamp blob[at:at + 20] to min(at + 20, stop) and check at + nbytes <= stop so multi-dword NSA MIMG instructions starting near code_end cannot read trailing bytes past code_end. Adds synthetic 12-byte NSA1 regression test.
A rectangle list is three corners; the fourth is v2 + v3 - v1 for the position and every interpolant, after the vertex stage. A quad list is four vertices per quad. Vulkan has neither. A PSO with topology type 19 was refused (E_INVALIDARG) and the two list topologies drew as a plain triangle list.

Rectangle list: the PSO becomes a triangle-list pipeline with a generated geometry stage (src/rect_list_geometry.h), built from the vertex shader's own SPIR-V outputs, that emits the strip v1 v2 v3 v4. Quad list: one triangle fan per quad (0 1 2, 0 2 3), drawn with the index values 4q..4q+3 so the translated vertex id (VertexIndex - BaseVertex) is right; non-indexed draws read a shared 0, 1, 2, ... buffer reserved in the arena.

Facts from xvalkyrie (GPL-3.0, commit 53af7df77c10); no code copied.
Taken from the follow-up patch of @matheuskshn (930e78a2, tested by them on an RTX 4070 Ti: replay_quad_list_test fails the two non-indexed cases on a6b31d51 and passes with it). Re-run here: replay_quad_list_test and d3d12_rect_list_test exit 0 on the pod (Wine, RTX 4090).
std::array::size() is a size_t, and the two constants made from it are 32-bit. MSVC warned
once in d3d12_vulkan_device.cpp and once in every file that includes vulkan_replay.h: 124
C4267 warnings in a Windows build of the runtime and its tests. The values (6 indices for a
quad) are unchanged.

AI-assisted (Claude Code; Claude Opus 5.5 and Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
ScratchBuffers creates every chunk as a transfer source and destination, which is all the
staged copies need. Its owner can now add usage flags: the expanded indices of indexed quad
lists (next commit) live in the same scratch, as an index buffer that a compute pass writes
through its device address. The default is unchanged.

vulkan_scratch_test checks the usage a chunk is created with, with and without the flags.

AI-assisted (Claude Code; Claude Opus 5.5 and Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
An indexed quad list was one triangle fan per quad over the application's index buffer.
That is wrong in two ways, both measured on #207 (RTX 4070 Ti there, RTX 4070 SUPER here):

- A fan's triangles are (v1 v2 v0) and (v2 v3 v0), and Vulkan takes a flat input from a
  triangle's first vertex. So a quad showed its second and third vertex, never its first:
  a quad with a red first vertex came out black and blue, 0 of 4096 pixels red.
- One draw per quad runs every instance of quad 0 before quad 1. D3D12 draws instance by
  instance, so where instances overlap the wrong one ended on top (2048 of 4096 pixels).

Neither can be fixed inside that scheme (VK_EXT_provoking_vertex cannot name a fan's hub
either), so the indices are rewritten: a compute pass (quad_index_expand.comp) reads the
application's index buffer on the GPU and writes (i0 i1 i2) (i0 i2 i3) for each quad as
32-bit indices into copy scratch, and the draw is one indexed triangle list over that
scratch with the application's instance count, base vertex and first instance. Both
triangles start at the quad's first vertex, like the non-indexed path.

- The host never reads the indices: a copy or a shader earlier in the list can have
  written them. The pass runs before the draw's rendering scope, between a barrier for
  those writes and one for its own, and between two segments of an active
  pipeline-statistics query, as the other helper dispatches do (D3D-162).
- 16-bit and 32-bit indices, read as whole words, so a 16-bit view at an address of
  2 modulo 4 works. Index values are copied as they are: VertexIndex - BaseVertex is still
  the application's index.
- The strip-cut values are ordinary indices, as in every list topology. An index past the
  view reads 0, as in D3D12, and the pass reads nothing past the view. A draw's last one to
  three indices are dropped.
- It needs bufferDeviceAddress. Without it, or inside a statistics query that cannot be
  split, the list is refused as unsupported.
- vulkan_topology(19) is a triangle list for both paths; nothing draws a fan any more
  (MoltenVK has no fans).

replay_quad_list_test replays indexed draws through prepare() and the real expander on a
recording device: one dispatch before the rendering scope and one draw in it, the push
constants for both index sizes, the view's end, the split of a draw larger than one
dispatch, the refusals, and the order inside a statistics query.

AI-assisted (Claude Code; Claude Opus 5.5 and Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
d3d12_rect_list draws its quads without an index buffer, so it could not see what #207's
review measured on indexed ones. d3d12_quad_index_test draws six 64x64 frames through
DrawIndexedInstanced with IASetPrimitiveTopology(19) and compares every pixel bit for bit:

  0  non-indexed control
  1  16-bit indices, a quad whose corners all differ: the first vertex's colour everywhere
  2  32-bit indices from StartIndexLocation 3
  3  16-bit indices from StartIndexLocation 5 (an address of 2 modulo 4), BaseVertexLocation 3
  4  two quads and two instances whose quads overlap: the later instance on top
  5  a view that ends inside the second quad: its last two indices read 0

The index buffer is in a DEFAULT heap and filled by a copy in the first list, so only the
GPU can read it. Two translated fixtures, like vs_m15 and ps_m15: vs_quad_inst.asm reads
the instance id (v3) to move and recolour each later instance, ps_quad_flat.asm reads its
colour with v_interp_mov, which makes the input Flat.

RTX 4070 SUPER (621.24), Windows 11, LEONIDA_VK_VALIDATION=1:
  on the six commits of #207: frames 1, 2, 3 and 5 match in 0 of 4096 pixels (black and
  blue, the second and third vertex), frame 4 in 2048, frame 0 in 4096; exit 1
  with the expansion: 4096 of 4096 in all six, 0 validation errors

run_gpu_tests.py lists the two fixtures as run by this test, and docs/testing.md names the
test (and d3d12_rect_list) among those that need llvm-mc and the SPIR-V tools.

AI-assisted (Claude Code; Claude Opus 5.5 and Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
The quad list entry of "Console rectangle and quad lists" described the fan per quad and
its two faults. It now describes both paths as one triangle-list draw, the compute pass
for indexed draws and where it runs, what it does with the base vertex, the strip-cut
values and indices past the view, what it needs, the measurement that replaced the fans,
and what is still not covered (ExecuteIndirect draws, which record no topology).

AI-assisted (Claude Code; Claude Opus 5.5 and Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
Carry only runtime/src/rect_list_geometry.h, byte-for-byte from 6aa8eb11c. The stage generator and its original commits are by tedin7 (#207, carried forward in #682). This makes the draw-time change buildable against main while the explicit rectangle/quad work is in review.
Select the geometry-stage variant when the input assembler requests an Xbox rectangle and cache it alongside the attachment-format variants. Keep a shared snapshot of the linked vertex program for that draw. Exercise alternating rectangle and triangle draws through the same PSO and compare the complete target after each switch.
The corresponding runtime views are assembled with the other first-run rendering dependencies.
Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic.

The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
Use the tagged pipeline variants and indexed quad expansion from #722 and #682 with the shared shader cache. Retain title-backed index uploads, cross-queue scratch sharing, amd64 console return conventions and the PC/console caller discriminator. The local shader build indexes native containers and includes the executable's embedded stages.
The integrated source already contains the committed and placed depth implementations and their GPU readback tests. Keep the additional D16/S8 and title-placed surface handling when reconciling the branches.
Keep completion batches with their owning Vulkan context. Test switching primitives, caller overrides, and the dynamic EXEC and uniform null-descriptor guards used for dimension-specific storage views.
Keep the desktop HRESULTs for Xbox-only formats. Check both console and desktop vtable callers in the mock, and exercise the full rectangle target for a derived PSO with a zero sample mask.
Seed eight words in the synthetic shader and check them in both GPU runners. Keep the desktop TFE load cases registered alongside the volume-view cases.
Use the validated console heap range when the title has no allocation hooks. Preserve partially committed buffer reservations, compare CBVs produced through the same ABI, and use the runtime's image robustness setting in the offline pipeline checker.
Retain the first-run origin-token poll and shared tokens alongside standard origin, vblank and flip events. Route attached presenter callbacks before the fallback window and dispatch local speech through the Windows provider with the upstream offline fallback.

The offline pipeline checker now enables the runtime mesh query feature for cache-producing runs. A controlled GPU comparison with the same compute shader changed from a miss to an application cache hit.
The known Xbox list interface can wrap a base desktop list and checks each forwarded slot. Detaching a managed presenter no longer falls back to a second window. Reset the integrated list counters with the rest of the device diagnostics.
The base is 8a242efeb, the merge of main and #984. 68 files conflicted; they were resolved in seven groups by
one rule: the same change in two forms keeps the base's form, everything only #939 has is kept, and where the
two solve one problem in two ways the base's is the frame and #939's plugs into it.

A, the Xbox proxy (d3d12_xs_device.cpp/.h, d3d12_xs.cpp, d3d12_xs_pso_stream.cpp/.h, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, device_proxy_test.cpp, queue_proxy_test.cpp): the base's files with #939's additions
ported in. Device slot 57 asks #939's NativeGraphicsFactory first and falls back to the base's
proxy_create_graphics_pipeline_from_native_code on E_NOTIMPL. Kept from #939: the providers (texture lease,
raw texture view, resource by address, constant view, descriptor mapping, depth-stencil UAV, texture pages),
the title-backed descriptor mirror, slot 13's feature answers, GPU labels on list slots 71/72. Dropped: #939's
duplicates of the boot ladder routes, its fallback window, its slot 133 stand-in.

A2 (xs_proxy_mock_test.cpp): the base's test with #939's slot 70 raw-buffer case; presentation cases follow
#939's rule that a device which ever had a handler has no queue fallback.

B1, the Vulkan device (d3d12_vulkan_device.cpp, d3d12_com.cpp/.h, shader_library.h, queue_families.h,
pipeline_cache_file.h, startup_trace.h): one lazy-pipeline mechanism, the base's; #939's pending_base_compile
and first_use_backend_pipelines dropped, prepare_on_bind and cold_graphics_compile kept. create_texture keeps
the base's signature; #939's deferred backing is folded into the base's placed-memory binder. #939's quad
lists as triangle indices.

B2, the D3D12 tests (d3d12_existing_heap, a8_dimensions, pipeline_cache_seed, title_va, rect_list,
shader_library, loader_tls_index0, draw, compute, xmem_placed, shader_library_corpus): the base's tests where
both carry the same case, #939's cases added (rebound tables, linear texture map, large vertex batch,
executable shaders, default A8 views).

C, the backend (vulkan_replay.h, vulkan_backend.h, vulkan_bindless.h, vulkan_scratch.h, vulkan_present.h,
rect_list_geometry.h, vk_test_device.h, vk_pipeline_check.cpp, vk_store_test.cpp, bindless_sizing_test.cpp,
replay_texture_barrier_test.cpp): the base's prepare_draw and lazy compute, its #1055 release rule and its
rectangle generator; #939's rectangle variants, GPU quad index expansion, 1D/3D and depth-stencil UAVs, the
label fence on the base's submit.

D, memory, services, presentation (xmem.cpp/.h, xg_xs.cpp, xg_xs_test.cpp, title_va_alias.h and its test,
main.cpp, frame_pacer.h, xbox_present.cpp/.h; xgameruntime_offline.cpp for one comment): the base's xmem with
#939's label hooks, file-backed sections and pin_mapped_data; both texture computers in xg_xs.cpp, the base's
answering first; --first-run-ui kept without host speech in its profile.

E, build, tools, docs (runtime/CMakeLists.txt, make_game.py, tools/rdna2spirv.py, tools/shader_disasm.py,
scripts, tests, docs; docs/README.md and tests/test_exe_shaders_stage.py beyond the conflicts): the base's
v_dot4 decode, #281's disassembler form and tests/semantic/test_fspx_dot4_op_sel_disasm.py dropped; the
base's executable-shader step with #939's cache fix; 366 registered tests.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The merged PlacedAtVaHandler keeps #939's seventh argument (the title's clear value, which the Vulkan device's create_placed_xbox_resource uses); the base's two test lambdas had six.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The merge keeps one first-use mechanism, the base's lazy pipelines; #939's DeviceInfo::first_use_backend_pipelines is gone from d3d12_com.h and vk_test_device.h, and these two tests still copied it. prepare_on_bind and cold_graphics_compile stay.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The merge had turned #939's opt-in round (on unless =0). The story-load boots of #984 were measured with the frame-event slots answered from the device's token counter, and handing them to the presentation without the title's interval makes the next WaitFrameEventX fail. So the base's behaviour is the default again and #939's hand-over, with the interval and origin event replayed to the pacer, is behind LEONIDA_FRAME_PACING=1 as on #939. The --first-run-ui profile sets it, so that profile keeps what #939 measured.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
No test covered the chain the merge builds for slot 57: #939's NativeGraphicsFactory first, the base's PC description path (CreateGraphicsPipelineState with the bare programs) when the factory answers E_NOTIMPL. The new case checks, on the mock device: no factory reaches the PC path; a factory answering E_NOTIMPL is asked once and the PC path then runs; a factory that succeeds is the answer and the PC path is not asked; E_INVALIDARG, E_OUTOFMEMORY and E_FAIL are returned as they are; an unreadable description is refused before the factory; removing the factory restores the PC path.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The merge commit was assembled from the resolver's copy of 20:23; its final copy of 20:34 differs in these places: a slot 133 texture is also registered under #939's title address, so a raw slot 70 view finds it instead of making a second image of the same pages; a lazy graphics pipeline re-applies #939's 4444 quantisation of the pixel shader when it re-reads its words; the UAV counter offset is added once; LEONIDA_GRAPHICS_STAGE_LAYOUT is on unless 0; Map asks #939's linear mapping first for a leased linear texture (changed in the next commit); an unused mutex is gone.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A slot 133 texture leased as linear has two answers to Map: the base's (the placement address, the title texture registry fills the image) and #939's (pinned pages, read-back of a GPU-written texture). The base's is what the retail boot ran through the intro movie and the story load on, and the video planes are such textures; #939's was measured to the first-run screens, which come before the movie. So the base's is asked first again, #939's first only with LEONIDA_LINEAR_MAP_FIRST=1, and a leased linear texture with no placement address (slots 76, 127) takes #939's mapping as before. xbox_linear_texture_map and xbox_linear_gpu_staging set the switch, so they still test #939's path.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Fourteen commits the #984 merge gained after 8a242efeb: its own failing tests (xmem_test under Wine, check_tls_index0, vk_bindless_grow, xs_present_lazy_test), the console-heap probe and the poke experiment behind their switches, Python tool fixes, and the title watchdog default. No conflicts.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
With the switch on, a leased linear texture takes #939's mapping and its result, not the placement address as a second answer: xbox_linear_texture_map expects Map to fail once the title's pages are unmapped, and the address would have been handed out there.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The merged device writes every constant-buffer V# in the console's form of 16-byte rows (the base's rule, which both measured boots had for the title's own views); #939 kept the byte-address form for a view made on the device itself. xbox_cbv_vectors and the rebound-table cases of d3d12_title_va_test expected #939's form for that producer. They now read the switch as d3d12_compute_test does, and xbox_cbv_vectors_raw runs the first with LEONIDA_CBV_RAW=1, which is #939's behaviour.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The merged image descriptor writer binds a Texture3D or Texture1D UAV only with VulkanDeviceInfo::robust_image_access (#939's rule: such views are read and written without a format), and the runtime's own device sets it wherever the GPU has the feature. The base's test of a slot 71 view of a placed Texture3D built its device without the flag, so the view was no longer bound and write_placed_texture_view answered false.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The base turns the console's depth family (DXGI 118 to 120) into the D24S8 family at every entry, so #939's
D16/S8 code was in the tree and unreachable. On a GPU without D24_UNORM_S8_UINT as a depth-stencil attachment
the D24S8 family is itself stored as D32_SFLOAT_S8_UINT, a third precision the title did not ask for, and that
is the AMD case, the one #939 was measured on. The device now decides when it is created: with a D24S8
attachment the base's mapping stays (the NVIDIA boots of #984), without one the family is kept and takes
#939's path (D16_UNORM_S8_UINT where the GPU has it, 16-bit quantised clears and stores).
LEONIDA_CONSOLE_D16S8=native or =d24 chooses for every GPU; the device logs which it took and what the GPU
offers. xbox_d16s8_storage and xbox_d16s8_surface ask for native (registered in the previous commit), so they
test #939's path on a GPU that has D24S8 too.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The base's early return for such a target came before #939's lines, so Format::rgba4_render_fallback was never set: #939's pixel-shader quantisation ran (it keys on the pipeline), its clear quantisation and its refusal of footprint copies did not. The flag is set now, so a clear stores what a draw would. The refusal of footprint copies is not taken as the default: the story-load boots of #984 ran with those copies made; LEONIDA_RGBA4_COPY_REFUSE=1 gives #939's refusal. Neither test device here lacks a 4444 colour attachment, so this path is exercised only on a GPU that does (NVIDIA).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The merge had taken the base's process-wide scan hook (title_va_aliases), which belongs to the first device that registered. A second device over the same GPU then had its tables scanned by the first: d3d12_rebound_second_device, a test of #939, failed on it. #939 scans through the context of the device (VulkanContext::set_table_scanner), which the merged device still registers. That one is asked first now and the process-wide hook serves a context without a scanner.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
CreateShaderResourceView asked for the image to tell a texture from a buffer. In the base that accessor binds a deferred placed image, so with prepare_on_bind the memory was bound before write_image_descriptor could remember the view, and #939's first-use path never ran (xbox_staged_texture_views, xbox_visible_texture_views). A texture that still waits for its memory is recognised without asking for the image. xbox_placed_texture_first_use expected a placed sampled texture to wait without prepare_on_bind as well; in the merge it waits only with it (the base backs every other title image when it is made), and the test says so.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The test of #939 sized its guest range through device slot 25 and expected at least the PC device's size. The merged slot 25 is the base's, which lays a console depth-stencil target out more tightly than the PC device (console_depth_stencil_size) because the title sums these sizes against a fixed pool. The range takes the larger of the two; the slot's answer only has to be valid.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
In the merge a vertex view that names title memory gets the base's buffer over those pages (make_title_buffer), kept until the device goes and holding a device reference each; #939 uploaded the bytes per submission and kept nothing. The large-batch run of d3d12_draw_test therefore no longer ends with one reference on the proxy. The other runs still check for exactly one.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
vs_quad_inst reads its root arguments from s0, the layout #939 had by default. The merged default is the console layout (from s8), which both measured boots ran with, so the test asks for the other one with LEONIDA_GRAPHICS_STAGE_LAYOUT set to 0. What it tests, the expansion of indexed quad lists, does not depend on the layout.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
run_tiny_first_run_ui clears two variables by passing them empty. Windows cannot hold an empty variable, so there they are unset; under Wine they exist, and the profile's size-only query reported them as set and kept them. The test failed that way on #939's head too. The profile now reads the first character, so an empty value gets the profile's default on both.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A completed label was stored only into a page that was read-write at that moment and dropped otherwise. The
base makes title pages read-only while a shadow or the geometry watch waits for the title's next write, so a
label for such a page was lost, and a title that waits for a completion label then waits for ever. The store
now announces the write the way a kernel write is announced (kernel_writes::begin_write): the layer opens the
pages it guards and copies them again at its next refresh. A page that is still read-only after that is the
title's own doing and the label is dropped as before; so are guard, no-access and decommitted pages and a
released allocation. The store moves out of the class as label::store_value so that it can be tested.

gpu_label_store_test (CPU only, registered as gpu_label_store) covers each of those cases with a stand-in for
the layer's opener.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The merge keeps two models of the console's texture layout: xg_xs_layout.h, which the XG computer answers the title with and the title-texture registry reads back with, and console_texture_layout.h, which the linear and tiled uploads of #939 read with. For 2D textures in seven formats, four modes and ten shapes the new case checks that both give one size, the same mip extents, and that what the first tiles the second detiles to the same rows, for every mip and array slice.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The whole-stage case of #939 failed on its own head and on the merge: its second run must do nothing, but the fake main translation wrote an index without the listing's entry and the fake FidelityFX index had no fspx_code_sha256, so both steps ran again. The fakes now write what test_bvh_shaders_stage and test_fspx_shaders_stage write for the same steps. 11 of 11 pass.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Layout::walk is private; detile() is the same copy.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
The slot 57 native pipeline description is adapted from enx/leonida at 5c175db90 on the original author's git mirror. The header now says so with the commit, GPL-3.0-or-later as a fork of this project, what was changed as #939 describes it, and that the server could not be reached on 2026-11-25, so the source and its licence were not read there. Comment only.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The same header as native_pso.h for the D3D12 part of the slot 57 path: enx/leonida at 5c175db90, GPL-3.0-or-later as a fork of this project, what was changed as #939 describes it, and that the source was unreachable on 2026-11-25. Comment only.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
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 <[email protected]>
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 <[email protected]>
#939 built the device's presentation with current_origin_poll, so a zero-timeout wait for the origin event answers with the newest passed origin; the merge had kept the base's three-argument call for every case. With the switch that hands slots 78 to 81 to the presentation, the pacer is now the one that tree was measured with; without it nothing changes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
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 <[email protected]>
The committed stand-in of slot 133 reads the word as a resource state, which is what the story-load boots had wherever the stand-in answered, and stays the default. The placed-at-VA handler of the same slot reads it as a D3D12_BARRIER_LAYOUT, and #939 measured the title passing 6 (SHADER_RESOURCE) for 1x1 targets, which as a state is INDEX_BUFFER | RENDER_TARGET. #939's reading is now behind the switch: CreateCommittedResource3 with the layout as given on a device with ID3D12Device10, else the legacy state of the layout. xs_proxy_mock_slot133_layout runs #939's cases in a process of its own.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:29:25 +00:00
github manually merged commit d9674fca8c into gh-pr/939/base 2026-11-26 09:29:26 +00:00
Author
Owner

@⁠towade on GitHub · 2026-11-24 20:19 UTC · original · edited 2026-11-26 07:16 UTC

checked: eb6a08cd3 built and run as the runbook says, on two GPUs neither of the tested machines had. Windows 11 26300, MSVC 19.44 (CMake + Ninja, -DLEONIDA_REQUIRE_VULKAN=ON -DLEONIDA_D3D12_SHIM_TESTS=ON, no SDL3), own 1.0.2.1 copy, a fresh work folder from this branch's make_game.py --stages check,shaders,runtime (47 min, exit 0: 26,503 main, 1,793 pipeline library, 22 FSPX, 52 BVH, 10 executable programs). Launched with --first-run-ui <exe> --trace --trace-d3d12, the executable's network blocked, stopped after 180 s. Counts only.

AMD Radeon RX 9070 XT (RDNA4, 32.0.32029.2010) Intel UHD 770 (Xe-LP, 32.0.101.7092, no mesh shaders)
end still running at 180 s, no exception the title's int3 after 10 s
D3D12 calls 91,670 1,656
PresentX ok / failed 130 / 0 0 / 0
ExecuteCommandLists ok / failed 130 / 0 0 / 0
pipeline states ok / failed / unsupported 68,520 / 0 / 0 0
DrawInstanced / DrawIndexedInstanced / Dispatch 190 / 137 / 36 0 / 0 / 2

On the RX 9070 XT, PresentX uses the title's own window and the presents are spread over the run: 57,572 of the 68,520 pipeline states are created after the first present, so the low present count is pipelines still being built on demand. The run logs a few remaining refusals: some slot 67 calls with large kind-6 blobs, a depth-stencil UAV plane of format 56, a view format 119 and an RTV format 28.

On the UHD 770 the run stops at the same window/settings guard as on main and #321 on this GPU (1,655 calls there), so this branch doesn't change that stop.

What the window shows on the RX 9070 XT. In a second run (same counts: 204 PresentX ok, 0 failed, no exception) I captured the title's window at 60, 120 and 170 s (3660x1940). All three show the milestone this PR describes: a plain dark background and, at the bottom right, the controller-prompt row with two button prompts (Y and A), legible and in the system language (German here). The picture doesn't change between 60 and 170 s. I'm not attaching the screenshots, since they show the title's own interface.

Not checked: input (no controller connected, no keys pressed), anything past 180 s, and the run without --trace-d3d12.

AI-assisted (Claude Code).

**@⁠towade** on GitHub · 2026-11-24 20:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7143370974) · edited 2026-11-26 07:16 UTC checked: `eb6a08cd3` built and run as the runbook says, on two GPUs neither of the tested machines had. Windows 11 26300, MSVC 19.44 (CMake + Ninja, `-DLEONIDA_REQUIRE_VULKAN=ON -DLEONIDA_D3D12_SHIM_TESTS=ON`, no SDL3), own 1.0.2.1 copy, a fresh work folder from this branch's `make_game.py --stages check,shaders,runtime` (47 min, exit 0: 26,503 main, 1,793 pipeline library, 22 FSPX, 52 BVH, 10 executable programs). Launched with `--first-run-ui <exe> --trace --trace-d3d12`, the executable's network blocked, stopped after 180 s. Counts only. | | **AMD Radeon RX 9070 XT** (RDNA4, 32.0.32029.2010) | **Intel UHD 770** (Xe-LP, 32.0.101.7092, no mesh shaders) | |---|---|---| | end | still running at 180 s, **no exception** | the title's `int3` after 10 s | | D3D12 calls | 91,670 | 1,656 | | `PresentX` ok / failed | **130 / 0** | 0 / 0 | | `ExecuteCommandLists` ok / failed | 130 / 0 | 0 / 0 | | pipeline states ok / failed / unsupported | 68,520 / 0 / 0 | 0 | | `DrawInstanced` / `DrawIndexedInstanced` / `Dispatch` | 190 / 137 / 36 | 0 / 0 / 2 | On the RX 9070 XT, `PresentX` uses the title's own window and the presents are spread over the run: 57,572 of the 68,520 pipeline states are created after the first present, so the low present count is pipelines still being built on demand. The run logs a few remaining refusals: some slot 67 calls with large kind-6 blobs, a depth-stencil UAV plane of format 56, a view format 119 and an RTV format 28. On the UHD 770 the run stops at the same window/settings guard as on `main` and #321 on this GPU (1,655 calls there), so this branch doesn't change that stop. **What the window shows on the RX 9070 XT.** In a second run (same counts: 204 `PresentX` ok, 0 failed, no exception) I captured the title's window at 60, 120 and 170 s (3660x1940). All three show the milestone this PR describes: a plain dark background and, at the bottom right, the controller-prompt row with two button prompts (Y and A), legible and in the system language (German here). The picture doesn't change between 60 and 170 s. I'm not attaching the screenshots, since they show the title's own interface. Not checked: input (no controller connected, no keys pressed), anything past 180 s, and the run without `--trace-d3d12`. AI-assisted (Claude Code).
Author
Owner

@⁠towade on GitHub · 2026-11-24 20:52 UTC · original

Follow-up to my run above, now with an Xbox Wireless Controller paired over Bluetooth (SDL names it "Xbox One S Controller", 045e:02e0). Same head eb6a08cd3, same work folder, RX 9070 XT only, --first-run-ui <exe> --trace --trace-d3d12, the executable's network blocked, stopped after 180 s. A person pressed A and Y on the pad while the controller-prompt row was on screen.

Without SDL3 (the build from my first comment): the import list shows no shim for GameInput.dll!#1, so it binds to the host's GameInput.dll. The presses had no visible effect. That run also ended early: at about 103 s two write access violations inside the title's video library, then the title's int3 at 106 s. The two earlier runs without a pad did not show this, and neither did the SDL3 run below, so it is intermittent and I can't tie it to the input.

With SDL3 (-DLEONIDA_SDL3_FETCH=ON, the pinned 3.4.20, otherwise the same options):

RX 9070 XT, SDL3 build
end still running at 180 s, no exception
PresentX ok / failed 212 / 0
GameInput.dll!#1 bound to the shim
shim SDL 3.4.20 gamepads, pad connected as player 1, keyboard pad as player 2; "no raw HID" for the pad (XInput interface, as the log explains)
button presses the shim reports from the pad 7 (input in use: Xbox … button press)
what the window shows the same dark background with the two prompts (Y and A) bottom right, from about 90 s to the end

So the presses reach the shim, but the screen doesn't react to either button, and apart from the shim's own lines the log shows nothing new after them: no xgameruntime line, only the frame loop.

What the title asks GameInput for. To see whether the title reads the pad at all, I added a local trace to the shim (not part of this PR: a log line for the first three calls of each method and then every power of two, behind an environment switch) and ran twice more, same setup:

  • At start the title calls GameInputCreate and RegisterDeviceCallback(kind = gamepad, status = connected, blocking enumeration). That call comes before SDL has reported the pad, so the enumeration finds nothing and the pad arrives through the callback afterwards. Later it registers a second device callback for the keyboard kind.
  • From about the time the controller-prompt row appears, it polls GetCurrentReading(gamepad, <device>) with a device: alternately the pad (045e:02e0) and the shim's keyboard pad. Every call returns S_OK, followed by GetGamepadState. No GetNextReading, no reading callbacks, no GetUiNavigationState.
  • It polls about once per frame, and frames come at roughly one per second at this point. In the first traced run every poll saw buttons = 0, because a short press fell between two polls. In the second the buttons were held for about 3 s each, and GetGamepadState returned the buttons: the trace's first button-down lines show A (0x4), then Y (0x20) on three polls in a row (the trace skips most later calls, so these are lower bounds).
  • Even then nothing happened: the window capture after the presses is byte-identical to the one before, and the log has no line after the presses except the frame loop and one memory-window note.

So on this branch the input path works end to end: the pad is enumerated, the title polls it and gets the buttons. The prompts not reacting is something past GameInput. Whether that action needs a runtime service the offline layer doesn't answer, or the title only acts on the press in a state it hasn't reached yet, I can't tell from these logs. One side note for anyone testing input here: at about one frame per second, a normal short press is usually missed by a title that polls the current reading, so hold the button.

Not checked: the Intel GPU with the pad, rumble, and anything past 180 s.

AI-assisted (Claude Code).

**@⁠towade** on GitHub · 2026-11-24 20:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7144179958) Follow-up to my run above, now with an Xbox Wireless Controller paired over Bluetooth (SDL names it "Xbox One S Controller", 045e:02e0). Same head `eb6a08cd3`, same work folder, RX 9070 XT only, `--first-run-ui <exe> --trace --trace-d3d12`, the executable's network blocked, stopped after 180 s. A person pressed A and Y on the pad while the controller-prompt row was on screen. **Without SDL3** (the build from my first comment): the import list shows no shim for `GameInput.dll!#1`, so it binds to the host's `GameInput.dll`. The presses had no visible effect. That run also ended early: at about 103 s two write access violations inside the title's video library, then the title's `int3` at 106 s. The two earlier runs without a pad did not show this, and neither did the SDL3 run below, so it is intermittent and I can't tie it to the input. **With SDL3** (`-DLEONIDA_SDL3_FETCH=ON`, the pinned 3.4.20, otherwise the same options): | | RX 9070 XT, SDL3 build | |---|---| | end | still running at 180 s, **no exception** | | `PresentX` ok / failed | 212 / 0 | | `GameInput.dll!#1` | bound to the shim | | shim | `SDL 3.4.20 gamepads`, pad connected as player 1, keyboard pad as player 2; "no raw HID" for the pad (XInput interface, as the log explains) | | button presses the shim reports from the pad | 7 (`input in use: Xbox … button press`) | | what the window shows | the same dark background with the two prompts (Y and A) bottom right, from about 90 s to the end | So the presses reach the shim, but the screen doesn't react to either button, and apart from the shim's own lines the log shows nothing new after them: no `xgameruntime` line, only the frame loop. **What the title asks GameInput for.** To see whether the title reads the pad at all, I added a local trace to the shim (not part of this PR: a log line for the first three calls of each method and then every power of two, behind an environment switch) and ran twice more, same setup: - At start the title calls `GameInputCreate` and `RegisterDeviceCallback(kind = gamepad, status = connected, blocking enumeration)`. That call comes before SDL has reported the pad, so the enumeration finds nothing and the pad arrives through the callback afterwards. Later it registers a second device callback for the keyboard kind. - From about the time the controller-prompt row appears, it polls `GetCurrentReading(gamepad, <device>)` with a device: alternately the pad (045e:02e0) and the shim's keyboard pad. Every call returns `S_OK`, followed by `GetGamepadState`. No `GetNextReading`, no reading callbacks, no `GetUiNavigationState`. - It polls about once per frame, and frames come at roughly one per second at this point. In the first traced run every poll saw `buttons = 0`, because a short press fell between two polls. In the second the buttons were held for about 3 s each, and `GetGamepadState` returned the buttons: the trace's first button-down lines show A (`0x4`), then Y (`0x20`) on three polls in a row (the trace skips most later calls, so these are lower bounds). - Even then nothing happened: the window capture after the presses is byte-identical to the one before, and the log has no line after the presses except the frame loop and one memory-window note. So on this branch the input path works end to end: the pad is enumerated, the title polls it and gets the buttons. The prompts not reacting is something past GameInput. Whether that action needs a runtime service the offline layer doesn't answer, or the title only acts on the press in a state it hasn't reached yet, I can't tell from these logs. One side note for anyone testing input here: at about one frame per second, a normal short press is usually missed by a title that polls the current reading, so hold the button. Not checked: the Intel GPU with the pad, rumble, and anything past 180 s. AI-assisted (Claude Code).
Author
Owner

@⁠ThomasHFWright on GitHub · 2026-11-25 00:18 UTC · original

Tested exact head eb6a08cd359d98b5777e70d54d0ae8a75879495a on Linux. Both title runs reach drawing/presentation but hit the same title breakpoint; no visible first-run UI verified here.

Machine/build: Ryzen 7 9800X3D, RTX 5090, NVIDIA 620.73.04, CachyOS kernel 7.3.6, 30 GiB RAM and 62 GiB swap. Distribution Wine 11.22 (not native Windows or Proton), clang-cl/LLVM 23.1.5 with xwin SDK 26100, RelWithDebInfo, Vulkan required, shim tests enabled, pinned SDL3 3.4.20. Source unchanged.

Preparation: fresh branch-matching shader workspace with wave64 emulation: main 26,503/26,503 translated and SPIR-V-valid; FSPX 27/29, BVH 52/52, library 2,632/2,684, executable 10/10, native catalog 25,321 digests. Runtime corpus lookup: zero missing/failures. Actual shader path used, with its sibling source-container directory available. Dry-run and init both pass.

Title: --first-run-ui, fresh dedicated prefix for the first run, no assertion skips or debug drawing. Network namespace disabled networking; package mounted read-only; separate overlay/caches. Profile defaults retained, including 2 GiB arena. Cgroup MemoryHigh 10 GiB / MemoryMax 14 GiB / SwapMax 8 GiB.

First run Repeat, warm cache
Title breakpoint (same site and stack) 49.49 s 48.29 s
PresentX (one layer only) 200 111
DrawInstanced 595 312
Dispatch 42 18
Captured frames, all RGB zero 2 4
Native-compute slot 67 E_INVALIDARG 48 48

The first run stalled in WineDbg until the harness stopped it at 300 s. The repeat enabled Wine SEH diagnostics and denser captures; I stopped that test scope at 63.77 s after the same debugger stall. These cleanup exits are separate from the title breakpoint. No preceding access violation in either startup trace. First-chance RPC exceptions continued through to drawing. No arena-refusal messages. No hard-limit or OOM-kill events. The first run had soft-limit pressure; the repeat had zero memory-limit events, so that pressure alone does not explain the repeated stop. The depth-UAV format-56 warning also occurs in the successful Windows report above; I have not established it as the cause.

Synthetic checks: full native/Windows builds pass; semantic suite 6,123 tests passes; native CTest 73 pass / 2 skip / 0 fail. Full Windows CTest under Wine: 301 pass / 24 fail / 32 skip of 357, including two DXGI timeouts. Some tests compare Wine host behavior with Microsoft Windows expectations, so these are not all established regressions in this branch. Full standalone GPU suite: 232 pass / 2 fail / 20 skip. The two failing TFE fixtures have stale expectations: rerunning just that pair with upstream 8afbba14b fixtures passes 2/2 on this branch unchanged. The PR #1334 adaptation fails the corrected pair and was kept out; details: #1334 .

One small Wine-specific fixture issue: run_tiny_first_run_ui fails its Vulkan/pipeline-default assertions when CTest supplies those variables as empty strings; the same synthetic probe with both variables absent passes all three checks. The title launcher removed inherited LEONIDA variables before applying its explicit backend/shader/capture settings, avoiding that empty-variable case.

No title data, traces, shader identifiers or captures uploaded. AI-assisted testing and report.

**@⁠ThomasHFWright** on GitHub · 2026-11-25 00:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7148377168) Tested exact head `eb6a08cd359d98b5777e70d54d0ae8a75879495a` on Linux. Both title runs reach drawing/presentation but hit the same title breakpoint; no visible first-run UI verified here. **Machine/build:** Ryzen 7 9800X3D, RTX 5090, NVIDIA 620.73.04, CachyOS kernel 7.3.6, 30 GiB RAM and 62 GiB swap. Distribution Wine 11.22 (not native Windows or Proton), clang-cl/LLVM 23.1.5 with xwin SDK 26100, RelWithDebInfo, Vulkan required, shim tests enabled, pinned SDL3 3.4.20. Source unchanged. **Preparation:** fresh branch-matching shader workspace with wave64 emulation: main 26,503/26,503 translated and SPIR-V-valid; FSPX 27/29, BVH 52/52, library 2,632/2,684, executable 10/10, native catalog 25,321 digests. Runtime corpus lookup: zero missing/failures. Actual shader path used, with its sibling source-container directory available. Dry-run and init both pass. **Title:** `--first-run-ui`, fresh dedicated prefix for the first run, no assertion skips or debug drawing. Network namespace disabled networking; package mounted read-only; separate overlay/caches. Profile defaults retained, including 2 GiB arena. Cgroup MemoryHigh 10 GiB / MemoryMax 14 GiB / SwapMax 8 GiB. | | First run | Repeat, warm cache | |---|---:|---:| | Title breakpoint (same site and stack) | 49.49 s | 48.29 s | | PresentX (one layer only) | 200 | 111 | | DrawInstanced | 595 | 312 | | Dispatch | 42 | 18 | | Captured frames, all RGB zero | 2 | 4 | | Native-compute slot 67 E_INVALIDARG | 48 | 48 | The first run stalled in WineDbg until the harness stopped it at 300 s. The repeat enabled Wine SEH diagnostics and denser captures; I stopped that test scope at 63.77 s after the same debugger stall. These cleanup exits are separate from the title breakpoint. No preceding access violation in either startup trace. First-chance RPC exceptions continued through to drawing. No arena-refusal messages. No hard-limit or OOM-kill events. The first run had soft-limit pressure; the repeat had **zero** memory-limit events, so that pressure alone does not explain the repeated stop. The depth-UAV format-56 warning also occurs in the successful Windows report above; I have not established it as the cause. **Synthetic checks:** full native/Windows builds pass; semantic suite 6,123 tests passes; native CTest 73 pass / 2 skip / 0 fail. Full Windows CTest under Wine: 301 pass / 24 fail / 32 skip of 357, including two DXGI timeouts. Some tests compare Wine host behavior with Microsoft Windows expectations, so these are not all established regressions in this branch. Full standalone GPU suite: 232 pass / 2 fail / 20 skip. The two failing TFE fixtures have stale expectations: rerunning just that pair with upstream `8afbba14b` fixtures passes **2/2 on this branch unchanged**. The PR #1334 adaptation fails the corrected pair and was kept out; details: https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/1334 . One small Wine-specific fixture issue: `run_tiny_first_run_ui` fails its Vulkan/pipeline-default assertions when CTest supplies those variables as empty strings; the same synthetic probe with both variables absent passes all three checks. The title launcher removed inherited LEONIDA variables before applying its explicit backend/shader/capture settings, avoiding that empty-variable case. No title data, traces, shader identifiers or captures uploaded. AI-assisted testing and report.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-25 00:49 UTC · original

I checked the startup cache checkpoint against this PR's exact head eb6a08cd. PortBridge linked the first-run profile's default LEONIDA_PIPELINE_COMPILE=on-demand to the first-use compute materializer. That callback creates the Vulkan pipeline without reaching the checkpoint call in the eager branch, even when LEONIDA_STARTUP_CACHE_CHECKPOINTS=1.

A small CPU fixture compiled directly from the two public branches used a fake clock and stub Vulkan/export calls. With a cache and opt-in enabled, eager creation requested 0/1/1 saves at 499/500/501 ms; first-use creation requested 0/0/0. All 48 combinations passed, including failed creation and opt-out controls. No game data or GPU is needed to repeat it.

If first-use snapshots are intended, marking the cache dirty in materialization and draining it outside replay locks would avoid adding a full synchronous write to that callback. Pinned sources, test and transcript. AI-assisted with Codex.

**@⁠akimfomin** on GitHub · 2026-11-25 00:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7148925393) I checked the startup cache checkpoint against this PR's exact head `eb6a08cd`. PortBridge linked the first-run profile's default `LEONIDA_PIPELINE_COMPILE=on-demand` to the first-use compute materializer. That callback creates the Vulkan pipeline without reaching the checkpoint call in the eager branch, even when `LEONIDA_STARTUP_CACHE_CHECKPOINTS=1`. A small CPU fixture compiled directly from the two public branches used a fake clock and stub Vulkan/export calls. With a cache and opt-in enabled, eager creation requested 0/1/1 saves at 499/500/501 ms; first-use creation requested 0/0/0. All 48 combinations passed, including failed creation and opt-out controls. No game data or GPU is needed to repeat it. If first-use snapshots are intended, marking the cache dirty in materialization and draining it outside replay locks would avoid adding a full synchronous write to that callback. [Pinned sources, test and transcript](https://github.com/akimfomin/PortBridge/blob/3c9684f0c22f06d35c3b2c2b59a407d3fa5f4830/research/rendering-night/continued-checkpoint-gap/README.md). AI-assisted with Codex.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 00:59 UTC · original

@⁠towade thanks for the two runs above (#939): they are the only measurement of this branch on AMD, and they are a large part of why it is being looked at for merging now.

One request about that comment: it embeds a screenshot of the title's interface. The project's first rule is no game data in commits, issues or pull requests, and a picture of the game's screen is game imagery. Could you edit the comment and take the image out?

  • Everything else in it is fine and worth keeping: the GPUs, the driver and build versions, the counts (PresentX, pipelines created and failed), where each run stopped.
  • What the picture showed can stay as a sentence, for example "the first-run screen with the controller prompt row is drawn".

Nothing from that comment goes into the merge itself; this is only about the thread.

AI-assisted (Claude Code, Claude Fable 5.2).

**@⁠aslan2142** on GitHub · 2026-11-25 00:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7149093156) @⁠towade thanks for the two runs above (https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/939): they are the only measurement of this branch on AMD, and they are a large part of why it is being looked at for merging now. One request about that comment: it embeds a screenshot of the title's interface. The project's first rule is no game data in commits, issues or pull requests, and a picture of the game's screen is game imagery. Could you edit the comment and take the image out? - Everything else in it is fine and worth keeping: the GPUs, the driver and build versions, the counts (`PresentX`, pipelines created and failed), where each run stopped. - What the picture showed can stay as a sentence, for example "the first-run screen with the controller prompt row is drawn". Nothing from that comment goes into the merge itself; this is only about the thread. AI-assisted (Claude Code, Claude Fable 5.2).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-25 01:36 UTC · original

checked: eb6a08cd3 on native Windows with an NVIDIA laptop GPU, built and launched as docs/first_run_ui.md says. Windows 11 (26200), VS 2022 Build Tools (MSVC 14.44) with CMake + Ninja, -DLEONIDA_REQUIRE_VULKAN=ON -DLEONIDA_D3D12_SHIM_TESTS=ON -DLEONIDA_SDL3_FETCH=ON (pinned SDL3 3.4.20), NVIDIA GeForce RTX 4070 Laptop GPU (8 GB), driver 32.0.15.9159, hybrid with an Intel Arc iGPU (the Vulkan device is the NVIDIA one), Core Ultra 7 155H, 40 GB RAM, own 1.0.2.1 copy. No network rule; the runtime's offline shims only. Counts only, no captures attached.

Shaders: this branch's make_game.py --stages check,shaders,runtime --runtime-build <build> on a work folder carved and disassembled earlier from main; the translator fingerprint differed, so everything was translated again with this branch (32 min, exit 0). Same counts as the PR and @⁠ThomasHFWright: 26,503 / 26,503 main shaders translated and spirv-val-valid, 25,321 native catalog digests, FSPX 27 / 29, BVH 52 / 52, library 2,632 / 2,684, executable 10 / 10.

--dry-run: 4 modules mapped, 0 unimplemented imports; GameInput.dll!#1 is bound to the shim.

Runs (gta6rt --first-run-ui <exe>, stopped by the harness):

run 1 run 2 run 3
options --trace --trace-d3d12 --trace only --trace, LEONIDA_WINDOW=1600x960
length 180 s 300 s 180 s
end still running, no exception still running, no exception still running, no exception
D3D12 calls 89,444 – –
PresentX ok / failed 48 / 0 – –
ExecuteCommandLists ok / failed 49 / 0 – –
pipeline states ok / failed / unsupported 68,520 / 0 / 0 – –
DrawInstanced / DrawIndexedInstanced / Dispatch 70 / 2 / 16 – –
slot 67 (DeserializeComputePipelineStateX) E_INVALIDARG 48 48 48

The pipeline-state count is the same as @⁠towade's RX 9070 XT; fewer presents in the same 180 s here (48 against 130), which fits the on-demand pipelines taking longer on this GPU. Same remaining refusals as on the RX 9070 XT: the depth-stencil UAV plane of format 56 and the RTV format 28, plus the usual format notes (29, 86, 19). Working set about 6.3 GB at 3.5 min (read by hand; my automatic sampling failed).

On a laptop display the prompt row is drawn under the taskbar. The display here is 1707 x 1067 logical pixels (150 % scaling), and its work area above the taskbar is 1707 x 1019. The title creates its window at (0,0) with a 1711 x 1048 client area. In runs 1 and 2 the person at the screen saw only the plain dark background, for the whole run. A PrintWindow capture of the client area at about 4 min has the background plus a bright block at client x 1334-1674, y 992-1019 (the prompt row's place); a screen capture of the same rectangle at the same moment has nothing bright in that corner. With the title bar on top, those rows land at screen y ≈ 1023-1050, so the row is entirely under the taskbar. In run 3, with LEONIDA_WINDOW=1600x960, the person saw the full milestone: the dark background and the two prompts (Y and A) at the bottom right, in English.

So the rendering result reproduces on NVIDIA, but anyone testing on a scaled laptop screen with the default profile will report "background only". Fitting the title's window into the monitor's work area (or setting a default LEONIDA_WINDOW in the --first-run-ui profile) would avoid that. I have not tried either.

Input: with the prompts visible (run 3), Enter (A) and Y were each held about 3 s on the keyboard pad, with the window focused. Nothing on screen changed, as in @⁠towade's pad runs. The shim only logs when the input family changes (input in use: ...), not each press, so this log cannot show whether the presses reached the title.

Not checked: a physical pad, present counts without --trace-d3d12, anything past 300 s.

Measured with Claude Code.

**@⁠OreoFR** on GitHub · 2026-11-25 01:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7149742523) checked: `eb6a08cd3` on **native Windows with an NVIDIA laptop GPU**, built and launched as `docs/first_run_ui.md` says. Windows 11 (26200), VS 2022 Build Tools (MSVC 14.44) with CMake + Ninja, `-DLEONIDA_REQUIRE_VULKAN=ON -DLEONIDA_D3D12_SHIM_TESTS=ON -DLEONIDA_SDL3_FETCH=ON` (pinned SDL3 3.4.20), **NVIDIA GeForce RTX 4070 Laptop GPU (8 GB), driver 32.0.15.9159**, hybrid with an Intel Arc iGPU (the Vulkan device is the NVIDIA one), Core Ultra 7 155H, 40 GB RAM, own 1.0.2.1 copy. No network rule; the runtime's offline shims only. Counts only, no captures attached. **Shaders:** this branch's `make_game.py --stages check,shaders,runtime --runtime-build <build>` on a work folder carved and disassembled earlier from `main`; the translator fingerprint differed, so everything was translated again with this branch (32 min, exit 0). Same counts as the PR and @⁠ThomasHFWright: 26,503 / 26,503 main shaders translated and `spirv-val`-valid, 25,321 native catalog digests, FSPX 27 / 29, BVH 52 / 52, library 2,632 / 2,684, executable 10 / 10. **`--dry-run`:** 4 modules mapped, 0 unimplemented imports; `GameInput.dll!#1` is bound to the shim. **Runs** (`gta6rt --first-run-ui <exe>`, stopped by the harness): | | run 1 | run 2 | run 3 | |---|---|---|---| | options | `--trace --trace-d3d12` | `--trace` only | `--trace`, `LEONIDA_WINDOW=1600x960` | | length | 180 s | **300 s** | 180 s | | end | still running, **no exception** | still running, **no exception** | still running, **no exception** | | D3D12 calls | 89,444 | – | – | | `PresentX` ok / failed | 48 / 0 | – | – | | `ExecuteCommandLists` ok / failed | 49 / 0 | – | – | | pipeline states ok / failed / unsupported | **68,520** / 0 / 0 | – | – | | `DrawInstanced` / `DrawIndexedInstanced` / `Dispatch` | 70 / 2 / 16 | – | – | | slot 67 (`DeserializeComputePipelineStateX`) `E_INVALIDARG` | 48 | 48 | 48 | The pipeline-state count is the same as @⁠towade's RX 9070 XT; fewer presents in the same 180 s here (48 against 130), which fits the on-demand pipelines taking longer on this GPU. Same remaining refusals as on the RX 9070 XT: the depth-stencil UAV plane of format 56 and the RTV format 28, plus the usual format notes (29, 86, 19). Working set about 6.3 GB at 3.5 min (read by hand; my automatic sampling failed). **On a laptop display the prompt row is drawn under the taskbar.** The display here is 1707 x 1067 logical pixels (150 % scaling), and its work area above the taskbar is 1707 x 1019. The title creates its window at (0,0) with a 1711 x 1048 client area. In runs 1 and 2 the person at the screen saw only the plain dark background, for the whole run. A `PrintWindow` capture of the client area at about 4 min has the background plus a bright block at client x 1334-1674, y 992-1019 (the prompt row's place); a screen capture of the same rectangle at the same moment has nothing bright in that corner. With the title bar on top, those rows land at screen y ≈ 1023-1050, so the row is entirely under the taskbar. In run 3, with `LEONIDA_WINDOW=1600x960`, the person saw the full milestone: the dark background and the two prompts (Y and A) at the bottom right, in English. So the rendering result reproduces on NVIDIA, but anyone testing on a scaled laptop screen with the default profile will report "background only". Fitting the title's window into the monitor's work area (or setting a default `LEONIDA_WINDOW` in the `--first-run-ui` profile) would avoid that. I have not tried either. **Input:** with the prompts visible (run 3), Enter (A) and Y were each held about 3 s on the keyboard pad, with the window focused. Nothing on screen changed, as in @⁠towade's pad runs. The shim only logs when the input family changes (`input in use: ...`), not each press, so this log cannot show whether the presses reached the title. Not checked: a physical pad, present counts without `--trace-d3d12`, anything past 300 s. Measured with Claude Code.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 02:33 UTC · original

Merged. Thank you, @⁠Rain156: this is the tree that took an RX 9070 XT past the title's own breakpoint, and it now sits on top of #984 and #968. @⁠ubiquitarianism, this was the second large merge of the night, done the same way as #984.

How it was brought up to date: main (with #984, #968 and the docs and build pieces since) was merged into this branch, not rebased, so your 100 commits are untouched and nothing was force-pushed. 68 files conflicted; they were resolved in seven groups. The rule: where the two trees answer the title's call differently, the tree measured further on the title's path is the default and the other stays behind a switch.

What stays as you built it:

  • Device slot 57: your NativeGraphicsFactory is asked first; E_NOTIMPL falls back to #984's path. There is a mock test of the chain.
  • Rectangles on triangle pipelines, indexed quad lists, 1D/3D and depth-stencil UAVs, the XG texture computer, the window pump, the translator rules, the texture providers and uploads, GPU completion labels.
  • --first-run-ui and its profile.

Your behaviour behind switches (the #984 behaviour is the default, because it was measured through the story load):

  • LEONIDA_FRAME_PACING=1 (still set by --first-run-ui);
  • LEONIDA_LINEAR_MAP_FIRST=1, LEONIDA_SLOT133_LAYOUT_WORD=1, LEONIDA_RGBA4_COPY_REFUSE=1, LEONIDA_CBV_RAW=1, LEONIDA_GRAPHICS_STAGE_LAYOUT=0.

Taken automatically where it matters: console D16S8 uses your D16/S8 path on a GPU without a D24_UNORM_S8_UINT attachment, which is the case on AMD; this was checked on an RDNA2 iGPU under RADV. LEONIDA_CONSOLE_D16S8=native forces it elsewhere.

Maintainer decisions:

  • Speech forwarding to the host's installed runtime stays in the code but is off by default and not in the profile (LEONIDA_LOCAL_SPEECH=1 turns it on), because of the "nothing online" rule.
  • Attribution was added: the four graphics-runtime-patches@d9a0bc1b patches, VIctory as GPL-3.0-or-later and translated to C++, and headers on native_pso.h and d3d12_xs_native_pso.h naming enx/leonida 5c175db90 as the source (unreachable when this was merged; GPL-3.0-or-later as a fork of this project).

Tests (clang-cl with the xwin SDK; the full runtime suite under Wine on llvmpipe and an RDNA2 iGPU):

  • Against main with #984 and #968, against #984 by itself, and against this branch's head before the merge: no test went from pass to fail. 39 tests are new and pass.
  • The three vk_present_dump* tests fail on the headless iGPU here, as they did on this branch's head and as vk_presenter_sync does on main: the iGPU cannot present under Xvfb.
  • Linux portable ctest: 82 pass, 2 skipped. Translator suite: 485 files, 6,269 tests, 0 failed. check_no_game_data.py is clean on the 131 changed files, and no image or hash list of the game is in any file.
  • Your tests were adapted where a rule changed: xbox_cbv_vectors, the rebound-table cases, xbox_placed_texture_first_use, d3d12_depth_stencil_uav, xbox_geometry_upload_batch and d3d12_quad_index. Two were red on this branch's head and are fixed: run_tiny_first_run_ui, and case 11 of test_exe_shaders_stage.

Please test, in this order:

  1. --first-run-ui on AMD (RX 9070 XT): any slot 57 call N failed lines, the console D16S8 log line, and whether the screen draws.
  2. Plain --run on NVIDIA through the story load: the depth-stencil UAV path, which now takes your two-resource path on every GPU, and the movie planes.
  3. A B4G4R4A4 target on NVIDIA.

Not run here: MSVC, native Windows, and the game.

AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 02:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7150883383) Merged. Thank you, @⁠Rain156: this is the tree that took an RX 9070 XT past the title's own breakpoint, and it now sits on top of #984 and #968. @⁠ubiquitarianism, this was the second large merge of the night, done the same way as #984. **How it was brought up to date:** `main` (with #984, #968 and the docs and build pieces since) was merged into this branch, not rebased, so your 100 commits are untouched and nothing was force-pushed. 68 files conflicted; they were resolved in seven groups. The rule: where the two trees answer the title's call differently, the tree measured further on the title's path is the default and the other stays behind a switch. **What stays as you built it:** - Device slot 57: your `NativeGraphicsFactory` is asked first; `E_NOTIMPL` falls back to #984's path. There is a mock test of the chain. - Rectangles on triangle pipelines, indexed quad lists, 1D/3D and depth-stencil UAVs, the XG texture computer, the window pump, the translator rules, the texture providers and uploads, GPU completion labels. - `--first-run-ui` and its profile. **Your behaviour behind switches** (the #984 behaviour is the default, because it was measured through the story load): - `LEONIDA_FRAME_PACING=1` (still set by `--first-run-ui`); - `LEONIDA_LINEAR_MAP_FIRST=1`, `LEONIDA_SLOT133_LAYOUT_WORD=1`, `LEONIDA_RGBA4_COPY_REFUSE=1`, `LEONIDA_CBV_RAW=1`, `LEONIDA_GRAPHICS_STAGE_LAYOUT=0`. **Taken automatically where it matters:** console D16S8 uses your D16/S8 path on a GPU without a `D24_UNORM_S8_UINT` attachment, which is the case on AMD; this was checked on an RDNA2 iGPU under RADV. `LEONIDA_CONSOLE_D16S8=native` forces it elsewhere. **Maintainer decisions:** - Speech forwarding to the host's installed runtime stays in the code but is off by default and not in the profile (`LEONIDA_LOCAL_SPEECH=1` turns it on), because of the "nothing online" rule. - Attribution was added: the four `graphics-runtime-patches@d9a0bc1b` patches, VIctory as GPL-3.0-or-later and translated to C++, and headers on `native_pso.h` and `d3d12_xs_native_pso.h` naming `enx/leonida` `5c175db90` as the source (unreachable when this was merged; GPL-3.0-or-later as a fork of this project). **Tests** (clang-cl with the xwin SDK; the full runtime suite under Wine on llvmpipe and an RDNA2 iGPU): - Against `main` with #984 and #968, against #984 by itself, and against this branch's head before the merge: no test went from pass to fail. 39 tests are new and pass. - The three `vk_present_dump*` tests fail on the headless iGPU here, as they did on this branch's head and as `vk_presenter_sync` does on `main`: the iGPU cannot present under Xvfb. - Linux portable `ctest`: 82 pass, 2 skipped. Translator suite: 485 files, 6,269 tests, 0 failed. `check_no_game_data.py` is clean on the 131 changed files, and no image or hash list of the game is in any file. - Your tests were adapted where a rule changed: `xbox_cbv_vectors`, the rebound-table cases, `xbox_placed_texture_first_use`, `d3d12_depth_stencil_uav`, `xbox_geometry_upload_batch` and `d3d12_quad_index`. Two were red on this branch's head and are fixed: `run_tiny_first_run_ui`, and case 11 of `test_exe_shaders_stage`. **Please test, in this order:** 1. `--first-run-ui` on AMD (RX 9070 XT): any `slot 57 call N failed` lines, the `console D16S8` log line, and whether the screen draws. 2. Plain `--run` on NVIDIA through the story load: the depth-stencil UAV path, which now takes your two-resource path on every GPU, and the movie planes. 3. A B4G4R4A4 target on NVIDIA. Not run here: MSVC, native Windows, and the game. AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 02:43 UTC · original

Post-merge check of main after this merge (Windows 11, Python 3.14): one repository-consistency test is red, and this merge is where it starts. It passes at 3ff2a2adc and fails at e79906a42:

FAILED tests/test_runtime_paths.py::RepositoryRuntimePathsTest::test_every_tool_the_jobs_read_triggers_the_workflow
['tools/conformance/**: missing (named in runtime/CMakeLists.txt)'] is not false : .github/workflows/runtime.yml path filter

runtime/CMakeLists.txt now reads tools/conformance/, so .github/workflows/runtime.yml needs tools/conformance/** added to its paths: filters (both the push and pull_request lists, next to the other tools/ entries). Then the test passes again. Everything else in the set passes: 591 passed, 5 skipped. I haven't touched the workflow myself, since it's a CI file; it's a one-line fix if you want it.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 02:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7151107177) Post-merge check of main after this merge (Windows 11, Python 3.14): one repository-consistency test is red, and this merge is where it starts. It passes at 3ff2a2adc and fails at e79906a42: ``` FAILED tests/test_runtime_paths.py::RepositoryRuntimePathsTest::test_every_tool_the_jobs_read_triggers_the_workflow ['tools/conformance/**: missing (named in runtime/CMakeLists.txt)'] is not false : .github/workflows/runtime.yml path filter ``` `runtime/CMakeLists.txt` now reads `tools/conformance/`, so `.github/workflows/runtime.yml` needs `tools/conformance/**` added to its `paths:` filters (both the push and pull_request lists, next to the other `tools/` entries). Then the test passes again. Everything else in the set passes: 591 passed, 5 skipped. I haven't touched the workflow myself, since it's a CI file; it's a one-line fix if you want it. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-25 03:25 UTC · original

@⁠aslan2142 your item 2, plain --run on NVIDIA, on native Windows: on main after this merge the title stops right after the first A on the landing screen, in 3 of 3 runs. main just before this merge goes past that point on the same machine. Counts and RVAs only.

Machine: Windows 11 (26200), VS 2022 Build Tools (MSVC 14.44, SDK 26100), CMake + Ninja, SDL3 3.4.20 (LEONIDA_SDL3_FETCH), NVIDIA GeForce RTX 4070 Laptop GPU (8 GB), driver 32.0.15.9159, Core Ultra 7 155H, 40 GB RAM, own 1.0.2.1 copy.

Settings (as scripts/linux-boot/boot.sh): gta6rt --run <exe> --game-dir <pkg> --overlay <dir> --trace <file>, LEONIDA_D3D12=vulkan, LEONIDA_ARENA_MB=2048, LEONIDA_PIPELINE_CACHE_BYTES=4294967296, LEONIDA_STARTUP_CACHE_CHECKPOINTS=1, the NVIDIA disk cache raised to 20 GB, LEONIDA_KEYBOARD_PAD=always, LEONIDA_INPUT_SCRIPT=a@60,a@75,a@90,a@105,a@120,…. Each tree has its own fresh work folder from its own make_game.py --stages check,shaders,runtime, with history.bcph generated (main 26,503 → 26,530 after this merge, library 2,683 / 2,684, exe 12 / 12, BVH 52 / 52, all spirv-val-valid).

main 0aecc5efa (#984 + #968, before this merge) main 85ece6847 (after this merge)
landing screen with its artwork yes yes
first A that the title acts on goes to the brightness page, then the legal pages stops 2-4 s later
runs 1 (cold cache) 3 (warm and partly warm)
end story load started (16,510 slot-70 texture views, 15,891 images), then the title's hang watchdog at 504 s (+0x23cf683, the handler variant), after 47 library compute compiles over 1 s (207 s in total, up to 21.3 s) on a cold driver cache run 1: VK_ERROR_DEVICE_LOST at ~122 s, then the title's int3 at +0x2474606. Runs 2 and 3: no device loss, the title's int3 at +0x131a2ad, 2 s and 4 s after the press
device lost 0 1 of 3

Same input script in run 3 as in the run before the merge. Run 1 had LEONIDA_TITLE_WATCHDOG=0, run 2 had LEONIDA_DEVICE_FAULT=1 (no device loss happened, so no fault report), run 3 neither.

The stack of the +0x131a2ad stop is the same in runs 2 and 3: +0x131a2ad ← +0x24740d5 ← +0x2473903 ← +0x3239287 ← +0x221c29c ← +0x2215eca (the title's thread trampoline). The runtime logs nothing unusual between the press and the stop: one library compute compile of 2.5 s, a slot-133 shadow-buffer summary and the usual B5G5R5A1 UAV note (format 86), which the run before the merge also prints. Before the device loss in run 1: several "import of title memory … landed below the arena … a shadow in the arena is used instead" and 64 KiB windows "named by a shader address" being mirrored.

So on this NVIDIA machine the merge moves the first stop from the story load back to the landing screen. I did not see a depth-stencil UAV message or a B4G4R4A4 target before the stop, so items 2 and 3 of your list could not be reached here. I can rerun with any switch you name (for example the old behaviour of one of the merged pieces), or bisect between 0aecc5efa and 85ece6847 if that helps. Traces and logs stay on this machine.

Measured with Claude Code.

**@⁠OreoFR** on GitHub · 2026-11-25 03:25 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7151895518) @⁠aslan2142 your item 2, plain `--run` on NVIDIA, on native Windows: **on `main` after this merge the title stops right after the first A on the landing screen, in 3 of 3 runs. `main` just before this merge goes past that point on the same machine.** Counts and RVAs only. **Machine:** Windows 11 (26200), VS 2022 Build Tools (MSVC 14.44, SDK 26100), CMake + Ninja, SDL3 3.4.20 (`LEONIDA_SDL3_FETCH`), **NVIDIA GeForce RTX 4070 Laptop GPU (8 GB), driver 32.0.15.9159**, Core Ultra 7 155H, 40 GB RAM, own 1.0.2.1 copy. **Settings** (as `scripts/linux-boot/boot.sh`): `gta6rt --run <exe> --game-dir <pkg> --overlay <dir> --trace <file>`, `LEONIDA_D3D12=vulkan`, `LEONIDA_ARENA_MB=2048`, `LEONIDA_PIPELINE_CACHE_BYTES=4294967296`, `LEONIDA_STARTUP_CACHE_CHECKPOINTS=1`, the NVIDIA disk cache raised to 20 GB, `LEONIDA_KEYBOARD_PAD=always`, `LEONIDA_INPUT_SCRIPT=a@60,a@75,a@90,a@105,a@120,…`. Each tree has its own fresh work folder from its own `make_game.py --stages check,shaders,runtime`, with `history.bcph` generated (main 26,503 → 26,530 after this merge, library 2,683 / 2,684, exe 12 / 12, BVH 52 / 52, all `spirv-val`-valid). | | `main` `0aecc5efa` (#984 + #968, before this merge) | `main` `85ece6847` (after this merge) | |---|---|---| | landing screen with its artwork | yes | yes | | first A that the title acts on | goes to the brightness page, then the legal pages | **stops 2-4 s later** | | runs | 1 (cold cache) | 3 (warm and partly warm) | | end | story load started (16,510 slot-70 texture views, 15,891 images), then the title's hang watchdog at 504 s (`+0x23cf683`, the handler variant), after 47 library compute compiles over 1 s (207 s in total, up to 21.3 s) on a cold driver cache | **run 1:** `VK_ERROR_DEVICE_LOST` at ~122 s, then the title's `int3` at `+0x2474606`. **Runs 2 and 3:** no device loss, the title's `int3` at **`+0x131a2ad`**, 2 s and 4 s after the press | | device lost | 0 | 1 of 3 | Same input script in run 3 as in the run before the merge. Run 1 had `LEONIDA_TITLE_WATCHDOG=0`, run 2 had `LEONIDA_DEVICE_FAULT=1` (no device loss happened, so no fault report), run 3 neither. The stack of the `+0x131a2ad` stop is the same in runs 2 and 3: `+0x131a2ad` ← `+0x24740d5` ← `+0x2473903` ← `+0x3239287` ← `+0x221c29c` ← `+0x2215eca` (the title's thread trampoline). The runtime logs nothing unusual between the press and the stop: one library compute compile of 2.5 s, a slot-133 shadow-buffer summary and the usual B5G5R5A1 UAV note (format 86), which the run before the merge also prints. Before the device loss in run 1: several "import of title memory … landed below the arena … a shadow in the arena is used instead" and 64 KiB windows "named by a shader address" being mirrored. So on this NVIDIA machine the merge moves the first stop from the story load back to the landing screen. I did not see a depth-stencil UAV message or a B4G4R4A4 target before the stop, so items 2 and 3 of your list could not be reached here. I can rerun with any switch you name (for example the old behaviour of one of the merged pieces), or bisect between `0aecc5efa` and `85ece6847` if that helps. Traces and logs stay on this machine. Measured with Claude Code.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 04:12 UTC · original · edited 2026-11-25 04:27 UTC

@⁠OreoFR @⁠aslan2142: root cause of the NVIDIA stop at the landing screen. You can skip the bisect.

Same stop here on native Windows 11, RTX 4070 SUPER (NVIDIA 621.24), main 0bc810504 built with MSVC: 3 of 3 runs end with an int3 51-74 s in (exit 0x80000003), after 182-362 PresentX. Main 3ff2a2adc, before this merge, goes past it on the same machine.

What happens (measured with cdb attached and a call trace through gta6rt's PDB; descriptions and return codes only):

  1. The int3 is the title's soft assert after a texture-create helper returns false. That helper's device slot 133 (CreatePlacedResourceX) returned E_INVALIDARG.
  2. The resource: TEXTURE2D 1280×720, 1 mip, format 118 (console D16_UNORM_S8_UINT), ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS (plus Xbox bits), layout argument 0xFFFFFFFF.
  3. The path, new in this merge: proxy_create_placed_resource_slot133 → proxy_create_placed_depth → PlacedDepthTextures::create → create_depth_uav_backing → CreateCommittedResource = S_OK → rt::d3d12::enable_depth_stencil_uav → Resource::enable_depth_stencil_uav = E_INVALIDARG.
  4. Why only NVIDIA: create_committed rewrites the format through pc_format(). On a GPU with D24_UNORM_S8_UINT attachments (NVIDIA; the log says "console D16S8 textures are made as D24S8"), 118 becomes D24_UNORM_S8_UINT. But Resource::enable_depth_stencil_uav accepts only R16_TYPELESS, 118 itself or R32G8X24_TYPELESS, so a console depth target made as D24S8 is refused. On AMD there's no D24S8 attachment, 118 stays native, and it passes, which matches the RX 9070 XT / RADV runs. Before this merge, slot 133 created that texture without unordered access and carried on.

Confirmation: the same build with LEONIDA_CONSOLE_D16S8=native has no int3, runs to its 200 s limit (5,856 PresentX, 66/66 captures non-black) and reaches a first-run consent page.

Two candidate fixes: let enable_depth_stencil_uav accept the D24S8 backing that pc_format() chose for 118, or have slot 133/76 fall back to the old stand-in without unordered access when the depth provider refuses. I'm testing the fallback locally now, and I'll report which one also keeps the picture right.

A second, separate observation with LEONIDA_CONSOLE_D16S8=native: from the "Finish setup?" page on, the background gradient is black, artwork is hard-edged, there are stray vertical lines, and the highlighted row's glyphs on the terms page are corrupted. 3ff2a2adc draws all of that correctly on the same machine. New log lines: "unbound T# in console heap … T# names layers the texture lacks" (1,100+ slots) and "names no registered texture". I don't know yet whether that comes from the native D16S8 path or another part of the merge; I'm narrowing it down.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 04:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7152637264) · edited 2026-11-25 04:27 UTC @⁠OreoFR @⁠aslan2142: root cause of the NVIDIA stop at the landing screen. You can skip the bisect. Same stop here on native Windows 11, RTX 4070 SUPER (NVIDIA 621.24), main 0bc810504 built with MSVC: 3 of 3 runs end with an int3 51-74 s in (exit 0x80000003), after 182-362 PresentX. Main 3ff2a2adc, before this merge, goes past it on the same machine. What happens (measured with cdb attached and a call trace through gta6rt's PDB; descriptions and return codes only): 1. The int3 is the title's soft assert after a texture-create helper returns false. That helper's device **slot 133 (CreatePlacedResourceX) returned `E_INVALIDARG`**. 2. The resource: TEXTURE2D 1280×720, 1 mip, **format 118 (console D16_UNORM_S8_UINT)**, `ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS` (plus Xbox bits), layout argument `0xFFFFFFFF`. 3. The path, new in this merge: `proxy_create_placed_resource_slot133` → `proxy_create_placed_depth` → `PlacedDepthTextures::create` → `create_depth_uav_backing` → `CreateCommittedResource` = S_OK → `rt::d3d12::enable_depth_stencil_uav` → `Resource::enable_depth_stencil_uav` = **E_INVALIDARG**. 4. Why only NVIDIA: `create_committed` rewrites the format through `pc_format()`. On a GPU with D24_UNORM_S8_UINT attachments (NVIDIA; the log says "console D16S8 textures are made as D24S8"), 118 becomes D24_UNORM_S8_UINT. But `Resource::enable_depth_stencil_uav` accepts only R16_TYPELESS, 118 itself or R32G8X24_TYPELESS, so a console depth target made as D24S8 is refused. On AMD there's no D24S8 attachment, 118 stays native, and it passes, which matches the RX 9070 XT / RADV runs. Before this merge, slot 133 created that texture without unordered access and carried on. **Confirmation:** the same build with `LEONIDA_CONSOLE_D16S8=native` has no int3, runs to its 200 s limit (5,856 PresentX, 66/66 captures non-black) and reaches a first-run consent page. Two candidate fixes: let `enable_depth_stencil_uav` accept the D24S8 backing that `pc_format()` chose for 118, or have slot 133/76 fall back to the old stand-in without unordered access when the depth provider refuses. I'm testing the fallback locally now, and I'll report which one also keeps the picture right. A second, separate observation with `LEONIDA_CONSOLE_D16S8=native`: from the "Finish setup?" page on, the background gradient is black, artwork is hard-edged, there are stray vertical lines, and the highlighted row's glyphs on the terms page are corrupted. 3ff2a2adc draws all of that correctly on the same machine. New log lines: "unbound T# in console heap … T# names layers the texture lacks" (1,100+ slots) and "names no registered texture". I don't know yet whether that comes from the native D16S8 path or another part of the merge; I'm narrowing it down. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 04:18 UTC · original · edited 2026-11-25 04:27 UTC

Follow-up: a fix for the NVIDIA landing-screen stop is verified on the same machine and copy. When the depth provider refuses that console D16S8 texture with unordered access, slots 133 and 76 fall back to the pre-#939 texture without unordered access. With default settings (D24S8), main 0bc810504 plus this ~28-line change: the fallback fires once, no int3, 6,187 PresentX with 0 failed, 69/69 captures non-black, and the boot reaches a first-run consent page. I'm opening it as a PR (claim RT-D16S8-UAV-NVIDIA-FALLBACK; #14 has hit GitHub's comment limit, so I'm noting the claim here). Teaching Resource::enable_depth_stencil_uav the D24S8-made form would be the fuller fix; say if you'd rather have that.

Narrowed down: the picture regression from "Finish setup?" onward is NOT the depth path. It looks identical with the fallback (D24S8) and with LEONIDA_CONSOLE_D16S8=native, so something else merged between 3ff2a2adc and 0bc810504 causes it. I'm bisecting it now, starting from the #939 merge commit itself.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 04:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7152724709) · edited 2026-11-25 04:27 UTC Follow-up: a fix for the NVIDIA landing-screen stop is verified on the same machine and copy. When the depth provider refuses that console D16S8 texture with unordered access, slots 133 and 76 fall back to the pre-#939 texture without unordered access. With default settings (D24S8), main 0bc810504 plus this ~28-line change: the fallback fires once, no int3, 6,187 PresentX with 0 failed, 69/69 captures non-black, and the boot reaches a first-run consent page. I'm opening it as a PR (claim RT-D16S8-UAV-NVIDIA-FALLBACK; #14 has hit GitHub's comment limit, so I'm noting the claim here). Teaching `Resource::enable_depth_stencil_uav` the D24S8-made form would be the fuller fix; say if you'd rather have that. Narrowed down: the picture regression from "Finish setup?" onward is NOT the depth path. It looks identical with the fallback (D24S8) and with `LEONIDA_CONSOLE_D16S8=native`, so something else merged between 3ff2a2adc and 0bc810504 causes it. I'm bisecting it now, starting from the #939 merge commit itself. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-25 04:22 UTC · original

@⁠QemmHD confirmed on a second NVIDIA (RTX 4070 Laptop, driver 32.0.15.9159, native Windows, main 85ece6847 and the #939 merge e79906a42): the same E_INVALIDARG on a format-118 placed target (2560×1440 here, flags 0x80300006), and a local switch that skips installing the depth-stencil UAV provider removes the stop. 3ff2a2adc passes on this machine too, so the bisect agrees with yours.

One more thing from this machine: in 4 of 12 runs the device was lost before any refused placement, then the title stopped at +0x2474606. In a --trace-d3d12 run every failed call (4 × CreatePipelineState, 2 × ExecuteCommandLists, Signal, PresentX) comes after the loss. Skipping the provider removed that mode as well. A fallback that only fires on a refusal may not cover it, so I'll run your PR here as soon as it is up, with the same input script, and report both modes.

Measured with Claude Code.

**@⁠OreoFR** on GitHub · 2026-11-25 04:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7152789720) @⁠QemmHD confirmed on a second NVIDIA (RTX 4070 Laptop, driver 32.0.15.9159, native Windows, main `85ece6847` and the #939 merge `e79906a42`): the same `E_INVALIDARG` on a format-118 placed target (2560×1440 here, flags `0x80300006`), and a local switch that skips installing the depth-stencil UAV provider removes the stop. `3ff2a2adc` passes on this machine too, so the bisect agrees with yours. One more thing from this machine: in 4 of 12 runs the device was lost **before** any refused placement, then the title stopped at `+0x2474606`. In a `--trace-d3d12` run every failed call (4 × `CreatePipelineState`, 2 × `ExecuteCommandLists`, `Signal`, `PresentX`) comes after the loss. Skipping the provider removed that mode as well. A fallback that only fires on a refusal may not cover it, so I'll run your PR here as soon as it is up, with the same input script, and report both modes. Measured with Claude Code.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 04:34 UTC · original

@⁠OreoFR @⁠aslan2142: the fix for the NVIDIA landing-screen stop is up as #1558. It falls back only when the depth provider itself refuses, and passes every other failure on. It includes a mock test plus a Vulkan ctest that forces the D24S8 choice on any GPU, with a negative control. A real boot here goes past the stop with it.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 04:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7152967800) @⁠OreoFR @⁠aslan2142: the fix for the NVIDIA landing-screen stop is up as **#1558**. It falls back only when the depth provider itself refuses, and passes every other failure on. It includes a mock test plus a Vulkan ctest that forces the D24S8 choice on any GPU, with a negative control. A real boot here goes past the stop with it. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 04:37 UTC · original

@⁠OreoFR thanks for the second-machine confirmation. #1558 is up, so please run it with both modes. The device-loss-first mode is a fair concern: #1558 only falls back when the provider refuses. If the loss comes from the provider path doing something before it refuses (or from a UAV on a texture it does accept), the fallback won't cover it. Here (RTX 4070 SUPER, desktop driver 621.24) I saw the int3 in 3 of 3 runs and no device loss before it, so your laptop may be hitting a different path. If you can, run once with LEONIDA_DEVICE_FAULT=1 (the RT-DEVICE-LOST-LOG / #1028 fault report names what was in flight), so we can tell whether the lost work touches the depth-UAV backing. If it does, the provider needs a stronger gate than refusal on NVIDIA, and I'll widen #1558 accordingly.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 04:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7153018151) @⁠OreoFR thanks for the second-machine confirmation. #1558 is up, so please run it with both modes. The device-loss-first mode is a fair concern: #1558 only falls back when the provider refuses. If the loss comes from the provider path doing something before it refuses (or from a UAV on a texture it does accept), the fallback won't cover it. Here (RTX 4070 SUPER, desktop driver 621.24) I saw the int3 in 3 of 3 runs and no device loss before it, so your laptop may be hitting a different path. If you can, run once with `LEONIDA_DEVICE_FAULT=1` (the RT-DEVICE-LOST-LOG / #1028 fault report names what was in flight), so we can tell whether the lost work touches the depth-UAV backing. If it does, the provider needs a stronger gate than refusal on NVIDIA, and I'll widen #1558 accordingly. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-25 05:16 UTC · original

@⁠QemmHD ran #1558 here with both modes, results on the PR: #1558

In short: with #1558 the landing-screen stop is gone on this laptop too, and the device-loss-first mode did not come back in 4 runs. What still stops some runs is the title's hang watchdog after the first A, while pipeline compiles hold the submit lock on a cold cache (#1547's area), and once a device loss later in the story load on library compute dispatches (the world-start wall). Neither touches the depth-UAV backing, so #1558 doesn't need a wider gate for NVIDIA from what I see.

Measured with Claude Code.

**@⁠OreoFR** on GitHub · 2026-11-25 05:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7153614241) @⁠QemmHD ran #1558 here with both modes, results on the PR: https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/1558 In short: with #1558 the landing-screen stop is gone on this laptop too, and the device-loss-first mode did not come back in 4 runs. What still stops some runs is the title's hang watchdog after the first A, while pipeline compiles hold the submit lock on a cold cache (#1547's area), and once a device loss later in the story load on library compute dispatches (the world-start wall). Neither touches the depth-UAV backing, so #1558 doesn't need a wider gate for NVIDIA from what I see. Measured with Claude Code.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 05:23 UTC · original

@⁠aslan2142 @⁠Rain156: a second NVIDIA finding on this merge, separate from the depth stop (#1558). This one is a picture regression, bisected on a real boot (Windows 11, RTX 4070 SUPER, NVIDIA 621.24, MSVC builds):

  • 3ff2a2adc (before #939): the later first-run pages draw correctly.
  • e79906a42 (the #939 merge commit): from the "Finish setup?" page onward, the background gradient is black, artwork is drawn hard-edged, there are stray vertical lines, and the highlighted row's glyphs are corrupted. The log shows "unbound T# in console heap … T# names layers the texture lacks" (1,100+ slots) and "names no registered texture".
  • Same with or without the depth fallback, and with LEONIDA_CONSOLE_D16S8=native, so it's not the depth path. Four of the documented switch sets don't fix it, and two make it worse.
  • Skipping this merge's slot 57 NativeGraphicsFactory (a local, env-gated 3-line experiment) restores the correct picture: 6,399 PresentX ok, with capture means identical to 3ff2a2adc.

So the native graphics pipelines built from slot 57 records (about 25,450 on this run) draw those pages wrongly on this card. My hypothesis is the blend or depth state they're created with, but I haven't measured that yet. If an env switch to turn the factory off is welcome as a stopgap, I can open it. Otherwise I'll keep narrowing down which state differs.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 05:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7153729424) @⁠aslan2142 @⁠Rain156: a second NVIDIA finding on this merge, separate from the depth stop (#1558). This one is a **picture regression**, bisected on a real boot (Windows 11, RTX 4070 SUPER, NVIDIA 621.24, MSVC builds): - **3ff2a2adc (before #939):** the later first-run pages draw correctly. - **e79906a42 (the #939 merge commit):** from the "Finish setup?" page onward, the background gradient is black, artwork is drawn hard-edged, there are stray vertical lines, and the highlighted row's glyphs are corrupted. The log shows "unbound T# in console heap … T# names layers the texture lacks" (1,100+ slots) and "names no registered texture". - **Same with or without the depth fallback,** and with `LEONIDA_CONSOLE_D16S8=native`, so it's not the depth path. Four of the documented switch sets don't fix it, and two make it worse. - **Skipping this merge's slot 57 `NativeGraphicsFactory`** (a local, env-gated 3-line experiment) restores the correct picture: 6,399 PresentX ok, with capture means identical to 3ff2a2adc. So the native graphics pipelines built from slot 57 records (about 25,450 on this run) draw those pages wrongly on this card. My hypothesis is the blend or depth state they're created with, but I haven't measured that yet. If an env switch to turn the factory off is welcome as a stopgap, I can open it. Otherwise I'll keep narrowing down which state differs. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-25 06:54 UTC · original

@⁠QemmHD a second NVIDIA machine for the picture regression: RTX 4070 Laptop, driver 591.59, Windows 11. Build: main c7e82e26e + #1558 + #1547 (slot 57 factory on), fresh first-run profile, warm pipeline cache.

  • It starts before "Finish setup?" here. On the "Navigation experience" (minimap) and "Subtitles" pages:

    • the condensed title font and the button prompts draw correctly over the gradient, which is still right on these pages;
    • the regular-weight text is drawn as one solid block per glyph and can't be read;
    • the option arrows are filled white squares;
    • the minimap illustration is a white frame, a black rectangle and a white diamond.

    Those quads look like they lose their texture's alpha completely, rather than getting a wrong colour, which fits your "hard-edged artwork". Some images of the loading slideshow are also posterized, with black patches.

  • This run only logged 12 unbound T# lines (6 of them "names no registered texture"), not 1,100+.

  • I can't confirm the restore without the factory on this laptop yet. With the same 3-line skip (LEONIDA_NATIVE_GRAPHICS=0 here), two runs never drew a first-run page: the title stays up for about 6 minutes while about 70 library compute pipelines build, then the screen goes grey and then black.

Measured with Claude Code.

**@⁠OreoFR** on GitHub · 2026-11-25 06:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7155291348) @⁠QemmHD a second NVIDIA machine for the picture regression: RTX 4070 Laptop, driver 591.59, Windows 11. Build: `main` `c7e82e26e` + #1558 + #1547 (slot 57 factory on), fresh first-run profile, warm pipeline cache. - **It starts before "Finish setup?" here.** On the "Navigation experience" (minimap) and "Subtitles" pages: - the condensed title font and the button prompts draw correctly over the gradient, which is still right on these pages; - the regular-weight text is drawn as one solid block per glyph and can't be read; - the option arrows are filled white squares; - the minimap illustration is a white frame, a black rectangle and a white diamond. Those quads look like they lose their texture's alpha completely, rather than getting a wrong colour, which fits your "hard-edged artwork". Some images of the loading slideshow are also posterized, with black patches. - **This run only logged 12 `unbound T#` lines** (6 of them "names no registered texture"), not 1,100+. - **I can't confirm the restore without the factory on this laptop yet.** With the same 3-line skip (`LEONIDA_NATIVE_GRAPHICS=0` here), two runs never drew a first-run page: the title stays up for about 6 minutes while about 70 library compute pipelines build, then the screen goes grey and then black. Measured with Claude Code.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 07:07 UTC · original

@⁠OreoFR thanks. "Quads lose their texture's alpha completely" fits what I saw better than a wrong colour does: unblended artwork, solid glyph blocks and black backgrounds where a gradient is composited. That points at the blend state of the pipelines the slot 57 native factory builds (e.g. BlendEnable or the render-target write mask not carried over from the record), rather than at the textures. That's a hypothesis I haven't measured yet. On the 4070 SUPER here, skipping the factory still draws the first-run pages correctly. Your laptop's 6-minute build of about 70 library compute pipelines without the factory looks like the separate compile-stall issue.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 07:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7155518557) @⁠OreoFR thanks. "Quads lose their texture's alpha completely" fits what I saw better than a wrong colour does: unblended artwork, solid glyph blocks and black backgrounds where a gradient is composited. That points at the **blend state** of the pipelines the slot 57 native factory builds (e.g. BlendEnable or the render-target write mask not carried over from the record), rather than at the textures. That's a hypothesis I haven't measured yet. On the 4070 SUPER here, skipping the factory still draws the first-run pages correctly. Your laptop's 6-minute build of about 70 library compute pipelines without the factory looks like the separate compile-stall issue. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-25 07:12 UTC · original

@⁠QemmHD the code agrees with your blend-state hypothesis. On main 42537e7b6, the slot 57 native factory never turns blending on:

  • runtime/shims/d3d12_xs_native_pso.h:164: the PSO desc starts zeroed (D3D12_GRAPHICS_PIPELINE_STATE_DESC pc{};). fill_fixed_state (line 33) then sets only RenderTargetWriteMask = ALL on each target, so every target keeps BlendEnable = FALSE, and AlphaToCoverageEnable is off as well. Depth is ALWAYS, and the cull mode is NONE.
  • The record's state blob A, which carries the blend, raster and depth state, is never read: runtime/src/native_pso.h:18 says "blend, raster, depth, not decoded". Only blob B (formats and input layout) is decoded.

So every pipeline the factory builds draws opaque. That gives exactly the symptoms we both see: glyph quads filled solid, hard-edged artwork, and black where a gradient should be composited over. It also explains why skipping the factory fixes your picture. palmetto reached the same point: its docs/state_blob.md decodes the blob's container over all 5,680 distinct state blobs, but pins no blend field and uses a default set instead.

If you aren't already on it, I'd like to take decoding the blend state from blob A, as an item in #1608. The starting point would be searching the blobs for RDNA2 CB_BLENDn_CONTROL / CB_COLOR_CONTROL-shaped words, using the register layout Mesa documents, with the UI pipelines (alpha over) as the first check. If you'd rather keep it, I'll test whatever you put up on this laptop.

AI-assisted.

**@⁠OreoFR** on GitHub · 2026-11-25 07:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7155614603) @⁠QemmHD the code agrees with your blend-state hypothesis. On `main` `42537e7b6`, the slot 57 native factory never turns blending on: - `runtime/shims/d3d12_xs_native_pso.h:164`: the PSO desc starts zeroed (`D3D12_GRAPHICS_PIPELINE_STATE_DESC pc{};`). `fill_fixed_state` (line 33) then sets only `RenderTargetWriteMask = ALL` on each target, so every target keeps `BlendEnable = FALSE`, and `AlphaToCoverageEnable` is off as well. Depth is `ALWAYS`, and the cull mode is `NONE`. - The record's state blob A, which carries the blend, raster and depth state, is never read: `runtime/src/native_pso.h:18` says "blend, raster, depth, not decoded". Only blob B (formats and input layout) is decoded. So every pipeline the factory builds draws opaque. That gives exactly the symptoms we both see: glyph quads filled solid, hard-edged artwork, and black where a gradient should be composited over. It also explains why skipping the factory fixes your picture. palmetto reached the same point: its `docs/state_blob.md` decodes the blob's container over all 5,680 distinct state blobs, but pins no blend field and uses a default set instead. If you aren't already on it, I'd like to take decoding the blend state from blob A, as an item in #1608. The starting point would be searching the blobs for RDNA2 `CB_BLENDn_CONTROL` / `CB_COLOR_CONTROL`-shaped words, using the register layout Mesa documents, with the UI pipelines (alpha over) as the first check. If you'd rather keep it, I'll test whatever you put up on this laptop. AI-assisted.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 07:22 UTC · original

@⁠OreoFR great find. That's the root cause: a zeroed desc with only RenderTargetWriteMask set means every native PSO draws opaque with depth ALWAYS. Please take the blend-state decode from blob A, it's yours. When you have a head, I'll A/B it on the real boot here (4070 SUPER), with the factory on versus off and capture comparisons on the first-run pages and loading art, and post the counts. A cheap interim option the maintainers might want until the decode lands: have the factory fall back to the translated-pipeline path for any record whose blob A isn't decoded yet, rather than build an opaque PSO.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 07:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7155793736) @⁠OreoFR great find. That's the root cause: a zeroed desc with only `RenderTargetWriteMask` set means every native PSO draws opaque with depth ALWAYS. Please take the blend-state decode from blob A, it's yours. When you have a head, I'll A/B it on the real boot here (4070 SUPER), with the factory on versus off and capture comparisons on the first-run pages and loading art, and post the counts. A cheap interim option the maintainers might want until the decode lands: have the factory fall back to the translated-pipeline path for any record whose blob A isn't decoded yet, rather than build an opaque PSO. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-25 07:43 UTC · original

@⁠QemmHD the blend-state decode is up as #1671. Blob A's shared block holds RDNA2 context registers: CB_TARGET_MASK at +0x78 and CB_BLEND0..7_CONTROL at +0xd0 (84 bytes further on in mesh pipelines). There are 34 distinct blend words across the library's 5,680 state blobs, all of them valid; the counts are in docs/fspx.md.

On a real boot here (main + #1558 + #1547 + #1671, RTX 4070 Laptop, fresh profile), the first-run pages, the legal screens (gradient and faded art behind them) and the loading slideshow draw correctly. The 1,937 dual-source (SRC1) records still keep blending off, because the translator has no second pixel-shader output yet. Your A/B on the 4070 SUPER would be very welcome.

AI-assisted.

**@⁠OreoFR** on GitHub · 2026-11-25 07:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7156188699) @⁠QemmHD the blend-state decode is up as #1671. Blob A's shared block holds RDNA2 context registers: `CB_TARGET_MASK` at `+0x78` and `CB_BLEND0..7_CONTROL` at `+0xd0` (84 bytes further on in mesh pipelines). There are 34 distinct blend words across the library's 5,680 state blobs, all of them valid; the counts are in `docs/fspx.md`. On a real boot here (`main` + #1558 + #1547 + #1671, RTX 4070 Laptop, fresh profile), the first-run pages, the legal screens (gradient and faded art behind them) and the loading slideshow draw correctly. The 1,937 dual-source (`SRC1`) records still keep blending off, because the translator has no second pixel-shader output yet. Your A/B on the 4070 SUPER would be very welcome. AI-assisted.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 07:53 UTC · original

@⁠OreoFR nice work on #1671. A real-boot A/B on the 4070 SUPER is queued (factory on, with vs without #1671, comparing captures of the landing prompt and loading slideshow and the unbound T# counts). I'll post the result on #1671.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 07:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/939#issuecomment-7156363238) @⁠OreoFR nice work on #1671. A real-boot A/B on the 4070 SUPER is queued (factory on, with vs without #1671, comparing captures of the landing prompt and loading slideshow and the `unbound T#` counts). I'll post the result on #1671. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.