d3d12: changed console heap slots are fixed without a time limit by default, not given to shaders as null (RT-CONSOLE-FIX-BUDGET-NULL) #1849

Manually merged
github merged 1 commit from gh-pr/1849/head into gh-pr/1849/base 2026-11-26 10:08:23 +00:00
Owner

@⁠DadaCap on GitHub · 2026-11-25 13:05 UTC · original
DadaCap:console-fix-no-null → main · +8 −7 · 3 files · 1 commits · merged 2026-11-25 17:33 UTC

RT-CONSOLE-FIX-BUDGET-NULL, claimed and found in #1608.

What

LEONIDA_CONSOLE_FIX_US (the time one submission may spend fixing changed console heap slots, #1723) defaults to 0, no limit, instead of 4,000 us. The variable still sets a limit for whoever wants one. The d3d12_unmapped_vsharp test no longer needs to set it.

Why

Past the limit a changed slot is written to the GPU's copy of the heap as a null descriptor until its retry, so a shader reads zero from a buffer the title has filled. At the first world frame that hangs the GPU: lib_cs_01144 (64x32x1 groups) bounds its loops by cvt_u32(size0 / size1 * pixel), with size1 in one of the nulled slots. The compute input probe shows the slot zero in the GPU's copy and valid in the title's memory.

RTX 5080, NVIDIA 621.24, host image copy off with #1827 runs result
default 4,000 us 2 (m41, m43) device lost right after the first world frame, 136 and 150 fault entries of type 4 in one 4.5 KiB range, last checkpoint lib_cs_01144
LEONIDA_CONSOLE_FIX_US=0 3 (m44, m45, m46) no device loss (480, 210 and 240 s, stopped by the time limit)

Cost: nothing I can measure here. Average time in the heap copy per submission, at the same stages: 3.2 to 17.2 ms with the limit, 3.7 to 10.8 ms without, and the longest single one 581 ms against 593 ms (such spikes exist in both). With the limit 7,891 to 30,249 slots an interval were left to retries around the world start.

The comment in the code gives 28 s for one submission as the reason for the limit. I do not see that cost on this machine, but @⁠Moriz82 measured it (speed-8); if it still occurs there, the alternative is to keep a limit for image descriptors whose texture is still missing and never defer buffer descriptors.

It does exist elsewhere: quartz-heron-58 measured, with no limit, 0.4 s rising to 8.2 s a submission in this phase at and after the world start on an RTX 4080 (2.3 ms before it, 150 to 200 ms with the limit), 146 submissions in 435 s; with #1887 on top the phase is 3 to 5 ms up to the world start and 3 to 35 ms around it. aslan2142 measured about 1.25 s a submission on an RX 7900 XTX. #1887 should follow this.

Tests

On main 98c2f7777, RTX 5080, Windows 11, VS 18 RelWithDebInfo: d3d12_unmapped_vsharp (now with the default), d3d12_console_descriptor_heap, d3d12_existing_heap and its two write-watch variants pass. No new test: exceeding a time limit on purpose is not deterministic, and the limit stays off by default. Not run: the whole ctest set, other GPUs.

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

🤖 Generated with Claude Code

**@⁠DadaCap** on GitHub · 2026-11-25 13:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849) `DadaCap:console-fix-no-null` → `main` · +8 −7 · 3 files · 1 commits · merged 2026-11-25 17:33 UTC RT-CONSOLE-FIX-BUDGET-NULL, claimed and found in [#1608](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). ## What `LEONIDA_CONSOLE_FIX_US` (the time one submission may spend fixing changed console heap slots, #1723) defaults to `0`, no limit, instead of 4,000 us. The variable still sets a limit for whoever wants one. The `d3d12_unmapped_vsharp` test no longer needs to set it. ## Why Past the limit a changed slot is written to the GPU's copy of the heap as a null descriptor until its retry, so a shader reads zero from a buffer the title has filled. At the first world frame that hangs the GPU: `lib_cs_01144` (64x32x1 groups) bounds its loops by `cvt_u32(size0 / size1 * pixel)`, with `size1` in one of the nulled slots. The compute input probe shows the slot zero in the GPU's copy and valid in the title's memory. | RTX 5080, NVIDIA 621.24, host image copy off with #1827 | runs | result | |---|---|---| | default 4,000 us | 2 (m41, m43) | device lost right after the first world frame, 136 and 150 fault entries of type 4 in one 4.5 KiB range, last checkpoint `lib_cs_01144` | | `LEONIDA_CONSOLE_FIX_US=0` | 3 (m44, m45, m46) | no device loss (480, 210 and 240 s, stopped by the time limit) | **Cost:** nothing I can measure here. Average time in the heap copy per submission, at the same stages: 3.2 to 17.2 ms with the limit, 3.7 to 10.8 ms without, and the longest single one 581 ms against 593 ms (such spikes exist in both). With the limit 7,891 to 30,249 slots an interval were left to retries around the world start. The comment in the code gives 28 s for one submission as the reason for the limit. I do not see that cost on this machine, but @⁠Moriz82 measured it (speed-8); if it still occurs there, the alternative is to keep a limit for image descriptors whose texture is still missing and never defer buffer descriptors. It does exist elsewhere: quartz-heron-58 measured, with no limit, 0.4 s rising to 8.2 s a submission in this phase at and after the world start on an RTX 4080 (2.3 ms before it, 150 to 200 ms with the limit), 146 submissions in 435 s; with #1887 on top the phase is 3 to 5 ms up to the world start and 3 to 35 ms around it. aslan2142 measured about 1.25 s a submission on an RX 7900 XTX. #1887 should follow this. ## Tests On `main` 98c2f7777, RTX 5080, Windows 11, VS 18 RelWithDebInfo: `d3d12_unmapped_vsharp` (now with the default), `d3d12_console_descriptor_heap`, `d3d12_existing_heap` and its two write-watch variants pass. No new test: exceeding a time limit on purpose is not deterministic, and the limit stays off by default. Not run: the whole `ctest` set, other GPUs. AI-assisted (Claude Code, Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:08:22 +00:00
github manually merged commit c90092b284 into gh-pr/1849/base 2026-11-26 10:08:23 +00:00
Author
Owner

@⁠GGandCo on GitHub · 2026-11-25 13:30 UTC · original

Intel data point: c90092b28 applied privately onto main98c2f7777 alongside PR1836 and local compatibility changes. Windows 11 / Intel UHD Graphics101.6314, MSVC RelWithDebInfo. d3d12_unmapped_vsharp and d3d12_console_descriptor_heap pass normally; d3d12_unmapped_vsharp also passes with Vulkan validation. No explicit LEONIDA_CONSOLE_FIX_US was set for these tests, so this checks the changed default. Full heap suite/gameplay not verified for this combination. AI-assisted (OpenAI Codex).

**@⁠GGandCo** on GitHub · 2026-11-25 13:30 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7163877770) Intel data point: c90092b28 applied privately onto main98c2f7777 alongside PR1836 and local compatibility changes. Windows 11 / Intel UHD Graphics101.6314, MSVC RelWithDebInfo. d3d12_unmapped_vsharp and d3d12_console_descriptor_heap pass normally; d3d12_unmapped_vsharp also passes with Vulkan validation. No explicit LEONIDA_CONSOLE_FIX_US was set for these tests, so this checks the changed default. Full heap suite/gameplay not verified for this combination. AI-assisted (OpenAI Codex).
Author
Owner

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

