[GH-ISSUE #1537] finding: on main the world-start device loss is the 64 MiB title-window cap (LEONIDA_TITLE_WINDOWS_MB); raising it gets past it #32

Closed
opened 2026-11-26 20:14:03 +01:00 by 4ld0 · 13 comments
Owner

Originally created by @DadaCap on GitHub (Nov 25, 2026).
Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/1537

finding: on main the device loss at the world start goes away when LEONIDA_TITLE_WINDOWS_MB (and LEONIDA_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 it log_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 (main 3ff2a2adc 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, local history.bcph):

switches runs what happens
defaults (+ LEONIDA_DEVICE_FAULT=1 in three of them); two with a library from my branch's translator, two with one from main's (26,503 main, 1,786 library, 10 exe, 22 FSPX, 52 BVH) 4 device lost at 298 to 305 s, every time, with either library. The log has the "past LEONIDA_TITLE_WINDOWS_MB ... MiB copied so far: 63" line before it in all 4. Fault report: a read of an invalid address far above the arena, in the range where the title's memory lies in the process (0x1b1be885000 in one run, with the arena at 0x2febd0000), checkpoint on a compute queue at a dispatch of 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 2 no device loss. Title windows grow to 9,407 and 9,552 (1.41 and 1.43 GB of copies), and no "does not fit the GPU address arena" line is printed. The run ends 60 to 85 s later, at 364 s and 387 s, on the title's hang watchdog (+0x23cf683 from +0x2215c35 / +0x2215eca).

So the stop that docs/linux_proton.md describes 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):

  • The GPU is idle while the title stalls: 1 % and 0 % busy at 315 s and 340 s in the second run (nvidia-smi, one run), so this is not GPU work.
  • Mirroring before each submission is large by then: "copied 923,374 KiB each from the title's pages in 61.7 ms on average", 14,675 VirtualQuery calls per refresh, and the title texture refresh another 40 to 69 ms a pass.
  • At the 340 s sample one runtime thread sits in PipelineState::build_compute inside 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 main can 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.

Originally created by @DadaCap on GitHub (Nov 25, 2026). Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/1537 finding: on `main` the device loss at the world start goes away when `LEONIDA_TITLE_WINDOWS_MB` (and `LEONIDA_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 it `log_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** (`main` 3ff2a2adc 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`, local `history.bcph`): | switches | runs | what happens | |---|---|---| | defaults (+ `LEONIDA_DEVICE_FAULT=1` in three of them); two with a library from my branch's translator, two with one from `main`'s (26,503 main, 1,786 library, 10 exe, 22 FSPX, 52 BVH) | 4 | device lost at 298 to 305 s, every time, with either library. The log has the "past LEONIDA_TITLE_WINDOWS_MB ... MiB copied so far: 63" line before it in all 4. Fault report: a read of an invalid address far above the arena, in the range where the title's memory lies in the process (0x1b1be885000 in one run, with the arena at 0x2febd0000), checkpoint on a compute queue at a dispatch of `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 | 2 | **no device loss.** Title windows grow to 9,407 and 9,552 (1.41 and 1.43 GB of copies), and no "does not fit the GPU address arena" line is printed. The run ends 60 to 85 s later, at 364 s and 387 s, on the title's hang watchdog (`+0x23cf683` from `+0x2215c35` / `+0x2215eca`). | So the stop that `docs/linux_proton.md` describes 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): - The GPU is idle while the title stalls: 1 % and 0 % busy at 315 s and 340 s in the second run (`nvidia-smi`, one run), so this is not GPU work. - Mirroring before each submission is large by then: "copied 923,374 KiB each from the title's pages in 61.7 ms on average", 14,675 `VirtualQuery` calls per refresh, and the title texture refresh another 40 to 69 ms a pass. - At the 340 s sample one runtime thread sits in `PipelineState::build_compute` inside 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 `main` can 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.
4ld0 closed this issue 2026-11-26 20:14:03 +01:00
Author
Owner

@DadaCap commented on GitHub (Nov 25, 2026):

One more run, which narrows the second row: with the title's hang watchdog kept kicked as well (LEONIDA_TITLE_WATCHDOG=0 on top of the two switches) the run gets further and then does lose the device, on another program and another kind of access.

  • 8,499 submissions against 5,854 and 5,132 in the two runs the watchdog ended; device lost at about 343 s (this run reached the story load about 60 s earlier than the others, with the driver's shader cache warm).
  • Fault report: type 2, a write to an invalid address, 0x1f92cd90000, again far above the arena; checkpoint on a compute queue, submission 8495, command 10, a dispatch of library/lib_cs_01468. The dispatch of lib_cs_01405 that faulted with the default cap went through.
  • The cap message was not printed and the arena was not reported full in this run, so this one is not the window cap.

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).

<!-- gh-comment-id:7152373977 --> @DadaCap commented on GitHub (Nov 25, 2026): One more run, which narrows the second row: with the title's hang watchdog kept kicked as well (`LEONIDA_TITLE_WATCHDOG=0` on top of the two switches) the run gets further and then **does lose the device**, on another program and another kind of access. - 8,499 submissions against 5,854 and 5,132 in the two runs the watchdog ended; device lost at about 343 s (this run reached the story load about 60 s earlier than the others, with the driver's shader cache warm). - Fault report: type 2, a **write** to an invalid address, 0x1f92cd90000, again far above the arena; checkpoint on a compute queue, submission 8495, command 10, a dispatch of `library/lib_cs_01468`. The dispatch of `lib_cs_01405` that faulted with the default cap went through. - The cap message was not printed and the arena was not reported full in this run, so this one is not the window cap. 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).
Author
Owner

@DadaCap commented on GitHub (Nov 25, 2026):

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) with reason=missing-endpoint, both in data/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 by tools/build_dstorage_history.py from my 1.0.2.1 copy; the runtime reports BC7 endpoint/index fields 4228/6144 8160/8192 for 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_01468 write 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_01468 gets four or five buffer descriptors in its one table (s4), all backed by imported title memory (storage=import in LEONIDA_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).

