d3d12: LEONIDA_HOST_IMAGE_COPY switch; auto leaves host image copies off on NVIDIA #1851

Open
github-bot wants to merge 1 commit from github-bot/gh-1851 into main AGit
Owner

@⁠QemmHD on GitHub · 2026-11-25 13:07 UTC · original
ubiquitarianism:claude/host-image-copy-switch → main · +116 −3 · 6 files · 1 commits · draft

Depends on #1827 (DadaCap): without host image copies, title images only get filled once #1827 lands; otherwise they stay zero (verified by ecox982745 on an RTX 4090). Merge #1827 first.

The layer uses VK_EXT_host_image_copy for WriteToSubresource/ReadFromSubresource whenever the device has the extension and its hostImageCopy feature. On an RTX 4070 SUPER (Windows 11), a real boot lost the device with WRITE_INVALID in 7 of 7 runs that used host image copies and in 0 of 2 that didn't (481 s and 901 s, both still running at their time limits, up to 31,841 ExecuteCommandLists and 7,960 presents). The mechanism is still open. Details, and what's been ruled out, are in #1608:

  • not a translated store (store trace over every program);
  • no buffer device address near the fault;
  • not a mapping the layer made;
  • not the caller memory of recent host copies;
  • no image bound past its memory;
  • no validation-layer error about host copies or memory.

What this adds: LEONIDA_HOST_IMAGE_COPY.

  • 0: never.
  • 1: whenever available (the old behaviour).
  • auto (the default; also for unset or unrecognised text): the same as 1, except on NVIDIA (vendorID 0x10DE), where it's off.

When it's off, the extension is neither enabled nor chained, no image gets host-transfer usage, and every CPU texture copy takes the existing staging submit. That's exactly the path a device without the extension already takes. Device creation logs one line in place of the old "no VK_EXT_host_image_copy" line: [rt] d3d12: host image copy: on|off (<reason>).

Files

  • runtime/src/host_image_copy_policy.h (new): the choice as a pure function.
  • runtime/test/host_image_copy_policy_test.cpp (new, registered as host_image_copy_policy): the decision table (unset, empty, auto, 0, 1, other text) on NVIDIA, AMD and Intel, available and not.
  • runtime/shims/d3d12_vulkan_device.cpp: uses the choice.
  • runtime/README.md and docs/d3d12_vulkan.md: the variable, and why auto is off on NVIDIA.

Tested (Windows 11, RTX 4070 SUPER, MSVC RelWithDebInfo):

  • The new test passes.
  • Full ctest -j 4: 415/416. The only failure is d3d12_depth_resolve, the known NVIDIA MFAA sample-position case (#1505).
  • Through the real layer device: unset, auto and other text log off (auto: NVIDIA); =0 and =1 log their own reason.
  • The consistency set is the same as main (its one pre-existing test_runtime_paths failure).
  • check_no_game_data.py is clean.

Cost and caveats

  • Staging uploads make the long loads slower.
  • The default leaves host copies unexercised on NVIDIA. The test harnesses that build their own device still cover them.
  • Replications on other NVIDIA cards (with =1 and with the default), and reports from AMD/Intel on whether auto should stay NVIDIA-only, are very welcome. If the mechanism turns out to be a layer usage error, the right fix replaces this default.

Claimed in #1608 as RT-HOST-IMAGE-COPY-SWITCH.

AI-assisted (Claude Code, Claude Opus 5.5).

🤖 Generated with Claude Code

https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf

**@⁠QemmHD** on GitHub · 2026-11-25 13:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851) `ubiquitarianism:claude/host-image-copy-switch` → `main` · +116 −3 · 6 files · 1 commits · draft **Depends on #1827** (DadaCap): without host image copies, title images only get filled once #1827 lands; otherwise they stay zero (verified by ecox982745 on an RTX 4090). Merge #1827 first. The layer uses `VK_EXT_host_image_copy` for `WriteToSubresource`/`ReadFromSubresource` whenever the device has the extension and its `hostImageCopy` feature. On an RTX 4070 SUPER (Windows 11), a real boot lost the device with WRITE_INVALID in **7 of 7** runs that used host image copies and in **0 of 2** that didn't (481 s and 901 s, both still running at their time limits, up to 31,841 `ExecuteCommandLists` and 7,960 presents). The mechanism is still open. Details, and what's been ruled out, are in #1608: - not a translated store (store trace over every program); - no buffer device address near the fault; - not a mapping the layer made; - not the caller memory of recent host copies; - no image bound past its memory; - no validation-layer error about host copies or memory. **What this adds:** `LEONIDA_HOST_IMAGE_COPY`. - `0`: never. - `1`: whenever available (the old behaviour). - `auto` (the default; also for unset or unrecognised text): the same as `1`, except on NVIDIA (vendorID `0x10DE`), where it's off. When it's off, the extension is neither enabled nor chained, no image gets host-transfer usage, and every CPU texture copy takes the existing staging submit. That's exactly the path a device without the extension already takes. Device creation logs one line in place of the old "no VK_EXT_host_image_copy" line: `[rt] d3d12: host image copy: on|off (<reason>)`. **Files** - `runtime/src/host_image_copy_policy.h` (new): the choice as a pure function. - `runtime/test/host_image_copy_policy_test.cpp` (new, registered as `host_image_copy_policy`): the decision table (unset, empty, `auto`, `0`, `1`, other text) on NVIDIA, AMD and Intel, available and not. - `runtime/shims/d3d12_vulkan_device.cpp`: uses the choice. - `runtime/README.md` and `docs/d3d12_vulkan.md`: the variable, and why `auto` is off on NVIDIA. **Tested** (Windows 11, RTX 4070 SUPER, MSVC RelWithDebInfo): - The new test passes. - Full `ctest -j 4`: 415/416. The only failure is `d3d12_depth_resolve`, the known NVIDIA MFAA sample-position case (#1505). - Through the real layer device: unset, `auto` and other text log `off (auto: NVIDIA)`; `=0` and `=1` log their own reason. - The consistency set is the same as main (its one pre-existing `test_runtime_paths` failure). - `check_no_game_data.py` is clean. **Cost and caveats** - Staging uploads make the long loads slower. - The default leaves host copies unexercised on NVIDIA. The test harnesses that build their own device still cover them. - Replications on other NVIDIA cards (with `=1` and with the default), and reports from AMD/Intel on whether `auto` should stay NVIDIA-only, are very welcome. If the mechanism turns out to be a layer usage error, the right fix replaces this default. Claimed in #1608 as RT-HOST-IMAGE-COPY-SWITCH. AI-assisted (Claude Code, Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
The layer enables VK_EXT_host_image_copy for WriteToSubresource and
ReadFromSubresource whenever the device has the extension and its
hostImageCopy feature. On an RTX 4070 SUPER (Windows 11) a real boot lost
the device with WRITE_INVALID in 7 of 7 runs that used host image copies
and in 0 of 2 that did not. The mechanism is not known yet.

