docs/boot.md: the Windows PowerShell 5.1 capture survives ErrorActionPreference Stop (PROC-271) (OLD-9939) #668

Merged
LouisRiverstone merged 1 commit from upstream-pr/668 into main 2026-11-24 12:43:29 +00:00
LouisRiverstone commented 2026-11-24 11:18:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by LouisRiverstone on 2026-11-24T11:18:57Z.


Claimed in the coordination issue as: OLD-9939 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129925439)

Replaces the carried-over draft #206. I'm the original author of old upstream PR 9939.

What and why

PROC-271. If the session, a profile or a script has set $ErrorActionPreference = 'Stop', Windows PowerShell 5.1 turns the first stderr line of the gta6rt.exe --run ... 2>&1 | ... capture in docs/boot.md into a terminating error. The run stops there, and the log has no [d3d12-trace] line, so it reads as a run that made no D3D12 call. The command now runs inside & { $ErrorActionPreference = 'Continue'; ... }, which is the same pattern scripts/first_look.ps1 uses for its dry run, and the doc explains why the wrapper is there.

The old branch's final diff, applied on current main (21625bca8) as one commit. It applied cleanly.

Tested

Measured with a stand-in on Windows PowerShell 5.1.26100. The stand-in printed three trace lines to stderr and exited with code 37.

  • Without the block: three lines captured with Continue, none with Stop.
  • With the block: three lines captured with either setting, $LASTEXITCODE was 37, and the session's preference was unchanged afterwards.

Documentation only.

GPUs tested: n/a

AI-assisted: yes (Claude Code)

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: documentation only)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5471136723 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/668). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-11-24T11:18:57Z. --- Claimed in the coordination issue as: OLD-9939 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129925439) Replaces the carried-over draft #206. I'm the original author of old upstream PR 9939. ### What and why PROC-271. If the session, a profile or a script has set `$ErrorActionPreference = 'Stop'`, Windows PowerShell 5.1 turns the first stderr line of the `gta6rt.exe --run ... 2>&1 | ...` capture in `docs/boot.md` into a terminating error. The run stops there, and the log has no `[d3d12-trace]` line, so it reads as a run that made no D3D12 call. The command now runs inside `& { $ErrorActionPreference = 'Continue'; ... }`, which is the same pattern `scripts/first_look.ps1` uses for its dry run, and the doc explains why the wrapper is there. The old branch's final diff, applied on current `main` (21625bca8) as one commit. It applied cleanly. ### Tested Measured with a stand-in on Windows PowerShell 5.1.26100. The stand-in printed three trace lines to stderr and exited with code 37. - Without the block: three lines captured with `Continue`, none with `Stop`. - With the block: three lines captured with either setting, `$LASTEXITCODE` was 37, and the session's preference was unchanged afterwards. Documentation only. GPUs tested: n/a AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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: documentation only)
kirigayakazima commented 2026-11-24 12:26:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-24T12:26:21Z.


Independently verified on Windows 11 x64 (Windows PowerShell 5.1.26100.9818, Python 3.14.7, CPU only, synthetic stand-in process — no game files) against head commit 4d470fd69b8fd415261b8283bc3bf31424d8bda5.

Verdict: Looks good — confirmed both the failure under $ErrorActionPreference = 'Stop' and that the scoped & { $ErrorActionPreference = 'Continue' ... } pipeline captures every stderr line cleanly while feeding tools/boot_trace.py.

Checks run locally

  • Clean merge with main (21625bca): git merge-tree --write-tree upstream/main HEAD exited 0; git diff --check upstream/main...HEAD clean.
  • Doc tests (python -I): all 13 files passed (test_docs_cli_flags.py 4, test_docs_design_rows.py 5, test_docs_encoding.py 1, test_docs_env_vars.py 4, test_docs_links.py 16, test_docs_list_items.py 3, test_docs_pr_template.py 2, test_docs_python_deps.py 3, test_docs_repeated_lines.py 2, test_docs_repo_paths.py 3, test_docs_table_ids.py 2, test_docs_table_rows.py 2, test_design_contract_rows.py 5).
  • python -I tests/test_boot_trace.py: 32 tests, OK.
  • python -I tests/test_dev_boot_trace.py: 5 tests, OK.
  • python -I scripts/check_no_game_data.py docs/boot.md: clean (exit 0).

Windows PowerShell 5.1.26100.9818 empirical reproduction