<!-- gh-comment-id:7152630333 --> @DadaCap commented on GitHub (Nov 25, 2026): 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) with `reason=missing-endpoint`, both in `data/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 by `tools/build_dstorage_history.py` from my 1.0.2.1 copy; the runtime reports `BC7 endpoint/index fields 4228/6144 8160/8192` for 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_01468` write 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_01468` gets four or five buffer descriptors in its one table (s4), all backed by imported title memory (`storage=import` in `LEONIDA_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).
Author
Owner

@quartz-heron-58 commented on GitHub (Nov 25, 2026):

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=4096 by 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.

switches runs result "does not fit the GPU address arena" lines
defaults 2 device lost at 150 s and at about 123 s, process exit 0xC0000005 31 and 38 before the loss
LEONIDA_DEVICE_FAULT=1 2 240 s, no loss 63 and 63
LEONIDA_ARENA_MB=4096 LEONIDA_TITLE_WINDOWS_MB=4096 1 240 s, no loss 0
LEONIDA_ARENA_MB=4096 only 1 240 s, no loss 0

The 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=1 makes 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)

<!-- gh-comment-id:7152717557 --> @quartz-heron-58 commented on GitHub (Nov 25, 2026): 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=4096` by 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. | switches | runs | result | "does not fit the GPU address arena" lines | |---|---|---|---| | defaults | 2 | device lost at 150 s and at about 123 s, process exit 0xC0000005 | 31 and 38 before the loss | | `LEONIDA_DEVICE_FAULT=1` | 2 | 240 s, no loss | 63 and 63 | | `LEONIDA_ARENA_MB=4096 LEONIDA_TITLE_WINDOWS_MB=4096` | 1 | 240 s, no loss | 0 | | `LEONIDA_ARENA_MB=4096` only | 1 | 240 s, no loss | 0 | The 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=1` makes 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)
Author
Owner

