Windows boot: LEONIDA_DEVICE_FAULT=2 by default, so a boot on NVIDIA reads the precompiled compute journal (BOOT-DEVICE-FAULT-2) #2599
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2599"
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?
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T01:25:56Z.
Claimed in the coordination issue as: BOOT-DEVICE-FAULT-2 (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7248776467)
What and why
scripts/windows-boot/boot.ps1setsLEONIDA_DEVICE_FAULT=1when the shell has not set it. On NVIDIA,1also turns onVK_NV_device_diagnostics_config(runtime/shims/d3d12_vulkan_device.cpp:23349-23360, READ IN CODE), and the runtime then addsnv-diagnostics-configto the key of every compute journal file (d3d12_vulkan_device.cpp:11818-11824, READ IN CODE). So a boot looked for different file names than the onesgta6rt --precompile-pipelineswrites without the variable, and read none of the precompiled journal, even thoughboot.ps1has passed that journal to the boot as its seed since #2481.The runtime already has a mode for this case. With
LEONIDA_DEVICE_FAULT=2it keeps the device-fault report (VK_EXT_device_fault), the NVIDIA checkpoints and the submit ring, and leaves out the diagnostics config (with_config,d3d12_vulkan_device.cpp:23355, READ IN CODE). This pull request makes2the default:boot.ps1: the default changes from"1"to"2". One exception: when the final environment hasLEONIDA_AFTERMATH=1and the user did not setLEONIDA_DEVICE_FAULT(not in the shell, not with-SetEnv, not as aKEY=VALUEargument), the script uses1. The runtime takes theLEONIDA_DEVICE_FAULTbranch before the Aftermath one (d3d12_vulkan_device.cpp:23352-23371, READ IN CODE), so under2a crash dump would lose NVIDIA's diagnostics config and its shader debug info, which the old default gave it. A value the user gives always wins.LEONIDA_DEVICE_FAULT.scripts/windows-boot/README.md: theLEONIDA_DEVICE_FAULTrow gives2and says what it keeps. It says that1adds the diagnostics config and is used automatically withLEONIDA_AFTERMATH=1. It also says that under2, "NVIDIA diagnostics config unavailable" in the runtime's[rt] device-fault: enabledline means the config was not requested, not a driver problem. TheLEONIDA_PIPELINE_JOURNAL_SEED_DIRrow no longer says the script sets1.Overrides work as before. A trailing
LEONIDA_DEVICE_FAULT=1argument still turns on the full diagnostics config for one boot (so do the shell and-SetEnv), andLEONIDA_DEVICE_FAULT=leaves the variable unset.What was measured (MEASURED, n=1 per cell, so these are observations, not settled numbers):
gta6rt --precompile-pipelines, run without the variable), then an A/B pair of 60 s boots of that same build:1against unset on1bc055e6c, unset against2onace0e9d1c. No commit between the two builds touchesd3d12_vulkan_device.cpp,vulkan_device_fault.horpipeline_cache_journal.h(git log 1bc055e6c..ace0e9d1c -- <those three paths>is empty; the range has 64 commits).pipeline journalprogress line within the 60 s. The runtime prints that line at the first event of a kind, then at every 100th.LEONIDA_DEVICE_FAULT1bc055e6c1(the old default)1bc055e6cace0e9d1cace0e9d1c2(the new default)With
1the line said 25 from journal files, and 500 compiled and written. The 25 were re-reads of files that the same boot had just written, as zmasi read it on #2570. The boot's writable journal gained about 519 files, which confirms it. So none came from the precompiled journal.Tested
The tests came first.
tests/test_windows_boot_journal_seed.pygets nine cases. Eight runboot.ps1 -DryRun(no launch, no game files):2;LEONIDA_DEVICE_FAULT=1wins when given on the command line, in the shell, or with-SetEnv(three cases);LEONIDA_DEVICE_FAULT=removes the variable;LEONIDA_AFTERMATH=1gives1, whether it comes as an argument, from the shell or from-SetEnv;LEONIDA_AFTERMATH=1with aLEONIDA_DEVICE_FAULT=2the user gave (argument, shell or-SetEnv) keeps2;LEONIDA_AFTERMATH=0keeps2(noLEONIDA_AFTERMATHat all is the default case).The ninth reads the README as plain text, with the Markdown marks dropped, so it runs on every OS. It checks that the row's default is
2and that no text says the script sets1. Six of the nine already pass onmainand pin existing behaviour: the three overrides, the removal and the two Aftermath cases.Red, on
main0a325350ewith only the test file added (the whole file, run withpython -I):With the default at
2but no Aftermath exception yet,test_aftermath_gets_the_diagnostics_configfailed in its three subtests ('2' != '1'; Ran 26 tests, FAILED (failures=3)).Mutations of
boot.ps1, each run against the full file: default back to"1"fails 2 tests. Without the Aftermath exception, 3 subtests fail. Without the-SetEnvloop, 3 tests fail.Green, with the change. Each file ran in its own process with
python -I(Python 3.13.12, Windows 11, Windows PowerShell 5.1):tests/test_windows_boot_journal_seed.py: 26 tests OK (17 existing and 9 new).tests/test_windows_boot_fault_digest.py: 5 OK.tests/test_ci_registration.py: 18 OK.tests/test_docs_*.py: 11 of 13 files OK. Two fail in exactly the same way onmain0a325350e, in files this pull request does not touch. Intest_docs_links, three links toREADME.md#project-statusand#running-the-loader-on-linuxhave no target. Intest_docs_cli_flags,README.md:94passes-Gametoscripts/play-d3d12.ps1.scripts/check_no_game_data.pyon the three changed files: clean.git merge-tree). With #2514 this branch merges cleanly. With #2593 the test file merges cleanly; the only conflict isruntime/test/d3d12_compile_pool_test.cpp, which #2593 has withmainitself.What was not checked:
VK_NV_device_diagnostics_config. If so,2behaves there as1did (READ IN CODE, by zmasi).scripts/linux-boot/) does not setLEONIDA_DEVICE_FAULT, so nothing changes there.2, so this pull request does not exercise the fault report in that mode. That runtime path already existed and is unchanged.LEONIDA_AFTERMATH=1was run. Only the dry runs above check the exception.Not in this PR:
docs/running.md:57,docs/d3d12_vulkan.mdandruntime/README.mdstill document onlyLEONIDA_DEVICE_FAULT=1(a follow-up). The runtime's "NVIDIA diagnostics config unavailable" under2(runtime/src/vulkan_device_fault.h:1171-1173) says "unavailable" for a config it did not request; that is a finding, not fixed here.Credits: MoonEyes posted the finding on #2570 (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7247013930). zmasi pointed out there that mode
2already exists and suggested this change (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7247136909), and read the 25 journal reads under1as the boot's own files.GPUs tested: NVIDIA GeForce RTX 3090 24 GB, driver 621.40, Windows 11 (profile L), for the four boots above. The unit tests need no GPU.
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:38:54Z.
#2599 | head
202ad50e5b(merged cleanly onto origin/maind8c10dd5e1) | Windows 11 (10.0.26200.9974), Windows PowerShell 5.1, Python 3.12.10 | AI-assisted: yesIndependent Verification (Windows 11 + PowerShell)
scripts/windows-boot/boot.ps1(defaultingLEONIDA_DEVICE_FAULTto"2", tracking explicit shell /-SetEnv/KEY=VALUEoverrides in$given, and promoting defaultLEONIDA_DEVICE_FAULTto"1"whenLEONIDA_AFTERMATHis"1"unless explicitly provided),scripts/windows-boot/README.md, andtests/test_windows_boot_journal_seed.py.python -I scripts/check_no_game_data.py scripts/windows-boot/README.md scripts/windows-boot/boot.ps1 tests/test_windows_boot_journal_seed.pypassed (rc=0).powershell.exe -NoProfile -ExecutionPolicy Bypass-DryRun):origin/maind8c10dd5e1boot.ps1+README.md): Running#2599'stests/test_windows_boot_journal_seed.pyagainst unpatchedboot.ps1andREADME.mdfailed3of26tests (FAILED (failures=3):test_device_fault_default_leaves_the_journal_names_alone,test_aftermath_off_keeps_the_default, andtest_readme_gives_the_default_2, all reporting'1' != '2').#2599 + origin/main):python -I tests/test_windows_boot_journal_seed.py -v->26/26passed (0skipped,OK,22.538s), verifying defaultLEONIDA_DEVICE_FAULT=2, CLIKEY=VALUE/ shell environment /-SetEnv @{}overrides,LEONIDA_DEVICE_FAULT=removal,LEONIDA_AFTERMATH=1auto-selection ofLEONIDA_DEVICE_FAULT=1while preserving explicit userLEONIDA_DEVICE_FAULT=2,LEONIDA_AFTERMATH=0keeping2, NTFS junction /\\?\/\\.\/ relative path seed checks, andDeviceFaultReadmeTest.test_docs_table_rows.py(2/2),test_docs_repo_paths.py(5/5),test_docs_encoding.py(1/1),test_docs_env_vars.py(5/5) -> allOK.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T01:42:46Z.
TAKEN by OreoFR: game boot A/B on RTX 4070 Laptop 8 GB
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T02:37:57Z.
#2599 game boot A/B: boot.ps1 default LEONIDA_DEVICE_FAULT 1 (main) / 2 (this PR), with a precompiled journal
Local test, AI-assisted (Claude Code, Claude Opus 5.5). Values only: no captures, logs or game paths leave this machine.
scripts/windows-boot/boot.ps1of origin/main59e65849b; B =59e65849b+ localgit merge --no-ffof #2599 head
202ad50e5(clean). #2599 re-checked 2026-11-29 02:37 UTC: OPEN, head still202ad50e5.gta6rt.exefor all seven boots, built from main0a325350e.git diff 0a325350e 59e65849b -- runtimeis empty, and #2599 touches noruntime/file, so it is the runtime of both arms.gta6rt --precompile-pipelines --smallest-first --max-bytes 1048576 --threads 16 --big-threads 4beside thatgta6rt.exe, with noLEONIDA_DEVICE_FAULT, noLEONIDA_AFTERMATH, noLEONIDA_PIPELINE_CACHE_DIR. Stopped by meafter 783 s: 2,378 compute entries journaled (the smallest, up to about 0.5 MB of SPIR-V; the whole library has
5,453).
boot.ps1passed it asLEONIDA_PIPELINE_JOURNAL_SEED_DIRin every boot of both arms (-DryRunand eachboot's printed environment show it).
boot.ps1 -GameDir -Shaders -Runtime -OutDir, nothing else set (default input scripta@45,a@60,a@75,a@90,default captures; no
LEONIDA_PEEKRVAs, so no game/session states).-Seconds 150for A1/B1, then210for therest because B1 had not started rendering by 150 s.
pipeline journalprogress lines (printed at the first event of a kind, then every100th, so a count is a floor to the hundred): "from journal files"; (2) compiles = files in the boot's own, fresh
journal at the end (one written per compute pipeline compiled); (3) seconds from process start to the first
PresentXok; (4) the runtime'ssubmit phaseslines: t of the first 5 s window at 5 frames/s or more ("renderingfrom"), the median frames/s of the windows after it, and how many of them were under 5 frames/s; (5) the
[rt] device-fault: enabledline.Prediction (written before the first boot)
A reads about 0 entries from the seed (key mismatch:
nv-diagnostics-config) and compiles every compute pipeline ituses; B reads most of the boot's compute pipelines from the seed and compiles only the ones larger than the seed's
cut; B's device-fault line says fault info on, checkpoints on, diagnostics config "unavailable"; B reaches its first
frame sooner than A.
RUN p2599-A1
RUN p2599-B1
RUN p2599-B2
RUN p2599-A2
RUN p2599-B3
RUN p2599-A3
RUN p2599-B4
Verdict
The PR does what it says on NVIDIA. With a journal pre-compiled without the variable, main's
boot.ps1(
LEONIDA_DEVICE_FAULT=1) read none of it: 102 / 657 / 751 compute pipelines compiled in A1-A3. The 5-31 "fromjournal files" were re-reads of files the same boot had just written (the first one came after 37 and 55 writes). Under
=1the key addsnv-diagnostics-config(READ IN CODE,d3d12_vulkan_device.cpp11818-11824), so no seed name canmatch. With the PR's default
2, the boots that got going read 1,201 from the seed. They compiled 0 / 12 / 16, whichfits pipelines bigger than my seed's cut at about 0.5 MB (ASSUMED, not checked name by name). Same result as Thib's
3090 table, on an 8 GB laptop card. Under
2, the device-fault line keeps fault info and checkpoints on, and thediagnostics config shows as "unavailable", as the README row now explains.
The second half of my prediction missed: B did not reach its first frame sooner. Rendering started at t=58-127 s in A
and t=64-82 s in B (B1 had not started by 150 s). The time before the first frame is title start-up, and it varies a
lot from boot to boot. Most of A's compiles came after the first frame (A2: 100 written at 60 s, 600 at 180 s). That is
where B differs: in the 54 windows of B2 and B4 after rendering started, none was under 5 frames/s. A2 had 26 of 29
windows under 5 (median 2.9). A3 had 3 of 30 (median 11.7), close to B. So the frame rate after the first frame is a
hint, n=2 per arm, not settled.
B3 crashed at 122 s (access violation, the runtime's unhandled-exception line) before any submission and before any
compute pipeline was looked up. The device had been created, with the same line as the other B boots. Nothing on the
journal path or the GPU had run yet, so #2599 most likely did not cause it (ASSUMED, n=1 crash). B1 was also slow to
start. I am noting them as start-up variance seen in this session, not as an effect of the change.
Caches: each boot had its own fresh pipeline cache and journal folder. The NVIDIA driver's disk cache was not cleared.
It was warm for
=1pipelines from earlier sessions on this machine, and the pre-compile filled it for the seed'spipelines. So A's compile cost may be understated, and the counts are the robust result here, not the timings.
python -I scripts/check_no_game_data.pyon this file: exit 0, nothing found.Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:29:20Z.
Review: COMMENTED
Static audit of
202ad50e5only. No builds, tests, or GPU runs were performed for this review. I found no actionable defects.scripts/windows-boot/boot.ps1resolves the shell,-SetEnv, and trailingKEY=VALUEarguments in that order before selecting the Aftermath default. Explicit0and1survive, and a trailing empty assignment removes the variable from the launched process. The finalLEONIDA_AFTERMATH=1selects mode1only when device fault was left to the script default. The added PowerShell constructs are compatible with 5.1 and 7 on static inspection.runtime/shims/d3d12_vulkan_device.cppuses the same compute builder for precompile and boot. Mode2omits the NVIDIA diagnostics config from device creation and the journal key, matching the key for a compatible precompile run with device fault and Aftermath unset.runtime/src/pipeline_cache_journal.hchecks the seed entry under that filename. Both modes request the same fault reporting, checkpoints, and optional AMD markers where supported. On AMD, Intel, or any other device that lacks NVIDIA's diagnostics config, the mode change has no effect on the enabled extensions or journal key.scripts/windows-boot/README.mddescribes the new default and Aftermath exception.tests/test_windows_boot_journal_seed.pyadds dry-run coverage for the defaults, override sources, removal, and Aftermath, plus a platform-independent README check. The test launcher prefers Windows PowerShell when both executables are installed.tests/test_docs_env_vars.pychecks whether variable names are documented, and both names remain documented.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T08:14:43Z.
Merged after OreoFR's check (check: red/green on
main+ this PR) and a re-check here: no conflict withmain343144161, same head as checked, not frozen,no-game-datagreen.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.