Independent NVIDIA Ampere data point on Windows 11 26H2 (26300.9711) at c90092b28 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).

All targeted tests passed with LEONIDA_CONSOLE_FIX_US unset (exercising the new 0 default):

  • d3d12_unmapped_vsharp_test (LEONIDA_VK_VALIDATION=1): passed, 0 VUIDs
  • d3d12_console_descriptor_heap_test (LEONIDA_VK_VALIDATION=1): passed, 0 VUIDs
  • d3d12_existing_heap_test (LEONIDA_VK_VALIDATION=1): passed, 0 VUIDs
  • d3d12_existing_heap_test (LEONIDA_EXISTING_HEAP_WRITE_WATCH=0 and =1): 2/2 passed

Not checked: full ctest suite or retail world-frame boot. LGTM.

AI-assisted verification.

**@⁠madvillain91** on GitHub · 2026-11-25 13:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#pullrequestreview-6058828714) · **reviewed** Independent NVIDIA Ampere data point on Windows 11 26H2 (26300.9711) at c90092b28 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). All targeted tests passed with `LEONIDA_CONSOLE_FIX_US` unset (exercising the new `0` default): - `d3d12_unmapped_vsharp_test` (`LEONIDA_VK_VALIDATION=1`): passed, 0 VUIDs - `d3d12_console_descriptor_heap_test` (`LEONIDA_VK_VALIDATION=1`): passed, 0 VUIDs - `d3d12_existing_heap_test` (`LEONIDA_VK_VALIDATION=1`): passed, 0 VUIDs - `d3d12_existing_heap_test` (`LEONIDA_EXISTING_HEAP_WRITE_WATCH=0` and `=1`): 2/2 passed Not checked: full `ctest` suite or retail world-frame boot. LGTM. AI-assisted verification.
Author
Owner