LEONIDA_HOST_IMAGE_COPY chooses: 0 never, 1 whenever available, auto (the
default, also for unset or unrecognized text) as 1 except on NVIDIA
(vendorID 0x10DE), where it is off. Off, the extension is neither enabled
nor chained, so no image gets host-transfer usage and every CPU texture
copy takes the existing staging submit, as on a device without it.

The choice is a pure function (src/host_image_copy_policy.h) with a unit
test of its table, and device creation logs one line with the choice and
the reason in place of the old "no VK_EXT_host_image_copy" line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:08:35 +00:00
Author
Owner

@⁠ecox982745 on GitHub · 2026-11-25 13:16 UTC · original

Please land #1827 before enabling the NVIDIA default in this PR. I reproduced the dependency on an RTX 4090 (Windows 11, NVIDIA 616.64) using the production create_vulkan_device_standalone entry point. Each run started a fresh process, so the runtime itself selected the extension and created the Vulkan device.

Build and LEONIDA_HOST_IMAGE_COPY Runtime decision on the 4090 BC7 initial GPU readback Mapped R8 linear plane
#1851 alone, unset / auto / 0 off 0/21 subresources matched byte check failed
#1851 alone, 1 on 21/21 passed
#1851 + #1827, unset / auto / 0 off 21/21 passed
#1851 + #1827, 1 on 21/21 passed

Exact sources were #1851 59c1586d4 and the same revision with the #1827 ea6d535ff diff applied. I tested unset, auto, 0 and 1 separately in both builds. Every passing BC7 run also preserved all 21 subresources after rewriting only mip 3 of array slice 2 and again after a submission with no writes. The CPU host_image_copy_policy test passed in both builds.

The R8 fixture was check_mapped_plane from d3d12_existing_heap_test.cpp. The BC7 fixture used fenced GPU texture-to-buffer copies over 43,632 payload bytes per submission. This verifies texture contents under the proposed default and the forced-on control. Retail boot stability remains unmeasured in this run. Synthetic fixture details on #1827

AI-assisted verification with OpenAI Codex.

**@⁠ecox982745** on GitHub · 2026-11-25 13:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7163537227) Please land #1827 before enabling the NVIDIA default in this PR. I reproduced the dependency on an RTX 4090 (Windows 11, NVIDIA 616.64) using the production `create_vulkan_device_standalone` entry point. Each run started a fresh process, so the runtime itself selected the extension and created the Vulkan device. | Build and `LEONIDA_HOST_IMAGE_COPY` | Runtime decision on the 4090 | BC7 initial GPU readback | Mapped R8 linear plane | | --- | --- | ---: | --- | | #1851 alone, unset / `auto` / `0` | off | 0/21 subresources matched | byte check failed | | #1851 alone, `1` | on | 21/21 | passed | | #1851 + #1827, unset / `auto` / `0` | off | 21/21 | passed | | #1851 + #1827, `1` | on | 21/21 | passed | Exact sources were #1851 `59c1586d4` and the same revision with the #1827 `ea6d535ff` diff applied. I tested unset, `auto`, `0` and `1` separately in both builds. Every passing BC7 run also preserved all 21 subresources after rewriting only mip 3 of array slice 2 and again after a submission with no writes. The CPU `host_image_copy_policy` test passed in both builds. The R8 fixture was `check_mapped_plane` from `d3d12_existing_heap_test.cpp`. The BC7 fixture used fenced GPU texture-to-buffer copies over 43,632 payload bytes per submission. This verifies texture contents under the proposed default and the forced-on control. Retail boot stability remains unmeasured in this run. [Synthetic fixture details on #1827](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/1827) AI-assisted verification with OpenAI Codex.
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-25 13:19 UTC · original · reviewed

One more NVIDIA configuration: desktop RTX 4060 (Ada), driver 610.88, Windows 11, MSVC 19.44 RelWithDebInfo, head 59c1586d4.

  • host_image_copy_policy: passes.
  • d3d12_texture_memory and d3d12_texture1d (both build the device through create_vulkan_device_standalone, so they read the switch), run three times:
LEONIDA_HOST_IMAGE_COPY logged line the 2 tests
unset host image copy: off (auto: NVIDIA); CPU texture copies use a staging submit 2/2 passed
0 host image copy: off (LEONIDA_HOST_IMAGE_COPY=0); CPU texture copies use a staging submit 2/2 passed
1 host image copy: on (LEONIDA_HOST_IMAGE_COPY=1) 2/2 passed

