Scripts: keep smoke settings out of the calling shell #2704

Closed
luckyteagirl wants to merge 2 commits from upstream-pr/2714 into main
luckyteagirl commented 2026-11-26 08:05:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T08:05:50Z.


scripts/smoke.ps1 currently changes the calling PowerShell session: it leaves XCL_NETWORK=0 and removes any pre-existing XCL_RUN_SECONDS and XCL_ACTIVITY after a run. Set these three overrides on the launched XCL process instead, so repeated or interactive smoke runs do not change the caller's settings.

What is in it

  • scripts/smoke.ps1: put the three run settings in ProcessStartInfo.EnvironmentVariables.
  • scripts/test-smoke-artifacts.tests.ps1: check that the mock child receives 0,5,1 while the caller retains its original settings. This assertion failed on the parent commit before the fix.
  • README.md: document the launcher's environment scope.

Tested

  • Follow-up fixture cleanup: same-process absent, seeded, and present-empty environment values restored on PowerShell 5.1 and 7.6.9; both smoke fixtures passed in each shell.
  • Windows 11 Home build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M (driver 30.0.13002.13003), Rust 1.99.0 MSVC; PowerShell 5.1.26100 and 7.6.9.
  • powershell.exe -NoProfile -File .\scripts\test-smoke-artifacts.tests.ps1: passed.
  • pwsh.exe -NoProfile -File .\scripts\test-smoke-artifacts.tests.ps1: passed.
  • powershell.exe -NoProfile -File .\scripts\smoke-title.tests.ps1: passed.
  • pwsh.exe -NoProfile -File .\scripts\smoke-title.tests.ps1: passed.
  • .\scripts\test.ps1: workspace build passed; the unfiltered xcl --lib run aborted with 0xc0000005 in the known RX 6800M DXIL test path, so it produced no complete suite count. A subsequent run with --skip gpu::dxil::core_tests::raw_loads_in_root_windows_respect_exec_and_bounds completed its library harness with 1111 passed, 197 failed, 27 ignored, 1 filtered out; many failures reported an unavailable D3D12 device and a suspect driver state after the abort. These runs do not establish a passing GPU suite.

Not tested

  • A passing full GPU suite or retail-title smoke after the driver failure. No runtime source changed.

AI use

  • RavenCurseBurg supplied the fixture cleanup in commit 9f48d39f, assisted by OpenAI Codex (GPT-6) for implementation and Windows CPU verification.
  • OpenAI Codex (GPT-6.2 Sol) reproduced the caller-environment bug, implemented the patch and test, and ran the focused PowerShell checks. OpenAI Codex (GPT-6.2 Astra) reviewed the diff and ran the workspace attempt.
<!-- greyfinch-sync:ivall/xcl:issue:5506280388 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2714). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T08:05:50Z. --- `scripts/smoke.ps1` currently changes the calling PowerShell session: it leaves `XCL_NETWORK=0` and removes any pre-existing `XCL_RUN_SECONDS` and `XCL_ACTIVITY` after a run. Set these three overrides on the launched XCL process instead, so repeated or interactive smoke runs do not change the caller's settings. **What is in it** - `scripts/smoke.ps1`: put the three run settings in `ProcessStartInfo.EnvironmentVariables`. - `scripts/test-smoke-artifacts.tests.ps1`: check that the mock child receives `0,5,1` while the caller retains its original settings. This assertion failed on the parent commit before the fix. - `README.md`: document the launcher's environment scope. **Tested** - Follow-up fixture cleanup: same-process absent, seeded, and present-empty environment values restored on PowerShell 5.1 and 7.6.9; both smoke fixtures passed in each shell. - Windows 11 Home build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M (driver 30.0.13002.13003), Rust 1.99.0 MSVC; PowerShell 5.1.26100 and 7.6.9. - `powershell.exe -NoProfile -File .\scripts\test-smoke-artifacts.tests.ps1`: passed. - `pwsh.exe -NoProfile -File .\scripts\test-smoke-artifacts.tests.ps1`: passed. - `powershell.exe -NoProfile -File .\scripts\smoke-title.tests.ps1`: passed. - `pwsh.exe -NoProfile -File .\scripts\smoke-title.tests.ps1`: passed. - `.\scripts\test.ps1`: workspace build passed; the unfiltered `xcl --lib` run aborted with `0xc0000005` in the known RX 6800M DXIL test path, so it produced no complete suite count. A subsequent run with `--skip gpu::dxil::core_tests::raw_loads_in_root_windows_respect_exec_and_bounds` completed its library harness with **1111 passed, 197 failed, 27 ignored, 1 filtered out**; many failures reported an unavailable D3D12 device and a suspect driver state after the abort. These runs do not establish a passing GPU suite. **Not tested** - A passing full GPU suite or retail-title smoke after the driver failure. No runtime source changed. **AI use** - RavenCurseBurg supplied the fixture cleanup in commit `9f48d39f`, assisted by OpenAI Codex (GPT-6) for implementation and Windows CPU verification. - OpenAI Codex (GPT-6.2 Sol) reproduced the caller-environment bug, implemented the patch and test, and ran the focused PowerShell checks. OpenAI Codex (GPT-6.2 Astra) reviewed the diff and ran the workspace attempt.
RavenCurseBurg commented 2026-11-26 08:42:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T08:42:10Z.


On e07279eb34ae634f863b88d15f9b99fd85953067, the caller kept its original environment across a successful launch, a process-start failure and a child that returned without a log path. I checked absent and pre-existing values in both shells, plus present-but-empty values in PowerShell 7 (15 cases). On runs that started a child, its actual environment contained XCL_NETWORK=0, XCL_RUN_SECONDS=3 and XCL_ACTIVITY=1.

