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
pull from: github-bot/gh-1851
merge into: github:main
github:main
github:docs/animation-merge-remnants
github:docs/story-dedup-and-cli
github:docs/restofworld-merge-remnants
github:docs/gamedata-dedup-tables
github:docs/textures-bcpack-tables-and-cli
github:docs/exe-fail-fast-shims-sync
github:fix/address-guard-wraparound-parity
github:fix/cvt-f16-denorm-and-clamp
github:docs/pso-cache-scope-note
github:docs/viewer-readme
github:docs/textures-arrays-dds-preview
github:docs/conformance-readme-status
github:fix/docs-validators-fences-urls
github:claude/loop-total
github:claude/pops-collision-seed
github:claude/dstorage-hold-page-reads
github:claude/host-image-copy-switch
github:feat/gdk-lifecycle-window-hook
github:claude/d16s8-uav-nvidia-fallback
github:feat/mfplat-offline-shim
github:claude/gameinput-slow-reader
github:fix/rt-null-barrier-clear
github:claude/depth-resolve-sample-positions
github:integration/palmetto-parity
github:claude/valu-literal-sext
github:claude/slot74-pool-handle
github:claude/rgb9e5-uint-alias-view
github:claude/fssm-root-layout-tables
github:feat/gdk-speech-display-lifecycle
github:asset-audio-skip-current
github:qemmhd/old-9940-rectangle-quad-lists
github:feat/ws2-offline-shim
github:qemmhd/rt-d16-unorm-uav
github:feat/xs-device-stops-7-9
github:qemmhd/rt-depth-same-base-shapes
github:qemmhd/rt-lazy-attachment-variant
github:feat/acphal-xma2-decoder
github:asset-audio-skip
github:codex/coord-claim-check-20261124-7e48
github:feat/xs-frame-pacing-presentx
github:feat/xs-device-vm-options
github:old-pr/9844
github:old-pr/9978
github:old-pr/9815
github:old-pr/10057
github:old-pr/9874
github:old-pr/9965
github:old-pr/9863
github:old-pr/10068
github:old-pr/10066
github:old-pr/10067
github:old-pr/10007
github:old-pr/10061
github:old-pr/10065
github:old-pr/10059
github:old-pr/10063
github:old-pr/10055
github:old-pr/10062
github:old-pr/10042
github:old-pr/10041
github:old-pr/10049
github:old-pr/10047
github:old-pr/10046
github:old-pr/10045
github:old-pr/10056
github:old-pr/10043
github:old-pr/10036
github:old-pr/10034
github:old-pr/9984
github:old-pr/10052
github:old-pr/10038
github:old-pr/10033
github:old-pr/10028
github:old-pr/10050
github:old-pr/9891
github:old-pr/9889
github:old-pr/10051
github:old-pr/10019
github:old-pr/10027
github:old-pr/10029
github:old-pr/10031
github:old-pr/10026
github:old-pr/9941
github:old-pr/10030
github:old-pr/10040
github:old-pr/9990
github:old-pr/10021
github:old-pr/9962
github:old-pr/10022
github:old-pr/10020
github:old-pr/10015
github:old-pr/10025
github:old-pr/9886
github:old-pr/10048
github:old-pr/10014
github:old-pr/10011
github:old-pr/9861
github:old-pr/10010
github:old-pr/10008
github:old-pr/9860
github:old-pr/10006
github:old-pr/9920
github:old-pr/9995
github:old-pr/10000
github:old-pr/10016
github:old-pr/10004
github:old-pr/10023
github:old-pr/9982
github:old-pr/9981
github:old-pr/9983
github:old-pr/9970
github:old-pr/9969
github:old-pr/9968
github:old-pr/9971
github:old-pr/9972
github:old-pr/9942
github:old-pr/9963
github:old-pr/9960
github:old-pr/9964
github:old-pr/9985
github:old-pr/9973
github:old-pr/9862
github:old-pr/9953
github:old-pr/10017
github:old-pr/9952
github:old-pr/9955
github:old-pr/9946
github:old-pr/9954
github:old-pr/9938
github:old-pr/9956
github:old-pr/9856
github:old-pr/9947
github:old-pr/9924
github:old-pr/9961
github:old-pr/9927
github:old-pr/9979
github:old-pr/10032
github:old-pr/9926
github:old-pr/5237
github:old-pr/9951
github:old-pr/9931
github:old-pr/9902
github:old-pr/9921
github:old-pr/9994
github:old-pr/9775
github:old-pr/9768
github:old-pr/9905
github:old-pr/9936
github:old-pr/9901
github:old-pr/9904
github:old-pr/9906
github:old-pr/9988
github:old-pr/9908
github:old-pr/9909
github:old-pr/9911
github:old-pr/9912
github:old-pr/9913
github:old-pr/9887
github:old-pr/9916
github:old-pr/9919
github:old-pr/9925
github:old-pr/9933
github:old-pr/9935
github:old-pr/9918
github:old-pr/9879
github:old-pr/9880
github:old-pr/9881
github:old-pr/9996
github:old-pr/9876
github:old-pr/9892
github:old-pr/9899
github:old-pr/9915
github:old-pr/9914
github:old-pr/9872
github:old-pr/9869
github:old-pr/9866
github:old-pr/9819
github:old-pr/10012
github:old-pr/9857
github:old-pr/9893
github:old-pr/9897
github:old-pr/9928
github:old-pr/9868
github:old-pr/9917
github:old-pr/9940
github:old-pr/9873
github:old-pr/9816
github:old-pr/10009
github:old-pr/9900
github:old-pr/9966
github:old-pr/9859
github:old-pr/9843
github:old-pr/9991
github:old-pr/10058
github:old-pr/9883
github:old-pr/9838
github:old-pr/9835
github:old-pr/9959
github:old-pr/9895
github:old-pr/9837
github:old-pr/9858
github:old-pr/9865
github:old-pr/9864
github:old-pr/9840
github:old-pr/9820
github:old-pr/4669
github:old-pr/9848
github:old-pr/9850
github:old-pr/9810
github:old-pr/9799
github:old-pr/9853
github:old-pr/9875
github:old-pr/9831
github:old-pr/9796
github:old-pr/9801
github:old-pr/9813
github:old-pr/9794
github:old-pr/7417
github:old-pr/9781
github:old-pr/9806
github:old-pr/9958
github:old-pr/9809
github:old-pr/9791
github:old-pr/9792
github:old-pr/10053
github:old-pr/9784
github:old-pr/9789
github:old-pr/9849
github:old-pr/9846
github:old-pr/9773
github:old-pr/9785
github:old-pr/9803
github:old-pr/9826
github:old-pr/9839
github:old-pr/9922
github:old-pr/9948
github:old-pr/7189
github:old-pr/9957
github:old-pr/9823
github:old-pr/9807
github:old-pr/9851
github:old-pr/9774
github:old-pr/9830
github:old-pr/9836
github:old-pr/9822
github:old-pr/9783
github:old-pr/9833
github:old-pr/9890
github:old-pr/9770
github:old-pr/9769
github:old-pr/9772
github:old-pr/9787
github:old-pr/9852
github:old-pr/9834
github:old-pr/9845
github:old-pr/9871
github:old-pr/9771
github:old-pr/9776
github:old-pr/10005
github:old-pr/9949
github:old-pr/9923
github:old-pr/9805
github:old-pr/9829
github:old-pr/9790
github:old-pr/9827
github:old-pr/9929
github:old-pr/9855
github:old-pr/9934
github:old-pr/9907
github:old-pr/9910
github:old-pr/9779
github:old-pr/9780
github:old-pr/9885
github:old-pr/9882
github:old-pr/9877
github:old-pr/9998
github:old-pr/4251
github:old-pr/9987
github:old-pr/9989
github:old-pr/9950
github:old-pr/9777
github:old-pr/10044
github:old-pr/9884
github:old-pr/2906
github:old-pr/5076
github:old-pr/9937
github:old-pr/9986
github:old-pr/3014
github:old-pr/9943
github:old-pr/9939
github:old-pr/4682
github:old-pr/4765
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
bug
Something isn't working
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
question
Further information is requested
wontfix
This will not be worked on
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
github/ubiquitarianism--leonida!1851
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1851"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@QemmHD on GitHub · 2026-11-25 13:07 UTC · original
ubiquitarianism:claude/host-image-copy-switch→main· +116 −3 · 6 files · 1 commits · draftDepends 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_copyforWriteToSubresource/ReadFromSubresourcewhenever the device has the extension and itshostImageCopyfeature. 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,841ExecuteCommandListsand 7,960 presents). The mechanism is still open. Details, and what's been ruled out, are in #1608: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 as1, except on NVIDIA (vendorID0x10DE), 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 ashost_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.mdanddocs/d3d12_vulkan.md: the variable, and whyautois off on NVIDIA.Tested (Windows 11, RTX 4070 SUPER, MSVC RelWithDebInfo):
ctest -j 4: 415/416. The only failure isd3d12_depth_resolve, the known NVIDIA MFAA sample-position case (#1505).autoand other text logoff (auto: NVIDIA);=0and=1log their own reason.test_runtime_pathsfailure).check_no_game_data.pyis clean.Cost and caveats
=1and with the default), and reports from AMD/Intel on whetherautoshould 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
@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_standaloneentry point. Each run started a fresh process, so the runtime itself selected the extension and created the Vulkan device.LEONIDA_HOST_IMAGE_COPYauto/01auto/01Exact sources were #1851
59c1586d4and the same revision with the #1827ea6d535ffdiff applied. I tested unset,auto,0and1separately 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 CPUhost_image_copy_policytest passed in both builds.The R8 fixture was
check_mapped_planefromd3d12_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 #1827AI-assisted verification with OpenAI Codex.
@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_memoryandd3d12_texture1d(both build the device throughcreate_vulkan_device_standalone, so they read the switch), run three times:LEONIDA_HOST_IMAGE_COPYhost image copy: off (auto: NVIDIA); CPU texture copies use a staging submit0host image copy: off (LEONIDA_HOST_IMAGE_COPY=0); CPU texture copies use a staging submit1host image copy: on (LEONIDA_HOST_IMAGE_COPY=1)These two only check that the switch is read and the device comes up; they do no CPU texture copies.
d3d12_subresource_copybuilds its own devices withhost_image_copyset 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,
vulkaninforeportsidenticalMemoryTypeRequirements = false(VkPhysicalDeviceVulkan14Properties, promoted fromVkPhysicalDeviceHostImageCopyPropertiesEXT), withhostImageCopy = trueand 28 copy src/dst layouts. So addingVK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXTmay change an image's memory requirements on NVIDIA. The layer adds that usage (d3d12_vulkan_device.cpp6196); it comparesmemoryTypeBitswith 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 acceptsoff(hereofffalls toauto, so stays on outside NVIDIA) and makes the test harness (vk_test_device.h) honour=0; this PR covers=0in 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).
@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
autoon 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).
@madvillain91 on GitHub · 2026-11-25 13:52 UTC · original · reviewed
Independent NVIDIA Ampere data point on Windows 11 26H2 (26300.9711) at
59c1586d4against main384abe5b0(PR base98c2f7777), 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).vulkaninforeportshostImageCopy = trueandidenticalMemoryTypeRequirements = falseon Ampere / 617.14 as well.host_image_copy_policy_test: passed (all cases passed).d3d12_texture_memory_test&d3d12_texture1d_test(both viacreate_vulkan_device_standalone):[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_teststagedhost_image_copy=falsepaths +d3d12_subresource_copy_test+d3d12_m2_textured_test, all 0 VUIDs underLEONIDA_VK_VALIDATION=1). Not checked: retail boot. LGTM (pending #1827 landing first as noted).AI-assisted verification.
@QemmHD on GitHub · 2026-11-25 13:53 UTC · original
Note: #1810 by abnalstlll-byte (opened earlier) adds
LEONIDA_HOST_IMAGE_COPY=0/offfor the same finding. This PR overlaps it and addsauto(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 14:53 UTC · original
#1827 has landed on main (
ea6d535ff, via #1192 at3d4f66123), so the dependency is met: withautooff on NVIDIA, title images now take the staged upload instead of staying zero. This branch merges cleanly onto3d4f66123. 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).
@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.
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.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.
@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).
@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.
71a769d7d+ #1827 + #1851, RelWithDebInfo with MSVC 2022 and SDL3. Shaders translated at0d80bc5df; no translator files changed between that commit and71a769d7d.scripts/windows-boot/boot.ps1defaults, plusLEONIDA_TITLE_WINDOWS_MB=1024andLEONIDA_TITLE_WATCHDOG=0.LEONIDA_HOST_IMAGE_COPYoff (auto: NVIDIA))0xc0000005inamd_fidelityfx_upscaler_xbox.dll+0x65ff(FSPX 27/29, #1862)11withLEONIDA_VK_VALIDATION=10xc0000005VUID-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 ofVkImageViewCreateInfo-image-06724/-subresourceRange-06725(baseArrayLayer6784 on a one-layer image), which #1860 covers.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.
@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).
@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.@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_COPYAll 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: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
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.
@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: offdefault should go. I'll rework this PR into the plain opt-in switch:LEONIDA_HOST_IMAGE_COPY=0to 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 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
vkCopyMemoryToImagecalls 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:54 UTC · original
Correction to my last comment: two things I said there don't hold.
vkCopyMemoryToImageskipped" 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.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_TRANSFERusage 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 addingVK_EXT_device_address_binding_reportto 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).
@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:
mainfe1553456(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 passspirv-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).
ActivateRays,ActivateProbesandActivateProbesTargetprograms of indirect diffuse lighting.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_DIRpointing at the offline cache. Host image copy:off (auto: NVIDIA)from #1851. One run per row.LEONIDA_TITLE_WATCHDOG=0)game_scarlett_master.exe+0x23cf683)main42537e7b6+ #1631; my run table of 07:54 in #1608).AI-assisted (Claude Code).
@QemmHD on GitHub · 2026-11-25 18:22 UTC · original
Thanks @Tyrannys, that's the second RTX 4070 SUPER: with host image copies off (
autofrom 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 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).
@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
maind1dff7949together with #2412, #2260, #2020, #2166 and #2418, it merged cleanly. The log line readshost image copy: off (LEONIDA_HOST_IMAGE_COPY=0); CPU texture copies use a staging submitwith the switch, andoff (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).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.