@⁠DadaCap on GitHub · 2026-11-25 13:55 UTC · original

Thank you @⁠madvillain91 for checking the new default on Ampere with validation. The same note as on #1827 about the write-watch variants: the variable is LEONIDA_WRITE_WATCH. AI-assisted (Claude Code).

**@⁠DadaCap** on GitHub · 2026-11-25 13:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7164483184) Thank you @⁠madvillain91 for checking the new default on Ampere with validation. The same note as on #1827 about the write-watch variants: the variable is `LEONIDA_WRITE_WATCH`. AI-assisted (Claude Code).
Author
Owner

@⁠quartz-heron-58 on GitHub · 2026-11-25 15:22 UTC · original

Retail data point from a second NVIDIA machine, including the cost the description asks about. Both halves show here: the device loss goes away, and the per-submission cost is large.

RTX 4080 16 GB, NVIDIA 621.24, Windows 11 26300, 32 GB RAM. Main 71a769d7d (not this branch; the variable set by hand), built with SDL3, one scripted A press, host image copies at the default, LEONIDA_DEVICE_FAULT=1, LEONIDA_TITLE_WINDOWS_MB=4096, shaders retranslated at that commit.

LEONIDA_CONSOLE_FIX_US runs result
unset (4,000) 2 device lost during the story load at ~130 and ~156 s (submission ~3,870 and ~4,094); type-4-only fault report, last checkpoint the dispatch of lib_cs_01144 named above (128x64x1 groups here)
0 4 no device loss in any; lengths 175, 180, 186 and 540 s (the first ended by the title's own hang watchdog, two by my free-RAM guard, the last by my time limit, with LEONIDA_TITLE_WATCHDOG=0)

Cost with 0, from the 540 s run (the "console descriptor heap ... (copy)" lines):

  • up to submission ~3,700 (menus, start of the load): 2.3 ms a submission, 1.4 ms of it fixing copied slots;
  • from submission ~6,500 (t ~105 s) to the end: 0.4 s rising to 8.2 s a submission, all of it in "fixing copied slots" (pages ~1.3 ms, retrying ~0.5 ms). 750 to 1,300 slots a submission, so several ms per fixed slot. The run made 146 submissions in its last 435 s, 0.1 to 0.2 frames/s, and the window stayed on the dimmed loading picture.

So on this machine the 28 s kind of cost from the code comment still exists without the limit, as seconds per submission for minutes on end rather than one spike. With the limit unset the same phase cost 150 to 200 ms a submission before the device was lost.

Not checked: this branch itself (only main with the variable), where inside the slot fix the time goes (no profile yet), host image copies off, and whether LEONIDA_TITLE_WINDOWS_MB=4096 changes the cost (a run with the default 64 ran out of RAM here at 186 s before the slow phase could be compared). One machine, few runs. I can profile the fix path next if that is useful.

AI-assisted (Claude Code).

**@⁠quartz-heron-58** on GitHub · 2026-11-25 15:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7166738799) Retail data point from a second NVIDIA machine, including the cost the description asks about. Both halves show here: the device loss goes away, and the per-submission cost is large. RTX 4080 16 GB, NVIDIA 621.24, Windows 11 26300, 32 GB RAM. Main 71a769d7d (not this branch; the variable set by hand), built with SDL3, one scripted A press, host image copies at the default, `LEONIDA_DEVICE_FAULT=1`, `LEONIDA_TITLE_WINDOWS_MB=4096`, shaders retranslated at that commit. | `LEONIDA_CONSOLE_FIX_US` | runs | result | |---|---|---| | unset (4,000) | 2 | device lost during the story load at ~130 and ~156 s (submission ~3,870 and ~4,094); type-4-only fault report, last checkpoint the dispatch of lib_cs_01144 named above (128x64x1 groups here) | | 0 | 4 | no device loss in any; lengths 175, 180, 186 and 540 s (the first ended by the title's own hang watchdog, two by my free-RAM guard, the last by my time limit, with `LEONIDA_TITLE_WATCHDOG=0`) | Cost with 0, from the 540 s run (the "console descriptor heap ... (copy)" lines): - up to submission ~3,700 (menus, start of the load): 2.3 ms a submission, 1.4 ms of it fixing copied slots; - from submission ~6,500 (t ~105 s) to the end: 0.4 s rising to 8.2 s a submission, all of it in "fixing copied slots" (pages ~1.3 ms, retrying ~0.5 ms). 750 to 1,300 slots a submission, so several ms per fixed slot. The run made 146 submissions in its last 435 s, 0.1 to 0.2 frames/s, and the window stayed on the dimmed loading picture. So on this machine the 28 s kind of cost from the code comment still exists without the limit, as seconds per submission for minutes on end rather than one spike. With the limit unset the same phase cost 150 to 200 ms a submission before the device was lost. Not checked: this branch itself (only main with the variable), where inside the slot fix the time goes (no profile yet), host image copies off, and whether `LEONIDA_TITLE_WINDOWS_MB=4096` changes the cost (a run with the default 64 ran out of RAM here at 186 s before the slow phase could be compared). One machine, few runs. I can profile the fix path next if that is useful. AI-assisted (Claude Code).
Author
Owner

@⁠HasiKe on GitHub · 2026-11-25 15:48 UTC · original

Same stop and same workaround result on a second vendor generation: RTX 2070 SUPER, NVIDIA 616.56, Windows 11, main 71a769d7d (host image copy on, the default), LEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096 LEONIDA_TITLE_WATCHDOG=0, scripted keyboard pad.

runs result
default LEONIDA_CONSOLE_FIX_US 2 device lost at ~416 s and ~573 s; the crash-diagnostic dump names the last started dispatch library/lib_cs_01144, 128x64x1 groups, fault ranges "Unknown Instruction Pointer" only (no read or write address)
LEONIDA_CONSOLE_FIX_US=0 1 no device loss in 900 s (killed by the time limit); submissions stop at ~3,706, then list values stays at 12,489 writes, 41 gates held, 0 met, 41 timed out, as DadaCap describes

The pipeline name in the dump comes from #1909 (compute pipelines named through VK_EXT_debug_utils). n is small; counts and program names only. AI-assisted (Claude Code).

**@⁠HasiKe** on GitHub · 2026-11-25 15:48 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7167327200) Same stop and same workaround result on a second vendor generation: RTX 2070 SUPER, NVIDIA 616.56, Windows 11, `main` 71a769d7d (host image copy on, the default), `LEONIDA_TITLE_WINDOWS_MB=4096 LEONIDA_ARENA_MB=4096 LEONIDA_TITLE_WATCHDOG=0`, scripted keyboard pad. | | runs | result | |---|---|---| | default `LEONIDA_CONSOLE_FIX_US` | 2 | device lost at ~416 s and ~573 s; the crash-diagnostic dump names the last started dispatch `library/lib_cs_01144`, 128x64x1 groups, fault ranges "Unknown Instruction Pointer" only (no read or write address) | | `LEONIDA_CONSOLE_FIX_US=0` | 1 | no device loss in 900 s (killed by the time limit); submissions stop at ~3,706, then `list values` stays at 12,489 writes, 41 gates held, 0 met, 41 timed out, as DadaCap describes | The pipeline name in the dump comes from #1909 (compute pipelines named through `VK_EXT_debug_utils`). n is small; counts and program names only. AI-assisted (Claude Code).
Author
Owner

