Skip to content

Windows boot: LEONIDA_DEVICE_FAULT=2 by default, so a boot on NVIDIA reads the precompiled compute journal (BOOT-DEVICE-FAULT-2) - #2599

Open
enlight3d wants to merge 1 commit into
ProjectLeonida:mainfrom
enlight3d:fix/boot-device-fault-keeps-journal
Open

enlight3d wants to merge 1 commit into
ProjectLeonida:mainfrom
enlight3d:fix/boot-device-fault-keeps-journal

Conversation

@enlight3d

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: BOOT-DEVICE-FAULT-2 (#2570 (comment))

What and why

scripts/windows-boot/boot.ps1 sets LEONIDA_DEVICE_FAULT=1 when the shell has not set it. On NVIDIA, 1 also turns on VK_NV_device_diagnostics_config (runtime/shims/d3d12_vulkan_device.cpp:23349-23360, READ IN CODE), and the runtime then adds nv-diagnostics-config to 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 ones gta6rt --precompile-pipelines writes without the variable, and read none of the precompiled journal, even though boot.ps1 has passed that journal to the boot as its seed since #2481.

The runtime already has a mode for this case. With LEONIDA_DEVICE_FAULT=2 it 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 makes 2 the default:

  • boot.ps1: the default changes from "1" to "2". One exception: when the final environment has LEONIDA_AFTERMATH=1 and the user did not set LEONIDA_DEVICE_FAULT (not in the shell, not with -SetEnv, not as a KEY=VALUE argument), the script uses 1. The runtime takes the LEONIDA_DEVICE_FAULT branch before the Aftermath one (d3d12_vulkan_device.cpp:23352-23371, READ IN CODE), so under 2 a 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.
  • The comment over the defaults said they match the Linux harness. It now says some are shared with it, and that it does not set LEONIDA_DEVICE_FAULT.
  • scripts/windows-boot/README.md: the LEONIDA_DEVICE_FAULT row gives 2 and says what it keeps. It says that 1 adds the diagnostics config and is used automatically with LEONIDA_AFTERMATH=1. It also says that under 2, "NVIDIA diagnostics config unavailable" in the runtime's [rt] device-fault: enabled line means the config was not requested, not a driver problem. The LEONIDA_PIPELINE_JOURNAL_SEED_DIR row no longer says the script sets 1.

Overrides work as before. A trailing LEONIDA_DEVICE_FAULT=1 argument still turns on the full diagnostics config for one boot (so do the shell and -SetEnv), and LEONIDA_DEVICE_FAULT= leaves the variable unset.

What was measured (MEASURED, n=1 per cell, so these are observations, not settled numbers):

  • MACHINE: NVIDIA GeForce RTX 3090, 24 GB, desktop | driver 621.40 | Windows 11 Pro | 64 GB
  • Setup: two builds. Each had its own fresh compute pre-compile (gta6rt --precompile-pipelines, run without the variable), then an A/B pair of 60 s boots of that same build: 1 against unset on 1bc055e, unset against 2 on ace0e9d. No commit between the two builds touches d3d12_vulkan_device.cpp, vulkan_device_fault.h or pipeline_cache_journal.h (git log 1bc055e6c..ace0e9d1c -- <those three paths> is empty; the range has 64 commits).
  • Measured value: the counters on the runtime's last pipeline journal progress line within the 60 s. The runtime prints that line at the first event of a kind, then at every 100th.
build LEONIDA_DEVICE_FAULT from the precompiled journal compiled
1bc055e 1 (the old default) 0 500
1bc055e unset 700 0
ace0e9d unset 700 0
ace0e9d 2 (the new default) 700 0

With 1 the 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.py gets nine cases. Eight run boot.ps1 -DryRun (no launch, no game files):

  • the default is 2;
  • LEONIDA_DEVICE_FAULT=1 wins when given on the command line, in the shell, or with -SetEnv (three cases);
  • LEONIDA_DEVICE_FAULT= removes the variable;
  • LEONIDA_AFTERMATH=1 gives 1, whether it comes as an argument, from the shell or from -SetEnv;
  • LEONIDA_AFTERMATH=1 with a LEONIDA_DEVICE_FAULT=2 the user gave (argument, shell or -SetEnv) keeps 2;
  • LEONIDA_AFTERMATH=0 keeps 2 (no LEONIDA_AFTERMATH at 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 2 and that no text says the script sets 1. Six of the nine already pass on main and pin existing behaviour: the three overrides, the removal and the two Aftermath cases.

Red, on main 0a32535 with only the test file added (the whole file, run with python -I):

FAIL: test_aftermath_off_keeps_the_default (__main__.BootJournalSeedTest.test_aftermath_off_keeps_the_default)
AssertionError: '1' != '2'
FAIL: test_device_fault_default_leaves_the_journal_names_alone (__main__.BootJournalSeedTest.test_device_fault_default_leaves_the_journal_names_alone)
AssertionError: '1' != '2'
FAIL: test_readme_gives_the_default_2 (__main__.DeviceFaultReadmeTest.test_readme_gives_the_default_2)
AssertionError: '1' != '2'
Ran 26 tests in 14.678s
FAILED (failures=3)

With the default at 2 but no Aftermath exception yet, test_aftermath_gets_the_diagnostics_config failed 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 -SetEnv loop, 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):

What was not checked:

  • AMD: not run. zmasi's reading of the code on Coordinating who works on what (continued from #1608) #2570 is that the journal names do not change on AMD, because AMD drivers do not offer VK_NV_device_diagnostics_config. If so, 2 behaves there as 1 did (READ IN CODE, by zmasi).
  • Linux: the Linux harness (scripts/linux-boot/) does not set LEONIDA_DEVICE_FAULT, so nothing changes there.
  • No device loss was provoked under 2, so this pull request does not exercise the fault report in that mode. That runtime path already existed and is unchanged.
  • No boot with LEONIDA_AFTERMATH=1 was run. Only the dry runs above check the exception.

Not in this PR: docs/running.md:57, docs/d3d12_vulkan.md and runtime/README.md still document only LEONIDA_DEVICE_FAULT=1 (a follow-up). The runtime's "NVIDIA diagnostics config unavailable" under 2 (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 (#2570 (comment)). zmasi pointed out there that mode 2 already exists and suggested this change (#2570 (comment)), and read the 25 journal reads under 1 as 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

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

…reads the compute journal gta6rt --precompile-pipelines wrote (1 with LEONIDA_AFTERMATH=1)

boot.ps1 set LEONIDA_DEVICE_FAULT=1 when the shell had not set it. On NVIDIA, 1 also enables
VK_NV_device_diagnostics_config (d3d12_vulkan_device.cpp:23349-23360), and the runtime then
puts that config into the key of every compute journal file (d3d12_vulkan_device.cpp:11818-11824,
"nv-diagnostics-config"). So a boot read none of the journal a pre-compile without the variable
had written, though boot.ps1 hands that journal to the boot as its seed since ProjectLeonida#2481. 2 is the
runtime's mode for this case: the device-fault report, checkpoints and the submit ring, without
the diagnostics config.

LEONIDA_AFTERMATH=1 still gets 1. The runtime takes the LEONIDA_DEVICE_FAULT branch before the
Aftermath one (d3d12_vulkan_device.cpp:23352-23371), so under 2 a crash dump would lose NVIDIA's
diagnostics config (no shader debug info). A LEONIDA_DEVICE_FAULT the user gives (shell, -SetEnv
or KEY=VALUE) always wins, and LEONIDA_DEVICE_FAULT= leaves it unset, as before.

Measured on an RTX 3090 24 GB, NVIDIA 621.40, Windows 11: two builds, each with its own fresh
compute pre-compile and an A/B pair of 60 s boots of that build, n=1 per cell. The counts are
from the runtime's last "pipeline journal" progress line within the 60 s (it prints at the
first event of a kind, then every 100th):

  build      LEONIDA_DEVICE_FAULT  from the precompiled journal  compiled
  1bc055e  1                       0                           500
  1bc055e  unset                 700                             0
  ace0e9d  unset                 700                             0
  ace0e9d  2                     700                             0

