Scripts: preserve the calling shell environment after smoke runs #521

Open
github-bot wants to merge 1 commit from github-bot/gh-521 into main AGit
Owner

@⁠wileyGray on GitHub · 2026-11-24 01:14 UTC · original
wileyGray:codex/smoke-child-environment → main · +55 −5 · 2 files · 1 commits · open

Running scripts/smoke.ps1 left networking disabled for later XCL runs in the same PowerShell session and erased the caller's time limit and activity setting. The child now inherits the smoke settings and the calling shell gets its original values back as soon as the child starts, including when launch fails.

What is in it

  • scripts/smoke.ps1 restores the three XCL_* values in finally around Process.Start. scripts/smoke-environment.tests.ps1 checks the child environment, set and absent parent variables, and a failed launch.

Tested

  • Windows build 26300, i9-14900K, RTX 4080 SUPER (32.0.16.2114) and Intel UHD 770 (32.0.101.7088). The script fixture launches a .cmd stand-in.
  • powershell.exe -NoProfile -NonInteractive -File scripts/smoke-environment.tests.ps1 and the same command with pwsh.exe. All three cases passed on Windows PowerShell 5.1.26100.9818 and PowerShell 7.6.9. The same test on base 7ebf1b8 failed on both because XCL_NETWORK was overwritten.
  • scripts/test-native-stderr.tests.ps1 also passed under both shells.
  • Debug build at 9bb6aa2 with Rust 1.93.0 MSVC and DXC 1.9.2609.5. cargo build --locked --workspace --offline passed. cargo test --workspace -- --test-threads=4 reported 677 passed, 0 failed, 41 ignored. Two GPU tests reported SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.

Not tested

  • Retail titles, optional game samples (XCL_SAMPLE_* unset), and the D3D12 debug layer (unavailable).

AI use

  • Codex (gpt-6.2-astra) wrote the fix, regression test and description and ran the script checks.
**@⁠wileyGray** on GitHub · 2026-11-24 01:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/521) `wileyGray:codex/smoke-child-environment` → `main` · +55 −5 · 2 files · 1 commits · open Running `scripts/smoke.ps1` left networking disabled for later XCL runs in the same PowerShell session and erased the caller's time limit and activity setting. The child now inherits the smoke settings and the calling shell gets its original values back as soon as the child starts, including when launch fails. **What is in it** - `scripts/smoke.ps1` restores the three `XCL_*` values in `finally` around `Process.Start`. `scripts/smoke-environment.tests.ps1` checks the child environment, set and absent parent variables, and a failed launch. **Tested** - Windows build 26300, i9-14900K, RTX 4080 SUPER (32.0.16.2114) and Intel UHD 770 (32.0.101.7088). The script fixture launches a `.cmd` stand-in. - `powershell.exe -NoProfile -NonInteractive -File scripts/smoke-environment.tests.ps1` and the same command with `pwsh.exe`. All three cases passed on Windows PowerShell 5.1.26100.9818 and PowerShell 7.6.9. The same test on base `7ebf1b8` failed on both because `XCL_NETWORK` was overwritten. - `scripts/test-native-stderr.tests.ps1` also passed under both shells. - Debug build at `9bb6aa2` with Rust 1.93.0 MSVC and DXC 1.9.2609.5. `cargo build --locked --workspace --offline` passed. `cargo test --workspace -- --test-threads=4` reported 677 passed, 0 failed, 41 ignored. Two GPU tests reported SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. **Not tested** - Retail titles, optional game samples (`XCL_SAMPLE_*` unset), and the D3D12 debug layer (unavailable). **AI use** - Codex (gpt-6.2-astra) wrote the fix, regression test and description and ran the script checks.
Save and restore the three XCL settings around Process.Start so the child inherits the smoke configuration even when the caller already has its own values. Cover set and absent variables and a failed launch.

Assisted-by: Codex (GPT-6.2 Astra)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:24:26 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 02:32 UTC · original

Tested exact head 9bb6aa2.