@⁠DadaCap on GitHub · 2026-11-25 15:54 UTC · original

Thank you @⁠HasiKe: a second NVIDIA generation, on plain main with host image copy on, with the same program name and the same answer is more than I could have shown alone. Together: 4 of 4 runs with the default budget lose the device at lib_cs_01144 (2 RTX 5080, 2 RTX 2070 SUPER), 4 of 4 without it do not (3 and 1). The freeze afterwards (41 gates held, 41 timed out) I traced to a pipeline build that every queue waits behind, not to the gates: 7163275522. LEONIDA_SERIAL_BIG_COMPILES=0 and letting it run helped a lot. AI-assisted (Claude Code).

**@⁠DadaCap** on GitHub · 2026-11-25 15:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7167412684) Thank you @⁠HasiKe: a second NVIDIA generation, on plain `main` with host image copy on, with the same program name and the same answer is more than I could have shown alone. Together: 4 of 4 runs with the default budget lose the device at `lib_cs_01144` (2 RTX 5080, 2 RTX 2070 SUPER), 4 of 4 without it do not (3 and 1). The freeze afterwards (41 gates held, 41 timed out) I traced to a pipeline build that every queue waits behind, not to the gates: [7163275522](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). `LEONIDA_SERIAL_BIG_COMPILES=0` and letting it run helped a lot. AI-assisted (Claude Code).
Author
Owner

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