These two only check that the switch is read and the device comes up; they do no CPU texture copies. d3d12_subresource_copy builds its own devices with host_image_copy set per path, so it ignores the switch: in all three runs its host-image-copy and forced-retry paths reported 0 mismatches against the host and Microsoft's recorded answers (109 steps each). That says host copies are correct in this synthetic test on this card, not that the switch's staging path was exercised. None of this covers the BC7/R8 cases from the 4090 comment here (#1827).

A driver fact that may help with the open mechanism: on this card and driver, vulkaninfo reports identicalMemoryTypeRequirements = false (VkPhysicalDeviceVulkan14Properties, promoted from VkPhysicalDeviceHostImageCopyPropertiesEXT), with hostImageCopy = true and 28 copy src/dst layouts. So adding VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT may change an image's memory requirements on NVIDIA. The layer adds that usage (d3d12_vulkan_device.cpp 6196); it compares memoryTypeBits with and without that usage for staged title images (6237-6258) and retries without it when no type is allowed (6332), but not for ordinary textures. That fits your note that the switch also changes the images' memory type; it is a lead, not a cause.

The in-game replication on a 4070 Laptop / 621.40 is in #1608 (made with a local info.host_image_copy = false, not this switch). #1810 also accepts off (here off falls to auto, so stays on outside NVIDIA) and makes the test harness (vk_test_device.h) honour =0; this PR covers =0 in the layer only.

AI-assisted: yes (Claude Code ran the build and the tests; a separate agent checked this text against the logs and the code; I read both).

**@⁠MoonEyes** on GitHub · 2026-11-25 13:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#pullrequestreview-6058346308) · **reviewed** One more NVIDIA configuration: desktop RTX 4060 (Ada), driver 610.88, Windows 11, MSVC 19.44 RelWithDebInfo, head 59c1586d4. - `host_image_copy_policy`: passes. - `d3d12_texture_memory` and `d3d12_texture1d` (both build the device through `create_vulkan_device_standalone`, so they read the switch), run three times: | `LEONIDA_HOST_IMAGE_COPY` | logged line | the 2 tests | |---|---|---| | unset | `host image copy: off (auto: NVIDIA); CPU texture copies use a staging submit` | 2/2 passed | | `0` | `host image copy: off (LEONIDA_HOST_IMAGE_COPY=0); CPU texture copies use a staging submit` | 2/2 passed | | `1` | `host image copy: on (LEONIDA_HOST_IMAGE_COPY=1)` | 2/2 passed | These two only check that the switch is read and the device comes up; they do no CPU texture copies. `d3d12_subresource_copy` builds its own devices with `host_image_copy` set per path, so it ignores the switch: in all three runs its host-image-copy and forced-retry paths reported 0 mismatches against the host and Microsoft's recorded answers (109 steps each). That says host copies are correct in this synthetic test on this card, not that the switch's staging path was exercised. None of this covers the BC7/R8 cases from the 4090 comment here (#1827). A driver fact that may help with the open mechanism: on this card and driver, `vulkaninfo` reports `identicalMemoryTypeRequirements = false` (VkPhysicalDeviceVulkan14Properties, promoted from `VkPhysicalDeviceHostImageCopyPropertiesEXT`), with `hostImageCopy = true` and 28 copy src/dst layouts. So adding `VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT` may change an image's memory requirements on NVIDIA. The layer adds that usage (`d3d12_vulkan_device.cpp` 6196); it compares `memoryTypeBits` with and without that usage for staged title images (6237-6258) and retries without it when no type is allowed (6332), but not for ordinary textures. That fits your note that the switch also changes the images' memory type; it is a lead, not a cause. The in-game replication on a 4070 Laptop / 621.40 is in #1608 (made with a local `info.host_image_copy = false`, not this switch). #1810 also accepts `off` (here `off` falls to `auto`, so stays on outside NVIDIA) and makes the test harness (`vk_test_device.h`) honour `=0`; this PR covers `=0` in the layer only. AI-assisted: yes (Claude Code ran the build and the tests; a separate agent checked this text against the logs and the code; I read both).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 13:23 UTC · original

@⁠ecox982745 thank you, that's an important catch, and the table makes it unambiguous. Without host copies, title images take neither path before #1827, so auto on NVIDIA would leave them zero. Agreed: this depends on #1827 and shouldn't land before it. I've marked that in the description. Next on this side: a real-boot run of #1851 + #1827 with the default (auto → off on NVIDIA) on the RTX 4070 SUPER, checking for both the device loss and textured captures. I'll post the result here and on #1827.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 13:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7163697898) @⁠ecox982745 thank you, that's an important catch, and the table makes it unambiguous. Without host copies, title images take neither path before #1827, so `auto` on NVIDIA would leave them zero. Agreed: **this depends on #1827 and shouldn't land before it.** I've marked that in the description. Next on this side: a real-boot run of #1851 + #1827 with the default (auto → off on NVIDIA) on the RTX 4070 SUPER, checking for both the device loss and textured captures. I'll post the result here and on #1827. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠madvillain91 on GitHub · 2026-11-25 13:52 UTC · original · reviewed

Independent NVIDIA Ampere data point on Windows 11 26H2 (26300.9711) at 59c1586d4 against main 384abe5b0 (PR base 98c2f7777), using VS 2022 Build Tools (MSVC 19.44.35230.0, RelWithDebInfo, Ninja), Vulkan SDK 1.4.363.0, and NVIDIA GeForce RTX 3070 Ti (driver 617.14, Vulkan 1.4.351).

  • vulkaninfo reports hostImageCopy = true and identicalMemoryTypeRequirements = false on Ampere / 617.14 as well.
  • host_image_copy_policy_test: passed (all cases passed).
  • d3d12_texture_memory_test & d3d12_texture1d_test (both via create_vulkan_device_standalone):
    • unset: [rt] d3d12: host image copy: off (auto: NVIDIA); CPU texture copies use a staging submit (2/2 passed)
    • LEONIDA_HOST_IMAGE_COPY=0: [rt] d3d12: host image copy: off (LEONIDA_HOST_IMAGE_COPY=0); CPU texture copies use a staging submit (2/2 passed)
    • LEONIDA_HOST_IMAGE_COPY=1: [rt] d3d12: host image copy: on (LEONIDA_HOST_IMAGE_COPY=1) (2/2 passed)
  • d3d12_subresource_copy_test: passed.

Also independently verified prerequisite #1827 on this same RTX 3070 Ti (d3d12_existing_heap_test staged host_image_copy=false paths + d3d12_subresource_copy_test + d3d12_m2_textured_test, all 0 VUIDs under LEONIDA_VK_VALIDATION=1). Not checked: retail boot. LGTM (pending #1827 landing first as noted).

AI-assisted verification.

**@⁠madvillain91** on GitHub · 2026-11-25 13:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#pullrequestreview-6058846287) · **reviewed** Independent NVIDIA Ampere data point on Windows 11 26H2 (26300.9711) at 59c1586d4 against main 384abe5b0 (PR base 98c2f7777), using VS 2022 Build Tools (MSVC 19.44.35230.0, RelWithDebInfo, Ninja), Vulkan SDK 1.4.363.0, and NVIDIA GeForce RTX 3070 Ti (driver 617.14, Vulkan 1.4.351). - `vulkaninfo` reports `hostImageCopy = true` and `identicalMemoryTypeRequirements = false` on Ampere / 617.14 as well. - `host_image_copy_policy_test`: passed (`all cases passed`). - `d3d12_texture_memory_test` & `d3d12_texture1d_test` (both via `create_vulkan_device_standalone`): - unset: `[rt] d3d12: host image copy: off (auto: NVIDIA); CPU texture copies use a staging submit` (2/2 passed) - `LEONIDA_HOST_IMAGE_COPY=0`: `[rt] d3d12: host image copy: off (LEONIDA_HOST_IMAGE_COPY=0); CPU texture copies use a staging submit` (2/2 passed) - `LEONIDA_HOST_IMAGE_COPY=1`: `[rt] d3d12: host image copy: on (LEONIDA_HOST_IMAGE_COPY=1)` (2/2 passed) - `d3d12_subresource_copy_test`: passed. Also independently verified prerequisite #1827 on this same RTX 3070 Ti (`d3d12_existing_heap_test` staged `host_image_copy=false` paths + `d3d12_subresource_copy_test` + `d3d12_m2_textured_test`, all 0 VUIDs under `LEONIDA_VK_VALIDATION=1`). Not checked: retail boot. LGTM (pending #1827 landing first as noted). AI-assisted verification.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 13:53 UTC · original

Note: #1810 by abnalstlll-byte (opened earlier) adds LEONIDA_HOST_IMAGE_COPY=0/off for the same finding. This PR overlaps it and adds auto (off on NVIDIA) plus a tested decision table. I've offered on #1810 to rebase this on top of it with credit, or to fold the extra parts into it, whichever the maintainers prefer. Still blocked on #1827 either way.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 13:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7164446696) Note: #1810 by abnalstlll-byte (opened earlier) adds `LEONIDA_HOST_IMAGE_COPY=0/off` for the same finding. This PR overlaps it and adds `auto` (off on NVIDIA) plus a tested decision table. I've offered on #1810 to rebase this on top of it with credit, or to fold the extra parts into it, whichever the maintainers prefer. Still blocked on #1827 either way. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 14:53 UTC · original

#1827 has landed on main (ea6d535ff, via #1192 at 3d4f66123), so the dependency is met: with auto off on NVIDIA, title images now take the staged upload instead of staying zero. This branch merges cleanly onto 3d4f66123. Since the last update, real-boot counts on the 4070 SUPER: 0 of 8 runs lose the device with host image copies off, against 7 of 7 with them, across both console profiles and two mains. OreoFR/MoonEyes reproduced it on a 4070 Laptop (621.40). A review from a maintainer would be welcome. On the overlap with #1810, whichever shape the maintainers prefer is fine by me.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 14:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7165968170) #1827 has landed on main (ea6d535ff, via #1192 at 3d4f66123), so the dependency is met: with `auto` off on NVIDIA, title images now take the staged upload instead of staying zero. This branch merges cleanly onto 3d4f66123. Since the last update, real-boot counts on the 4070 SUPER: 0 of 8 runs lose the device with host image copies off, against 7 of 7 with them, across both console profiles and two mains. OreoFR/MoonEyes reproduced it on a 4070 Laptop (621.40). A review from a maintainer would be welcome. On the overlap with #1810, whichever shape the maintainers prefer is fine by me. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-25 14:56 UTC · original

Data point, not a decision: with #1893 (fixes the D32S8 → D32 depth copy that wrote past the end of the D32 image) and host image copy on (default), I no longer get crash A on my RTX 4070 Laptop 8 GB, driver 621.40.

  • Run 1 (main + #1893): stopped by crash B (lib_cs_01144) at ~266 s. Crash A used to hit between 236 and 323 s on this build, so this run only partly covers that window.
  • Run 2 (main + #1893 + #1849): 378 s, no device loss.

So turning host image copy off may no longer be needed against crash A. That is 2 runs on one machine. Could someone with a 12 GB+ card (and ideally one who reproduced A with host copy on) run #1893 with host image copy on before we decide on this PR?

AI-assisted.

**@⁠OreoFR** on GitHub · 2026-11-25 14:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7166050100) Data point, not a decision: with #1893 (fixes the D32S8 → D32 depth copy that wrote past the end of the D32 image) and host image copy on (default), I no longer get crash A on my RTX 4070 Laptop 8 GB, driver 621.40. - Run 1 (main + #1893): stopped by crash B (`lib_cs_01144`) at ~266 s. Crash A used to hit between 236 and 323 s on this build, so this run only partly covers that window. - Run 2 (main + #1893 + #1849): 378 s, no device loss. So turning host image copy off may no longer be needed against crash A. That is 2 runs on one machine. Could someone with a 12 GB+ card (and ideally one who reproduced A with host copy on) run #1893 with host image copy on before we decide on this PR? AI-assisted.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 15:08 UTC · original

@⁠OreoFR that's a much better explanation than mine: a mismatched-format depth copy writing past the D32 image fits everything I saw (a driver routine, no translated store, the fault just past an image). It also explains why host image copies off only hid it, by moving memory around. I'm running #1893 with host image copies ON on the RTX 4070 SUPER now (12 GB; it reproduced A in 7 of 7 runs without the switch): 2 runs of #1893 alone, 1 with #1849, and a control without #1893 on the same main. If #1893 clears A here too, this PR's NVIDIA default shouldn't land. I'd then reduce it to the plain switch, or close it in favour of #1810, and #1893 is the real fix.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 15:08 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7166358235) @⁠OreoFR that's a much better explanation than mine: a mismatched-format depth copy writing past the D32 image fits everything I saw (a driver routine, no translated store, the fault just past an image). It also explains why host image copies off only *hid* it, by moving memory around. I'm running #1893 with host image copies ON on the RTX 4070 SUPER now (12 GB; it reproduced A in 7 of 7 runs without the switch): 2 runs of #1893 alone, 1 with #1849, and a control without #1893 on the same main. If #1893 clears A here too, this PR's NVIDIA default shouldn't land. I'd then reduce it to the plain switch, or close it in favour of #1810, and #1893 is the real fix. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Diegobecker07 on GitHub · 2026-11-25 15:36 UTC · original

Data point for this PR, on a desktop RTX 5070 Ti 16 GB with NVIDIA 621.24 (Windows 11 Pro 26300, Ryzen 9 5900X, 48 GB, own 1.0.2.1). Counts only.

  • Build: main 71a769d7d + #1827 + #1851, RelWithDebInfo with MSVC 2022 and SDL3. Shaders translated at 0d80bc5df; no translator files changed between that commit and 71a769d7d.
  • Switches: scripts/windows-boot/boot.ps1 defaults, plus LEONIDA_TITLE_WINDOWS_MB=1024 and LEONIDA_TITLE_WATCHDOG=0.
  • Setup: the first-run pages were completed once in the overlay, so in each boot the story load starts 130–150 s in.
LEONIDA_HOST_IMAGE_COPY boots story load covered device loss how it ended
unset (off (auto: NVIDIA)) 1 ~340 s none 0xc0000005 in amd_fidelityfx_upscaler_xbox.dll+0x65ff (FSPX 27/29, #1862)
1 2 ~330 s and ~350 s none time limit (482 s)
1 with LEONIDA_VK_VALIDATION=1 1 ~375 s none the same upscaler 0xc0000005
  • Host image copies on did not lose the device in 3 of 3 boots on this card. The 4070 SUPER's 7 of 7 runs used the same driver (621.24).
  • Validation: VUID-vkCmdCopyImage-srcImage-01548 (the D32S8 → D32 copy that #1893 fixes) did not appear before the run ended. stdout went to a file and the run ended in an access violation, so a message still in the buffer at the end could be missing. The only VUIDs were four pairs of VkImageViewCreateInfo-image-06724 / -subresourceRange-06725 (baseArrayLayer 6784 on a one-layer image), which #1860 covers.
  • Title-window budget: 1024 MiB was reached (MiB copied so far: 1023) in three of the four boots.

This doesn't contradict the 4070 SUPER result. If #1893's explanation holds (a copy that writes past the end of a D32 image), whether that write hits something that faults probably depends on what is bound after the image, which can differ between cards. Because the control boots didn't fail here, I didn't run #1893 on this card.

AI-assisted.

**@⁠Diegobecker07** on GitHub · 2026-11-25 15:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7167115922) Data point for this PR, on a desktop RTX 5070 Ti 16 GB with NVIDIA 621.24 (Windows 11 Pro 26300, Ryzen 9 5900X, 48 GB, own 1.0.2.1). Counts only. - **Build:** main 71a769d7d + #1827 + #1851, RelWithDebInfo with MSVC 2022 and SDL3. Shaders translated at 0d80bc5df; no translator files changed between that commit and 71a769d7d. - **Switches:** `scripts/windows-boot/boot.ps1` defaults, plus `LEONIDA_TITLE_WINDOWS_MB=1024` and `LEONIDA_TITLE_WATCHDOG=0`. - **Setup:** the first-run pages were completed once in the overlay, so in each boot the story load starts 130–150 s in. | `LEONIDA_HOST_IMAGE_COPY` | boots | story load covered | device loss | how it ended | |---|---|---|---|---| | unset (`off (auto: NVIDIA)`) | 1 | ~340 s | none | `0xc0000005` in `amd_fidelityfx_upscaler_xbox.dll+0x65ff` (FSPX 27/29, #1862) | | `1` | 2 | ~330 s and ~350 s | none | time limit (482 s) | | `1` with `LEONIDA_VK_VALIDATION=1` | 1 | ~375 s | none | the same upscaler `0xc0000005` | - **Host image copies on did not lose the device in 3 of 3 boots on this card.** The 4070 SUPER's 7 of 7 runs used the same driver (621.24). - **Validation:** `VUID-vkCmdCopyImage-srcImage-01548` (the D32S8 → D32 copy that #1893 fixes) did not appear before the run ended. stdout went to a file and the run ended in an access violation, so a message still in the buffer at the end could be missing. The only VUIDs were four pairs of `VkImageViewCreateInfo-image-06724` / `-subresourceRange-06725` (`baseArrayLayer` 6784 on a one-layer image), which #1860 covers. - **Title-window budget:** 1024 MiB was reached (`MiB copied so far: 1023`) in three of the four boots. This doesn't contradict the 4070 SUPER result. If #1893's explanation holds (a copy that writes past the end of a D32 image), whether that write hits something that faults probably depends on what is bound after the image, which can differ between cards. Because the control boots didn't fail here, I didn't run #1893 on this card. AI-assisted.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 15:37 UTC · original

Thanks @⁠Diegobecker07, that's useful: no loss with host copies on in 3 of 3 boots on a 16 GB 5070 Ti fits #1893's explanation. Whether the write past the D32 image faults depends on what's bound after it, which differs with VRAM size and allocation order. Right now on the 4070 SUPER (same driver, 621.24): a control boot of main without #1893, then #1893 ×2 with host copies on, then #1893 + #1849. If #1893 clears it here, I'll drop this PR's NVIDIA default.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 15:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7167136157) Thanks @⁠Diegobecker07, that's useful: no loss with host copies on in 3 of 3 boots on a 16 GB 5070 Ti fits #1893's explanation. Whether the write past the D32 image faults depends on what's bound after it, which differs with VRAM size and allocation order. Right now on the 4070 SUPER (same driver, 621.24): a control boot of main without #1893, then #1893 ×2 with host copies on, then #1893 + #1849. If #1893 clears it here, I'll drop this PR's NVIDIA default. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-25 16:10 UTC · original

Merge order suggestion: #1893 first. If QemmHD's 4070 SUPER runs confirm that #1893 clears crash A with host image copy on, this PR could keep only the opt-in switch (LEONIDA_HOST_IMAGE_COPY=0) and drop the NVIDIA default. Host copy off costs upload performance on every NVIDIA card. Happy to rerun if needed.

**@⁠OreoFR** on GitHub · 2026-11-25 16:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7167657893) Merge order suggestion: #1893 first. If QemmHD's 4070 SUPER runs confirm that #1893 clears crash A with host image copy on, this PR could keep only the opt-in switch (`LEONIDA_HOST_IMAGE_COPY=0`) and drop the NVIDIA default. Host copy off costs upload performance on every NVIDIA card. Happy to rerun if needed.
Author
Owner

@⁠quartz-heron-58 on GitHub · 2026-11-25 16:13 UTC · original

Retail data for the default question, from a 16 GB card: host image copies on did not lose the device here once #1893 was in, and leaving them off costs about 3.9 GB of VRAM at the world start.

RTX 4080 16 GB, NVIDIA 621.24, Windows 11 26300, 32 GB RAM. Local merge of main b0f3d3998 + #1849 #1893 #1889 #1860 #1886 #1882 #1887 and this PR; LEONIDA_TITLE_WINDOWS_MB=4096, LEONIDA_ARENA_MB=2048, LEONIDA_TITLE_WATCHDOG=0, LEONIDA_DEVICE_FAULT=1, scripted keyboard pad.

LEONIDA_HOST_IMAGE_COPY runs device loss ended by
unset (auto: off here) 2 none my free-RAM guard at 161 s; time limit at 150 s
1 4 none my free-RAM guard at 174, 229, 238 and 280 s

All six got to the world start (frames stop, large compute pipelines build); none got further, so this says nothing about later crashes.

Memory with LEONIDA_MEM_PROBE=1, one run each:

auto (off), t=150 s 1, t=237 s
registered image backing from slot 133 8,122 MiB 4,350 MiB
"CPU-fillable without a fill" 3,894 MiB 91 MiB
device-local (type 1) allocations 12,294 MiB 8,181 MiB

With the 2,048 MiB arena on top, the off run is at about 14.3 GB of 16 GB by 150 s, and in the other off run the log has "a 5594624-byte allocation did not fit in device-local memory and went to memory type 0". So on 16 GB the off default pushes allocations into shared memory around the world start; with copies on there is room left.

Not checked: main without #1893 with copies on (so I cannot say #1893 is what makes it safe here), anything past the world start, more than one probe run per setting. The probe times differ (150 s and 237 s); the later one is the smaller, so the gap is not from running longer.

AI-assisted (Claude Code).

**@⁠quartz-heron-58** on GitHub · 2026-11-25 16:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7167694464) Retail data for the default question, from a 16 GB card: host image copies on did not lose the device here once #1893 was in, and leaving them off costs about 3.9 GB of VRAM at the world start. RTX 4080 16 GB, NVIDIA 621.24, Windows 11 26300, 32 GB RAM. Local merge of main b0f3d3998 + #1849 #1893 #1889 #1860 #1886 #1882 #1887 and this PR; `LEONIDA_TITLE_WINDOWS_MB=4096`, `LEONIDA_ARENA_MB=2048`, `LEONIDA_TITLE_WATCHDOG=0`, `LEONIDA_DEVICE_FAULT=1`, scripted keyboard pad. | `LEONIDA_HOST_IMAGE_COPY` | runs | device loss | ended by | |---|---|---|---| | unset (auto: off here) | 2 | none | my free-RAM guard at 161 s; time limit at 150 s | | 1 | 4 | none | my free-RAM guard at 174, 229, 238 and 280 s | All six got to the world start (frames stop, large compute pipelines build); none got further, so this says nothing about later crashes. Memory with `LEONIDA_MEM_PROBE=1`, one run each: | | auto (off), t=150 s | 1, t=237 s | |---|---|---| | registered image backing from slot 133 | 8,122 MiB | 4,350 MiB | | "CPU-fillable without a fill" | 3,894 MiB | 91 MiB | | device-local (type 1) allocations | 12,294 MiB | 8,181 MiB | With the 2,048 MiB arena on top, the off run is at about 14.3 GB of 16 GB by 150 s, and in the other off run the log has "a 5594624-byte allocation did not fit in device-local memory and went to memory type 0". So on 16 GB the off default pushes allocations into shared memory around the world start; with copies on there is room left. Not checked: main without #1893 with copies on (so I cannot say #1893 is what makes it safe here), anything past the world start, more than one probe run per setting. The probe times differ (150 s and 237 s); the later one is the smaller, so the gap is not from running longer. AI-assisted (Claude Code).
Author
Owner

@⁠quartz-heron-58 on GitHub · 2026-11-25 16:13 UTC · original

One detail to my table above: the 174 s run with copies on also had Snooozs's merge of #1592 with main and a translated fspx_gfx (16,914 programs); the other five runs are the merge exactly as listed.

**@⁠quartz-heron-58** on GitHub · 2026-11-25 16:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7167697415) One detail to my table above: the 174 s run with copies on also had Snooozs's merge of #1592 with main and a translated fspx_gfx (16,914 programs); the other five runs are the merge exactly as listed.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 16:22 UTC · original