Tested

  • Windows 11 Home 26300, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 on this machine).
  • powershell -NoProfile -File scripts/smoke-environment.tests.ps1 on 9bb6aa2: passed (exit 0).
  • Control: the same test file against scripts/smoke.ps1 of the parent commit 7ebf1b8: fails (exit 1) with The smoke run changed XCL_NETWORK in the calling shell.. So the test catches what the PR fixes.
  • scripts/test-native-stderr.tests.ps1 on 9bb6aa2: passed.

Not tested

  • PowerShell 7 (pwsh), a real scripts/smoke.ps1 run on a title (no title on this machine), the Rust suite (the PR changes no Rust).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and the control and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 02:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/521#issuecomment-7120241165) Tested exact head `9bb6aa2`. **Tested** - Windows 11 Home 26300, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 on this machine). - `powershell -NoProfile -File scripts/smoke-environment.tests.ps1` on `9bb6aa2`: passed (exit 0). - Control: the same test file against `scripts/smoke.ps1` of the parent commit `7ebf1b8`: fails (exit 1) with `The smoke run changed XCL_NETWORK in the calling shell.`. So the test catches what the PR fixes. - `scripts/test-native-stderr.tests.ps1` on `9bb6aa2`: passed. **Not tested** - PowerShell 7 (`pwsh`), a real `scripts/smoke.ps1` run on a title (no title on this machine), the Rust suite (the PR changes no Rust). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and the control and wrote this report. I checked it before posting.
Author
Owner

@⁠2968412091-ui on GitHub · 2026-11-24 03:35 UTC · original

Independent PowerShell 7 check on Windows x64 build 26200. I ran scripts/smoke-environment.tests.ps1 from 9bb6aa2e using -NoProfile -File.

smoke.ps1 revision Shell Result
main 91f9a5e9 PowerShell 7.6.9 Exit 1: The smoke run changed XCL_NETWORK in the calling shell.
PR 9bb6aa2e PowerShell 7.6.9 Exit 0
PR 9bb6aa2e Windows PowerShell 5.1.26100.9818 Exit 0

The synthetic fixture checked the child environment and restoration of the parent environment, including a failed launch. No GPU, retail title, or Rust workspace tests were run for this report.

AI use: Codex (GPT-6.2-astra) ran the tests and prepared this report.

**@⁠2968412091-ui** on GitHub · 2026-11-24 03:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/521#issuecomment-7121232583) Independent PowerShell 7 check on Windows x64 build 26200. I ran `scripts/smoke-environment.tests.ps1` from `9bb6aa2e` using `-NoProfile -File`. | smoke.ps1 revision | Shell | Result | |---|---|---| | main `91f9a5e9` | PowerShell 7.6.9 | Exit 1: `The smoke run changed XCL_NETWORK in the calling shell.` | | PR `9bb6aa2e` | PowerShell 7.6.9 | Exit 0 | | PR `9bb6aa2e` | Windows PowerShell 5.1.26100.9818 | Exit 0 | The synthetic fixture checked the child environment and restoration of the parent environment, including a failed launch. No GPU, retail title, or Rust workspace tests were run for this report. AI use: Codex (GPT-6.2-astra) ran the tests and prepared this report.
Author
Owner

@⁠Alpha325 on GitHub · 2026-11-25 02:51 UTC · original

I tested 9bb6aa2efcfcb80b58187da5dc9f39a8df3a9a74 against its parent 7ebf1b8 on Windows PowerShell 5.1.26100.9818 and PowerShell 7.6.9.

A synthetic child recorded XCL_NETWORK, XCL_RUN_SECONDS, and XCL_ACTIVITY, then waited for a release file. While it was still waiting, the child had the smoke settings (0 2 1) and the parent had its original settings (17 23 29). On the parent commit, the calling shell still exposed 0 2 1 at that same point. Both shells reproduced the difference.

I also temporarily deferred restoration until the child exited on the PR. On PowerShell 7.6.9, the bundled fixture still passed, while the new fixture failed as expected. I restored smoke.ps1 after that control.

AI use — OpenAI Codex (GPT-6) wrote and ran the synthetic fixture and drafted this report.

