startup: run a package with shared presets (console, OS, GPU) #3378

Merged
pigalot merged 8 commits from upstream-pr/3378 into main 2026-11-29 12:16:48 +00:00
pigalot commented 2026-11-28 17:00:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-28T17:00:32Z.


Change

Adds tools/startup/run_preset.py, a launcher for runs of a local package. It has three choices: console (x or s), GPU (nvidia or amd) and OS (win11, win10 or linux; the host by default). Every other setting comes from tools/startup/run_presets.json, which is applied in layers: base, then OS, console, GPU. Each layer says why its settings are there and gives the measured run behind them.

.\out\pe-env\Scripts\python.exe -B tools\startup\run_preset.py --package <package root> --console x --gpu nvidia

The launcher also:

  • stages the executable folder's PE files in the run folder, hard-linked where the volume allows and copied otherwise, so the package is never written;
  • gives each run an empty storage folder;
  • maps the package on G: with subst for the run and removes the mapping afterwards. It refuses a letter that is taken, unless subst already maps it onto this package;
  • writes the merged settings to settings.json, starts run.ps1 (or run.sh on Linux) and prints triage_run.py for the logs.

--print shows the merged settings and the exact command without starting anything.

The base layer sets:

  • -SuspendOthers 0 (#3332);
  • X2W_PROBE_PRECHECK=0 (#3313);
  • X2W_D3D12_RING_RELEASE_AT_SUBMIT (#2949), X2W_D3D12_ROOT_SRV_AT_DRAW (#3028) and X2W_D3D12_TABLE_ALIAS (#2977);
  • X2W_HIDE_TITLE_WINDOW=1, so only the output window stays on screen;
  • the switches common to the furthest #870 reports.

AGENTS.md gets a short section that points to the launcher and asks contributors to keep the presets current, with evidence for each change.

Why subst and not run.ps1 -MapDrive: -MapDrive rewrites only opens that pass through the debugger's file hooks. With it, a real-package run stayed on its first screens, with 11 pipelines translated in 420 s. The same settings on a subst drive kept loading and reached 76.

Refs #870, #3331

Verification

Build: 4d1b42bd (this branch on aec2e084), release, Windows 11 Pro 26200, NVIDIA.

  • python -B tests/startup_run_preset_check.py: OK: 12 preset choices, staging and controls. The check covers:

    • every console × OS × GPU choice against the real run.ps1/run.sh switch names;
    • the layer merge rules;
    • staging on a synthetic package, checking the package is left unchanged;
    • subst handling with a fake subst.

    Negative controls, each of which must be refused or caught:

    • a misspelt switch, an unknown key, a non-X2W env name, a number as an env value, an empty choice list and an unknown choice;
    • a letter mapped elsewhere or held by a volume, and a failing subst;
    • a config without an Executable.

    Taking X2W_HIDE_TITLE_WINDOW out of base fails all 12 choices.

  • python -B tests/startup_run_ps1_check.py: exit 0.

  • python -B tests/docs_links_check.py: Checked 156 Markdown files and 681 links.

  • tests/startup_run_sh_check.py skips on Windows (POSIX launcher), so it was not run.

Real-package runs (local data, not reproducible from this repository), Series X / NVIDIA preset, 420 s, same input script and seed storage on every run:

Build Settings Result
ec71c290 + #3332 previous shared settings, holding off alive, 75,028 translated draws, 62 pipelines
ec71c290 + #3332 this preset with -MapDrive alive, 73,780 draws, 11 pipelines
ec71c290 + #3332 this preset with subst, before PROBE_PRECHECK=0 alive, 162,303 draws, 74 pipelines, 2,134 textures
ec71c290 + #3332 + X2W_PROBE_PRECHECK=0 alive, 1,142,089 draws, 78 pipelines, 5,372 textures
ec71c290 + #3332 + X2W_HIDE_TITLE_WINDOW=1 alive, title window hidden once and not shown again, 975,488 draws, 77 pipelines
4d1b42bd (this branch) as committed alive, title window hidden once, ConsoleMode 0x64, input first read at 52 s, 655,334 draws, 79 / 482 pipelines translated / missing, 4,247 textures

The Series S preset (--console s) on ec71c290 + #3332 was also alive at 420 s, with 1,008,389 draws and 75 pipelines.

With one run per configuration, the draw counts vary a lot from run to run: the two Series X runs with the same settings drew 975k and 1.14M. The table supports "runs to the timeout with these settings", not a ranking of small differences.

Evidence and follow-up

Not measured: AMD, Linux (Wine/Proton) and Windows 10. The AMD and NVIDIA layers are deliberately identical. They exist so that a measured difference has somewhere to go. The Linux layer copies run.sh's defaults and the lazy-commit pair from the one reported Linux run (#1198, #2911).

Left out on purpose:

  • X2W_D3D12_VIEW_TOKEN_GUARDED (#3097), because main does not read it yet;
  • lazy commit on Windows, because our runs with it crashed at about 190 to 250 s;
  • the native-shader switches, because they need a desktop DXC and packs that not every run has.

Whether keyboard input reaches the title after its window is hidden is still unmeasured. The output window belongs to the same process, so the input stand-in's focus check still sees the process in front. The runs above used the input script.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

This pull request was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5542549546 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-28T17:00:32Z. --- ## Change Adds `tools/startup/run_preset.py`, a launcher for runs of a local package. It has three choices: console (`x` or `s`), GPU (`nvidia` or `amd`) and OS (`win11`, `win10` or `linux`; the host by default). Every other setting comes from `tools/startup/run_presets.json`, which is applied in layers: base, then OS, console, GPU. Each layer says why its settings are there and gives the measured run behind them. ```powershell .\out\pe-env\Scripts\python.exe -B tools\startup\run_preset.py --package <package root> --console x --gpu nvidia ``` The launcher also: - stages the executable folder's PE files in the run folder, hard-linked where the volume allows and copied otherwise, so the package is never written; - gives each run an empty storage folder; - maps the package on `G:` with `subst` for the run and removes the mapping afterwards. It refuses a letter that is taken, unless `subst` already maps it onto this package; - writes the merged settings to `settings.json`, starts `run.ps1` (or `run.sh` on Linux) and prints `triage_run.py` for the logs. `--print` shows the merged settings and the exact command without starting anything. The base layer sets: - `-SuspendOthers 0` (#3332); - `X2W_PROBE_PRECHECK=0` (#3313); - `X2W_D3D12_RING_RELEASE_AT_SUBMIT` (#2949), `X2W_D3D12_ROOT_SRV_AT_DRAW` (#3028) and `X2W_D3D12_TABLE_ALIAS` (#2977); - `X2W_HIDE_TITLE_WINDOW=1`, so only the output window stays on screen; - the switches common to the furthest #870 reports. `AGENTS.md` gets a short section that points to the launcher and asks contributors to keep the presets current, with evidence for each change. Why `subst` and not `run.ps1 -MapDrive`: `-MapDrive` rewrites only opens that pass through the debugger's file hooks. With it, a real-package run stayed on its first screens, with 11 pipelines translated in 420 s. The same settings on a `subst` drive kept loading and reached 76. Refs #870, #3331 ## Verification Build: `4d1b42bd` (this branch on `aec2e084`), release, Windows 11 Pro 26200, NVIDIA. - `python -B tests/startup_run_preset_check.py`: `OK: 12 preset choices, staging and controls`. The check covers: - every console × OS × GPU choice against the real `run.ps1`/`run.sh` switch names; - the layer merge rules; - staging on a synthetic package, checking the package is left unchanged; - `subst` handling with a fake `subst`. Negative controls, each of which must be refused or caught: - a misspelt switch, an unknown key, a non-X2W env name, a number as an env value, an empty choice list and an unknown choice; - a letter mapped elsewhere or held by a volume, and a failing `subst`; - a config without an `Executable`. Taking `X2W_HIDE_TITLE_WINDOW` out of base fails all 12 choices. - `python -B tests/startup_run_ps1_check.py`: exit 0. - `python -B tests/docs_links_check.py`: `Checked 156 Markdown files and 681 links.` - `tests/startup_run_sh_check.py` skips on Windows (POSIX launcher), so it was not run. Real-package runs (local data, not reproducible from this repository), Series X / NVIDIA preset, 420 s, same input script and seed storage on every run: | Build | Settings | Result | |---|---|---| | `ec71c290` + #3332 | previous shared settings, holding off | alive, 75,028 translated draws, 62 pipelines | | `ec71c290` + #3332 | this preset with `-MapDrive` | alive, 73,780 draws, 11 pipelines | | `ec71c290` + #3332 | this preset with `subst`, before `PROBE_PRECHECK=0` | alive, 162,303 draws, 74 pipelines, 2,134 textures | | `ec71c290` + #3332 | + `X2W_PROBE_PRECHECK=0` | alive, 1,142,089 draws, 78 pipelines, 5,372 textures | | `ec71c290` + #3332 | + `X2W_HIDE_TITLE_WINDOW=1` | alive, title window hidden once and not shown again, 975,488 draws, 77 pipelines | | `4d1b42bd` (this branch) | as committed | alive, title window hidden once, ConsoleMode 0x64, input first read at 52 s, 655,334 draws, 79 / 482 pipelines translated / missing, 4,247 textures | The Series S preset (`--console s`) on `ec71c290` + #3332 was also alive at 420 s, with 1,008,389 draws and 75 pipelines. With one run per configuration, the draw counts vary a lot from run to run: the two Series X runs with the same settings drew 975k and 1.14M. The table supports "runs to the timeout with these settings", not a ranking of small differences. ## Evidence and follow-up Not measured: AMD, Linux (Wine/Proton) and Windows 10. The AMD and NVIDIA layers are deliberately identical. They exist so that a measured difference has somewhere to go. The Linux layer copies `run.sh`'s defaults and the lazy-commit pair from the one reported Linux run (#1198, #2911). Left out on purpose: - `X2W_D3D12_VIEW_TOKEN_GUARDED` (#3097), because main does not read it yet; - lazy commit on Windows, because our runs with it crashed at about 190 to 250 s; - the native-shader switches, because they need a desktop DXC and packs that not every run has. Whether keyboard input reaches the title after its window is hidden is still unmeasured. The output window belongs to the same process, so the input stand-in's focus check still sees the process in front. The runs above used the input script. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. This pull request was AI-assisted.
Leyukaka commented 2026-11-28 17:13:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T17:13:00Z.

Review: CHANGES_REQUESTED


Reviewed 4d1b42bd by its diff.

The package folder can be written. stage() in tools/startup/run_preset.py hard-links every .exe/.dll of the executable's folder into the stage (os.link(f, target), copy only on OSError), and the command runs the staged executable. run.ps1 then copies the 8 stand-ins into that folder ($runDir = Split-Path -Parent $Exe, Copy-Item ... -Force, tools/startup/run.ps1:43-47), and run.sh does the same with cp -f (run.sh:99-102). If the executable's folder holds a file with a stand-in's name and the stage is on the same volume, the staged entry is a hard link to the package's file. cp -f truncates and rewrites an existing destination in place, so on Linux the copy writes into the package's file when it is writable; Copy-Item -Force likely does the same on Windows (not measured). The docs say "the package folder itself is never written", and the stage() docstring "Nothing under the package is written". Fix: do not link a file whose name is one of the stand-ins (copy or skip it), or copy instead of linking, and add a test with such a file that checks the package copy is unchanged.

Caller environment is not recorded. The child starts from dict(os.environ) and the layers are applied on top (env = dict(os.environ); env.update(settings["env"])). An X2W_* already set in the caller's shell reaches the run, settings.json (choice, run, env, layers, command) does not record it, and an env: null in a layer cannot remove it, because null only drops values from earlier layers. Fix: record the inherited X2W_* values in settings.json and make null remove the variable from the child's environment. If inherited values are dropped instead, keep the ones run.sh reads from the caller (X2W_WIN_PYTHON, X2W_FXC, X2W_HOST_PYTHON).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6099224088 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378#pullrequestreview-6099224088). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T17:13:00Z. **Review:** CHANGES_REQUESTED --- Reviewed `4d1b42bd` by its diff. **The package folder can be written.** `stage()` in `tools/startup/run_preset.py` hard-links every `.exe`/`.dll` of the executable's folder into the stage (`os.link(f, target)`, copy only on `OSError`), and the command runs the staged executable. `run.ps1` then copies the 8 stand-ins into that folder (`$runDir = Split-Path -Parent $Exe`, `Copy-Item ... -Force`, `tools/startup/run.ps1:43-47`), and `run.sh` does the same with `cp -f` (`run.sh:99-102`). If the executable's folder holds a file with a stand-in's name and the stage is on the same volume, the staged entry is a hard link to the package's file. `cp -f` truncates and rewrites an existing destination in place, so on Linux the copy writes into the package's file when it is writable; `Copy-Item -Force` likely does the same on Windows (not measured). The docs say "the package folder itself is never written", and the `stage()` docstring "Nothing under the package is written". Fix: do not link a file whose name is one of the stand-ins (copy or skip it), or copy instead of linking, and add a test with such a file that checks the package copy is unchanged. **Caller environment is not recorded.** The child starts from `dict(os.environ)` and the layers are applied on top (`env = dict(os.environ); env.update(settings["env"])`). An `X2W_*` already set in the caller's shell reaches the run, `settings.json` (`choice`, `run`, `env`, `layers`, `command`) does not record it, and an `env: null` in a layer cannot remove it, because `null` only drops values from earlier layers. Fix: record the inherited `X2W_*` values in `settings.json` and make `null` remove the variable from the child's environment. If inherited values are dropped instead, keep the ones `run.sh` reads from the caller (`X2W_WIN_PYTHON`, `X2W_FXC`, `X2W_HOST_PYTHON`).
JohnConnorNPC commented 2026-11-28 17:15:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T17:15:23Z.


Thanks for this. Checked at 4d1b42bd: the trial merge onto main aec2e084 is clean (git merge-tree --write-tree, rc 0), CI is 3/3 green, startup_run_preset_check.py prints OK: 12 preset choices, staging and controls, the run.sh/run.ps1 text checks, docs links and check fragments pass, 11 of 11 mutations of the new check fail it, and nothing under src/ changes. I'd ask for one change before merge.

MUST: run.sh writes into the package through the hard link. stage() calls os.link for every .exe/.dll in the executable's folder. run.sh then runs cp -f "$build_dir/$dll.dll" "$run_dir/" for the 8 stand-in names. That rewrites the linked file in place, so a package that ships one of those names gets modified, even though the docs say the package is never written. To reproduce on a synthetic package (Linux, repo root):

P=/tmp/p; mkdir -p $P/pkg/bin $P/build && printf 'MZ pkg' >$P/pkg/bin/xg_xs.dll && printf 'MZ exe' >$P/pkg/bin/t.exe && printf 'MZ stand-in' >$P/build/xg_xs.dll
python3 -c "import sys; sys.path.insert(0, 'tools/startup'); import run_preset as r; from pathlib import Path as P; print(r.stage(P('$P/pkg'), P('$P/pkg/bin/t.exe'), P('$P/run/stage'))[1:])"
cp -f $P/build/xg_xs.dll $P/run/stage/bin/ && cat $P/pkg/bin/xg_xs.dll

This prints (2, 0), so both files were linked, and then MZ stand-in: the package's own file was replaced. run.ps1's Copy-Item … -Force probably does the same on NTFS, but I didn't run it on Windows. I also haven't measured whether a real package ships any of these names. This would show it: ls <exe folder> | grep -ixE '(xmem|d3d12_xs|AcpHal|XCRDAPI|chad|xapu|xg_xs|GameInput)\.dll'. The check's "package unchanged" test covers only stage(), and its fixture has no stand-in name. Suggested fix: copy (or skip) the stand-in names instead of linking them, and add one to the fixture along with a run.sh-style copy step.

SHOULD: the check AMD and NVIDIA differ without a recorded reason fails on exactly the edit that the PR body ("so that a measured difference has somewhere to go") and the new AGENTS.md text ("put it in that host's layer") invite. Adding "env": {"X2W_SPLIT_INDIRECT_DISPATCH": "1"} to gpu.amd, with the reason in its why, makes python3 tests/startup_run_preset_check.py exit 1 with FAIL: win11: AMD and NVIDIA differ without a recorded reason (win10 and linux fail the same way). Could it either be dropped, or accept a difference whose key is named in that layer's why?

Minor: Linux --suspend-others 0 is never asserted (only Windows -SuspendOthers is), and removing -StoragePath crashes the check in cmd.index (ValueError) instead of giving a named FAIL.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7242874870 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378#issuecomment-7242874870). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T17:15:23Z. --- Thanks for this. Checked at 4d1b42bd: the trial merge onto main aec2e084 is clean (`git merge-tree --write-tree`, rc 0), CI is 3/3 green, `startup_run_preset_check.py` prints `OK: 12 preset choices, staging and controls`, the run.sh/run.ps1 text checks, docs links and check fragments pass, 11 of 11 mutations of the new check fail it, and nothing under `src/` changes. I'd ask for one change before merge. **MUST: run.sh writes into the package through the hard link.** `stage()` calls `os.link` for every .exe/.dll in the executable's folder. run.sh then runs `cp -f "$build_dir/$dll.dll" "$run_dir/"` for the 8 stand-in names. That rewrites the linked file in place, so a package that ships one of those names gets modified, even though the docs say the package is never written. To reproduce on a synthetic package (Linux, repo root): ``` P=/tmp/p; mkdir -p $P/pkg/bin $P/build && printf 'MZ pkg' >$P/pkg/bin/xg_xs.dll && printf 'MZ exe' >$P/pkg/bin/t.exe && printf 'MZ stand-in' >$P/build/xg_xs.dll python3 -c "import sys; sys.path.insert(0, 'tools/startup'); import run_preset as r; from pathlib import Path as P; print(r.stage(P('$P/pkg'), P('$P/pkg/bin/t.exe'), P('$P/run/stage'))[1:])" cp -f $P/build/xg_xs.dll $P/run/stage/bin/ && cat $P/pkg/bin/xg_xs.dll ``` This prints `(2, 0)`, so both files were linked, and then `MZ stand-in`: the package's own file was replaced. run.ps1's `Copy-Item … -Force` probably does the same on NTFS, but I didn't run it on Windows. I also haven't measured whether a real package ships any of these names. This would show it: `ls <exe folder> | grep -ixE '(xmem|d3d12_xs|AcpHal|XCRDAPI|chad|xapu|xg_xs|GameInput)\.dll'`. The check's "package unchanged" test covers only `stage()`, and its fixture has no stand-in name. Suggested fix: copy (or skip) the stand-in names instead of linking them, and add one to the fixture along with a run.sh-style copy step. **SHOULD:** the check `AMD and NVIDIA differ without a recorded reason` fails on exactly the edit that the PR body ("so that a measured difference has somewhere to go") and the new AGENTS.md text ("put it in that host's layer") invite. Adding `"env": {"X2W_SPLIT_INDIRECT_DISPATCH": "1"}` to `gpu.amd`, with the reason in its `why`, makes `python3 tests/startup_run_preset_check.py` exit 1 with `FAIL: win11: AMD and NVIDIA differ without a recorded reason` (win10 and linux fail the same way). Could it either be dropped, or accept a difference whose key is named in that layer's `why`? Minor: Linux `--suspend-others 0` is never asserted (only Windows `-SuspendOthers` is), and removing `-StoragePath` crashes the check in `cmd.index` (ValueError) instead of giving a named FAIL. This comment was AI-assisted.
pigalot commented 2026-11-28 17:42:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-28T17:42:40Z.


Thanks @Leyukaka and @JohnConnorNPC. Pushed four commits on top of 4d1b42bd; the branch still merges
cleanly onto current main (git merge-tree --write-tree, rc 0) and nothing under src/ changes.

Package written through the hard link (both of you). Confirmed on Windows too: on NTFS, with a synthetic
package, Copy-Item -Force over a hard-linked xg_xs.dll replaced the package's file under pwsh 7.7 and
Windows PowerShell 5.1. Fixed in 6d656cdf: stage() always copies a file whose name (any case) is one of
the 8 stand-ins, and links only the rest. STAND_INS in run_preset.py is checked against the lists in
run.ps1 and run.sh. The check now stages a package with GameInput.dll and XMEM.dll, rewrites the
stand-ins over the stage the way the scripts do (an in-place write), and compares the package; a control with
those names linked must change it. John's repro on the new head prints (1, 1) and then MZ pkg.

Caller environment (Leyukaka). d2215885: merge() also returns unset (keys whose last value is
null), and those are removed from the child's environment, so null now also drops a value set in the
caller's shell. Caller X2W_* and WINE* values that reach the run are kept (so X2W_WIN_PYTHON, X2W_FXC,
X2W_HOST_PYTHON still work), written to settings.json as inherited_env, and listed by --print. The
check covers it end to end with the child start replaced: the environment it gets and what settings.json
records.

GPU check vs. the documented edit (John, SHOULD). 5f28d9b2: a difference between GPU choices (env or
run) is now accepted when each GPU layer that sets the key names it in its why, for every OS and console.
Your edit (X2W_SPLIT_INDIRECT_DISPATCH in gpu.amd) passes; an unnamed env value and an unnamed run option
fail. AGENTS.md and the docs say to name the switch in the layer's why.

Minor (John). 30fdfe5e: Linux commands are checked for --suspend-others 0, and a missing flag gives a
named FAIL instead of a ValueError (dropping -StoragePath now gives 8 per-run storage FAILs).

After each commit: startup_run_preset_check.py (OK: 12 preset choices, staging and controls, also under
Linux), startup_run_ps1_check.py and docs_links_check.py pass. Each new check was mutation-tested: the old
linking, the old environment handling, a missing -StoragePath and a missing --suspend-others each fail it.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7243226095 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378#issuecomment-7243226095). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-28T17:42:40Z. --- Thanks @Leyukaka and @JohnConnorNPC. Pushed four commits on top of `4d1b42bd`; the branch still merges cleanly onto current main (`git merge-tree --write-tree`, rc 0) and nothing under `src/` changes. **Package written through the hard link (both of you).** Confirmed on Windows too: on NTFS, with a synthetic package, `Copy-Item -Force` over a hard-linked `xg_xs.dll` replaced the package's file under pwsh 7.7 and Windows PowerShell 5.1. Fixed in `6d656cdf`: `stage()` always copies a file whose name (any case) is one of the 8 stand-ins, and links only the rest. `STAND_INS` in `run_preset.py` is checked against the lists in `run.ps1` and `run.sh`. The check now stages a package with `GameInput.dll` and `XMEM.dll`, rewrites the stand-ins over the stage the way the scripts do (an in-place write), and compares the package; a control with those names linked must change it. John's repro on the new head prints `(1, 1)` and then `MZ pkg`. **Caller environment (Leyukaka).** `d2215885`: `merge()` also returns `unset` (keys whose last value is `null`), and those are removed from the child's environment, so `null` now also drops a value set in the caller's shell. Caller `X2W_*` and `WINE*` values that reach the run are kept (so `X2W_WIN_PYTHON`, `X2W_FXC`, `X2W_HOST_PYTHON` still work), written to `settings.json` as `inherited_env`, and listed by `--print`. The check covers it end to end with the child start replaced: the environment it gets and what `settings.json` records. **GPU check vs. the documented edit (John, SHOULD).** `5f28d9b2`: a difference between GPU choices (env or run) is now accepted when each GPU layer that sets the key names it in its `why`, for every OS and console. Your edit (`X2W_SPLIT_INDIRECT_DISPATCH` in `gpu.amd`) passes; an unnamed env value and an unnamed run option fail. AGENTS.md and the docs say to name the switch in the layer's `why`. **Minor (John).** `30fdfe5e`: Linux commands are checked for `--suspend-others 0`, and a missing flag gives a named FAIL instead of a `ValueError` (dropping `-StoragePath` now gives 8 `per-run storage` FAILs). After each commit: `startup_run_preset_check.py` (`OK: 12 preset choices, staging and controls`, also under Linux), `startup_run_ps1_check.py` and `docs_links_check.py` pass. Each new check was mutation-tested: the old linking, the old environment handling, a missing `-StoragePath` and a missing `--suspend-others` each fail it. This reply was AI-assisted.
KelboLive commented 2026-11-28 20:39:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T20:39:11Z.

Review: APPROVED


LGTM — well-structured launcher with solid test coverage.

run_preset.py and run_presets.json replace hand-written run lines with layered settings (base → OS → console → GPU). Each entry carries its why. Staging hard-links PE files while protecting stand-in-named DLLs from in-place rewrite. Drive mapping via subst (not -MapDrive) avoids debugger file hook issues. The Python fixture covers all console/OS/GPU combos, staging, refusals, and the --print path.

Ready to land.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6099993665 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378#pullrequestreview-6099993665). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T20:39:11Z. **Review:** APPROVED --- LGTM — well-structured launcher with solid test coverage. `run_preset.py` and `run_presets.json` replace hand-written run lines with layered settings (base → OS → console → GPU). Each entry carries its `why`. Staging hard-links PE files while protecting stand-in-named DLLs from in-place rewrite. Drive mapping via `subst` (not `-MapDrive`) avoids debugger file hook issues. The Python fixture covers all console/OS/GPU combos, staging, refusals, and the --print path. Ready to land.
KelboLive commented 2026-11-28 21:06:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:06:48Z.

Review: APPROVED


LGTM — well-structured launcher with layered config and thorough tests.

run_preset.py starts a package run with settings from run_presets.json: base, OS, console, GPU layers merge in order; null unsets; strict validation (no unknown keys, no non-X2W env, string values only). Launcher stages PE files (hard-linked, stand-ins always copied), maps package on subst drive, disables thread holding, hides title window, runs run.ps1/run.sh, and prints triage. Presets file documents every setting with why, runs, and measured results. Test covers layer merging, GPU unexplained differences check, drive mapping, staging, and negative controls.

Ready to land.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100088928 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378#pullrequestreview-6100088928). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T21:06:48Z. **Review:** APPROVED --- LGTM — well-structured launcher with layered config and thorough tests. run_preset.py starts a package run with settings from run_presets.json: base, OS, console, GPU layers merge in order; null unsets; strict validation (no unknown keys, no non-X2W env, string values only). Launcher stages PE files (hard-linked, stand-ins always copied), maps package on subst drive, disables thread holding, hides title window, runs run.ps1/run.sh, and prints triage. Presets file documents every setting with why, runs, and measured results. Test covers layer merging, GPU unexplained differences check, drive mapping, staging, and negative controls. Ready to land.
KelboLive commented 2026-11-28 21:17:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:17:01Z.

Review: APPROVED


LGTM — clean launcher for shared real-run settings.

run_preset.py picks console (x/s), GPU (nvidia/amd), OS (win11/win10/linux) and merges layered settings from run_presets.json (base → OS → console → GPU). Each layer records why it exists. Null env values unset earlier settings. Staging hard-links PE files (copies stand-in-named ones), maps the package via subst (not run.ps1 -MapDrive), disables thread holding (#1408), and hides the title window once presents reach the output window.

run_presets.json ships measured settings: RING_RELEASE_AT_SUBMIT, ROOT_SRV_AT_DRAW, TABLE_ALIAS, RUNTIME_LOCAL, PROBE_PRECHECK=0, etc. with cited evidence. GPU layers are documented with why fields.

Tests cover layer merging, null unsets, caller env recording, drive mapping (fake subst), staging (hard links, stand-in copies, synthetic package), validation (unknown keys, misspelt switches, non-X2W env names), and --print output.

Documentation in AGENTS.md and startup-runtime.md explains the workflow and maintenance rules.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100121881 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378#pullrequestreview-6100121881). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T21:17:01Z. **Review:** APPROVED --- LGTM — clean launcher for shared real-run settings. run_preset.py picks console (x/s), GPU (nvidia/amd), OS (win11/win10/linux) and merges layered settings from run_presets.json (base → OS → console → GPU). Each layer records why it exists. Null env values unset earlier settings. Staging hard-links PE files (copies stand-in-named ones), maps the package via subst (not run.ps1 -MapDrive), disables thread holding (#1408), and hides the title window once presents reach the output window. run_presets.json ships measured settings: RING_RELEASE_AT_SUBMIT, ROOT_SRV_AT_DRAW, TABLE_ALIAS, RUNTIME_LOCAL, PROBE_PRECHECK=0, etc. with cited evidence. GPU layers are documented with why fields. Tests cover layer merging, null unsets, caller env recording, drive mapping (fake subst), staging (hard links, stand-in copies, synthetic package), validation (unknown keys, misspelt switches, non-X2W env names), and --print output. Documentation in AGENTS.md and startup-runtime.md explains the workflow and maintenance rules.
KelboLive commented 2026-11-28 21:57:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:57:16Z.

Review: APPROVED


LGTM — clean launcher for shared real-run settings.

run_preset.py picks console (x/s), GPU (nvidia/amd), OS (win11/win10/linux) and merges layered settings from run_presets.json (base → OS → console → GPU). Each layer records why it exists. Null env values unset earlier settings. Staging hard-links PE files (copies stand-in-named ones), maps the package via subst (not run.ps1 -MapDrive), disables thread holding (#1408), and hides the title window once presents reach the output window.

run_presets.json ships measured settings: RING_RELEASE_AT_SUBMIT, ROOT_SRV_AT_DRAW, TABLE_ALIAS, RUNTIME_LOCAL, PROBE_PRECHECK=0, etc. with cited evidence. GPU layers are documented with why fields.

Tests cover layer merging, null unsets, caller env recording, drive mapping (fake subst), staging (hard links, stand-in copies, synthetic package), validation (unknown keys, misspelt switches, non-X2W env names), and --print output.

Documentation in AGENTS.md and startup-runtime.md explains the workflow and maintenance rules.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100253505 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378#pullrequestreview-6100253505). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T21:57:16Z. **Review:** APPROVED --- LGTM — clean launcher for shared real-run settings. run_preset.py picks console (x/s), GPU (nvidia/amd), OS (win11/win10/linux) and merges layered settings from run_presets.json (base → OS → console → GPU). Each layer records why it exists. Null env values unset earlier settings. Staging hard-links PE files (copies stand-in-named ones), maps the package via subst (not run.ps1 -MapDrive), disables thread holding (#1408), and hides the title window once presents reach the output window. run_presets.json ships measured settings: RING_RELEASE_AT_SUBMIT, ROOT_SRV_AT_DRAW, TABLE_ALIAS, RUNTIME_LOCAL, PROBE_PRECHECK=0, etc. with cited evidence. GPU layers are documented with why fields. Tests cover layer merging, null unsets, caller env recording, drive mapping (fake subst), staging (hard links, stand-in copies, synthetic package), validation (unknown keys, misspelt switches, non-X2W env names), and --print output. Documentation in AGENTS.md and startup-runtime.md explains the workflow and maintenance rules.
lukaslw-lab commented 2026-11-29 00:09:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-29T00:09:53Z.


Not a blocker. On "lazy commit on Windows, because our runs with it crashed at about 190 to 250 s": do you still have one of those run folders? triage_run.py on it shows how it ended. If not, a lazy on/off pair on the same build would show whether lazy is the cause.

What we saw: before #2209's fix (c40e3dac), lazy-on runs stopped with access violations in the title's code at 315–430 s (3 of 3), while the lazy-off control ran 600 s. The cause was a block released while the fault handler was committing it. Since that fix, with X2W_XMEM_LAZY_COMMIT=1 + X2W_XMEM_LAZY_STARTUP=1 (Windows 10, 16 GB RAM, RTX 3080 Ti), 189 runs ran to their timeout (171 past 190 s), and none ended in xmem.dll.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7247920027 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378#issuecomment-7247920027). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-29T00:09:53Z. --- Not a blocker. On "lazy commit on Windows, because our runs with it crashed at about 190 to 250 s": do you still have one of those run folders? `triage_run.py` on it shows how it ended. If not, a lazy on/off pair on the same build would show whether lazy is the cause. What we saw: before #2209's fix (`c40e3dac`), lazy-on runs stopped with access violations in the title's code at 315–430 s (3 of 3), while the lazy-off control ran 600 s. The cause was a block released while the fault handler was committing it. Since that fix, with `X2W_XMEM_LAZY_COMMIT=1` + `X2W_XMEM_LAZY_STARTUP=1` (Windows 10, 16 GB RAM, RTX 3080 Ti), 189 runs ran to their timeout (171 past 190 s), and none ended in `xmem.dll`. This comment was AI-assisted.
Leyukaka commented 2026-11-29 07:34:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T07:34:41Z.

Review: APPROVED


Re-reviewed at 30fdfe5e by the diff from 4d1b42bd. This replaces my earlier review; both points are fixed.

  • Hard link: stage() copies a file named like one of the 8 stand-ins (any case) and links only the rest. STAND_INS is compared with the lists in run.ps1 and run.sh. The check stages a package holding GameInput.dll and XMEM.dll, rewrites the stand-ins in place over the stage and compares the package (bytes and mtime); the control with STAND_INS = () must change the package where links work.
  • Environment: null now removes the caller's value (unset, child_env()), and caller X2W_*/WINE* values that reach the run are written to settings.json as inherited_env and listed by --print. X2W_WIN_PYTHON, X2W_FXC and X2W_HOST_PYTHON are kept. Covered by child_env() directly and by a main() run with the child start replaced.

Minor, not blocking: unexplained_gpu_differences() accepts a key with key not in why, a plain substring test, so a run key such as render or seconds passes on any why that contains the word, and X2W_A passes when the why names X2W_AB.

git merge-tree --write-tree onto origin/main 212d4b5f: clean.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6101925294 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3378#pullrequestreview-6101925294). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T07:34:41Z. **Review:** APPROVED --- Re-reviewed at `30fdfe5e` by the diff from `4d1b42bd`. This replaces my earlier review; both points are fixed. - Hard link: `stage()` copies a file named like one of the 8 stand-ins (any case) and links only the rest. `STAND_INS` is compared with the lists in `run.ps1` and `run.sh`. The check stages a package holding `GameInput.dll` and `XMEM.dll`, rewrites the stand-ins in place over the stage and compares the package (bytes and mtime); the control with `STAND_INS = ()` must change the package where links work. - Environment: `null` now removes the caller's value (`unset`, `child_env()`), and caller `X2W_*`/`WINE*` values that reach the run are written to `settings.json` as `inherited_env` and listed by `--print`. `X2W_WIN_PYTHON`, `X2W_FXC` and `X2W_HOST_PYTHON` are kept. Covered by `child_env()` directly and by a `main()` run with the child start replaced. Minor, not blocking: `unexplained_gpu_differences()` accepts a key with `key not in why`, a plain substring test, so a `run` key such as `render` or `seconds` passes on any `why` that contains the word, and `X2W_A` passes when the `why` names `X2W_AB`. `git merge-tree --write-tree` onto `origin/main` `212d4b5f`: clean.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
R0Y00/Xbox2Windows!3378
No description provided.