[PR #1723] [MERGED] Integrate post-story-load memory, queue and Vulkan fixes (RT-POST-STORY-RUNTIME) #1739

Closed
opened 2026-11-26 21:18:47 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: integration/post-story-runtime


📝 Commits (10+)

  • ba62682 Integrate post-story-load memory, queue and Vulkan runtime changes
  • be6301b Merge commit 'refs/tmp/main' into HEAD
  • df2e409 runtime: define NOMINMAX before windows.h in submit_phases.h and thread_sampler.h
  • 682a557 runtime test: define the slot-31 recorder check_list_values_more uses
  • eedc7c8 d3d12_xs: queue slot 31 without a mapper keeps the unmodelled answer
  • 6f36d14 d3d12: inline table V#s nothing backs become zero-size, as console heap slots
  • d7ef292 d3d12: a V# may name a layer buffer below the arena again, sign-extended
  • 92394f1 title_gpu_views: a pair can be marked independent; such a twin is not imported
  • 29c356b runtime test: cs_user_data's descriptor-word mode gets its own sentinel
  • c7fdc26 runtime test: compile_teardown expects no session cache from llvmpipe

📊 Changes

107 files changed (+27279 additions, -8823 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+98 -12)
📝 docs/d3d12_xs_console_abi.md (+77 -0)
📝 docs/first_run_ui.md (+1 -1)
📝 runtime/CMakeLists.txt (+221 -26)
📝 runtime/README.md (+38 -2)
📝 runtime/shims/d3d12_com.cpp (+202 -51)
📝 runtime/shims/d3d12_com.h (+30 -3)
📝 runtime/shims/d3d12_com_object.h (+30 -4)
➕ runtime/shims/d3d12_compile_exit.h (+13 -0)
📝 runtime/shims/d3d12_compute_input_probe.h (+255 -8)
📝 runtime/shims/d3d12_geometry_views.h (+189 -25)
➕ runtime/shims/d3d12_indirect_draw_policy.h (+20 -0)
📝 runtime/shims/d3d12_pipeline_compile.h (+232 -28)
📝 runtime/shims/d3d12_title_buffer_windows.h (+37 -5)
📝 runtime/shims/d3d12_title_image_upload.h (+100 -50)
📝 runtime/shims/d3d12_vulkan_device.cpp (+1989 -353)
📝 runtime/shims/d3d12_xs_device.cpp (+958 -13)
📝 runtime/shims/d3d12_xs_device.h (+64 -0)
➕ runtime/shims/d3d12_xs_list_values.h (+1291 -0)
📝 runtime/shims/dstorage.cpp (+14 -4)

...and 80 more files

📄 Description

Claimed as RT-POST-STORY-RUNTIME in the coordination issue.

This follows #984, which brought the offline boot through the end of the story load on Linux/Proton and native Windows. This draft brings the subsequent runtime changes onto upstream’s pipeline-worker, descriptor and queue interfaces. It includes the queue, memory and draw changes together so reviewers can exercise the same executable the integration tests cover.

What and why

Area Change
Physical memory A reserve-only XMem window carved from a live parent keeps the ranges on either side. Page remaps, CPU/GPU aliases, first-touch handling and guarded copies now coordinate with the threads that use them. An opt-in private heap isolates title allocations.
Command lists and queues Console 32- and 64-bit writes, waits and GPU timestamps retain their position in the list. Queue page remaps keep their fence alive until completion. This overlaps the write-value work in #622.
Indirect graphics Simple DRAW and DRAW_INDEXED signatures use the recorded pipeline, targets, root data and index/vertex bindings. Bundles can record the operation and inherit the executing parent's state. The GPU checks argument counts in private scratch and applies a shared work budget per command list. Unsupported signatures still go through validation.
Descriptors and arena Unreachable buffer descriptors resolve to a null view. Unbacked slots retry under a bounded budget. Heap padding protects the covered range beyond the last resource descriptor. Arena allocation and free-block walks use the same lock.
Textures and submission Texture refresh holds references across callbacks; optional background work moves fills and geometry copies off the submitting thread. Buffer refreshes can copy only dirty tiles. Layout changes are journaled per submission. Small linear RGBA32F exposure targets have a tested readback footprint.
Ray tracing and presentation TLAS construction translates instance addresses for bottom-level acceleration structures. Startup splash detection samples the readback image sparsely.
Pipeline lifetime Background compilation and device teardown coordinate so a released pipeline cannot leave queued work using its Vulkan objects. Submission, compiler and device-fault diagnostics expose where execution stalls.
Diagnostics and tests Optional Nsight Aftermath support, frame-phase counters, a local stage timeline, GPU pixel/readback fixtures and CPU concurrency tests.

Contributors. Plaaasma co-authored the changes, including XMem window handling, list values and descriptor backing. ivanepsilondelta contributed the stateful indirect graphics and pixel tests. Both are credited on the integration commit.

Tested

Platform and build Observed result
Linux / Proton, accepted working build Offline Series S configuration on an RTX 4070. Landed at about 40 s and entered story loading at about 60 s. The loading screen had ended by the 160 s sample. The runtime continued submitting work until a title assertion at about 545 s, at roughly 0.85 title frames/s after loading. The run reported no GPU device loss.
Linux, public integration during rebase 6,280 translator tests passed across 488 files. The portable runtime suite passed 87 of 89 registered cases. Two skipped because the translated corpus and Vulkan validation mode were unset. The three changed built-in compute shaders regenerated byte-for-byte from their GLSL and passed SPIR-V validation.
Windows executable, cross-built on Linux The x64 MSVC-target executable linked and ran under Proton. The RTX 4070 passed the null-descriptor and indirect-clamp GPU fixtures. Texture-layout tests passed 465 checks. An earlier trial of the public integration stopped at a title breakpoint during initialization with the locally available shader library.
Native Windows The previously merged baseline reached the end of story loading on Windows 11 with an RTX 4070 Ti. The public integration head still needs a native Windows boot. Baseline results in #984

The accepted working build used a diagnostic configuration with title compute, indirect draws and acceleration-structure builds disabled, and stub pipelines enabled. That run establishes progress through loading. Playable world rendering and default-settings performance remain unverified.

Open checks for this draft

  • During testing the indirect bundle and heap-resource pixel fixtures exposed a replay path that read scratch arguments before the GPU clamp populated them. This commit fixes the missing dispatch. Those pixel fixtures and a direct-heap test that timed out need a fresh run after the rebase.
  • The default XMem suite on Proton still failed its system-wide commit-charge assertion, which also failed on upstream. Forced reserve mode had additional Wine view-state and protection mismatches.
  • The final rebase retained upstream's new pipeline compilation workers. The new null-buffer semantic test, data guard, diff checks and clean merge were verified on the resulting commit. The full-suite numbers above precede that final rebase. The runtime workflow path-filter test also fails on upstream and is being addressed separately in #1657.

GPUs tested: NVIDIA GeForce RTX 4070, driver 620.73.04, CachyOS with Proton Experimental. The native Windows RTX 4070 Ti result above belongs to #984.

AI-assisted: yes

Checklist

  • Rebased on upstream main and verified a clean Git merge.
  • This is a cross-subsystem integration draft for review as a single runtime change.
  • Source and synthetic fixtures only. The game-data guard passed. Private traces, captures, binaries and working-branch history stay local.
  • The translator rules are unchanged. The new semantic test covers the existing null-buffer contract.

🔄 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/1723 **Author:** [@Moriz82](https://github.com/Moriz82) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `integration/post-story-runtime` --- ### 📝 Commits (10+) - [`ba62682`](https://github.com/ubiquitarianism/leonida/commit/ba626820ec54776fb0faffa2413727285befe85b) Integrate post-story-load memory, queue and Vulkan runtime changes - [`be6301b`](https://github.com/ubiquitarianism/leonida/commit/be6301be994fad50e46b1208bad48d47bf503259) Merge commit 'refs/tmp/main' into HEAD - [`df2e409`](https://github.com/ubiquitarianism/leonida/commit/df2e4093efc71313026a93216b1741d7b83d7295) runtime: define NOMINMAX before windows.h in submit_phases.h and thread_sampler.h - [`682a557`](https://github.com/ubiquitarianism/leonida/commit/682a557f873acad42a3df33133a02ab3b3ded600) runtime test: define the slot-31 recorder check_list_values_more uses - [`eedc7c8`](https://github.com/ubiquitarianism/leonida/commit/eedc7c8db98f26a0cf23d3593bb2eb39fe47d491) d3d12_xs: queue slot 31 without a mapper keeps the unmodelled answer - [`6f36d14`](https://github.com/ubiquitarianism/leonida/commit/6f36d1400297d44151e5b078248cdf15c7b98211) d3d12: inline table V#s nothing backs become zero-size, as console heap slots - [`d7ef292`](https://github.com/ubiquitarianism/leonida/commit/d7ef292e31807bb1f890384a2a9b1337f1032fdf) d3d12: a V# may name a layer buffer below the arena again, sign-extended - [`92394f1`](https://github.com/ubiquitarianism/leonida/commit/92394f1f83e96099cc517aefcbe70adc69c9a520) title_gpu_views: a pair can be marked independent; such a twin is not imported - [`29c356b`](https://github.com/ubiquitarianism/leonida/commit/29c356b0bcd448181eb74367757dae922cb106ec) runtime test: cs_user_data's descriptor-word mode gets its own sentinel - [`c7fdc26`](https://github.com/ubiquitarianism/leonida/commit/c7fdc26d2a06df7b25242963b7be18d5c53e33fd) runtime test: compile_teardown expects no session cache from llvmpipe ### 📊 Changes **107 files changed** (+27279 additions, -8823 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+98 -12) 📝 `docs/d3d12_xs_console_abi.md` (+77 -0) 📝 `docs/first_run_ui.md` (+1 -1) 📝 `runtime/CMakeLists.txt` (+221 -26) 📝 `runtime/README.md` (+38 -2) 📝 `runtime/shims/d3d12_com.cpp` (+202 -51) 📝 `runtime/shims/d3d12_com.h` (+30 -3) 📝 `runtime/shims/d3d12_com_object.h` (+30 -4) ➕ `runtime/shims/d3d12_compile_exit.h` (+13 -0) 📝 `runtime/shims/d3d12_compute_input_probe.h` (+255 -8) 📝 `runtime/shims/d3d12_geometry_views.h` (+189 -25) ➕ `runtime/shims/d3d12_indirect_draw_policy.h` (+20 -0) 📝 `runtime/shims/d3d12_pipeline_compile.h` (+232 -28) 📝 `runtime/shims/d3d12_title_buffer_windows.h` (+37 -5) 📝 `runtime/shims/d3d12_title_image_upload.h` (+100 -50) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+1989 -353) 📝 `runtime/shims/d3d12_xs_device.cpp` (+958 -13) 📝 `runtime/shims/d3d12_xs_device.h` (+64 -0) ➕ `runtime/shims/d3d12_xs_list_values.h` (+1291 -0) 📝 `runtime/shims/dstorage.cpp` (+14 -4) _...and 80 more files_ </details> ### 📄 Description Claimed as **RT-POST-STORY-RUNTIME** in [the coordination issue](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7157334772). This follows [#984](https://github.com/ubiquitarianism/leonida/pull/984), which brought the offline boot through the end of the story load on Linux/Proton and native Windows. This draft brings the subsequent runtime changes onto upstream’s pipeline-worker, descriptor and queue interfaces. It includes the queue, memory and draw changes together so reviewers can exercise the same executable the integration tests cover. ### What and why | Area | Change | | --- | --- | | Physical memory | A reserve-only XMem window carved from a live parent keeps the ranges on either side. Page remaps, CPU/GPU aliases, first-touch handling and guarded copies now coordinate with the threads that use them. An opt-in private heap isolates title allocations. | | Command lists and queues | Console 32- and 64-bit writes, waits and GPU timestamps retain their position in the list. Queue page remaps keep their fence alive until completion. This overlaps the write-value work in [#622](https://github.com/ubiquitarianism/leonida/pull/622). | | Indirect graphics | Simple DRAW and DRAW_INDEXED signatures use the recorded pipeline, targets, root data and index/vertex bindings. Bundles can record the operation and inherit the executing parent's state. The GPU checks argument counts in private scratch and applies a shared work budget per command list. Unsupported signatures still go through validation. | | Descriptors and arena | Unreachable buffer descriptors resolve to a null view. Unbacked slots retry under a bounded budget. Heap padding protects the covered range beyond the last resource descriptor. Arena allocation and free-block walks use the same lock. | | Textures and submission | Texture refresh holds references across callbacks; optional background work moves fills and geometry copies off the submitting thread. Buffer refreshes can copy only dirty tiles. Layout changes are journaled per submission. Small linear RGBA32F exposure targets have a tested readback footprint. | | Ray tracing and presentation | TLAS construction translates instance addresses for bottom-level acceleration structures. Startup splash detection samples the readback image sparsely. | | Pipeline lifetime | Background compilation and device teardown coordinate so a released pipeline cannot leave queued work using its Vulkan objects. Submission, compiler and device-fault diagnostics expose where execution stalls. | | Diagnostics and tests | Optional Nsight Aftermath support, frame-phase counters, a local stage timeline, GPU pixel/readback fixtures and CPU concurrency tests. | **Contributors.** Plaaasma co-authored the changes, including XMem window handling, list values and descriptor backing. ivanepsilondelta contributed the stateful indirect graphics and pixel tests. Both are credited on the integration commit. ### Tested | Platform and build | Observed result | | --- | --- | | Linux / Proton, accepted working build | Offline Series S configuration on an RTX 4070. Landed at about 40 s and entered story loading at about 60 s. The loading screen had ended by the 160 s sample. The runtime continued submitting work until a title assertion at about 545 s, at roughly 0.85 title frames/s after loading. The run reported no GPU device loss. | | Linux, public integration during rebase | 6,280 translator tests passed across 488 files. The portable runtime suite passed 87 of 89 registered cases. Two skipped because the translated corpus and Vulkan validation mode were unset. The three changed built-in compute shaders regenerated byte-for-byte from their GLSL and passed SPIR-V validation. | | Windows executable, cross-built on Linux | The x64 MSVC-target executable linked and ran under Proton. The RTX 4070 passed the null-descriptor and indirect-clamp GPU fixtures. Texture-layout tests passed 465 checks. An earlier trial of the public integration stopped at a title breakpoint during initialization with the locally available shader library. | | Native Windows | The previously merged baseline reached the end of story loading on Windows 11 with an RTX 4070 Ti. The public integration head still needs a native Windows boot. [Baseline results in #984](https://github.com/ubiquitarianism/leonida/pull/984) | The accepted working build used a diagnostic configuration with title compute, indirect draws and acceleration-structure builds disabled, and stub pipelines enabled. That run establishes progress through loading. Playable world rendering and default-settings performance remain unverified. **Open checks for this draft** - During testing the indirect bundle and heap-resource pixel fixtures exposed a replay path that read scratch arguments before the GPU clamp populated them. This commit fixes the missing dispatch. Those pixel fixtures and a direct-heap test that timed out need a fresh run after the rebase. - The default XMem suite on Proton still failed its system-wide commit-charge assertion, which also failed on upstream. Forced reserve mode had additional Wine view-state and protection mismatches. - The final rebase retained upstream's new pipeline compilation workers. The new null-buffer semantic test, data guard, diff checks and clean merge were verified on the resulting commit. The full-suite numbers above precede that final rebase. The runtime workflow path-filter test also fails on upstream and is being addressed separately in [#1657](https://github.com/ubiquitarianism/leonida/pull/1657). GPUs tested: NVIDIA GeForce RTX 4070, driver 620.73.04, CachyOS with Proton Experimental. The native Windows RTX 4070 Ti result above belongs to #984. AI-assisted: yes ### Checklist - [x] Rebased on upstream main and verified a clean Git merge. - [ ] This is a cross-subsystem integration draft for review as a single runtime change. - [x] Source and synthetic fixtures only. The game-data guard passed. Private traces, captures, binaries and working-branch history stay local. - The translator rules are unchanged. The new semantic test covers the existing null-buffer contract. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:18:47 +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#1739
No description provided.