Scripts: smoke.ps1 reads the log of a run it killed on timeout #1260

Open
vladbondarenko97 wants to merge 1 commit from upstream-pr/1270 into main
vladbondarenko97 commented 2026-11-24 14:03:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vladbondarenko97 on 2026-11-24T14:03:35Z.


xcl run prints Log: only when it ends (launcher.rs). So when smoke.ps1 kills a run on its timeout (-Seconds + 120 s), the line is never there, and the script throws XCL printed no log path instead of printing the block with exit: killed (no exit). That branch of the script could not be reached. A title hits it when it stops responding after an unhandled exception: on an RTX 3080 Ti the retail title did this at the world load (0xc0000005 at +0x2215c35, then no exit for 20 min), so the run that most needed a block got none.

On a timeout, the log is now taken from the data: folder that the launcher prints at its start (<data>\logs\xcl.log, as Config::logs_dir). A run that ends by itself without Log: still throws, as before.

This does not overlap #1073 (it ends the process tree so the timeout returns at all) and complements it: with #1073, a timed-out run still has no Log: line.

What is in it

  • scripts/smoke.ps1: on a timeout, fall back to <data>\logs\xcl.log when Log: is missing.
  • scripts/smoke-timeout-log.tests.ps1: runs a private copy of smoke.ps1 with a 3 s deadline against a compiled stand-in that prints XCL's start lines and hangs, then checks the block (exit: killed (no exit), presents, peak commit from the synthetic log). No game files or GPU needed.

Tested

  • RTX 3080 Ti 12 GB (driver 32.0.16.1060), i7-12700KF, Windows 11 Pro 26300, rustc 1.100.0, debug, Windows PowerShell 5.1. Tree: this branch = main 930e8b4 + this commit.
  • scripts\smoke-timeout-log.tests.ps1 against main's smoke.ps1: fails with XCL printed no log path; its output: XCL 0.0.0 - starting 'synthetic' (exit 1). Against this branch: smoke timeout log: 1 passed (exit 0).
  • The same two runs under PowerShell 7.7.0 (pwsh -NoProfile -File scripts\smoke-timeout-log.tests.ps1): main fails with XCL printed no log path (exit 1); this branch: smoke timeout log: 1 passed (exit 0).
  • cargo build --workspace then cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored; SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).

Regression run
Not needed: scripts only.

Not tested

  • AMD.
  • Together with #1073 applied: the two touch different lines; not run as a stack.

AI use

  • Claude Code with Claude Opus 5.5: found the cause from a real run, wrote the change, the test and this description, and ran the tests on my machine. I reviewed the diff.
