finding: on main the world-start device loss is the 64 MiB title-window cap (LEONIDA_TITLE_WINDOWS_MB); raising it gets past it #1537
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Reference
No Branch/Tag specified
main
github-pr/3295
beta
docs/changelog-3483-3500
github-pr/3294
github-pr/2975
github-pr/2815
feat/gate-driver-start
feat/skip-pipelines-release
perf/lazy-compare
perf/mwaitx-wait
test/prio-ceiling-main
fix/ab-cpu-stdout
fix/gate-old-crashes
diag/ab-cpu
test/main-0312
github-pr/3291
diag/indirect-clamp-census
feat/barrier-enhanced
perf/texture-frame-ceiling
perf/dstorage-threads
fix/console-queue-dma-tables
fix/port-descriptors-record-parts
fix/frame-waits-fence
fix/console-sampler-words
fix/graphics-userdata-spill
fix/xg-reserved-layout-rotation
fix/barrier-console-flags
fix/switches-wait-test-child
test/list-value-waits
test/lot-gxdk-0412
fix/bvh-compacted-size
docs/i18n-quickstarts
feat/native-pipeline-slots
fix/clippy-leonida-gpu
fix/list-value-producers
fix/descriptor-page-straddle
fix/xmem-low-window
fix/ffx-jitter-never-zero
fix/run-stdout-closed
github-pr/2892
github-pr/2896
feat/warm-save-every
github-pr/2980
github-pr/2994
github-pr/3005
github-pr/3010
github-pr/3136
github-pr/3303
github-pr/3220
github-pr/3143
github-pr/3330
github-pr/3226
github-pr/3187
carry/3395
github-pr/2946
github-pr/2947
github-pr/2945
github-pr/2983
github-pr/3001
github-pr/3372
github-pr/3128
github-pr/3296
github-pr/2588
github-pr/3119
github-pr/3378
fix/crash-diagnostics
feat/dlss-mip-bias
fix/retired-out-of-order
fix/dxr-postbuild-barrier
fix/amd-relay-default
fix/removed-report-wait
feat/heap-twin
feat/vram-margin
github-pr/2472
github-pr/3123
github-pr/3088
assets/annonce-v1
github-pr/2794
github-pr/3300
github-pr/3304
github-pr/3308
github-pr/3367
github-pr/3369
fix/launcher-dlss-diagnostics
github-pr/3269
github-pr/2957
github-pr/3205
fix/crash-zero-guard
github-pr/3185
github-pr/3099
github-pr/3104
github-pr/3348
github-pr/3379
github-pr/3377
perf/darner-title-priority-ceiling
github-pr/3376
gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github-pr/3373
github-pr/3368
github-pr/3198
gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github-pr/3346
github-pr/3375
github-pr/2958
github-pr/3151
github-pr/3307
github-pr/3278
github-pr/3374
fix/runtime-test-conservative-fixtures
github-pr/3366
ci/shard-semantic-linux
github-pr/3354
docs/fg-limit-fps-switch
github-pr/3365
fix/read-file-hard-link
github-pr/3364
fix/book-slot-heap-never-read
github-pr/3361
github-pr/3263
github-pr/3360
github-pr/3353
github-pr/3331
fix/alias-later-queued-submissions
github-pr/3352
github-pr/3228
github-pr/3349
claude/gallant-sagan-aamatr
github-pr/3200
github-pr/3132
github-pr/3323
github-pr/3332
github-pr/3340
github-pr/3311
github-pr/3334
github-pr/3297
github-pr/3256
github-pr/2567
github-pr/2851
d3d12/agility-sdk-621
github-pr/3164
github-pr/3114
github-pr/3050
github-pr/3113
github-pr/3326
github-pr/3144
github-pr/2642
github-pr/3072
github-pr/2789
github-pr/2643
github-pr/3009
github-pr/3035
github-pr/3031
github-pr/2686
github-pr/2834
github-pr/3321
github-pr/3325
github-pr/3290
github-pr/3324
github-pr/3130
claude/fervent-curie-m19lnr
github-pr/3309
github-pr/3305
github-pr/3306
github-pr/3302
github-pr/3301
github-pr/3345
github-pr/3211
github-pr/3027
github-pr/3286
github-pr/3235
github-pr/3265
github-pr/3275
codex/skip-no-hit-ray-passes
github-pr/2823
github-pr/2911
github-pr/3262
github-pr/3125
github-pr/3206
github-pr/3250
github-pr/3238
github-pr/3188
github-pr/2952
github-pr/3217
github-pr/3168
t3/preserve-fsr-sdk-restart-path
t3/propagate-host-failure-hresult
github-pr/3209
t3/launcher-custom-parameters
github-pr/3207
github-pr/3183
github-pr/3160
github-pr/3201
ci/less-to-run
github-pr/2930
github-pr/2797
github-pr/2999
perf/native-compute-shader-forms
github-pr/3191
github-pr/3011
github-pr/3019
github-pr/2996
gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
claude/blissful-franklin-ukp7ag
github-pr/3141
github-pr/3156
github-pr/3150
github-pr/3153
github-pr/3163
github-pr/3142
github-pr/3139
github-pr/2841
github-pr/3069
github-pr/3098
github-pr/3107
github-pr/3071
github-pr/2774
github-pr/2889
github-pr/3075
github-pr/2661
github-pr/3064
github-pr/3054
github-pr/3049
github-pr/2855
github-pr/2943
github-pr/3016
github-pr/2887
github-pr/3006
github-pr/3003
github-pr/2993
notes/card-time-and-plant-flicker
github-pr/2989
feat/vulkan-rs
github-pr/2985
github-pr/2951
github-pr/2982
github-pr/752
github-pr/792
github-pr/2877
github-pr/2654
github-pr/2893
github-pr/2948
github-pr/2944
github-pr/2919
github-pr/2915
archive/ci/less-to-run/20261202T1121Z
github-pr/2800
github-pr/2822
github-pr/2833
github-pr/2840
github-pr/2831
github-pr/2832
github-pr/2801
github-pr/2890
github-pr/2891
github-pr/2664
github-pr/2807
rt-call-trace
github-pr/2755
perf/ahead-split
github-pr/2587
github-pr/2698
github-pr/2609
github-pr/3219
docs/readme-runtime-proposal
github-pr/2017
github-pr/1741
github-pr/1667
codex/coord-claim-check-20261124-7e48
v1.1.0
v1.0.1
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy#1537
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
finding: on
mainthe device loss at the world start goes away whenLEONIDA_TITLE_WINDOWS_MB(andLEONIDA_ARENA_MB) are raised; the default 64 MiB of title windows runs out just before it, and from then on shader addresses that name title memory reach the GPU untranslated.Where:
runtime/shims/d3d12_vulkan_device.cpp,DeviceState::resolve_title_memory:title_window_cap = 64ull << 20, and past itlog_once("title memory named by a shader address is past LEONIDA_TITLE_WINDOWS_MB, left untranslated; ...")returns the title's own virtual address as the shader address.Measured (
main3ff2a2adc built unchanged, native Windows 11, 64 GB, RTX 5080 16 GB, NVIDIA 621.24, own 1.0.2.1; keyboard pad with A every 5 s from 30 s;LEONIDA_SKIP_INT3=1, localhistory.bcph):LEONIDA_DEVICE_FAULT=1in three of them); two with a library from my branch's translator, two with one frommain's (26,503 main, 1,786 library, 10 exe, 22 FSPX, 52 BVH)library/lib_cs_01405(255 1 1 or 247 1 1). The title then takes its fatal path (int3 at+0x2474606, access violation 0.1 s later).LEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096,main's library+0x23cf683from+0x2215c35/+0x2215eca).So the stop that
docs/linux_proton.mddescribes as "culling compute at world start reads buffers ... where the memory behind them is not mapped" is, on this machine, the window cap: with a higher cap the same dispatches run. I raised both switches together and did not separate them; the default arena (256 MiB) was also full in these runs ("does not fit the GPU address arena", 49 to 63 lines per run).What comes next with the cap raised (same two runs):
nvidia-smi, one run), so this is not GPU work.VirtualQuerycalls per refresh, and the title texture refresh another 40 to 69 ms a pass.PipelineState::build_computeinside the driver (a compute pipeline compile), 30 of 30 samples, and one driver compiler thread is busy. Whether a title thread waits on that for the 30 s the watchdog allows I could not show: my sampler does not unwind the title's frames reliably.Why it matters: a tester on
maincan get past the device loss today with the two switches. For the code, two separate things: the default cap is below what the world start needs (1.4 GB here), and an address the layer cannot translate is handed to the GPU as it is, where one read loses the device; a null or zero-filled range in its place would cost a wrong frame instead of the device. I have not written either change and am not claiming one here; whoever owns the title windows will know which is right.Needs: game files, and enough RAM for the larger windows (the process peaked at 19.9 GB private in these runs). Not measured: each switch alone, another GPU vendor, and anything past the watchdog. Counters, switch names and addresses of the executable only; no game data. AI-assisted (Claude Code).
Posted as an issue because #14 has reached 2,500 comments and takes no more; once there is a new coordination issue I will link this from it.
One more run, which narrows the second row: with the title's hang watchdog kept kicked as well (
LEONIDA_TITLE_WATCHDOG=0on top of the two switches) the run gets further and then does lose the device, on another program and another kind of access.library/lib_cs_01468. The dispatch oflib_cs_01405that faulted with the default cap went through.So the order of stops on this machine is: the 64 MiB window cap (read fault in
lib_cs_01405), then the title's 30 s watchdog, and behind that a write through an address the layer did not translate (lib_cs_01468). One run for the third; I have not looked at which descriptor it is. AI-assisted (Claude Code).Two more observations from the same runs, each a separate subject; I put them here only because #14 is full.
1. Two BCPack requests fail at every boot (6 of 6 runs, same two requests): BC7, destination in physical pages,
E_DSTORAGE_DECOMPRESSION_ERROR(0x89240030) withreason=missing-endpoint, both indata/ttdb/props/octa_imposters.ttpf: offset 455285504 (9,423 into 12,288 bytes) and offset 76014336 (19,699 into 24,576 bytes). The profile was built unchanged bytools/build_dstorage_history.pyfrom my 1.0.2.1 copy; the runtime reportsBC7 endpoint/index fields 4228/6144 8160/8192for it. So the fit from the player's own pools leaves endpoint fields that these two chunks need. The title carries on after them. For whoever owns the BCPack predictor (RT-BCPACK-DECODER); the offsets should reproduce on any 1.0.2.1 copy.2. The run with the watchdog kicked does not always end in the device loss. Of three such runs, one lost the device (the
lib_cs_01468write above), one ran into my time limit first (I had a test suite running beside it, my mistake), and one ended with process exit 0xC0000005 at 385 s with no exception record in the trace and no device loss, at 4,689 submissions. In the runs I looked at,lib_cs_01468gets four or five buffer descriptors in its one table (s4), all backed by imported title memory (storage=importinLEONIDA_COMPUTE_INPUTS), and they look sane in the dispatches before; I did not catch the faulting dispatch with the probe on. So the third stop is not pinned down, and I am leaving it here rather than guess.AI-assisted (Claude Code).
A second machine, and one of your two switches on its own: on an RTX 4080 the default arena alone loses the device much earlier, before any input, and
LEONIDA_ARENA_MB=4096by itself removes that.Setup: main 3ff2a2adc built unchanged, native Windows 11 build 26300, 32 GB, RTX 4080 16 GB, NVIDIA 621.24, own 1.0.2.1, shaders from main's translator (26,503 main, 1,796 library). The build has no SDL3, so nothing is pressed in any run: this is only what the title does by itself in the first four minutes.
LEONIDA_LAZY_PSO=1 LEONIDA_SKIP_INT3=1. Each run is stopped by me at 240 s if it gets there.LEONIDA_DEVICE_FAULT=1LEONIDA_ARENA_MB=4096 LEONIDA_TITLE_WINDOWS_MB=4096LEONIDA_ARENA_MB=4096onlyThe window-cap line ("past LEONIDA_TITLE_WINDOWS_MB") was not printed in the default runs, and once in the arena-only run, without a loss in the 240 s. So this early stop goes with the full 256 MiB arena, not with the window cap, and it is not the stop at about 300 s you describe: these runs never reach the story load.
This also corrects the reading I posted in #14 (comment 7151745666). There I reported that
LEONIDA_DEVICE_FAULT=1makes this loss go away, 2 of 2 each way. That measurement stands, but the arena is full in those runs as well (63 lines each), so the diagnostics switch does not remove the cause; it changes whether the same condition ends in a loss within 240 s. Why, I have not looked at.Memory with the arena at 4096, for the 32 GB case: private bytes 7.8 GB at 10 s, 9.9 GB at 121 s, 13.4 GB at 181 s and flat to 231 s; free physical memory never below 13.6 GB.
Not measured: anything with input, the window switch on its own, more than one run for each of the last two rows, the fault report for the default-arena loss (it does not happen with the report on). Counters, switch names and log line counts only. AI-assisted: yes (Claude Code)
I'd like to help out and ask if I can take on the
DeviceState::resolve_title_memorycap / untranslated-address fallback fix inruntime/shims/d3d12_vulkan_device.cpp(tracked here because #14 is at the 2,500-comment cap).Before writing a patch, do maintainers have a preference between:
resolve_title_memoryruns pastLEONIDA_TITLE_WINDOWS_MB(avoiding untranslated virtual addresses reaching the GPU and causing device loss),LEONIDA_TITLE_WINDOWS_MBcap, orIf anyone already has a branch in progress for this, please let me know and I'll gladly step aside. (AI-assisted via Antigravity.)
Thanks for recording this while #14 was full. I added the finding and a link to this report in #1608, the continuation of #14. If this was only a temporary coordination issue, would you consider closing it? If you are still using it to track the device loss or any of the follow-up findings, please keep it open.
Confirmed on a third machine, with a 12 GB card: Windows 11, RTX 4070 SUPER (NVIDIA 621.24), main c7e82e26e (it includes #1064 and #1232, which don't change this), plus #1558 for the earlier NVIDIA landing stop.
LEONIDA_TITLE_WINDOWS_MB=1024: no device loss, 0 refused ExecuteCommandLists. The windows grow to 8,192 windows / 841 MiB by 225 s, still growing, so the default needs to be well over 13× larger here.I'll test #1631 on the same boot with the default cap and report back there.
AI-assisted (Claude Code, Claude Opus 5.5).
@lixonik thank you for indexing it in #1608. I would keep this one open as the record of the device loss until #1631 (or a higher default cap) lands, and close it then; nothing else depends on it, since the other observations are linked from #1608 now.
@quartz-heron-58 @QemmHD thank you for the second and third machine. The arena alone on the 4080 and the 841 MiB of windows at 225 s on the 4070 SUPER are the two things I had not separated. The WRITE_INVALID stop in #1608 matches what I saw once the watchdog was kept kicked (a write, pipeline-library compute, lib_cs_01468 on the queue).
AI-assisted (Claude Code).
A fourth machine, the smallest NVIDIA card so far and an older driver: Windows 11 (build 26300), RTX 5070 12 GB, NVIDIA 621.01, Ryzen 7 7800X3D, 64 GB, own 1.0.2.1 (all 108 sizes match
game/xbox-1.0.2.1.json; SHA-256 checked on the 52 files under 200 MB, the executable included). Shaders translated at3de22a190(26,503 / 26,503 main passspirv-val, 52/52 BVH, 12/12 exe;--wave64-emulateauto → on); runtime rebuilt atbcaa13dad(includes #1558).--first-run-uiprofile, 2560x1440 swapchain,LEONIDA_DEVICE_FAULT=1, fresh overlay and save folder each run.3de22a190(before #1558)exe+0x131a2adafter 39 s, right afterslot 133 depth texture refused (hr=0x80070057, placement): format 118 2560x1440x1bcaa13dadpast LEONIDA_TITLE_WINDOWS_MB ... MiB copied so far: 63, then device lost at 426 s (vkDeviceWaitIdle, title texture upload); last dispatches on the direct queue arelibrary/lib_cs_02993andlibrary/lib_cs_00031; then int3 atexe+0x2474606bcaa13dadLEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096 LEONIDA_TITLE_WATCHDOG=0 LEONIDA_KEYBOARD_PAD=alwaysaddress[1] type=2(WRITE_INVALID) at an address in the title's process range (far above the arena), last dispatches on a compute queue arelibrary/lib_cs_00927(18,1,1); then int3 atexe+0x2474606So on this card too: #1558 removes the first NVIDIA stop, the default 64 MiB cap is reached and the device is lost after it, and with the cap raised (and the watchdog kicked) the loss moves to a write to an untranslated title address on a compute queue, as in your watchdog-off run, on a different library program. Input reached the title in runs 2 and 3 (keyboard pad and an Xbox One pad); run 2 stayed on the account-selection page.
Counts, offsets and program names only, no game data. AI-assisted.
Thanks @kurrutako, that's the same sequence as on the 4070 SUPER. One caution on run 3: on my side a store trace over all 4,976 translated programs that store (details in #1608) showed that no translated shader forms that WRITE_INVALID address. The compute queue's last dispatch is just where that queue had finished its list. The fault is the last 4 KiB page of a 448-page span on a 2 MiB boundary, with a constant instruction pointer across runs and a direct queue that hadn't reached a marked command. That points at a write the layer or driver makes itself at the start of a submission. The leading suspect is the per-submission zero fill / storage-image initialize in
vulkan_backend.h, which runs before any checkpoint marker. I'm testing that now.Also worth a re-run: main just took #1723 (ed94fbef9, the post-story-load memory/queue/Vulkan integration: an indirect clamp, zero-size V#s for unbacked inline tables, twins that aren't imported), which may move this stop.
AI-assisted (Claude Code, Claude Opus 5.5).
Confirmed on a second NVIDIA card: GeForce RTX 2070 SUPER (8 GB), driver 616.56, Windows 11, 64 GB RAM, own 1.0.2.1, runtime from c7e82e26e (includes #1021),
LEONIDA_CONSOLE_D16S8=native, localhistory.bcph, keyboard pad driven by a recordedLEONIDA_INPUT_SCRIPT(noLEONIDA_SKIP_INT3).VK_LAYER_LUNARG_crash_diagnostic+VK_EXT_device_fault:Invalid Readat a title-range address, in avkCmdDispatch(28 to 241 groups) on the dedicated compute family. A local handle log maps the pipeline tolibrary/lib_cs_01405. Then the title's int3 at+0x2474606.LEONIDA_ARENA_MB=4095onlyLEONIDA_TITLE_WINDOWS_MB=512only+0x4dcbc9d(111 s) in the otherLEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096+0x23cf683(write 0x0), the watchdog stop you describe.So on this card the 512 MiB cap is not enough either; it needs the full ~1.7 GB. PR #1728's V# guard (tested on its 4ebe44664) does not prevent the loss, which fits a raw global load:
lib_cs_01405's index entry listsPhysicalStorageBufferAddresses.I also posted this as a finding in #1608 before I found this issue. That entry is a duplicate of this one and I have marked it so.
Counters, switch names and executable offsets only; no game data. AI-assisted (Claude Code).
Same order of stops on the RTX 2070 SUPER (driver 616.56, c7e82e26e,
LEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096, scripted keyboard pad):+0x23cf683. 29 compute pipelines take 2 to 9 s each at the world start, among themlib_cs_02147(9.4 s) and3InstanceCulling_CS_Tree_BatchCull(7.0 s).vk_pipeline_checkinto the samepipeline_cache.binbeforehand (0 failed) did not help: the runtime built the same 29 again. The checker's pipelines probably use a different layout from the title's root signatures, so the cache entries do not match. Treat that as a hypothesis.LEONIDA_TITLE_WATCHDOG=0on top: device lost at about 500 s, then the int3 at+0x2474606. This dump'sVK_EXT_device_faultgives only an "Unknown Instruction Pointer" range and no read or write address, so I cannot say whether it is yourlib_cs_01468write.AI-assisted (Claude Code); no game data.
Status check: the runtime half of this is fixed on main.
ba626820ebacks a title address past the cap (or with the arena full) with the persistent geometry copy, or writes its view zero-size, so the raw VA no longer reaches the GPU; #1631 (merged) addedd3d12_title_window_cap, the test for that path withLEONIDA_TITLE_WINDOWS_MB=0. What is left of the finding is the default cap itself (64 MiB against the ~1.4 GB the world start used, at a ~19.9 GB process peak) — a memory tradeoff, not the device-loss bug — and the elevated-cap runs still stop at the watchdog (+0x23cf683from+0x2215c35), which is the address #1915 reports.Closing as I said I would: #1631 is merged and, as BubsMcgee sums up, an address past the cap (or with the arena full) is backed by a geometry copy or written as a zero-size view, so the raw address no longer reaches the GPU. What is left of the finding is the default cap (64 MiB) against what the world needs, a memory choice; in my world runs
LEONIDA_TITLE_WINDOWS_MB=4096withLEONIDA_ARENA_MB=4095took the "got no GPU copy" count from 131,072 to 128 and made acceleration-structure builds resolve that did not, at the price of the copies #1867 cuts. Thank you to everyone who confirmed it on their cards. AI-assisted (Claude Code).