@Tetn5 commented on GitHub (Nov 25, 2026):

I'd like to help out and ask if I can take on the DeviceState::resolve_title_memory cap / untranslated-address fallback fix in runtime/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:

  1. Returning a zero-filled / safe dummy range when resolve_title_memory runs past LEONIDA_TITLE_WINDOWS_MB (avoiding untranslated virtual addresses reaching the GPU and causing device loss),
  2. Raising the default LEONIDA_TITLE_WINDOWS_MB cap, or
  3. Doing both (plus a focused synthetic test covering the over-cap fallback path)?

If anyone already has a branch in progress for this, please let me know and I'll gladly step aside. (AI-assisted via Antigravity.)

<!-- gh-comment-id:7152787755 --> @Tetn5 commented on GitHub (Nov 25, 2026): I'd like to help out and ask if I can take on the `DeviceState::resolve_title_memory` cap / untranslated-address fallback fix in `runtime/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: 1. Returning a zero-filled / safe dummy range when `resolve_title_memory` runs past `LEONIDA_TITLE_WINDOWS_MB` (avoiding untranslated virtual addresses reaching the GPU and causing device loss), 2. Raising the default `LEONIDA_TITLE_WINDOWS_MB` cap, or 3. Doing both (plus a focused synthetic test covering the over-cap fallback path)? If anyone already has a branch in progress for this, please let me know and I'll gladly step aside. (AI-assisted via Antigravity.)
Author
Owner

@lixonik commented on GitHub (Nov 25, 2026):

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.

<!-- gh-comment-id:7154634008 --> @lixonik commented on GitHub (Nov 25, 2026): Thanks for recording this while #14 was full. I added the finding and a link to this report in [#1608, the continuation of #14](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7154627786). 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.
Author
Owner

@QemmHD commented on GitHub (Nov 25, 2026):

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.

  • Default windows (64 MiB): about 30 s after "title memory named by a shader address is past LEONIDA_TITLE_WINDOWS_MB, left untranslated; MiB copied so far: 63", the first compute-dispatch group at world start faults: VK_ERROR_DEVICE_LOST, device-fault READ_INVALID, and the checkpoints on one list of 13 pipeline-library dispatches. 3 of 3 runs across two trees. Skipping the first program only moves the fault to the next one.
  • 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.
  • Memory at that point: about 18.4 GB private, about 10.5 of 12 GB VRAM.

I'll test #1631 on the same boot with the default cap and report back there.

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