<!-- greyfinch-sync:ivall/xcl:issue:5473645811 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1270). Originally posted by [vladbondarenko97](https://github.com/vladbondarenko97) on 2026-11-24T14:03:35Z. --- `xcl run` prints `Log:` only when it ends (`launcher.rs`). So when `smoke.ps1` kills a run on its timeout (`-Seconds` + 120 s), the line is never there, and the script throws `XCL printed no log path` instead of printing the block with `exit: killed (no exit)`. That branch of the script could not be reached. A title hits it when it stops responding after an unhandled exception: on an RTX 3080 Ti the retail title did this at the world load (`0xc0000005` at `+0x2215c35`, then no exit for 20 min), so the run that most needed a block got none. On a timeout, the log is now taken from the `data:` folder that the launcher prints at its start (`<data>\logs\xcl.log`, as `Config::logs_dir`). A run that ends by itself without `Log:` still throws, as before. This does not overlap #1073 (it ends the process tree so the timeout returns at all) and complements it: with #1073, a timed-out run still has no `Log:` line. **What is in it** - `scripts/smoke.ps1`: on a timeout, fall back to `<data>\logs\xcl.log` when `Log:` is missing. - `scripts/smoke-timeout-log.tests.ps1`: runs a private copy of `smoke.ps1` with a 3 s deadline against a compiled stand-in that prints XCL's start lines and hangs, then checks the block (`exit: killed (no exit)`, presents, peak commit from the synthetic log). No game files or GPU needed. **Tested** - RTX 3080 Ti 12 GB (driver 32.0.16.1060), i7-12700KF, Windows 11 Pro 26300, rustc 1.100.0, debug, Windows PowerShell 5.1. Tree: this branch = `main` `930e8b4` + this commit. - `scripts\smoke-timeout-log.tests.ps1` against `main`'s `smoke.ps1`: **fails** with `XCL printed no log path; its output: XCL 0.0.0 - starting 'synthetic'` (exit 1). Against this branch: `smoke timeout log: 1 passed` (exit 0). - The same two runs under **PowerShell 7.7.0** (`pwsh -NoProfile -File scripts\smoke-timeout-log.tests.ps1`): `main` fails with `XCL printed no log path` (exit 1); this branch: `smoke timeout log: 1 passed` (exit 0). - `cargo build --workspace` then `cargo test --workspace -- --test-threads=4`: **751 passed, 0 failed, 41 ignored**; SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). **Regression run** Not needed: scripts only. **Not tested** - AMD. - Together with #1073 applied: the two touch different lines; not run as a stack. **AI use** - Claude Code with Claude Opus 5.5: found the cause from a real run, wrote the change, the test and this description, and ran the tests on my machine. I reviewed the diff.
DavidM1911 commented 2026-11-24 15:05:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T14:07:40Z.


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

  • scripts/smoke-timeout-log.tests.ps1: 1 passed, 0 failed.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7133882391 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1270#issuecomment-7133882391). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T14:07:40Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - scripts/smoke-timeout-log.tests.ps1: 1 passed, 0 failed. Thanks!
RavenCurseBurg commented 2026-11-25 15:08:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T15:06:32Z.


Tested the script combination listed under Not tested. On 5e4d91a7fe2c1bf2aa7c04bbafbe098f2e3ebbb3, scripts/smoke-timeout-log.tests.ps1 passed independently in Windows PowerShell 5.1.26100.9711 and PowerShell 7.6.9. I then applied only the scripts/smoke.ps1 diff from #1073 (a95661e6fc) to a temporary copy. It applied cleanly. Both upstream scripts, smoke-timeout-log.tests.ps1 and smoke-timeout.tests.ps1, passed against the combined script in each shell, including the normal, timeout, failed termination and open-pipe cases.

For the combined failure mode, I adapted #1073’s synthetic fixture to print only the startup data: line, write a 2,345 MB marker in logs/xcl.log, then wait on a child that inherits the output pipes. With the fixture’s five-second deadline, the smoke block reported exit: killed (no exit) and peak commit: 2345 MB. The fixture checked that both recorded PIDs had exited. This passed in each shell under normal Windows process permissions. An initial restricted-session run reached the fixture’s open-pipe assertion, so these results do not establish cleanup in that restricted environment.

Windows 11 26100.9711, i7-13700, RTX 4060. This was a two-script integration test with shortened deadlines, no retail run or Rust/GPU suite. OpenAI Codex (GPT-6) assembled the stack, ran both fixtures and wrote the report.

<!-- greyfinch-sync:ivall/xcl:comment:7166314948 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1270#issuecomment-7166314948). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T15:06:32Z. --- Tested the script combination listed under **Not tested**. On `5e4d91a7fe2c1bf2aa7c04bbafbe098f2e3ebbb3`, `scripts/smoke-timeout-log.tests.ps1` passed independently in Windows PowerShell 5.1.26100.9711 and PowerShell 7.6.9. I then applied only the `scripts/smoke.ps1` diff from #1073 (`a95661e6fc`) to a temporary copy. It applied cleanly. Both upstream scripts, `smoke-timeout-log.tests.ps1` and `smoke-timeout.tests.ps1`, passed against the combined script in each shell, including the normal, timeout, failed termination and open-pipe cases. For the combined failure mode, I adapted #1073’s synthetic fixture to print only the startup `data:` line, write a 2,345 MB marker in `logs/xcl.log`, then wait on a child that inherits the output pipes. With the fixture’s five-second deadline, the smoke block reported `exit: killed (no exit)` and `peak commit: 2345 MB`. The fixture checked that both recorded PIDs had exited. This passed in each shell under normal Windows process permissions. An initial restricted-session run reached the fixture’s open-pipe assertion, so these results do not establish cleanup in that restricted environment. Windows 11 26100.9711, i7-13700, RTX 4060. This was a two-script integration test with shortened deadlines, no retail run or Rust/GPU suite. OpenAI Codex (GPT-6) assembled the stack, ran both fixtures and wrote the report.
github-actions[bot] commented 2026-11-29 20:42:40 +00:00 (Migrated from github.com)

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


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:7262296604 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1270#issuecomment-7262296604). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:42:40Z. --- 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 05:17:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:17:31Z.


Triage (#1607) – head 5e4d91a

#1073 also changes the timeout path of scripts/smoke.ps1, but it kills the launcher's process tree; this PR finds the log from the data: line when Log: is missing. The two are complementary, not duplicates (the shared lines are test-fixture boilerplate).
scripts/smoke-timeout-log.tests.ps1 looks for ($Seconds + 120) * 1000, which main replaced with ($Seconds + $StartupTimeoutSeconds) * 1000 (5bec5877); after a rebase the test throws 'Smoke timeout expression changed'.
With a real xcl run, the title is a child process that inherits the output pipes, so after $p.Kill() the read of stdout can still hang until the title exits; the log fallback is only reached once that is fixed too (#1073).
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:7301617035 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1270#issuecomment-7301617035). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:17:31Z. --- **Triage (#1607)** – head 5e4d91a #1073 also changes the timeout path of scripts/smoke.ps1, but it kills the launcher's process tree; this PR finds the log from the `data:` line when `Log:` is missing. The two are complementary, not duplicates (the shared lines are test-fixture boilerplate). scripts/smoke-timeout-log.tests.ps1 looks for `($Seconds + 120) * 1000`, which main replaced with `($Seconds + $StartupTimeoutSeconds) * 1000` (5bec5877); after a rebase the test throws 'Smoke timeout expression changed'. With a real `xcl run`, the title is a child process that inherits the output pipes, so after `$p.Kill()` the read of stdout can still hang until the title exits; the log fallback is only reached once that is fixed too (#1073). 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/1270:upstream-pr/1270'
git switch 'upstream-pr/1270'

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