[PR #321] [MERGED] [draft, integration] retail boot to the frame loop on current main (RT-BOOT-INTEGRATION) #374

Closed
opened 2026-11-26 20:17:40 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/321
Author: @Mumogg
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: boot/frame-loop-on-main


📝 Commits (10+)

  • e925b63 d3d12_xs: route command queue slot 35 to ExecuteCommandLists
  • d3a1c29 d3d12: persist the pipeline cache across launches (D3D-704)
  • 86cd0c5 d3d12: draw the console's rectangle lists (17, PSO type 19) and quad lists (19) as triangles
  • a6b31d5 d3d12: rectangle list stage emits (v1 v2 v4) (v1 v4 v3) with capability Geometry, log cut-off quads (review fixes)
  • a3da512 d3d12: checkpoint slow compute pipeline compiles
  • 49410a5 d3d12: a slot-133 buffer whose pages are not imported is a shadow at the title's VA
  • 14dc9af d3d12: enable SSE4.1 for Clang's slot-133 streaming copy
  • ba5e9a3 local: merge #7604
  • ccf9f87 local: merge #7286 with list-array unwrap
  • d2b4538 Merge remote-tracking branch 'astro/ladder-frame' into local/ladder-frame-wine

📊 Changes

116 files changed (+15904 additions, -1582 deletions)

View changed files

📝 README.md (+1 -1)
📝 docs/README.md (+5 -0)
📝 docs/d3d12_command_objects.md (+11 -4)
📝 docs/d3d12_vulkan.md (+130 -36)
➕ docs/d3d12_xs_console_abi.md (+279 -0)
📝 docs/design.md (+7 -2)
➕ docs/directstorage.md (+197 -0)
📝 docs/embedded_shaders.md (+20 -8)
📝 docs/pipeline_check.md (+18 -0)
📝 docs/retail_boot_chain.md (+1 -1)
📝 docs/runtime_imports.md (+43 -4)
📝 docs/shader_library.md (+5 -7)
📝 docs/xdxr.md (+34 -0)
📝 make_game.py (+84 -1)
📝 runtime/CMakeLists.txt (+186 -6)
📝 runtime/shims/d3d12_com.cpp (+48 -2)
📝 runtime/shims/d3d12_com.h (+16 -0)
📝 runtime/shims/d3d12_com_object.h (+9 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+760 -47)
📝 runtime/shims/d3d12_xs.cpp (+21 -2)

...and 80 more files

📄 Description

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

main 84347bbb6 merged with the stack that reaches the frame loop on my machine: ASTROWwwW's ladder-frame integration 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: main has most of these commits as ancestors without their content (finding in #14), so git treats them as already merged. This was merged against main'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.

main 9ec34cdff main + #127 + #131 this branch
D3D12 calls 0 1 (D3D12XboxCreateDevice) 1,800,377
Pipeline states created 0 0 50,468
ExecuteCommandLists 0 0 178,233, none failed
DrawInstanced 0 0 133,669
PresentX 0 0 89,126
Ends with title int3 at 0.65 s host AV at device slot 26 still running at the timeout

The 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: this branch keeps the run-mapped physical pages of the stack (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.
  • Slot 14: main routes 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.
  • Rect lists: the fourth corner is v2 + v3 - v1, the rule d3d12_rect_list tests. LEONIDA_RECT_FOURTH=v1v3 switches to v1 + 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) at e0d4fd2b8: 292 of 321 pass. For comparison, plain main 9ec34cdff under the same Wine: 275 of 299.

  • 22 failures are the same tests that fail on plain main here.
  • xmem and d3d12_com fail on main and pass on this branch.
  • Seven fail only here:
    • d3d12_xmem_placed and d3d12_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 #131.
    • run_tiny_tls_ga: its last part sets TMP/TEMP to 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 fresh VirtualAlloc lands above the arena size; under Wine it lands below.
    • pipeline_cache_seed: vk_pipeline_check exits 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

  • The diagnostics and experiment switches that were in the first push are removed (e0d4fd2b8). Four switches remain, each for a fix that is not proposed for main yet: LEONIDA_GRAPHICS_STAGE_LAYOUT (opt-in), LEONIDA_DESC_MIRROR, LEONIDA_SLOT70_TITLE (on by default) and LEONIDA_RECT_FOURTH.
  • My own fixes that I intend to send separately, each with its measurement: descriptor write-through and table mirror for title-backed heaps, graphics root arguments in the s8 window, slot 70 views over title memory, vertex and index views in title memory.
  • A run of more than about five minutes needs a memory cap here: NVIDIA's compiler takes the title's largest compute modules and memory goes from about 20 GB to over 50 GB.

No game data, addresses or offsets are in the branch (scripts/check_no_game_data.py over 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/321 **Author:** [@Mumogg](https://github.com/Mumogg) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `boot/frame-loop-on-main` --- ### 📝 Commits (10+) - [`e925b63`](https://github.com/ubiquitarianism/leonida/commit/e925b634551ed96d1ed097dfe17d7dfca0cdbe4d) d3d12_xs: route command queue slot 35 to ExecuteCommandLists - [`d3a1c29`](https://github.com/ubiquitarianism/leonida/commit/d3a1c290b5738694e4d3b78a66350e70e0eb5846) d3d12: persist the pipeline cache across launches (D3D-704) - [`86cd0c5`](https://github.com/ubiquitarianism/leonida/commit/86cd0c5f2a392f6637ff5724d2786b12084b28b7) d3d12: draw the console's rectangle lists (17, PSO type 19) and quad lists (19) as triangles - [`a6b31d5`](https://github.com/ubiquitarianism/leonida/commit/a6b31d51ac5d4ea43e965539fd1793f7d995d6db) d3d12: rectangle list stage emits (v1 v2 v4) (v1 v4 v3) with capability Geometry, log cut-off quads (review fixes) - [`a3da512`](https://github.com/ubiquitarianism/leonida/commit/a3da5122fdb1d4d9db8c5c2cdb89e9f04f46671b) d3d12: checkpoint slow compute pipeline compiles - [`49410a5`](https://github.com/ubiquitarianism/leonida/commit/49410a52fc6684f09692d551815fd385c73be7fc) d3d12: a slot-133 buffer whose pages are not imported is a shadow at the title's VA - [`14dc9af`](https://github.com/ubiquitarianism/leonida/commit/14dc9af525c5e54f9edbde43ccb2bbe499007852) d3d12: enable SSE4.1 for Clang's slot-133 streaming copy - [`ba5e9a3`](https://github.com/ubiquitarianism/leonida/commit/ba5e9a39c94bf873fe05109200ab1986602a005f) local: merge #7604 - [`ccf9f87`](https://github.com/ubiquitarianism/leonida/commit/ccf9f87fc30c23ba9b9bb5809b4d0705400ae567) local: merge #7286 with list-array unwrap - [`d2b4538`](https://github.com/ubiquitarianism/leonida/commit/d2b4538c4c6129bb2472bbcb78343ae555c1cfae) Merge remote-tracking branch 'astro/ladder-frame' into local/ladder-frame-wine ### 📊 Changes **116 files changed** (+15904 additions, -1582 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -1) 📝 `docs/README.md` (+5 -0) 📝 `docs/d3d12_command_objects.md` (+11 -4) 📝 `docs/d3d12_vulkan.md` (+130 -36) ➕ `docs/d3d12_xs_console_abi.md` (+279 -0) 📝 `docs/design.md` (+7 -2) ➕ `docs/directstorage.md` (+197 -0) 📝 `docs/embedded_shaders.md` (+20 -8) 📝 `docs/pipeline_check.md` (+18 -0) 📝 `docs/retail_boot_chain.md` (+1 -1) 📝 `docs/runtime_imports.md` (+43 -4) 📝 `docs/shader_library.md` (+5 -7) 📝 `docs/xdxr.md` (+34 -0) 📝 `make_game.py` (+84 -1) 📝 `runtime/CMakeLists.txt` (+186 -6) 📝 `runtime/shims/d3d12_com.cpp` (+48 -2) 📝 `runtime/shims/d3d12_com.h` (+16 -0) 📝 `runtime/shims/d3d12_com_object.h` (+9 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+760 -47) 📝 `runtime/shims/d3d12_xs.cpp` (+21 -2) _...and 80 more files_ </details> ### 📄 Description 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 `main` `84347bbb6` merged with the stack that reaches the frame loop on my machine: ASTROWwwW's `ladder-frame` integration 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: `main` has most of these commits as ancestors without their content (finding in #14), so git treats them as already merged. This was merged against `main`'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`. | | `main` `9ec34cdff` | `main` + #127 + #131 | this branch | |---|---|---|---| | D3D12 calls | 0 | 1 (`D3D12XboxCreateDevice`) | 1,800,377 | | Pipeline states created | 0 | 0 | 50,468 | | `ExecuteCommandLists` | 0 | 0 | 178,233, none failed | | `DrawInstanced` | 0 | 0 | 133,669 | | `PresentX` | 0 | 0 | 89,126 | | Ends with | title `int3` at 0.65 s | host AV at device slot 26 | still running at the timeout | The 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**: this branch keeps the run-mapped physical pages of the stack (`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. - **Slot 14**: `main` routes 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. - **Rect lists**: the fourth corner is `v2 + v3 - v1`, the rule `d3d12_rect_list` tests. `LEONIDA_RECT_FOURTH=v1v3` switches to `v1 + 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`) at `e0d4fd2b8`: **292 of 321 pass**. For comparison, plain `main` `9ec34cdff` under the same Wine: 275 of 299. - 22 failures are the same tests that fail on plain `main` here. - `xmem` and `d3d12_com` fail on `main` and pass on this branch. - Seven fail only here: - `d3d12_xmem_placed` and `d3d12_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 #131. - `run_tiny_tls_ga`: its last part sets `TMP`/`TEMP` to 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 fresh `VirtualAlloc` lands above the arena size; under Wine it lands below. - `pipeline_cache_seed`: `vk_pipeline_check` exits 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 - The diagnostics and experiment switches that were in the first push are removed (`e0d4fd2b8`). Four switches remain, each for a fix that is not proposed for `main` yet: `LEONIDA_GRAPHICS_STAGE_LAYOUT` (opt-in), `LEONIDA_DESC_MIRROR`, `LEONIDA_SLOT70_TITLE` (on by default) and `LEONIDA_RECT_FOURTH`. - My own fixes that I intend to send separately, each with its measurement: descriptor write-through and table mirror for title-backed heaps, graphics root arguments in the s8 window, slot 70 views over title memory, vertex and index views in title memory. - A run of more than about five minutes needs a memory cap here: NVIDIA's compiler takes the title's largest compute modules and memory goes from about 20 GB to over 50 GB. No game data, addresses or offsets are in the branch (`scripts/check_no_game_data.py` over 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.com/claude-code) https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:40 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#374
No description provided.