d3d12: merge bundle of eight open runtime PRs, conflicts fixed (#2020 #2166 #1851 #2465 #1705 #2117 #2012 #407) #2509

Merged
OreoFR merged 29 commits from upstream-pr/2509 into main 2026-11-27 21:42:08 +00:00
OreoFR commented 2026-11-27 21:40:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-27T21:40:12Z.


A merge bundle asked for by @aslan2142: eight open runtime PRs merged onto main 39f52f39c in one branch, with their conflicts fixed, so they can be reviewed and merged together. No new code beyond the conflict resolutions. Each PR keeps its own commits and authors (merge commits, no squash).

Claims: this bundles the PRs' own items, it claims nothing new: RT-PLACED-DEFER-STAGED (#2020), RT-TITLE-PARTIAL-MIPS (#2166), RT-HOST-IMAGE-COPY-SWITCH (#1851), RT-TITLE-WINDOW-RETIRE (#2465), RT-TITLE-HASH-WC-STREAM (#1705), RT-CONSOLE-VSHARP-MEMO (#2117), RT-TITLE-TEXTURE-REFRESH-ENVELOPE-AND-WRAP (#2012), STAGED-COPY-OWN-WAIT (#407).

Depends on: #2020, #2166, #1851, #2465, #1705, #2117, #2012, #407 (merging this one merges them; the separate PRs can then be closed).

What was merged, in order

PR Author What Conflicts
#2020 @DadaCap a placed BC image the title has not filled shares a zero image none
#2166 @DadaCap readable smaller mips of a title texture whose larger ones are missing none
#1851 @QemmHD LEONIDA_HOST_IMAGE_COPY switch, auto off on NVIDIA none
#2465 @DadaCap retire a title window nothing reaches none
#1705 @DadaCap the texture hash reads write-combined memory through a streaming copy none
#2117 @azsekazvamdimitar console heap V# words fixed once a pass none
#2012 @IlyassRS3 O(1) envelope fast path in title_texture_refresh runtime/CMakeLists.txt
#407 @Kokonotcu CPU subresource copies wait for their own submission only runtime/shims/d3d12_vulkan_device.cpp (3)

How the conflicts were fixed

  • #2012, runtime/CMakeLists.txt: it and #1851 each add a test at the same place (title_texture_refresh_test, host_image_copy_policy_test). Both are kept.
  • #407, d3d12_vulkan_device.cpp, three places:
    1. DeviceState fields: main's title_upload / title_upload_mutex are kept, next to #407's staging_queue and new staging_copy_queue, with #407's comment above the staging fields.
    2. Resource::staged_copy: #407's queue choice (copy family for colour, the graphics family's last VkQueue otherwise) and its wait_submitted() instead of idle(). main had made its staging queue synchronous (make_synchronous(), from #2098): both new queues keep that, so a copy is still submitted inline and then waited for, now on its own submission only.
    3. Device teardown: main's block (resolver halt, geometry, external windows, title_upload) is kept, and both staging queues are reset.

Tests

On an RTX 4070 Laptop GPU 8 GB (NVIDIA 621.40, Windows 11), RelWithDebInfo, Ninja:

  • Full build of this branch (all targets): OK.
  • ctest, all 509 tests (-j 4): 506 pass, 3 fail. None of the 3 comes from this bundle:
    • dxgi_waitable_latency passes when run alone (-j 1): a timing test disturbed by the parallel run.
    • xbox_present and d3d12_set_descriptor_heaps fail the same way on plain main (built from the same tree without the bundle). They were already failing before it (MEASURED).
  • The bundled PRs' own tests pass: d3d12_existing_heap (#2020, #1705), xg_xs (#2166), host_image_copy_policy (#1851), title_texture_refresh (#2012), d3d12_staged_copy_wait (#407), d3d12_unmapped_vsharp (#2117), the title-window tests of #2465.
  • python -I scripts/check_no_game_data.py on the 27 changed files: clean.
  • In game: the same runtime code (this bundle on main ae19dea64; the 12 newer main commits touch nothing under runtime/shims or runtime/src) ran a 900 s world run with the same recipe and caches as a plain-main control:
    • World reached (249 s vs 286 s on main). 0 device lost, 0 exceptions, 0 validation errors, and the run went the full 900 s.
    • CPU submit phases, ms per submission from world entry +30 to +200 s: shadows 839 → 157, replay 428 → 92, heaps 185 → 57, textures 101 → 63.
    • Frame rate unchanged, ~0.05 fps after world entry on this 8 GB laptop: the bundle does not fix the world-entry slowdown by itself.
    • To watch: gpu-stall lines (GPU work over 4 s) went from 0 to 30 in the same window, 13 with #407 alone. That fits the GPU becoming the limit once the CPU waits are gone, but is not settled yet (n=1 each).

AI-assisted (Claude Code, Claude Opus 5.5). Tested on an RTX 4070 Laptop GPU 8 GB, NVIDIA 621.40, Windows 11.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5533422266 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2509). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-27T21:40:12Z. --- A merge bundle asked for by @aslan2142: eight open runtime PRs merged onto `main` 39f52f39c in one branch, with their conflicts fixed, so they can be reviewed and merged together. No new code beyond the conflict resolutions. Each PR keeps its own commits and authors (merge commits, no squash). Claims: this bundles the PRs' own items, it claims nothing new: RT-PLACED-DEFER-STAGED (#2020), RT-TITLE-PARTIAL-MIPS (#2166), RT-HOST-IMAGE-COPY-SWITCH (#1851), RT-TITLE-WINDOW-RETIRE (#2465), RT-TITLE-HASH-WC-STREAM (#1705), RT-CONSOLE-VSHARP-MEMO (#2117), RT-TITLE-TEXTURE-REFRESH-ENVELOPE-AND-WRAP (#2012), STAGED-COPY-OWN-WAIT (#407). Depends on: #2020, #2166, #1851, #2465, #1705, #2117, #2012, #407 (merging this one merges them; the separate PRs can then be closed). ## What was merged, in order | PR | Author | What | Conflicts | |---|---|---|---| | #2020 | @DadaCap | a placed BC image the title has not filled shares a zero image | none | | #2166 | @DadaCap | readable smaller mips of a title texture whose larger ones are missing | none | | #1851 | @QemmHD | `LEONIDA_HOST_IMAGE_COPY` switch, auto off on NVIDIA | none | | #2465 | @DadaCap | retire a title window nothing reaches | none | | #1705 | @DadaCap | the texture hash reads write-combined memory through a streaming copy | none | | #2117 | @azsekazvamdimitar | console heap V# words fixed once a pass | none | | #2012 | @IlyassRS3 | O(1) envelope fast path in title_texture_refresh | `runtime/CMakeLists.txt` | | #407 | @Kokonotcu | CPU subresource copies wait for their own submission only | `runtime/shims/d3d12_vulkan_device.cpp` (3) | ## How the conflicts were fixed - **#2012, `runtime/CMakeLists.txt`**: it and #1851 each add a test at the same place (`title_texture_refresh_test`, `host_image_copy_policy_test`). Both are kept. - **#407, `d3d12_vulkan_device.cpp`**, three places: 1. `DeviceState` fields: main's `title_upload` / `title_upload_mutex` are kept, next to #407's `staging_queue` and new `staging_copy_queue`, with #407's comment above the staging fields. 2. `Resource::staged_copy`: #407's queue choice (copy family for colour, the graphics family's last VkQueue otherwise) and its `wait_submitted()` instead of `idle()`. main had made its staging queue synchronous (`make_synchronous()`, from #2098): both new queues keep that, so a copy is still submitted inline and then waited for, now on its own submission only. 3. Device teardown: main's block (resolver halt, geometry, external windows, `title_upload`) is kept, and both staging queues are reset. ## Tests On an RTX 4070 Laptop GPU 8 GB (NVIDIA 621.40, Windows 11), RelWithDebInfo, Ninja: - **Full build** of this branch (all targets): OK. - **`ctest`, all 509 tests** (`-j 4`): 506 pass, 3 fail. None of the 3 comes from this bundle: - `dxgi_waitable_latency` passes when run alone (`-j 1`): a timing test disturbed by the parallel run. - `xbox_present` and `d3d12_set_descriptor_heaps` fail the same way on plain `main` (built from the same tree without the bundle). They were already failing before it (MEASURED). - **The bundled PRs' own tests** pass: `d3d12_existing_heap` (#2020, #1705), `xg_xs` (#2166), `host_image_copy_policy` (#1851), `title_texture_refresh` (#2012), `d3d12_staged_copy_wait` (#407), `d3d12_unmapped_vsharp` (#2117), the title-window tests of #2465. - **`python -I scripts/check_no_game_data.py`** on the 27 changed files: clean. - **In game**: the same runtime code (this bundle on `main` ae19dea64; the 12 newer `main` commits touch nothing under `runtime/shims` or `runtime/src`) ran a 900 s world run with the same recipe and caches as a plain-`main` control: - World reached (249 s vs 286 s on main). **0 device lost, 0 exceptions, 0 validation errors**, and the run went the full 900 s. - CPU submit phases, ms per submission from world entry +30 to +200 s: shadows 839 → 157, replay 428 → 92, heaps 185 → 57, textures 101 → 63. - Frame rate unchanged, ~0.05 fps after world entry on this 8 GB laptop: the bundle does not fix the world-entry slowdown by itself. - To watch: `gpu-stall` lines (GPU work over 4 s) went from 0 to 30 in the same window, 13 with #407 alone. That fits the GPU becoming the limit once the CPU waits are gone, but is not settled yet (n=1 each). AI-assisted (Claude Code, Claude Opus 5.5). Tested on an RTX 4070 Laptop GPU 8 GB, NVIDIA 621.40, Windows 11. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!2509
No description provided.