Native Windows 11 / RTX 5070 Ti (610.74). On main 71a769d7d I compared both budgets using the same instrumented executable and translated shaders. Before the last checkpointed compute dispatch, 6 of 8 referenced descriptors held data on the CPU side but were zero in the GPU heap. All six were deferred by the 4,000 us budget. With LEONIDA_CONSOLE_FIX_US=0, all 8 resolved and the Vulkan timeline confirmed the batch completed.

On 446574e76 the batch also completed with the override. At least 42 more submissions followed in 38 seconds without another present. A heap pass took about 11 seconds and the run eventually stopped in the title watchdog. I tested the proposed setting on main. World rendering remains unconfirmed here.

AI-assisted (OpenAI Codex, GPT-6).

**@⁠sodove** on GitHub · 2026-11-25 16:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7167676909) Native Windows 11 / RTX 5070 Ti (610.74). On main `71a769d7d` I compared both budgets using the same instrumented executable and translated shaders. Before the last checkpointed compute dispatch, 6 of 8 referenced descriptors held data on the CPU side but were zero in the GPU heap. All six were deferred by the 4,000 us budget. With `LEONIDA_CONSOLE_FIX_US=0`, all 8 resolved and the Vulkan timeline confirmed the batch completed. On `446574e76` the batch also completed with the override. At least 42 more submissions followed in 38 seconds without another present. A heap pass took about 11 seconds and the run eventually stopped in the title watchdog. I tested the proposed setting on main. World rendering remains unconfirmed here. AI-assisted (OpenAI Codex, GPT-6).
Author
Owner

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

Correction and follow-up to my comment above.

Correction: the A press in those runs was not scripted. With SDL3 the script needs LEONIDA_KEYBOARD_PAD=always, which I had not set; the machine's owner pressed A on a controller each time. The run counts and results stand. Later runs use the scripted keyboard pad.

Follow-up on the cost: it goes away with #1887. Same machine (RTX 4080, 621.24), a local merge of main b0f3d3998 with this PR, #1887 and #1893 #1889 #1860 #1886 #1882 #1851, variable unset (so this PR's new default): the console heap phase is 3 to 5 ms a submission up to the world start and 3 to 35 ms around it (single spikes to about 380 ms), against 0.4 to 8.2 s without #1887. Six runs, no device loss, all ended at or just after the world start by my free-RAM guard or time limit (150 to 280 s), so nothing here covers later frames.

So from this machine: no objection to the new default as long as #1887 goes in with it or first; without #1887 the default made the world start unusable here.

AI-assisted (Claude Code).