Thanks @⁠OreoFR, @⁠quartz-heron-58 and @⁠abnalstlll-byte. #1893 has landed now, and quartz-heron-58's numbers settle the default question by themselves: host copies OFF cost about 3.9 GB of device-local memory at world start (12.3 GB vs 8.2 GB on a 4080), which pushes 12 GB cards into shared memory. So the NVIDIA auto: off default should go. I'll rework this PR into the plain opt-in switch: LEONIDA_HOST_IMAGE_COPY=0 to force staging, default on as before, with the one log line and the decision test kept. I'll push that after my A/B of #1893 on the 4070 SUPER finishes (on the build that lost the device in 7 of 7 runs), and post the counts here.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 16:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7167888971) Thanks @⁠OreoFR, @⁠quartz-heron-58 and @⁠abnalstlll-byte. #1893 has landed now, and quartz-heron-58's numbers settle the default question by themselves: host copies OFF cost about 3.9 GB of device-local memory at world start (12.3 GB vs 8.2 GB on a 4080), which pushes 12 GB cards into shared memory. So the NVIDIA `auto: off` default should go. I'll rework this PR into the plain opt-in switch: `LEONIDA_HOST_IMAGE_COPY=0` to force staging, default on as before, with the one log line and the decision test kept. I'll push that after my A/B of #1893 on the 4070 SUPER finishes (on the build that lost the device in 7 of 7 runs), and post the counts here. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 17:04 UTC · original

