[PR #1251] [CLOSED] scripts: boot the loader under Wine or Proton from a checkout (LINUX-PROTON-DOCS-SCRIPTS) #1283

Closed
opened 2026-11-26 20:20:43 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1251
Author: @Moriz82
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: split/linux-proton-docs-scripts


📝 Commits (1)

  • ed8309a scripts: boot the loader under Wine or Proton from a checkout (LINUX-PROTON-DOCS-SCRIPTS)

📊 Changes

7 files changed (+293 additions, -133 deletions)

View changed files

📝 docs/README.md (+1 -0)
📝 docs/linux_proton.md (+70 -28)
📝 scripts/linux-boot/boot-digest.sh (+33 -33)
📝 scripts/linux-boot/boot-inner.sh (+10 -10)
📝 scripts/linux-boot/boot.sh (+40 -26)
📝 scripts/linux-boot/run-boot.sh (+48 -36)
➕ tests/test_linux_boot_scripts.py (+91 -0)

📄 Description

Claimed in the coordination issue as: LINUX-PROTON-DOCS-SCRIPTS (claim).

Part of the split of #984 into small pull requests.

Depends on: none

Overlaps: none found. docs/linux.md and the README's Running the loader on Linux cover the build and <out>/gta6rt.sh, and scripts/run_wine_session.sh runs the CI tests. This child adds the boot scripts of #984 and one page for them, and repeats neither.

What and why

scripts/linux-boot is for someone who boots the loader on Linux again and again while working on the runtime, straight from a checkout, and wants to know afterwards what happened:

  • configure-worktree.sh <checkout> configures the clang-cl and xwin cross-build in runtime/build/boot (SDL3_SRC makes it work offline).
  • boot.sh dry-run|init|run [seconds] starts the loader under Wine or Proton inside unshare -rn, a new user and network namespace that needs no root, so the title has no network at all. It sets the Vulkan backend and the shader library, moves NVIDIA's shader disk cache out of the way and raises its limit, and writes the startup and D3D12 traces with their tools/boot_trace.py summary.
  • run-boot.sh <name> <gta6rt.exe> [seconds] [KEY=VALUE ...] runs that as a systemd --user unit: it waits for memory headroom, holds a GPU lock and a build lock for the whole boot, samples RAM, swap, the unit's memory and VRAM every 2 s, and afterwards writes a digest (verdict, counts from the trace, captured frames, memory peaks, kernel OOM and GPU events, every distinct error line with its count). The digest is written also when the kernel or systemd-oomd killed the boot.

Everything the scripts produce goes to LEONIDA_BOOT_DIR, outside the repository. docs/linux_proton.md is the page, with one row in docs/README.md.

What changed against the scripts in #984

  • No fixed paths. The package, the shader library and the output folder come from LEONIDA_GAME_DIR, LEONIDA_SHADERS and LEONIDA_BOOT_DIR. A missing one is refused with one line before anything starts.
  • Only switches main has. The input script (#1074), the title's own window, the pipeline cache directory and checkpoints, the source-frame capture and the device-type default are gone from the scripts, and so are the digest counters for log lines that main does not print.
  • Two faults in the digest are fixed. It read the unit's result through tr -d "\x27", which GNU tr takes as the characters x, 2 and 7: a failed unit's result became 'eit-code', matched no case, and the verdict stayed OK. And the digest unit stopped waiting as soon as the boot unit began to deactivate, before systemd had logged the result. It now waits for the unit to end and also uses the loader's exit code.
  • One default Wine for both scripts (Proton Experimental's when Steam has it, else wine), and the page says in bold to use one Wine per prefix. In #984 boot.sh defaulted to wine and run-boot.sh to Proton. I made exactly that mistake while testing this child: one boot.sh run used the distribution's Wine 11.22 on the Proton prefix. A Proton prefix links to files inside the Proton installation, and the other Wine's prefix update wrote through those links: about 1,200 of Proton's own files were overwritten, and from then on every Proton start on this machine failed (its services could not create the device manager).
  • The Wine crash debugger is off (winedbg.exe=d). In that broken state, winedbg started for a crashing Wine service crashed as well and was started again for itself, about ten thousand times, until memory and swap were full. That happened twice before the cause was found. With the override a crashing process just ends; the loader's own trace still records the title's exceptions.
  • The page is cut down to what main does. #984's version was a test report of that branch: a boot timeline, three machines, the list of what the branch changes and where it stops. None of that holds for main, so none of it is here; it belongs with the children that bring those changes.
  • Not carried: the one line of runtime/test/xmem_test.cpp that the split map counted under this topic (it belongs to the xmem children), and the fork's own sync script.

Tested

CachyOS (Arch), kernel 7.3.5, Proton Experimental (Wine 11.0), Ryzen 5 5600X, 16 GB RAM, NVIDIA GeForce RTX 4070 12 GB (driver 620.73.04), clang-cl 23.1.5 with an xwin SDK, Ninja, ccache, bash 5, systemd user session. On main 6293c1c4f with this child:

SDL3_SRC=<SDL3 source tree> scripts/linux-boot/configure-worktree.sh .
cmake --build runtime/build/boot --target gta6rt -j6
export LEONIDA_GAME_DIR=<package> LEONIDA_SHADERS=<work>/shaders/spirv LEONIDA_BOOT_DIR=<scratch> WINEPREFIX=<boot prefix>
scripts/linux-boot/boot.sh dry-run
scripts/linux-boot/boot.sh init
scripts/linux-boot/run-boot.sh long runtime/build/boot/gta6rt.exe 60
scripts/linux-boot/run-boot.sh short runtime/build/boot/gta6rt.exe 3
python3 -I tests/test_linux_boot_scripts.py
  • Configure and build: both succeed (290 build steps, gta6rt.exe and gta6rt_tls_host.dll).
  • boot.sh dry-run and boot.sh init: exit 0, traces and summary written.
  • run-boot.sh with a 60 s limit: on main the title stops within seconds with an exception of its own, after creating its device, command queue, a descriptor heap and its first resources. The digest says EXITED WITH ERROR, unit result exit-code, and run-boot.sh exits 1. This was run several times while the scripts changed. The earlier runs stopped about 6 s in at a breakpoint exception (0x80000003). The run on the final tree stopped after 2 s with an access violation, but that run was made after the Proton installation had been damaged as described above, so it says nothing about main. Where main stops is not established here; what is checked is that the scripts report it.
  • run-boot.sh with a 3 s limit (before the damage and again on the final tree): the loader is stopped at the limit, the digest says OK (ran its full time limit), run-boot.sh exits 0. One line per boot is appended to boots.tsv.
  • Wrong input (no package folder, a missing loader, a missing gta6rt_tls_host.dll, a missing shader library, a name with a space, an unknown mode): each is refused with exit 2 and creates nothing.
  • tests/test_linux_boot_scripts.py (new): 3 tests pass. It checks that the five scripts parse (bash -n), are executable, have LF line endings, and refuse wrong input before they create a folder or start anything. With one check removed from boot.sh the test fails. It needs no Wine, no systemd unit and no game files, and skips itself outside Linux.
  • The standard-library and pytest files under tests/ the way ci.yml runs them: 521 files, 520 pass. tests/test_imhex_patterns.py fails, as it does on the base commit.
  • python3 -I scripts/check_no_game_data.py: passes.

Not run: any other distribution, plain Wine instead of Proton, an AMD or Intel GPU (the sampler's VRAM columns come from nvidia-smi and hold ? without it), a boot that reaches a picture (main does not get there on this machine), and a clean run of the KILLED BY OOM verdict (it appeared once, when the debugger incident above exhausted memory during a boot, but that path was not tested on purpose), and a boot on a repaired Proton installation after the final change (the final-tree boots ran in the damaged one). shellcheck is not installed on this machine; the scripts were checked with bash -n only. The translator suite was not run: no tool or runtime file changes.

GPUs tested: NVIDIA GeForce RTX 4070 (the scripts only start the loader; nothing here is GPU code).

AI-assisted: yes (Claude Code).

Checklist

  • Based on current main (6293c1c4f). One topic: scripts, their page and their test. No runtime or translator code.
  • No game data, no local paths. Traces, logs and digests are written outside the repository, and the page says to keep them local.
  • Nothing online: the title runs in a network namespace with no interfaces.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1251 **Author:** [@Moriz82](https://github.com/Moriz82) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `split/linux-proton-docs-scripts` --- ### 📝 Commits (1) - [`ed8309a`](https://github.com/ubiquitarianism/leonida/commit/ed8309a595652ca293b6c0fe06f67e389452dc60) scripts: boot the loader under Wine or Proton from a checkout (LINUX-PROTON-DOCS-SCRIPTS) ### 📊 Changes **7 files changed** (+293 additions, -133 deletions) <details> <summary>View changed files</summary> 📝 `docs/README.md` (+1 -0) 📝 `docs/linux_proton.md` (+70 -28) 📝 `scripts/linux-boot/boot-digest.sh` (+33 -33) 📝 `scripts/linux-boot/boot-inner.sh` (+10 -10) 📝 `scripts/linux-boot/boot.sh` (+40 -26) 📝 `scripts/linux-boot/run-boot.sh` (+48 -36) ➕ `tests/test_linux_boot_scripts.py` (+91 -0) </details> ### 📄 Description Claimed in the coordination issue as: LINUX-PROTON-DOCS-SCRIPTS ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144161765)). Part of the split of #984 into small pull requests. Depends on: none Overlaps: none found. `docs/linux.md` and the README's *Running the loader on Linux* cover the build and `<out>/gta6rt.sh`, and `scripts/run_wine_session.sh` runs the CI tests. This child adds the boot scripts of #984 and one page for them, and repeats neither. ### What and why `scripts/linux-boot` is for someone who boots the loader on Linux again and again while working on the runtime, straight from a checkout, and wants to know afterwards what happened: - `configure-worktree.sh <checkout>` configures the clang-cl and xwin cross-build in `runtime/build/boot` (`SDL3_SRC` makes it work offline). - `boot.sh dry-run|init|run [seconds]` starts the loader under Wine or Proton inside `unshare -rn`, a new user and network namespace that needs no root, so the title has no network at all. It sets the Vulkan backend and the shader library, moves NVIDIA's shader disk cache out of the way and raises its limit, and writes the startup and D3D12 traces with their `tools/boot_trace.py` summary. - `run-boot.sh <name> <gta6rt.exe> [seconds] [KEY=VALUE ...]` runs that as a `systemd --user` unit: it waits for memory headroom, holds a GPU lock and a build lock for the whole boot, samples RAM, swap, the unit's memory and VRAM every 2 s, and afterwards writes a digest (verdict, counts from the trace, captured frames, memory peaks, kernel OOM and GPU events, every distinct error line with its count). The digest is written also when the kernel or `systemd-oomd` killed the boot. Everything the scripts produce goes to `LEONIDA_BOOT_DIR`, outside the repository. `docs/linux_proton.md` is the page, with one row in `docs/README.md`. ### What changed against the scripts in #984 - **No fixed paths.** The package, the shader library and the output folder come from `LEONIDA_GAME_DIR`, `LEONIDA_SHADERS` and `LEONIDA_BOOT_DIR`. A missing one is refused with one line before anything starts. - **Only switches `main` has.** The input script (#1074), the title's own window, the pipeline cache directory and checkpoints, the source-frame capture and the device-type default are gone from the scripts, and so are the digest counters for log lines that `main` does not print. - **Two faults in the digest are fixed.** It read the unit's result through `tr -d "\x27"`, which GNU `tr` takes as the characters `x`, `2` and `7`: a failed unit's result became `'eit-code'`, matched no case, and the verdict stayed `OK`. And the digest unit stopped waiting as soon as the boot unit began to deactivate, before systemd had logged the result. It now waits for the unit to end and also uses the loader's exit code. - **One default Wine for both scripts** (Proton Experimental's when Steam has it, else `wine`), and the page says in bold to use one Wine per prefix. In #984 `boot.sh` defaulted to `wine` and `run-boot.sh` to Proton. I made exactly that mistake while testing this child: one `boot.sh` run used the distribution's Wine 11.22 on the Proton prefix. A Proton prefix links to files inside the Proton installation, and the other Wine's prefix update wrote through those links: about 1,200 of Proton's own files were overwritten, and from then on every Proton start on this machine failed (its services could not create the device manager). - **The Wine crash debugger is off** (`winedbg.exe=d`). In that broken state, `winedbg` started for a crashing Wine service crashed as well and was started again for itself, about ten thousand times, until memory and swap were full. That happened twice before the cause was found. With the override a crashing process just ends; the loader's own trace still records the title's exceptions. - **The page is cut down to what `main` does.** #984's version was a test report of that branch: a boot timeline, three machines, the list of what the branch changes and where it stops. None of that holds for `main`, so none of it is here; it belongs with the children that bring those changes. - **Not carried:** the one line of `runtime/test/xmem_test.cpp` that the split map counted under this topic (it belongs to the xmem children), and the fork's own sync script. ### Tested CachyOS (Arch), kernel 7.3.5, Proton Experimental (Wine 11.0), Ryzen 5 5600X, 16 GB RAM, NVIDIA GeForce RTX 4070 12 GB (driver 620.73.04), clang-cl 23.1.5 with an xwin SDK, Ninja, ccache, bash 5, systemd user session. On `main` `6293c1c4f` with this child: ```sh SDL3_SRC=<SDL3 source tree> scripts/linux-boot/configure-worktree.sh . cmake --build runtime/build/boot --target gta6rt -j6 export LEONIDA_GAME_DIR=<package> LEONIDA_SHADERS=<work>/shaders/spirv LEONIDA_BOOT_DIR=<scratch> WINEPREFIX=<boot prefix> scripts/linux-boot/boot.sh dry-run scripts/linux-boot/boot.sh init scripts/linux-boot/run-boot.sh long runtime/build/boot/gta6rt.exe 60 scripts/linux-boot/run-boot.sh short runtime/build/boot/gta6rt.exe 3 python3 -I tests/test_linux_boot_scripts.py ``` - Configure and build: both succeed (290 build steps, `gta6rt.exe` and `gta6rt_tls_host.dll`). - `boot.sh dry-run` and `boot.sh init`: exit 0, traces and summary written. - `run-boot.sh` with a 60 s limit: on `main` the title stops within seconds with an exception of its own, after creating its device, command queue, a descriptor heap and its first resources. The digest says `EXITED WITH ERROR`, unit result `exit-code`, and `run-boot.sh` exits 1. This was run several times while the scripts changed. The earlier runs stopped about 6 s in at a breakpoint exception (`0x80000003`). The run on the final tree stopped after 2 s with an access violation, but that run was made after the Proton installation had been damaged as described above, so it says nothing about `main`. Where `main` stops is not established here; what is checked is that the scripts report it. - `run-boot.sh` with a 3 s limit (before the damage and again on the final tree): the loader is stopped at the limit, the digest says `OK (ran its full time limit)`, `run-boot.sh` exits 0. One line per boot is appended to `boots.tsv`. - Wrong input (no package folder, a missing loader, a missing `gta6rt_tls_host.dll`, a missing shader library, a name with a space, an unknown mode): each is refused with exit 2 and creates nothing. - `tests/test_linux_boot_scripts.py` (new): 3 tests pass. It checks that the five scripts parse (`bash -n`), are executable, have LF line endings, and refuse wrong input before they create a folder or start anything. With one check removed from `boot.sh` the test fails. It needs no Wine, no systemd unit and no game files, and skips itself outside Linux. - The standard-library and pytest files under `tests/` the way `ci.yml` runs them: 521 files, 520 pass. `tests/test_imhex_patterns.py` fails, as it does on the base commit. - `python3 -I scripts/check_no_game_data.py`: passes. Not run: any other distribution, plain Wine instead of Proton, an AMD or Intel GPU (the sampler's VRAM columns come from `nvidia-smi` and hold `?` without it), a boot that reaches a picture (`main` does not get there on this machine), and a clean run of the `KILLED BY OOM` verdict (it appeared once, when the debugger incident above exhausted memory during a boot, but that path was not tested on purpose), and a boot on a repaired Proton installation after the final change (the final-tree boots ran in the damaged one). `shellcheck` is not installed on this machine; the scripts were checked with `bash -n` only. The translator suite was not run: no tool or runtime file changes. GPUs tested: NVIDIA GeForce RTX 4070 (the scripts only start the loader; nothing here is GPU code). AI-assisted: yes (Claude Code). ### Checklist - [x] Based on current `main` (`6293c1c4f`). One topic: scripts, their page and their test. No runtime or translator code. - [x] No game data, no local paths. Traces, logs and digests are written outside the repository, and the page says to keep them local. - [x] Nothing online: the title runs in a network namespace with no interfaces. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:43 +01:00
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#1283
No description provided.