**@⁠quartz-heron-58** on GitHub · 2026-11-25 16:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7167702309) Correction and follow-up to my comment above. Correction: the A press in those runs was not scripted. With SDL3 the script needs `LEONIDA_KEYBOARD_PAD=always`, which I had not set; the machine's owner pressed A on a controller each time. The run counts and results stand. Later runs use the scripted keyboard pad. Follow-up on the cost: it goes away with #1887. Same machine (RTX 4080, 621.24), a local merge of main b0f3d3998 with this PR, #1887 and #1893 #1889 #1860 #1886 #1882 #1851, variable unset (so this PR's new default): the console heap phase is 3 to 5 ms a submission up to the world start and 3 to 35 ms around it (single spikes to about 380 ms), against 0.4 to 8.2 s without #1887. Six runs, no device loss, all ended at or just after the world start by my free-RAM guard or time limit (150 to 280 s), so nothing here covers later frames. So from this machine: no objection to the new default as long as #1887 goes in with it or first; without #1887 the default made the world start unusable here. AI-assisted (Claude Code).
Author
Owner

@⁠Christopher-Sundeby on GitHub · 2026-11-25 17:23 UTC · original · edited 2026-11-25 17:42 UTC

Tested on an 8 GB Ampere card: no device loss in 4 of 4 runs without the limit, against 2 of 2 losses with the 4,000 us limit.

Setup: RTX 3060 Ti 8 GB, NVIDIA 621.24, Windows 11, own 1.0.2.1, retail boot with --first-run-ui. LEONIDA_ASYNC_PIPELINES=1 LEONIDA_DEVICE_TYPE=6 LEONIDA_ARENA_MB=2048 LEONIDA_TITLE_WATCHDOG=0 LEONIDA_DEVICE_FAULT=1. The only input was LEONIDA_INPUT_SCRIPT=a@72,a@74,a@76,a@90, so every run reaches the world start at a similar time. Shaders predate #1862, so every run ends at the FSR +0x65ff stop.

run build LEONIDA_CONSOLE_FIX_US most slots "left to retries" in one report device loss
r4, r6 main b0f3d3998 default 4000 64, 3,381 yes (~148 s, ~129 s; type-4 entries only, last dispatches lib_cs_01144 in r4 and lib_cs_01462/_01457/_01468 in r6)
r5, r7 main b0f3d3998 0 0 no
r8, r9 main 9e7720c9e + this PR default (now 0) 0 no

All six reach the first RehydrateRaytracingAccelerationStructureBatched2X between ~112 s and ~155 s.

The cost you named, seen once: in r7, at ~106-114 s (around submission 4,295), one submission spent 4.76 s in the console heaps. Only 4 submissions went through in 8.1 s, and that report's heap copy averaged 1,592 ms in "fixing copied slots" (422 KiB a submission, 646 slots). The other three runs without the limit never went above 7.5 ms average in a report. So 1 of 4 runs had a ~5 s stall at the story-load rewrite, far below the 28 s of speed-8, and 0 of 4 hung. Two runs per row, counts only.

AI-assisted (Claude Code).