Correction to my last comment, with data. I said I'd drop the NVIDIA default once #1893 was in; on the RTX 4070 SUPER it isn't that simple. On the build that lost the device in 7 of 7 runs with host copies on, adding #1893 changed nothing: 2 of 2 valid runs still lost the device with the same signature (WRITE_INVALID, same offset mod 2 MiB, same instruction-pointer entry; a third run was void). A log of every image-to-image copy at the patched spot shows no copy between two depth formats at all before the loss, so #1893 had nothing to act on here. On this card it's a different trigger from OreoFR's world-start one. That's also consistent with Diegobecker07's and quartz-heron-58's 16 GB cards not losing the device with copies on.

The running tally on the 4070 SUPER: losses in 9 of 9 runs with host image copies, 0 of 8 without, and 0 of 1 with only the vkCopyMemoryToImage calls skipped (usage and memory type unchanged). That points at a host copy write itself. Before the loss, the only unusual image copies in that window are block-compressed uploads with mips down to 1×1. I'm bisecting which class of host write is needed (BC formats, sub-block mips, …) to turn this into a narrow fix, so copies can stay on for everything else (quartz-heron-58's 3.9 GB matters). Until then I'd keep this PR as it is, and I'll update it with the bisect.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 17:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7168959856) Correction to my last comment, with data. I said I'd drop the NVIDIA default once #1893 was in; on the RTX 4070 SUPER it isn't that simple. On the build that lost the device in 7 of 7 runs with host copies on, adding #1893 changed nothing: **2 of 2 valid runs still lost the device with the same signature** (WRITE_INVALID, same offset mod 2 MiB, same instruction-pointer entry; a third run was void). A log of every image-to-image copy at the patched spot shows **no copy between two depth formats at all before the loss**, so #1893 had nothing to act on here. On this card it's a different trigger from OreoFR's world-start one. That's also consistent with Diegobecker07's and quartz-heron-58's 16 GB cards not losing the device with copies on. The running tally on the 4070 SUPER: losses in 9 of 9 runs with host image copies, 0 of 8 without, and 0 of 1 with only the `vkCopyMemoryToImage` calls skipped (usage and memory type unchanged). That points at a host copy write itself. Before the loss, the only unusual image copies in that window are block-compressed uploads with mips down to 1×1. I'm bisecting which class of host write is needed (BC formats, sub-block mips, …) to turn this into a narrow fix, so copies can stay on for everything else (quartz-heron-58's 3.9 GB matters). Until then I'd keep this PR as it is, and I'll update it with the bisect. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 17:54 UTC · original

