Repository navigation
[integration] Windows offline boot to the first-run UI (RT-WINDOWS-FIRST-RUN-UI) - #939
Conversation
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 c7d5f8e.
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 (ProjectLeonida#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.
…lists (19) as triangles 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.
…ty Geometry, log cut-off quads (review fixes)
Depends on: #7384 AI-assisted: yes (Codex)
…the title's VA 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 <noreply@anthropic.com>
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).
… buffer V#s the layer writes 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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ugh an arena window 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 <noreply@anthropic.com>
… declared slots and is timed 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 <noreply@anthropic.com>
…, not the GLSL keyword out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er variables Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…are pulled in before the scan Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at inputs use the first quad vertex, and the PSO topology type is read as raw bits 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 a6b31d5 and passes with it). Re-run here: replay_quad_list_test and d3d12_rect_list_test exit 0 on the pod (Wine, RTX 4090).
…ed value Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e told apart from float outputs on the vertex side (comment only)
|
@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). |
|
@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 AI-assisted (Claude Code, Claude Opus 5.5). |
|
@QemmHD ran #1558 here with both modes, results on the PR: #1558 (comment) 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. |
main records the console's value writes (list slots 71 and 72) as GPU completion labels since ProjectLeonida#939. This widens where a completed label may land: the GPU address arena, and the pages the title maps, which main does not track and whose title view may be PAGE_NOACCESS for the CPU. The recording stays main's; the landing and the default are ours.
|
@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):
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 a second NVIDIA machine for the picture regression: RTX 4070 Laptop, driver 591.59, Windows 11. Build:
Measured with Claude Code. |
|
@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). |
…C-README-BOOT-STATUS) The status still said the game does not boot and the PE loader row said it was untested against the real executable. Since ubiquitarianism#321, ubiquitarianism#939 and ubiquitarianism#984, main boots the game from your own copy on native Windows and on Linux through Proton, through the story load into the world phase, as docs/linux_proton.md and docs/first_run_ui.md record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@QemmHD the code agrees with your blend-state hypothesis. On
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 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 AI-assisted. |
|
@OreoFR great find. That's the root cause: a zeroed desc with only AI-assisted (Claude Code, Claude Opus 5.5). |
|
@QemmHD the blend-state decode is up as #1671. Blob A's shared block holds RDNA2 context registers: On a real boot here ( AI-assisted. |
…scriptor heaps Rebased onto upstream main on top of ProjectLeonida#939 (LEONIDA_DESC_MIRROR) and the below-arena guard: - d3d12_com.h / d3d12_vulkan_device.cpp: add rt::d3d12::host_import_va_in_vsharp_range() so positive offsets >= 2^48 above heap_base also fall back to the arena shadow while preserving LEONIDA_IMPORT_BELOW_ARENA=1 for below-arena imports; add deterministic 48-bit boundary + BDA arena tests in d3d12_existing_heap_test.cpp. - d3d12_xs_device.cpp: layer two missing sync paths directly on top of LEONIDA_DESC_MIRROR and local_accessible(): 1) local_sync_source() before CopyDescriptors / CopyDescriptorsSimple so direct CPU writes to custom-backed source heaps reach destinations immediately on the CPU timeline. 2) Per-slot 64-bit fingerprint sync (local_sync_shader_visible_heaps) before queue ExecuteCommandLists (slots 10/35) for shader-visible custom-backed heaps, picking up pre-filled slots on first submit and title-byte-copied descriptors outside 64-slot root-table binds without copying unchanged slots. - d3d12_console_descriptor_heap_test.cpp: add unit coverage for pre-filled first-submit sync, post-creation direct writes, and CopyDescriptorsSimple / CopyDescriptors from custom-backed heaps.
…-fallback Merging. **Why merged** - Fixes the NVIDIA startup stop that #939 introduced. Slot 133 asks for a D16S8 (format 118) depth texture with unordered access. On NVIDIA, `pc_format()` maps it to D24S8 and the depth provider refuses UAV on that, so the boot died early. With this PR the refusal is logged once and the texture is made without UAV, i.e. the pre-#939 stand-in. - Independent real-boot confirmations past the stop, each against the same build without the PR stopping there: - RTX 4070 SUPER, Windows 11; - RTX 5060 Ti, Windows 10 (Snooozs); - RTX 3070 Ti, Wine 11.22 (djrolfes); - RTX 3080 Ti, Wine 11.17 (slauko: 603 s, no exception); - RTX 3090, Proton (azsekazvamdimitar). - On AMD (adrianmjim, RX 7900 XT) the native path is untouched and the related tests pass, including a GPU without D24S8 that falls back to D32S8. - Re-tested here merged onto 3de22a1 (after #1547) on an RTX 4070 SUPER, and the merge onto the current main (57ba40b, which only adds #1493's translator change) is also clean: - fresh RelWithDebInfo build; - full ctest 410/411, where the only failure is `d3d12_depth_resolve`, the known NVIDIA MFAA sample-position case fixed by #1505; - the PR's 16 related tests pass, also with `LEONIDA_VK_VALIDATION=1`; - the consistency set is the same as main. **Why it's good** - It's a narrow fallback, used only when the provider refuses. Consoles and GPUs that accept the format keep the native path. - It comes with tests for the refused and accepted cases. - It unblocks every NVIDIA tester at the same spot. **Known and separate:** the slot 133 stand-in leaks about 60 Vulkan objects at device teardown under validation. That leak predates this PR and is reported in #1608. Full D16S8 UAV semantics on NVIDIA remain a follow-up. AI-assisted (Claude Code, Claude Opus 5.5).
…der refuses it Since ProjectLeonida#939, slots 76 and 133 hand a depth-stencil texture with unordered access to the depth provider. On a GPU with D24S8 attachments (every NVIDIA card) the Vulkan layer's pc_format() makes D16_UNORM_S8_UINT (format 118) as D24_UNORM_S8_UINT, and Resource::enable_depth_stencil_uav accepts only R16_TYPELESS, 118 and R32G8X24_TYPELESS, so it answers E_INVALIDARG. Slot 133 passed that on for a 1280x720 format 118 texture with ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS (all-ones layout), and the boot stopped on an int3. When the provider refuses (E_INVALIDARG or E_NOTIMPL from the provider call itself), slot 76 now makes the committed texture without unordered access and slot 133 goes on to its stand-in (the title-placed texture, else the committed one), as both did before the provider. The first refusal per slot is logged. Any other failure is passed on as before: the provider out of memory, the backing's own CreateCommittedResource, a refused placement or description. The refused backing is released and no placement range is registered. On a real boot (Windows 11, RTX 4070 SUPER, driver 621.24), on 0bc8105 with an earlier form of this change that fell back on any failure of the depth path (the only one that occurred was the provider's): the fallback fires once (slot 133, format 118, hr=0x80070057), no int3, 6,187 PresentX ok and 0 failed, 69/69 captures non-black, and the boot reaches the first-run pages. Without it, 3 of 3 boots stopped on the int3 after 182-362 PresentX. Tests: - xs_proxy_mock: a mock provider refusing a format 118 texture (E_INVALIDARG, E_NOTIMPL) through slots 76 and 133 gets S_OK and the stand-in, with the refused backing released; E_OUTOFMEMORY from the provider, a failing backing and a refused placement are passed on with no stand-in. - xbox_d16s8_refused_uav (Vulkan, LEONIDA_CONSOLE_D16S8=d24): slots 76 and 133 return a depth-stencil texture without unordered access. Both fail without the change (slot 76 and slot 133 each checked on its own). Follow-up: teach enable_depth_stencil_uav the D24S8-made form of format 118, so these textures keep their UAVs on NVIDIA too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
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 normalmake_game.pycommand and the launch command. Build and launch from this branchTested
eb6a08cd3build, 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.check,shaders,runtimecommand 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 withcheck,runtime.d3d12_vulkan_devicetest 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.GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 x64 build 26200, MSVC x64 RelWithDebInfo.
AI-assisted: Yes (Codex).
Checklist
mainand checked for a clean merge.docs/design.md.