**@⁠Christopher-Sundeby** on GitHub · 2026-11-25 17:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7169425102) · edited 2026-11-25 17:42 UTC Tested on an 8 GB Ampere card: **no device loss in 4 of 4 runs without the limit, against 2 of 2 losses with the 4,000 us limit.** **Setup:** RTX 3060 Ti 8 GB, NVIDIA 621.24, Windows 11, own 1.0.2.1, retail boot with `--first-run-ui`. `LEONIDA_ASYNC_PIPELINES=1 LEONIDA_DEVICE_TYPE=6 LEONIDA_ARENA_MB=2048 LEONIDA_TITLE_WATCHDOG=0 LEONIDA_DEVICE_FAULT=1`. The only input was `LEONIDA_INPUT_SCRIPT=a@72,a@74,a@76,a@90`, so every run reaches the world start at a similar time. Shaders predate #1862, so every run ends at the FSR `+0x65ff` stop. | run | build | `LEONIDA_CONSOLE_FIX_US` | most slots "left to retries" in one report | device loss | |---|---|---|---|---| | r4, r6 | `main` b0f3d3998 | default 4000 | 64, 3,381 | **yes** (~148 s, ~129 s; type-4 entries only, last dispatches `lib_cs_01144` in r4 and `lib_cs_01462`/`_01457`/`_01468` in r6) | | r5, r7 | `main` b0f3d3998 | 0 | 0 | no | | r8, r9 | `main` 9e7720c9e + this PR | default (now 0) | 0 | no | All six reach the first `RehydrateRaytracingAccelerationStructureBatched2X` between ~112 s and ~155 s. **The cost you named, seen once:** in r7, at ~106-114 s (around submission 4,295), one submission spent **4.76 s** in the console heaps. Only 4 submissions went through in 8.1 s, and that report's heap copy averaged 1,592 ms in "fixing copied slots" (422 KiB a submission, 646 slots). The other three runs without the limit never went above 7.5 ms average in a report. So 1 of 4 runs had a ~5 s stall at the story-load rewrite, far below the 28 s of speed-8, and 0 of 4 hung. Two runs per row, counts only. AI-assisted (Claude Code).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 17:33 UTC · original

Merged. Thank you, @⁠DadaCap, and thanks to everyone who ran it.

  • Real boot on an RX 7900 XTX (RADV, Mesa 26.3.1, Wine): with the old 4 ms default, two runs lost the device at the world start: the GPU read a garbage address, and the ring was reset. With LEONIDA_CONSOLE_FIX_US=0, this PR's new default, the same build went past that point into the opening sequence and ran about 22 minutes without a device loss.
  • The mechanism, from sodove's native run (RTX 5070 Ti): under the 4 ms budget, 6 of 8 descriptors a compute dispatch referenced were still zero in the GPU heap. With the budget off, all 8 resolved.
  • Cost: the heap phase gets much slower. quartz-heron-58 measured 0.4–8.2 s per submission without the limit, and here the slot fix-up is about 1.25 s per submission at the world start. Their runs show #1887 brings that down to 3–35 ms, so #1887 should follow this quickly; its review is in progress. Until then, the world start is slow, but it no longer loses the device.
  • Windows suite under Wine (llvmpipe and an RDNA2 iGPU): nothing goes from pass to fail.
  • Small follow-ups: please put quartz-heron-58's numbers in the description's Cost paragraph, and name the model in the AI line.
  • Checked on main 082ebe440 + c90092b28: it merges cleanly; the semantic suite passes (490 files, 6,292 tests, 0 files failed); the 15 docs and writer tests pass; check_no_game_data.py is clean on the 3 changed files.

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

**@⁠aslan2142** on GitHub · 2026-11-25 17:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7169671363) Merged. Thank you, @⁠DadaCap, and thanks to everyone who ran it. - **Real boot on an RX 7900 XTX (RADV, Mesa 26.3.1, Wine):** with the old 4 ms default, two runs lost the device at the world start: the GPU read a garbage address, and the ring was reset. With `LEONIDA_CONSOLE_FIX_US=0`, this PR's new default, the same build went past that point into the opening sequence and ran about 22 minutes without a device loss. - **The mechanism**, from sodove's native run (RTX 5070 Ti): under the 4 ms budget, 6 of 8 descriptors a compute dispatch referenced were still zero in the GPU heap. With the budget off, all 8 resolved. - **Cost:** the heap phase gets much slower. quartz-heron-58 measured 0.4–8.2 s per submission without the limit, and here the slot fix-up is about 1.25 s per submission at the world start. Their runs show #1887 brings that down to 3–35 ms, so **#1887 should follow this quickly**; its review is in progress. Until then, the world start is slow, but it no longer loses the device. - **Windows suite under Wine** (llvmpipe and an RDNA2 iGPU): nothing goes from pass to fail. - **Small follow-ups:** please put quartz-heron-58's numbers in the description's Cost paragraph, and name the model in the AI line. - **Checked on `main` `082ebe440` + `c90092b28`:** it merges cleanly; the semantic suite passes (490 files, 6,292 tests, 0 files failed); the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 3 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Tyrannys on GitHub · 2026-11-25 18:12 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:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1849#issuecomment-7170579890) · 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.