Correction to my last comment: two things I said there don't hold.

  1. The "0 of 1 with only vkCopyMemoryToImage skipped" run was on a main where the load crawls, and it never reached the point where the loss happens. It's not evidence, so please disregard it.
  2. "It points at a host copy write itself" is wrong. On the build that reproduces the loss, skipping every block-compressed host write left only two plain host writes in the whole run, both the runtime's own startup picture at t=0. The loss still came at 261 s with the same signature.

What stands: with host image copies enabled the loss happens every time on that build (11 of 11); with the extension unused it doesn't (0 of 2 there, 0 of 6 on newer mains). So, as OreoFR suggested for their case, what the switch changes is most likely placement: HOST_TRANSFER usage changes the images' memory type and where they're bound, and that decides whether some other operation's overrun lands on unmapped memory. On this card that operation isn't the depth copy #1893 fixed. I'm adding VK_EXT_device_address_binding_report to the loss diagnostics, with unbind history (or using @⁠MoonEyes's version if it's up), to name the object at the fault on this card.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 17:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7170172983) Correction to my last comment: two things I said there don't hold. 1. The "0 of 1 with only `vkCopyMemoryToImage` skipped" run was on a main where the load crawls, and it never reached the point where the loss happens. It's not evidence, so please disregard it. 2. "It points at a host copy write itself" is wrong. On the build that reproduces the loss, skipping **every** block-compressed host write left only two plain host writes in the whole run, both the runtime's own startup picture at t=0. The loss still came at 261 s with the same signature. What stands: with host image copies **enabled** the loss happens every time on that build (11 of 11); with the extension **unused** it doesn't (0 of 2 there, 0 of 6 on newer mains). So, as OreoFR suggested for their case, what the switch changes is most likely **placement**: `HOST_TRANSFER` usage changes the images' memory type and where they're bound, and that decides whether some other operation's overrun lands on unmapped memory. On this card that operation isn't the depth copy #1893 fixed. I'm adding `VK_EXT_device_address_binding_report` to the loss diagnostics, with unbind history (or using @⁠MoonEyes's version if it's up), to name the object at the fault on this card. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Tyrannys on GitHub · 2026-11-25 18:11 UTC · original · edited 2026-11-25 18:55 UTC