<!-- gh-comment-id:7154802686 --> @QemmHD commented on GitHub (Nov 25, 2026): 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. - **Default windows (64 MiB):** about 30 s after "title memory named by a shader address is past LEONIDA_TITLE_WINDOWS_MB, left untranslated; MiB copied so far: 63", the first compute-dispatch group at world start faults: VK_ERROR_DEVICE_LOST, device-fault READ_INVALID, and the checkpoints on one list of 13 pipeline-library dispatches. 3 of 3 runs across two trees. Skipping the first program only moves the fault to the next one. - **`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. - **Memory at that point:** about 18.4 GB private, about 10.5 of 12 GB VRAM. I'll test #1631 on the same boot with the default cap and report back there. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@DadaCap commented on GitHub (Nov 25, 2026):

@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).

<!-- gh-comment-id:7156045400 --> @DadaCap commented on GitHub (Nov 25, 2026): @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).
Author
Owner

@kurrutako commented on GitHub (Nov 25, 2026):

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 at 3de22a190 (26,503 / 26,503 main pass spirv-val, 52/52 BVH, 12/12 exe; --wave64-emulate auto → on); runtime rebuilt at bcaa13dad (includes #1558). --first-run-ui profile, 2560x1440 swapchain, LEONIDA_DEVICE_FAULT=1, fresh overlay and save folder each run.

run runtime switches end
1 3de22a190 (before #1558) defaults int3 at exe+0x131a2ad after 39 s, right after slot 133 depth texture refused (hr=0x80070057, placement): format 118 2560x1440x1
2 bcaa13dad defaults #1558's fallback fires once (slot 133, format 118); past 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 are library/lib_cs_02993 and library/lib_cs_00031; then int3 at exe+0x2474606
3 bcaa13dad LEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096 LEONIDA_TITLE_WATCHDOG=0 LEONIDA_KEYBOARD_PAD=always no cap line; title windows grow to 9,375 (1.45 GB in 12,965 copies, ~0.9 GB copied per submission at ~75 ms); device lost at 257 s, fault report address[1] type=2 (WRITE_INVALID) at an address in the title's process range (far above the arena), last dispatches on a compute queue are library/lib_cs_00927 (18,1,1); then int3 at exe+0x2474606

So 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.

<!-- gh-comment-id:7161202601 --> @kurrutako commented on GitHub (Nov 25, 2026): 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 at `3de22a190` (26,503 / 26,503 main pass `spirv-val`, 52/52 BVH, 12/12 exe; `--wave64-emulate` auto → on); runtime rebuilt at `bcaa13dad` (includes #1558). `--first-run-ui` profile, 2560x1440 swapchain, `LEONIDA_DEVICE_FAULT=1`, fresh overlay and save folder each run. | run | runtime | switches | end | |---|---|---|---| | 1 | `3de22a190` (before #1558) | defaults | int3 at `exe+0x131a2ad` after **39 s**, right after `slot 133 depth texture refused (hr=0x80070057, placement): format 118 2560x1440x1` | | 2 | `bcaa13dad` | defaults | #1558's fallback fires once (slot 133, format 118); `past 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 are `library/lib_cs_02993` and `library/lib_cs_00031`; then int3 at `exe+0x2474606` | | 3 | `bcaa13dad` | `LEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096 LEONIDA_TITLE_WATCHDOG=0 LEONIDA_KEYBOARD_PAD=always` | no cap line; title windows grow to 9,375 (1.45 GB in 12,965 copies, ~0.9 GB copied per submission at ~75 ms); **device lost at 257 s**, fault report `address[1] type=2` (WRITE_INVALID) at an address in the title's process range (far above the arena), last dispatches on a compute queue are `library/lib_cs_00927` (18,1,1); then int3 at `exe+0x2474606` | So 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.
Author
Owner

@QemmHD commented on GitHub (Nov 25, 2026):

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).

<!-- gh-comment-id:7161298965 --> @QemmHD commented on GitHub (Nov 25, 2026): 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).
Author
Owner

@HasiKe commented on GitHub (Nov 25, 2026):

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, local history.bcph, keyboard pad driven by a recorded LEONIDA_INPUT_SCRIPT (no LEONIDA_SKIP_INT3).

switches runs what happens
defaults 4 device lost at 228 to 458 s. The "past LEONIDA_TITLE_WINDOWS_MB ... left untranslated" line comes before it every time. VK_LAYER_LUNARG_crash_diagnostic + VK_EXT_device_fault: Invalid Read at a title-range address, in a vkCmdDispatch (28 to 241 groups) on the dedicated compute family. A local handle log maps the pipeline to library/lib_cs_01405. Then the title's int3 at +0x2474606.
LEONIDA_ARENA_MB=4095 only 1 no arena overflow lines, same device loss
LEONIDA_TITLE_WINDOWS_MB=512 only 2 the cap is still hit once; device lost in one run, an early int3 at +0x4dcbc9d (111 s) in the other
LEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096 1 no device loss, no cap or arena lines. 9,596 title windows (1,668,530 KiB), "copied 957,544.6 KiB each ... in 80.024 ms on average". Ends at 395 s on the access violation at +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 lists PhysicalStorageBufferAddresses.

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).

<!-- gh-comment-id:7163065664 --> @HasiKe commented on GitHub (Nov 25, 2026): 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`, local `history.bcph`, keyboard pad driven by a recorded `LEONIDA_INPUT_SCRIPT` (no `LEONIDA_SKIP_INT3`). | switches | runs | what happens | |---|---|---| | defaults | 4 | device lost at 228 to 458 s. The "past LEONIDA_TITLE_WINDOWS_MB ... left untranslated" line comes before it every time. `VK_LAYER_LUNARG_crash_diagnostic` + `VK_EXT_device_fault`: `Invalid Read` at a title-range address, in a `vkCmdDispatch` (28 to 241 groups) on the dedicated compute family. A local handle log maps the pipeline to `library/lib_cs_01405`. Then the title's int3 at `+0x2474606`. | | `LEONIDA_ARENA_MB=4095` only | 1 | no arena overflow lines, same device loss | | `LEONIDA_TITLE_WINDOWS_MB=512` only | 2 | the cap is still hit once; device lost in one run, an early int3 at `+0x4dcbc9d` (111 s) in the other | | `LEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096` | 1 | **no device loss**, no cap or arena lines. 9,596 title windows (1,668,530 KiB), "copied 957,544.6 KiB each ... in 80.024 ms on average". Ends at 395 s on the access violation at `+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 lists `PhysicalStorageBufferAddresses`. 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).
Author
Owner

@HasiKe commented on GitHub (Nov 25, 2026):

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):

  • Watchdog armed: ends at 440 s and 479 s on the access violation at +0x23cf683. 29 compute pipelines take 2 to 9 s each at the world start, among them lib_cs_02147 (9.4 s) and 3InstanceCulling_CS_Tree_BatchCull (7.0 s).
  • Precompiling all 1,844 library compute pipelines with vk_pipeline_check into the same pipeline_cache.bin beforehand (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=0 on top: device lost at about 500 s, then the int3 at +0x2474606. This dump's VK_EXT_device_fault gives only an "Unknown Instruction Pointer" range and no read or write address, so I cannot say whether it is your lib_cs_01468 write.

AI-assisted (Claude Code); no game data.

<!-- gh-comment-id:7164270759 --> @HasiKe commented on GitHub (Nov 25, 2026): 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): - Watchdog armed: ends at 440 s and 479 s on the access violation at `+0x23cf683`. 29 compute pipelines take 2 to 9 s each at the world start, among them `lib_cs_02147` (9.4 s) and `3InstanceCulling_CS_Tree_BatchCull` (7.0 s). - Precompiling all 1,844 library compute pipelines with `vk_pipeline_check` into the same `pipeline_cache.bin` beforehand (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=0` on top: device lost at about 500 s, then the int3 at `+0x2474606`. This dump's `VK_EXT_device_fault` gives only an "Unknown Instruction Pointer" range and no read or write address, so I cannot say whether it is your `lib_cs_01468` write. AI-assisted (Claude Code); no game data.
Author
Owner

@BubsMcgee commented on GitHub (Nov 25, 2026):

Status check: the runtime half of this is fixed on main. ba626820e backs 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) added d3d12_title_window_cap, the test for that path with LEONIDA_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 (+0x23cf683 from +0x2215c35), which is the address #1915 reports.

<!-- gh-comment-id:7169182325 --> @BubsMcgee commented on GitHub (Nov 25, 2026): Status check: the runtime half of this is fixed on main. `ba626820e` backs 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) added `d3d12_title_window_cap`, the test for that path with `LEONIDA_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 (`+0x23cf683` from `+0x2215c35`), which is the address #1915 reports.
Author
Owner

@DadaCap commented on GitHub (Nov 25, 2026):

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=4096 with LEONIDA_ARENA_MB=4095 took 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).

<!-- gh-comment-id:7169228282 --> @DadaCap commented on GitHub (Nov 25, 2026): 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=4096` with `LEONIDA_ARENA_MB=4095` took 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](https://github.com/ubiquitarianism/leonida/pull/1867) cuts. Thank you to everyone who confirmed it on their cards. AI-assisted (Claude Code).
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#32
No description provided.