**@⁠Alpha325** on GitHub · 2026-11-25 02:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/521#issuecomment-7151281863) I tested `9bb6aa2efcfcb80b58187da5dc9f39a8df3a9a74` against its parent `7ebf1b8` on Windows PowerShell 5.1.26100.9818 and PowerShell 7.6.9. A synthetic child recorded `XCL_NETWORK`, `XCL_RUN_SECONDS`, and `XCL_ACTIVITY`, then waited for a release file. While it was still waiting, the child had the smoke settings (`0 2 1`) and the parent had its original settings (`17 23 29`). On the parent commit, the calling shell still exposed `0 2 1` at that same point. Both shells reproduced the difference. I also temporarily deferred restoration until the child exited on the PR. On PowerShell 7.6.9, the bundled fixture still passed, while the new fixture failed as expected. I restored `smoke.ps1` after that control. AI use — OpenAI Codex (GPT-6) wrote and ran the synthetic fixture and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 13:53 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 13:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/521#issuecomment-7164443111) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 20:36 UTC · original · edited 2026-11-25 20:46 UTC

Tested on 9bb6aa2efcfcb80b58187da5dc9f39a8df3a9a74, Windows 11 build 26100.9711, Core i7-13700. A native fixture initialized a Windows environment variable to the empty string with SetEnvironmentVariableW. I rotated the empty, absent and non-ASCII values through XCL_NETWORK, XCL_RUN_SECONDS and XCL_ACTIVITY. For each rotation I ran scripts/smoke.ps1 -Seconds 2 once with a working fixture executable and once with a directory as -Xcl to make Process.Start fail. I compared the Windows environment block before and after.

Calling shell Empty value after the call Absent and non-ASCII values
Windows PowerShell 5.1 Became absent in all 6 cases Preserved
PowerShell 7.6.9 Preserved in all 6 cases Preserved

Every successful child saw 0 / 2 / 1. Invoking the script in a separate PowerShell process preserved all three values in the outer caller for every case on both editions. I added that verified invocation to the script help. Both shells also passed -NoProfile -ExecutionPolicy Bypass -File scripts/smoke-environment.tests.ps1.

Not tested — A retail launch, GPU execution, or the Rust workspace. OpenAI Codex (GPT-6) prepared and ran the fixtures, wrote the help text, and prepared this report.

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 20:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/521#issuecomment-7173928019) · edited 2026-11-25 20:46 UTC **Tested** on `9bb6aa2efcfcb80b58187da5dc9f39a8df3a9a74`, Windows 11 build 26100.9711, Core i7-13700. A native fixture initialized a Windows environment variable to the empty string with `SetEnvironmentVariableW`. I rotated the empty, absent and non-ASCII values through `XCL_NETWORK`, `XCL_RUN_SECONDS` and `XCL_ACTIVITY`. For each rotation I ran `scripts/smoke.ps1 -Seconds 2` once with a working fixture executable and once with a directory as `-Xcl` to make `Process.Start` fail. I compared the Windows environment block before and after. | Calling shell | Empty value after the call | Absent and non-ASCII values | |---|---|---| | Windows PowerShell 5.1 | Became absent in all 6 cases | Preserved | | PowerShell 7.6.9 | Preserved in all 6 cases | Preserved | Every successful child saw `0 / 2 / 1`. Invoking the script in a separate PowerShell process preserved all three values in the outer caller for every case on both editions. I added that verified invocation to the [script help](https://github.com/RavenCurseBurg/xcl/commit/0232b8d6d4a7c2f2d5981e146b422eaabed26d03). Both shells also passed `-NoProfile -ExecutionPolicy Bypass -File scripts/smoke-environment.tests.ps1`. **Not tested** — A retail launch, GPU execution, or the Rust workspace. OpenAI Codex (GPT-6) prepared and ran the fixtures, wrote the help text, and prepared this report.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/521/head:github-bot/gh-521'
git switch 'github-bot/gh-521'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-521'
git switch 'github-bot/gh-521'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-521'
git switch 'github-bot/gh-521'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-521'
git switch 'main'
git merge --squash 'github-bot/gh-521'
git switch 'main'
git merge --ff-only 'github-bot/gh-521'
git switch 'main'
git merge 'github-bot/gh-521'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.