With 1 the line said 25 from journal files: files that same boot had just written (zmasi's
reading on ProjectLeonida#2570; the boot's writable journal gained about 519 files). No commit in
1bc055e..ace0e9d touches d3d12_vulkan_device.cpp, vulkan_device_fault.h or
pipeline_cache_journal.h. Found by MoonEyes on ProjectLeonida#2570; zmasi pointed there at mode 2.

The README's row says 2, when 1 is used, and that "NVIDIA diagnostics config unavailable" in
the runtime's device-fault line means "not requested" under 2. Its seed row no longer says the
script sets 1. The comment over the defaults says the Linux harness does not set the variable.

Test: tests/test_windows_boot_journal_seed.py, dry runs for the default, the shell, -SetEnv and
KEY=VALUE overrides, the removal and LEONIDA_AFTERMATH, and the README row (read as text, on any
system).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zmasi

zmasi commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

#2599 | head 202ad50 (merged cleanly onto origin/main d8c10dd) | Windows 11 (10.0.26200.9974), Windows PowerShell 5.1, Python 3.12.10 | AI-assisted: yes

Independent Verification (Windows 11 + PowerShell)

  • Diff & safety audit: Inspected 100% of the diff across scripts/windows-boot/boot.ps1 (defaulting LEONIDA_DEVICE_FAULT to "2", tracking explicit shell / -SetEnv / KEY=VALUE overrides in $given, and promoting default LEONIDA_DEVICE_FAULT to "1" when LEONIDA_AFTERMATH is "1" unless explicitly provided), scripts/windows-boot/README.md, and tests/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.py passed (rc=0).
  • Red -> Green on native Windows 11 (powershell.exe -NoProfile -ExecutionPolicy Bypass -DryRun):
    • Red (origin/main d8c10dd5e1 boot.ps1 + README.md): Running #2599's tests/test_windows_boot_journal_seed.py against unpatched boot.ps1 and README.md failed 3 of 26 tests (FAILED (failures=3): test_device_fault_default_leaves_the_journal_names_alone, test_aftermath_off_keeps_the_default, and test_readme_gives_the_default_2, all reporting '1' != '2').
    • Green (#2599 + origin/main):
      • python -I tests/test_windows_boot_journal_seed.py -v -> 26/26 passed (0 skipped, OK, 22.538s), verifying default LEONIDA_DEVICE_FAULT=2, CLI KEY=VALUE / shell environment / -SetEnv @{} overrides, LEONIDA_DEVICE_FAULT= removal, LEONIDA_AFTERMATH=1 auto-selection of LEONIDA_DEVICE_FAULT=1 while preserving explicit user LEONIDA_DEVICE_FAULT=2, LEONIDA_AFTERMATH=0 keeping 2, NTFS junction / \\?\ / \\.\ / relative path seed checks, and DeviceFaultReadmeTest.
      • Doc verification suites: 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) -> all OK.

@OreoFR

OreoFR commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

TAKEN by OreoFR: game boot A/B on RTX 4070 Laptop 8 GB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants