Repository navigation
[draft, integration] retail boot to the frame loop on current main (RT-BOOT-INTEGRATION) - #321
Conversation
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)
Windows / RTX 3070 frame-loop resultTested the PR #321 head The full shaders stage completed first: 26,503 corpus shaders, 21 FSPX programs, 52 BVH programs and 2,528 pipeline-library programs. The runtime loaded 29,104 translated shaders. Guarded bootA wrapper sampled free system RAM every 2 seconds and stopped the process if it fell below 3 GiB.
The stack reached the frame loop and continued presenting until the RAM guard stopped it. There was no crash, no failed present and no title The first D3D12 failures were 14 Command evidence$env:LEONIDA_D3D12 = 'vulkan'
$env:LEONIDA_SHADERS = '<work>\shaders\spirv'
& '<frame-loop>\runtime\build\windows-rtx3070\gta6rt.exe' `
--run '<package>\game_scarlett_master.exe' `
--game-dir '<package>' `
--overlay '<writable overlay>' `
--trace "$env:TEMP\leonida-frame-20261124-131518.jsonl" `
--trace-d3d12
# The wrapper stopped the process at 2.88 GiB free after 284.4 s.
python -I tools/boot_trace.py `
"$env:TEMP\leonida-frame-20261124-131518.jsonl" `
--d3d12 "$env:TEMP\leonida-frame-20261124-131518.stderr.log" `
--counts-only
Follow-up patchClaimed RT-LAZY-PSO-RECT-LIST in coordination issue #14: #14 (comment) Focused local commit Counts and outcomes only; no game data included. AI-assisted (DeepSeek v4.1 Flash 1017). |
|
Provenance clarification for the 14 nonfatal PSO refusals: the shader build was run from plain No game data included. AI-assisted (DeepSeek v4.1 Flash 1017). |
Windows / RTX 3070 — PR #321 + #511 + rectangle-list fix + #588 + #461 + #517Tested on Windows 11, MSVC 14.44.35207, NVIDIA GeForce RTX 3070 (Ampere), driver 610.88, Vulkan SDK 1.4.363.0, with a byte-verified 1.0.2.1 package. Stack head: ValidationGuarded bootCommand: $env:LEONIDA_D3D12 = 'vulkan'
$env:LEONIDA_SHADERS = '<work>\shaders\spirv'
$env:LEONIDA_LAZY_PSO = '1'
$env:LEONIDA_ARENA_MB = '1024'
$env:LEONIDA_ALLOC_LOG = '1'
$env:LEONIDA_CAPTURE = '<capture dir>'
$env:LEONIDA_CAPTURE_EVERY = '1'
$env:LEONIDA_CAPTURE_LIMIT = '10'
& '<stack>\runtime\build\windows-rtx3070\gta6rt.exe' `
--run '<package>\game_scarlett_master.exe' `
--game-dir '<package>' `
--overlay '<writable overlay>' `
--trace '<temp>\leonida-lazy.jsonl' `
--trace-d3d12The wrapper stopped the process if free RAM fell below 3 GiB or after 600 seconds.
All seven captured frames are 2564×1421 and 100% black (mean RGB 0.00, one unique color). First stop advancedThe previous The new stop is a title Also measured in this run:
Follow-up claimed
The measured NVIDIA path is to allocate the title's placeholder reservation from inside the arena's host mapping and rebase title addresses by subtraction, rather than importing a separate sparse buffer. This depends on #375/#644 but does not duplicate them. Counts, shapes and outcomes only; no game data included. AI-assisted (DeepSeek v4.1 Flash 1017). |
|
Native Windows synthetic presentation check on integration head
This is a synthetic test finding. The retail executable was not run and these results do not establish the cause of a blank retail frame. No game files or game logs used for these tests. AI-assisted (Codex). |
|
Tested on native Windows with MSVC, which the description says was not tried yet: Windows 10 22H2 (19045), NVIDIA GeForce RTX 3060, driver 610.88 (32.0.16.1088), MSVC 19.44, Windows SDK 10.0.26100,
|
… answered on main and pending retail The Where entry still said the integration tree "carries a fix for stop 4 that main does not", which reads as a missing fix. It now names the commit the retail measurement was taken at (867d922) and says the integration tree clears stop 4 with #4313. Status opens with "answered on main by b7a3fed and 4710549 ... the retail confirmation is still pending", and names #4313 (carried by #321 and #64) as an alternative design. Tested: tests/test_docs_*.py, 47 passed (test_docs_links green); the repo-consistency set, 566 passed, 5 skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
Verified on the integration head in ProjectLeonida/mandy#321.
Independent command-generation and argument checks for ProjectLeonida/mandy#321.
Record the 16-run Wine/RTX 4070 Ti matrix against Mumogg's integration head. Track the distinction from Dezmonius's Windows dispatch report in ProjectLeonida/mandy#321.
Compare two source-built presenters with a standalone native/Wine control. Follow up on Dezmonius's integration measurements in ProjectLeonida/mandy#321.
|
Independent Linux/Wine validation of exact head Hardware/environment: Ryzen 7 9800X3D, RTX 5090, NVIDIA 620.73.04, Wine 11.22, Linux 7.3.6-1-cachyos. Title runs used the actual desktop, isolated networking, read-only package input, and separate writable artifacts. No shader substitutions or exception-skipping flags. Build/test results
The comparison applied the published Real title results (PresentX counted at one layer, not double-counted):
Each was stopped by its time bound (exit 124), not an application crash. These are not performance comparisons; later runs reused caches. The longer run experienced cgroup MemoryHigh pressure and swap use, but no hard-limit/OOM kill. Concrete finding: with the 256 MiB default, the first three runs logged 14/12/14 slot-67 native compute failures returning This confirms a frame loop here, not visible gameplay. Increasing the arena removes one observed failure but does not solve the black frames. Next comparison is the newer first-run UI integration in #939. No game-derived files, raw title logs, shader identifiers, or captures attached. |
…first-run UI 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.
…ax, wrxchg b64) Six wave32 fixtures for the docs/design.md rows 321, 322 and 324, each an eight-word dump and lane 0 alone running the atomics: - cs_w32_lds_mskor (ProjectLeonida#321): ds_mskor_b32 and ds_mskor_rtn_b32, including DATA2 bits outside DATA being ORed in (0x11223344, mask 0x0000FFFF, DATA2 8 -> 0x11220008) and the rtn old word. - cs_w32_lds_atomics_incdec / _atomics_rtn (ProjectLeonida#322): ds_inc/dec/rsub_u32 at the DATA-1, DATA, above-DATA, 0 and 1 boundaries, the rsub wrap, and the pre-op word each _rtn_ form returns. - cs_w32_lds_minmax_f32 (ProjectLeonida#322): ds_min/max_f32 and the returning forms with a qNaN in either operand, -0/+0 and +inf/-inf. - cs_w32_lds_wrxchg_b64 (ProjectLeonida#324): ds_wrxchg_rtn_b64 and ds_wrxchg2_rtn_b64, the old pair, vdst order at *8 offsets 1 and 2, and the words written. - cs_w32_lds_wrxchg2st64_b64 (ProjectLeonida#324): ds_wrxchg2st64_rtn_b64 at *64 offsets 1 and 2 (0x200/0x400) over a 2 KiB LDS, with *8 markers so a wrong unit fails. Registered in check.py (CS_DUMPS and both wave32 lists), run_gpu_tests.py (every table and the wave64 exclusion), and regen_fixtures.py. Pinned by tests/semantic/test_batch5_gpu_fixtures.py, which runs the same eight words through spirv_mini_interp. Both runners pass on the RDNA2 iGPU (gfx1036, RADV Mesa 27.0.0-devel), 8/8 words per fixture. No translator mismatch appeared.
…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>
Claimed in #14 as
RT-BOOT-INTEGRATION. Draft: for testing and for carving into small pull requests, not for merging as it is. #127 and #131 are the first two pieces, already carved out.What this is
main84347bbb6merged with the stack that reaches the frame loop on my machine: ASTROWwwW'sladder-frameintegration of the retail boot pull requests, the old pull requests 7604, 7286, 7584, 6446, 8591, 7384, 7535, 7448, 9137 and 9419, and my own fixes on top. Almost none of it is my code: the authors are in the history (ASTROWwwW, tedin7, mariuslozo-boop, Jadiac, NiiRoZz, Etr0p, Gustavo Kissel, hcristosm, thibaut and others).Why a merge and not a rebase of each piece:
mainhas most of these commits as ancestors without their content (finding in #14), so git treats them as already merged. This was merged againstmain's tree with the conflicts resolved by hand; the two merge commits say what was chosen where.Measured
Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, 300 s,
LEONIDA_D3D12=vulkan.main9ec34cdffmain+ #127 + #131D3D12XboxCreateDevice)ExecuteCommandListsDrawInstancedPresentXint3at 0.65 sThe window stays black: with the real pixel stages the title composes a fully transparent layer over its clear. That is what it draws while it waits at this point, as far as I can tell, not a presentation fault (a forced clear colour and a forced pixel stage both reach the screen).
Choices that need a maintainer's decision
xmem.cpp).main's commit-on-touch xmem, with the two view-protection fixes it lost (7e8e3c1db,954fcb106), boots to 50,468 pipelines here and then fails one submit with an unknown resource. Without those two fixes it stops at 1,181 calls: the title's device set-up returns false after the first map into a write-combined window. I can send those two fixes on their own.mainroutes the console descriptor heap to a handler in the Vulkan layer; the stack serves it inside the proxy with title-backed heaps (old PR 7021). The handler is registered and stored here, but not called.v2 + v3 - v1, the ruled3d12_rect_listtests.LEONIDA_RECT_FOURTH=v1v3switches tov1 + v3 - v2, the only one that covered the target for the title's full-screen rectangle draws here. Open question, not a claim.Tests
Every target builds. Runtime suite under Wine (
ctest -j 4) ate0d4fd2b8: 292 of 321 pass. For comparison, plainmain9ec34cdffunder the same Wine: 275 of 299.mainhere.xmemandd3d12_comfail onmainand pass on this branch.d3d12_xmem_placedandd3d12_console_descriptor_heap:main's tests of the two designs this branch does not use yet (commit-on-touch xmem, the slot 14 handler). See the choices above.dstorage: the guard-page case, as in runtime: restore the console DirectStorage shim, with the typed-error inflate it needs (RT-DSTORAGE-RESTORE, #47) #131.run_tiny_tls_ga: its last part setsTMP/TEMPto a missing folder and expects the reservation to fail; under Wine the run returns 0. I read that as Wine not passing those variables through, not verified.d3d12_title_va: stops at its first check, that a freshVirtualAlloclands above the arena size; under Wine it lands below.pipeline_cache_seed:vk_pipeline_checkexits 9 without output on the synthetic shader. Cause not found.xs_proxy_mock: passes when run alone, failed in the parallel run. Cause not found.Not built with MSVC and not run on Windows.
Rough edges, stated plainly
e0d4fd2b8). Four switches remain, each for a fix that is not proposed formainyet:LEONIDA_GRAPHICS_STAGE_LAYOUT(opt-in),LEONIDA_DESC_MIRROR,LEONIDA_SLOT70_TITLE(on by default) andLEONIDA_RECT_FOURTH.No game data, addresses or offsets are in the branch (
scripts/check_no_game_data.pyover every added or changed file, plus a grep for image addresses).AI-assisted (Claude Code); built, run and measured on the machine above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt