Scripts: terminate the title process tree when a smoke run times out #1065

Open
storrmzz wants to merge 1 commit from upstream-pr/1073 into main
storrmzz commented 2026-11-24 11:18:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by storrmzz on 2026-11-24T11:18:41Z.


When a smoke run times out, killing only the launcher leaves the title child alive with inherited output pipes. The subsequent ReadToEndAsync result can then wait indefinitely. Terminate the process tree with Windows taskkill /T /F and bound the post-timeout waits; report a termination failure instead of hanging.

What is in it

  • scripts/smoke.ps1: terminate the title's process tree on timeout, compatible with Windows PowerShell 5.1.
  • scripts/smoke-timeout.tests.ps1: synthetic native parent/child processes exercise normal exit, timeout cleanup, failed termination and unclosed pipes. A private script copy shortens the deadline to five seconds.
  • CI runs the regression under PowerShell 5.1 and 7; README documents it.

Tested

Current validation (2026-11-30)

  • Head a042f77c5f10dd5fb46479f5a24bef205823ad38, rebased onto main 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b without conflicts. No Rust or runtime changes in this PR.
  • GitHub CI: all three jobs passed, including Build and test (Windows, no GPU) and both PowerShell smoke-timeout jobs. Runner GPU/sample skips are not retail coverage.
  • CI command ./scripts/test.ps1 --nocapture --skip test_title_runs_and_game_folder_is_untouched: 2885 passed, 0 failed, 51 ignored across 43 Cargo test/doc-test targets, plus 73 benchmark self-checks passed, with 289 distinct explicit SKIPPED messages. The synthetic title e2e exclusion is the existing upstream CI configuration, unchanged here.
  • Locally reran scripts/smoke-timeout.tests.ps1 with -NoProfile -ExecutionPolicy Bypass -File under powershell.exe and pwsh: each 4 passed, 0 failed, 0 skipped. scripts/smoke-title.tests.ps1 and scripts/test-smoke-artifacts.tests.ps1 also passed in both shells. git diff --check passed. No new local full Rust suite run for this scripts/CI-only update.
  • Prior CI attempt built successfully and passed both shell jobs, but its parallel Rust library tests aborted with 0xc0000005 (STATUS_ACCESS_VIOLATION), so that suite was incomplete. The rebased head has the same file tree as that attempt's tested merge 9654f79; the successful repeat did not reproduce the crash. The initial crash remains unexplained, not claimed fixed by the rebase. Main's own CI run also passed.

CI workflow correction (2026-11-30)

  • Previous head 67b9599e41ed8a3f4eb0c860864925c696c2b33a. GitHub rejected the preceding workflow before starting any jobs: Unrecognized named-value: 'matrix' at the step's shell field. Use literal powershell / pwsh shells on conditional steps, retaining both matrix jobs.
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/smoke-timeout.tests.ps1 and the same command with pwsh: each 4 passed, 0 failed, 0 skipped. git diff --check: passed.
  • Only CI configuration changed since the previous tested revision. No new local Rust build/full-suite run; the GitHub CI result is reported by the check, not assumed successful here.

Rebase validation (2026-11-29)

  • Previous head 3bd548315b106e76bc5b2b149679f444d2cbfdfe, rebased onto main d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0. Same Windows PC/toolchain as below.
  • Preserved main's configurable StartupTimeoutSeconds, artifact output and newer README test/benchmark documentation; retained process-tree termination and adjusted the timeout fixture to the configurable deadline.
  • powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/smoke-timeout.tests.ps1: 4 passed, no failures or skips. Same command with pwsh.exe: 4 passed, no failures or skips.
  • scripts/smoke-title.tests.ps1 and scripts/test-smoke-artifacts.tests.ps1: both passed under Windows PowerShell 5.1 and PowerShell 7 (all four invocations exit 0).
  • git diff --check: passed. Full Rust workspace suite not rerun for this script-only rebase.

Earlier revision results (historical; not the rebased head)

  • Commit a95661e6fc063b139a59a6ff0d0c3eadef399001. Windows 11 build 26300, Ryzen 7 8840HS, Radeon 780M (driver 32.0.31033.3); rustc 1.100.0 MSVC, debug, Windows SDK 10.0.26100.0 / DXC 1.9.2602.17.
  • cargo build --locked --workspace --jobs 2: passed.
  • cargo test --locked --workspace --no-fail-fast --jobs 2 -- --test-threads=4: 741 passed, 0 failed, 41 ignored; 0 SKIPPED GPU tests. Includes the synthetic title e2e run.
  • powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/smoke-timeout.tests.ps1: 4 passed (5.1.26100.9818). Same command with pwsh: 4 passed (7.6.9).
  • The regression against the original smoke script at 384f7f7: normal exit passes, timeout fails in both shells because the script never returns. Fixture processes are cleaned up.
  • python -B -m unittest discover -s scripts -p 'test_*.py' -v: 9 passed; existing native-stderr script test passes in both shells; git diff --check passes.

Regression run
No runtime changes: scripts, CI and README only.

Not tested
Retail titles and optional XCL_SAMPLE_* inputs (all unset), the 41 ignored diagnostic tests, other GPUs, and Wine. File-dependent tests that return early without samples are not retail coverage.

AI use
This PR was created with AI assistance from OpenAI Codex (GPT-6).

<!-- greyfinch-sync:ivall/xcl:issue:5471133204 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1073). Originally posted by [storrmzz](https://github.com/storrmzz) on 2026-11-24T11:18:41Z. --- When a smoke run times out, killing only the launcher leaves the title child alive with inherited output pipes. The subsequent ReadToEndAsync result can then wait indefinitely. Terminate the process tree with Windows taskkill /T /F and bound the post-timeout waits; report a termination failure instead of hanging. **What is in it** - `scripts/smoke.ps1`: terminate the title's process tree on timeout, compatible with Windows PowerShell 5.1. - `scripts/smoke-timeout.tests.ps1`: synthetic native parent/child processes exercise normal exit, timeout cleanup, failed termination and unclosed pipes. A private script copy shortens the deadline to five seconds. - CI runs the regression under PowerShell 5.1 and 7; README documents it. **Tested** **Current validation (2026-11-30)** - Head `a042f77c5f10dd5fb46479f5a24bef205823ad38`, rebased onto main `9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b` without conflicts. No Rust or runtime changes in this PR. - [GitHub CI](https://github.com/xcl-dev/xcl/actions/runs/46404814580): all three jobs passed, including `Build and test (Windows, no GPU)` and both PowerShell smoke-timeout jobs. Runner GPU/sample skips are not retail coverage. - CI command `./scripts/test.ps1 --nocapture --skip test_title_runs_and_game_folder_is_untouched`: 2885 passed, 0 failed, 51 ignored across 43 Cargo test/doc-test targets, plus 73 benchmark self-checks passed, with 289 distinct explicit SKIPPED messages. The synthetic title e2e exclusion is the existing upstream CI configuration, unchanged here. - Locally reran `scripts/smoke-timeout.tests.ps1` with `-NoProfile -ExecutionPolicy Bypass -File` under `powershell.exe` and `pwsh`: each 4 passed, 0 failed, 0 skipped. `scripts/smoke-title.tests.ps1` and `scripts/test-smoke-artifacts.tests.ps1` also passed in both shells. `git diff --check` passed. No new local full Rust suite run for this scripts/CI-only update. - Prior [CI attempt](https://github.com/xcl-dev/xcl/actions/runs/46402437914) built successfully and passed both shell jobs, but its parallel Rust library tests aborted with `0xc0000005` (`STATUS_ACCESS_VIOLATION`), so that suite was incomplete. The rebased head has the same file tree as that attempt's tested merge `9654f79`; the successful repeat did not reproduce the crash. The initial crash remains unexplained, not claimed fixed by the rebase. Main's own [CI run](https://github.com/xcl-dev/xcl/actions/runs/46389693219) also passed. **CI workflow correction (2026-11-30)** - Previous head `67b9599e41ed8a3f4eb0c860864925c696c2b33a`. GitHub rejected the preceding workflow before starting any jobs: `Unrecognized named-value: 'matrix'` at the step's `shell` field. Use literal `powershell` / `pwsh` shells on conditional steps, retaining both matrix jobs. - `powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/smoke-timeout.tests.ps1` and the same command with `pwsh`: each 4 passed, 0 failed, 0 skipped. `git diff --check`: passed. - Only CI configuration changed since the previous tested revision. No new local Rust build/full-suite run; the GitHub CI result is reported by the check, not assumed successful here. **Rebase validation (2026-11-29)** - Previous head `3bd548315b106e76bc5b2b149679f444d2cbfdfe`, rebased onto main `d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0`. Same Windows PC/toolchain as below. - Preserved main's configurable `StartupTimeoutSeconds`, artifact output and newer README test/benchmark documentation; retained process-tree termination and adjusted the timeout fixture to the configurable deadline. - `powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/smoke-timeout.tests.ps1`: 4 passed, no failures or skips. Same command with `pwsh.exe`: 4 passed, no failures or skips. - `scripts/smoke-title.tests.ps1` and `scripts/test-smoke-artifacts.tests.ps1`: both passed under Windows PowerShell 5.1 and PowerShell 7 (all four invocations exit 0). - `git diff --check`: passed. Full Rust workspace suite not rerun for this script-only rebase. **Earlier revision results (historical; not the rebased head)** - Commit `a95661e6fc063b139a59a6ff0d0c3eadef399001`. Windows 11 build 26300, Ryzen 7 8840HS, Radeon 780M (driver 32.0.31033.3); rustc 1.100.0 MSVC, debug, Windows SDK 10.0.26100.0 / DXC 1.9.2602.17. - `cargo build --locked --workspace --jobs 2`: passed. - `cargo test --locked --workspace --no-fail-fast --jobs 2 -- --test-threads=4`: **741 passed, 0 failed, 41 ignored; 0 SKIPPED GPU tests**. Includes the synthetic title e2e run. - `powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/smoke-timeout.tests.ps1`: 4 passed (5.1.26100.9818). Same command with `pwsh`: 4 passed (7.6.9). - The regression against the original smoke script at `384f7f7`: normal exit passes, timeout fails in both shells because the script never returns. Fixture processes are cleaned up. - `python -B -m unittest discover -s scripts -p 'test_*.py' -v`: 9 passed; existing native-stderr script test passes in both shells; `git diff --check` passes. **Regression run** No runtime changes: scripts, CI and README only. **Not tested** Retail titles and optional `XCL_SAMPLE_*` inputs (all unset), the 41 ignored diagnostic tests, other GPUs, and Wine. File-dependent tests that return early without samples are not retail coverage. **AI use** This PR was created with AI assistance from OpenAI Codex (GPT-6).
futurepro62 commented 2026-11-24 15:05:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:15:16Z.


Tested exact head a95661e, script tests only, since this PR has no test report yet.

Tested

  • Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here).
  • powershell.exe -NoProfile -File scripts/smoke-timeout.tests.ps1 at the head: exit 0, PASS normal, PASS timeout, PASS failure, PASS open-pipes (31 s).
  • The PR's test file(s) against current main's script (930e8b4): exit 1: PASS normal, then timeout: smoke.ps1 did not return after the deadline., so the test reproduces the hang on main's smoke.ps1. So the new test catches the problem the PR fixes.