The artifact test fixture itself had a separate caller-visible effect. In PowerShell 7.6.9 I removed all three variables, invoked scripts/test-smoke-artifacts.tests.ps1 in that same process, then read them back. Its assertions passed, but cleanup recreated all three as empty strings. On 5.1 they stayed absent. The fixture cleanup fix explicitly removes previously absent entries and restores saved strings. All five restoration cases passed on the candidate (absent/seeded on both shells and empty on 7). The smoke launcher is unchanged by this commit. I also exercised the debug-switch interaction on the #2039 rebase.

Windows PowerShell 5.1 and PowerShell 7.6.9 on Windows 11. OpenAI Codex (GPT-6) prepared and ran the fixtures. Synthetic logs, reports and immediately exiting launchers only; no game, GPU workload or workspace build.

Retest on 9f48d39fc42d957cd7bd01e648afab93c78012d2

The head now includes the fixture cleanup commit tested above. I reran scripts/test-smoke-artifacts.tests.ps1 in the same shell and read back all three caller settings after each run. All five restoration cases passed: absent and seeded values on Windows PowerShell 5.1 and PowerShell 7, plus present-empty values on PowerShell 7. The checked-in fixture also verified the child received 0,5,1.

OpenAI Codex (GPT-6) ran the synthetic fixtures on Windows 11. No retail title, GPU workload or Rust workspace build was used.

<!-- greyfinch-sync:ivall/xcl:comment:7186914657 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2714#issuecomment-7186914657). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T08:42:10Z. --- On `e07279eb34ae634f863b88d15f9b99fd85953067`, the caller kept its original environment across a successful launch, a process-start failure and a child that returned without a log path. I checked absent and pre-existing values in both shells, plus present-but-empty values in PowerShell 7 (15 cases). On runs that started a child, its actual environment contained `XCL_NETWORK=0`, `XCL_RUN_SECONDS=3` and `XCL_ACTIVITY=1`. The artifact **test fixture itself** had a separate caller-visible effect. In PowerShell 7.6.9 I removed all three variables, invoked `scripts/test-smoke-artifacts.tests.ps1` in that same process, then read them back. Its assertions passed, but cleanup recreated all three as empty strings. On 5.1 they stayed absent. The [fixture cleanup fix](https://github.com/RavenCurseBurg/xcl/commit/9f48d39fc42d957cd7bd01e648afab93c78012d2) explicitly removes previously absent entries and restores saved strings. All five restoration cases passed on the candidate (absent/seeded on both shells and empty on 7). The smoke launcher is unchanged by this commit. I also exercised the debug-switch interaction on the [#2039 rebase](https://github.com/RavenCurseBurg/xcl/commit/c53c23fe9c41acc0795265d1641c2ec71498f721). Windows PowerShell 5.1 and PowerShell 7.6.9 on Windows 11. OpenAI Codex (GPT-6) prepared and ran the fixtures. Synthetic logs, reports and immediately exiting launchers only; no game, GPU workload or workspace build. **Retest on `9f48d39fc42d957cd7bd01e648afab93c78012d2`** The head now includes the fixture cleanup commit tested above. I reran `scripts/test-smoke-artifacts.tests.ps1` in the same shell and read back all three caller settings after each run. All five restoration cases passed: absent and seeded values on Windows PowerShell 5.1 and PowerShell 7, plus present-empty values on PowerShell 7. The checked-in fixture also verified the child received `0,5,1`. OpenAI Codex (GPT-6) ran the synthetic fixtures on Windows 11. No retail title, GPU workload or Rust workspace build was used.
Foniass commented 2026-12-01 08:47:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:47:29Z.


Triage (#1607) – head 9f48d39

Main already has this change. Commit 50f2961 (#3460) moved XCL_NETWORK, XCL_RUN_SECONDS and XCL_ACTIVITY in scripts/smoke.ps1 to $psi.EnvironmentVariables and removed the Remove-Item Env:.... That is the same change as here. It also extended test-smoke-artifacts.tests.ps1 to check both the child values and the caller's values. #521 fixes the same problem by saving and restoring $env: around Start().
Only the README sentence is not on main.
Recommendation: close (superseded by main commit 50f2961 / #3460).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305788870 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2714#issuecomment-7305788870). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:47:29Z. --- **Triage (#1607)** – head 9f48d39 Main already has this change. Commit `50f2961` (#3460) moved `XCL_NETWORK`, `XCL_RUN_SECONDS` and `XCL_ACTIVITY` in `scripts/smoke.ps1` to `$psi.EnvironmentVariables` and removed the `Remove-Item Env:...`. That is the same change as here. It also extended `test-smoke-artifacts.tests.ps1` to check both the child values and the caller's values. #521 fixes the same problem by saving and restoring `$env:` around `Start()`. Only the README sentence is not on main. Recommendation: close (superseded by main commit 50f2961 / #3460). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:59:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:59:00Z.


Closing as superseded: this change is already on main (50f2961). main smoke.ps1 sets XCL_NETWORK/XCL_RUN_SECONDS/XCL_ACTIVITY on $psi.EnvironmentVariables (lines 57-61, 50f2961 #3460), no Remove-Item of the caller's env; only README sentence differs

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311930850 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2714#issuecomment-7311930850). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:59:00Z. --- Closing as superseded: this change is already on `main` (50f2961). main smoke.ps1 sets XCL_NETWORK/XCL_RUN_SECONDS/XCL_ACTIVITY on $psi.EnvironmentVariables (lines 57-61, 50f2961 #3460), no Remove-Item of the caller's env; only README sentence differs Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

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
xcl-dev/xcl!2704
No description provided.