Test report from a combined build on a second NVIDIA machine. Counts only.

Machine: Windows 11, RTX 4070 SUPER, NVIDIA 621.01, 64 GB, own 1.0.2.1 copy.

Build: main fe1553456 (already contains #1827 and #1893), plus #674, #1662, #1851, #1849, #1905, #1957, #1950, #1886 and #1894. All of them merged without conflicts.

Shaders: translated on 3de22a190 + #674 + #1662 with --wave64-emulate. 29,279 of 29,280 translated, and all 29,279 pass spirv-val. That is 2,683 library programs and 29 of 29 FSPX. main's translator changes since then are correctness fixes only.

Pipeline cache: warm and complete, 26,503 of 26,503 (9.6 GB).

  • Three library compute programs took 30 to 32 minutes each to build alone: the ScreenProbes ActivateRays, ActivateProbes and ActivateProbesTarget programs of indirect diffuse lighting.
  • Building all three at once crashed the NVIDIA compiler ("NVVM compilation failed: 3", after 22 minutes).

Recipe: scripts/windows-boot/boot.ps1 -Seconds 480, LEONIDA_KEYBOARD_PAD=1 LEONIDA_SKIP_INT3=1 LEONIDA_TITLE_WINDOWS_MB=1024 LEONIDA_MAP_READBACK=1, LEONIDA_PIPELINE_CACHE_DIR pointing at the offline cache. Host image copy: off (auto: NVIDIA) from #1851. One run per row.

run 1 run 2 (+ LEONIDA_TITLE_WATCHDOG=0)
end 344 s: the title's hang watchdog (null write at game_scarlett_master.exe+0x23cf683) full 484 s, stopped by the script
device loss / fault report none none
D3D12 calls 330,487 375,686
ExecuteCommandLists 5,490 6,017
Dispatch / DrawIndexedInstanced 2,435 / 2,726 2,779 / 6,026
PresentX 1,358 ok, 0 failed 1,465 ok, 0 failed
captures 23, all non-black 25, all non-black
indirect draws recorded / emitted / skipped 64 / 0 / 5,092 128 / 34 / 9,244 (#429 not included)
  • WRITE_INVALID: the world-start WRITE_INVALID did not happen in either run. On this machine it ended an earlier run with host image copies on (main 42537e7b6 + #1631; my run table of 07:54 in #1608).
  • #1950 / #1886: in run 1 the exit filter ran on the title's fatal exception: "1 pipeline build(s) still running at exit; writing the pipelines finished so far". It then refused the write: "pipeline cache is 9722912321 bytes, over the 4294967296-byte write limit". With a seeded offline cache, the union is past 4 GiB, so nothing from the session was kept. This is the seeded case raised on #1886. No session file was written in either run.

AI-assisted (Claude Code).

**@⁠Tyrannys** on GitHub · 2026-11-25 18:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7170579179) · edited 2026-11-25 18:55 UTC Test report from a combined build on a second NVIDIA machine. Counts only. **Machine:** Windows 11, RTX 4070 SUPER, NVIDIA 621.01, 64 GB, own 1.0.2.1 copy. **Build:** `main` `fe1553456` (already contains #1827 and #1893), plus #674, #1662, #1851, #1849, #1905, #1957, #1950, #1886 and #1894. All of them merged without conflicts. **Shaders:** translated on `3de22a190` + #674 + #1662 with `--wave64-emulate`. 29,279 of 29,280 translated, and all 29,279 pass `spirv-val`. That is 2,683 library programs and 29 of 29 FSPX. `main`'s translator changes since then are correctness fixes only. **Pipeline cache:** warm and complete, 26,503 of 26,503 (9.6 GB). - Three library compute programs took 30 to 32 minutes each to build alone: the ScreenProbes `ActivateRays`, `ActivateProbes` and `ActivateProbesTarget` programs of indirect diffuse lighting. - Building all three at once crashed the NVIDIA compiler ("NVVM compilation failed: 3", after 22 minutes). **Recipe:** `scripts/windows-boot/boot.ps1 -Seconds 480`, `LEONIDA_KEYBOARD_PAD=1 LEONIDA_SKIP_INT3=1 LEONIDA_TITLE_WINDOWS_MB=1024 LEONIDA_MAP_READBACK=1`, `LEONIDA_PIPELINE_CACHE_DIR` pointing at the offline cache. Host image copy: `off (auto: NVIDIA)` from #1851. One run per row. | | run 1 | run 2 (+ `LEONIDA_TITLE_WATCHDOG=0`) | |---|---|---| | end | 344 s: the title's hang watchdog (null write at `game_scarlett_master.exe+0x23cf683`) | full 484 s, stopped by the script | | device loss / fault report | none | none | | D3D12 calls | 330,487 | 375,686 | | ExecuteCommandLists | 5,490 | 6,017 | | Dispatch / DrawIndexedInstanced | 2,435 / 2,726 | 2,779 / 6,026 | | PresentX | 1,358 ok, 0 failed | 1,465 ok, 0 failed | | captures | 23, all non-black | 25, all non-black | | indirect draws recorded / emitted / skipped | 64 / 0 / 5,092 | 128 / 34 / 9,244 (#429 not included) | - **WRITE_INVALID:** the world-start WRITE_INVALID did not happen in either run. On this machine it ended an earlier run with host image copies on (`main` `42537e7b6` + #1631; my run table of 07:54 in #1608). - **#1950 / #1886:** in run 1 the exit filter ran on the title's fatal exception: "1 pipeline build(s) still running at exit; writing the pipelines finished so far". It then refused the write: "pipeline cache is 9722912321 bytes, over the 4294967296-byte write limit". With a seeded offline cache, the union is past 4 GiB, so nothing from the session was kept. This is the seeded case raised on #1886. No session file was written in either run. AI-assisted (Claude Code).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 18:22 UTC · original

Thanks @⁠Tyrannys, that's the second RTX 4070 SUPER: with host image copies off (auto from this PR) no WRITE_INVALID in either run, against your earlier loss with them on. That matches mine (on/off 11/11 vs 0/8 on the build that reproduces it). Two things in your table are worth their own threads: the three ScreenProbes compute programs at 30-32 minutes each (and the NVVM failure when built together), and the session cache that isn't written once a seeded cache is over the 4 GiB limit (#1886).

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 18:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7170827889) Thanks @⁠Tyrannys, that's the second RTX 4070 SUPER: with host image copies off (`auto` from this PR) no WRITE_INVALID in either run, against your earlier loss with them on. That matches mine (on/off 11/11 vs 0/8 on the build that reproduces it). Two things in your table are worth their own threads: the three ScreenProbes compute programs at 30-32 minutes each (and the NVVM failure when built together), and the session cache that isn't written once a seeded cache is over the 4 GiB limit (#1886). AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 19:00 UTC · original

Moving this back to draft. New evidence on the RTX 4070 SUPER suggests the host-image-copy switch doesn't address the root cause of the world-start loss here: with copies off, the runs simply never reached the stage where the loss happens. So the 0-of-8 is not evidence of a fix. Please don't merge on the strength of my earlier counts. I'll follow up once the root cause is confirmed and a proper fix is tested.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 19:00 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7171694960) Moving this back to draft. New evidence on the RTX 4070 SUPER suggests the host-image-copy switch doesn't address the root cause of the world-start loss here: with copies off, the runs simply never reached the stage where the loss happens. So the 0-of-8 is not evidence of a fix. Please don't merge on the strength of my earlier counts. I'll follow up once the root cause is confirmed and a proper fix is tested. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-27 03:59 UTC · original

Retail data from profile M (RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11). Merged onto main d1dff7949 together with #2412, #2260, #2020, #2166 and #2418, it merged cleanly. The log line reads host image copy: off (LEONIDA_HOST_IMAGE_COPY=0); CPU texture copies use a staging submit with the switch, and off (auto: NVIDIA) without it. Four runs with host copies off and #2020, up to 815 s each: no device loss at all. Two were stopped by my memory guard, one by an unrelated hang (#2418), and one reached the world phase (more than 63k indirect draws). Host commit went up (37 GB private at peak in the world phase), so a small page file is not enough with this on. MEASURED (n=4). (Edited a minute after posting: the first version said the runs had compute-timeout losses; those were in other runs with host copies on.) AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠OreoFR** on GitHub · 2026-11-27 03:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1851#issuecomment-7209433376) Retail data from profile M (RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11). Merged onto `main` d1dff7949 together with #2412, #2260, #2020, #2166 and #2418, it merged cleanly. The log line reads `host image copy: off (LEONIDA_HOST_IMAGE_COPY=0); CPU texture copies use a staging submit` with the switch, and `off (auto: NVIDIA)` without it. Four runs with host copies off and #2020, up to 815 s each: no device loss at all. Two were stopped by my memory guard, one by an unrelated hang (#2418), and one reached the world phase (more than 63k indirect draws). Host commit went up (37 GB private at peak in the world phase), so a small page file is not enough with this on. `MEASURED (n=4)`. (Edited a minute after posting: the first version said the runs had compute-timeout losses; those were in other runs with host copies on.) AI-assisted (Claude Code, Claude Opus 5.5).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1851/head:github-bot/gh-1851'
git switch 'github-bot/gh-1851'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1851'
git switch 'github-bot/gh-1851'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1851'
git switch 'github-bot/gh-1851'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1851'
git switch 'main'
git merge --squash 'github-bot/gh-1851'
git switch 'main'
git merge --ff-only 'github-bot/gh-1851'
git switch 'main'
git merge 'github-bot/gh-1851'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.