Not tested

  • PowerShell 7, the CI workflow itself, a game (no runtime code changed).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7134079262 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1073#issuecomment-7134079262). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T14:15:16Z. --- Tested exact head `a95661e`, script tests only, since this PR has no test report yet. **Tested** - Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here). - `powershell.exe -NoProfile -File scripts/smoke-timeout.tests.ps1` at the head: exit 0, `PASS normal`, `PASS timeout`, `PASS failure`, `PASS open-pipes` (31 s). - The PR's test file(s) against current main's script (`930e8b4`): exit 1: `PASS normal`, then `timeout: smoke.ps1 did not return after the deadline.`, so the test reproduces the hang on main's `smoke.ps1`. So the new test catches the problem the PR fixes. **Not tested** - PowerShell 7, the CI workflow itself, a game (no runtime code changed). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-25 09:08:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:51:26Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7157557998 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1073#issuecomment-7157557998). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T08:51:26Z. --- 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!
github-actions[bot] commented 2026-11-29 07:40:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:40:46Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252622439 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1073#issuecomment-7252622439). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:40:46Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 04:45:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:45:32Z.


Triage (#1607) – head a042f77

#1270 also changes the timeout path of scripts/smoke.ps1, but it reads the log of the killed run; this PR kills the launcher's whole process tree (taskkill /T) so the inherited output pipes close. The two are complementary, not duplicates. #1080 rewrites the same WaitForExit(($Seconds + $StartupTimeoutSeconds) * 1000) line, and smoke-timeout.tests.ps1 looks for that exact expression, so whichever merges second needs a rebase and a fixture update.
No problems found in the diff.
Recommendation: keep open.

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:7301069742 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1073#issuecomment-7301069742). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:45:32Z. --- **Triage (#1607)** – head a042f77 #1270 also changes the timeout path of scripts/smoke.ps1, but it reads the log of the killed run; this PR kills the launcher's whole process tree (taskkill /T) so the inherited output pipes close. The two are complementary, not duplicates. #1080 rewrites the same `WaitForExit(($Seconds + $StartupTimeoutSeconds) * 1000)` line, and smoke-timeout.tests.ps1 looks for that exact expression, so whichever merges second needs a rebase and a fixture update. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1073:upstream-pr/1073'
git switch 'upstream-pr/1073'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1073'
git switch 'upstream-pr/1073'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1073'
git switch 'upstream-pr/1073'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1073'
git switch 'main'
git merge --squash 'upstream-pr/1073'
git switch 'main'
git merge --ff-only 'upstream-pr/1073'
git switch 'main'
git merge 'upstream-pr/1073'
git push origin 'main'
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!1065
No description provided.