Ran a synthetic stand-in command printing 3 [d3d12-trace] lines to stderr and exiting 37, then parsed Boot + D3D12 with python -I tools/boot_trace.py $trace --d3d12 $log --json:

  • Pre-PR pipeline (... 2>&1 | ForEach-Object { $_.ToString() } | Out-File -LiteralPath $log -Width 4096 -Encoding utf8):
    • $ErrorActionPreference = 'Continue': PowerShell exited 0, $LASTEXITCODE = 37, 3 lines captured (135 bytes), boot_trace.py exited 0 (d3d12.calls = 3).
    • $ErrorActionPreference = 'Stop': PowerShell aborted (exit 1) on the first stderr line, no log was written (0 lines), boot_trace.py exited 2.
  • PR #668 pipeline (& { $ErrorActionPreference = 'Continue'; ... 2>&1 } | ForEach-Object { $_.ToString() } | Out-File ...):
    • Under 'Continue': PowerShell exited 0, $LASTEXITCODE = 37, $ErrorActionPreference remained Continue, 3 lines captured (135 bytes), boot_trace.py exited 0 (d3d12.calls = 3).
    • Under 'Stop': PowerShell exited 0, $LASTEXITCODE = 37, outer $ErrorActionPreference remained Stop, all 3 lines captured (135 bytes), and boot_trace.py exited 0 (d3d12.calls = 3).

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7131439811 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/668#issuecomment-7131439811). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-24T12:26:21Z. --- Independently verified on Windows 11 x64 (`Windows PowerShell 5.1.26100.9818`, `Python 3.14.7`, CPU only, synthetic stand-in process — no game files) against head commit `4d470fd69b8fd415261b8283bc3bf31424d8bda5`. **Verdict: Looks good** — confirmed both the failure under `$ErrorActionPreference = 'Stop'` and that the scoped `& { $ErrorActionPreference = 'Continue' ... }` pipeline captures every stderr line cleanly while feeding `tools/boot_trace.py`. ### Checks run locally - Clean merge with `main` (`21625bca`): `git merge-tree --write-tree upstream/main HEAD` exited `0`; `git diff --check upstream/main...HEAD` clean. - Doc tests (`python -I`): all 13 files passed (`test_docs_cli_flags.py` 4, `test_docs_design_rows.py` 5, `test_docs_encoding.py` 1, `test_docs_env_vars.py` 4, `test_docs_links.py` 16, `test_docs_list_items.py` 3, `test_docs_pr_template.py` 2, `test_docs_python_deps.py` 3, `test_docs_repeated_lines.py` 2, `test_docs_repo_paths.py` 3, `test_docs_table_ids.py` 2, `test_docs_table_rows.py` 2, `test_design_contract_rows.py` 5). - `python -I tests/test_boot_trace.py`: **32 tests, OK**. - `python -I tests/test_dev_boot_trace.py`: **5 tests, OK**. - `python -I scripts/check_no_game_data.py docs/boot.md`: clean (exit `0`). ### Windows PowerShell `5.1.26100.9818` empirical reproduction Ran a synthetic stand-in command printing 3 `[d3d12-trace]` lines to `stderr` and exiting `37`, then parsed `Boot + D3D12` with `python -I tools/boot_trace.py $trace --d3d12 $log --json`: - **Pre-PR pipeline** (`... 2>&1 | ForEach-Object { $_.ToString() } | Out-File -LiteralPath $log -Width 4096 -Encoding utf8`): - `$ErrorActionPreference = 'Continue'`: PowerShell exited `0`, `$LASTEXITCODE = 37`, 3 lines captured (`135` bytes), `boot_trace.py` exited `0` (`d3d12.calls = 3`). - `$ErrorActionPreference = 'Stop'`: PowerShell aborted (`exit 1`) on the first stderr line, no log was written (`0` lines), `boot_trace.py` exited `2`. - **PR #668 pipeline** (`& { $ErrorActionPreference = 'Continue'; ... 2>&1 } | ForEach-Object { $_.ToString() } | Out-File ...`): - Under `'Continue'`: PowerShell exited `0`, `$LASTEXITCODE = 37`, `$ErrorActionPreference` remained `Continue`, 3 lines captured (`135` bytes), `boot_trace.py` exited `0` (`d3d12.calls = 3`). - Under `'Stop'`: PowerShell exited `0`, `$LASTEXITCODE = 37`, outer `$ErrorActionPreference` remained `Stop`, all 3 lines captured (`135` bytes), and `boot_trace.py` exited `0` (`d3d12.calls = 3`). AI-assisted: yes
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
ProjectLeonida/mandy!668
No description provided.