Scripts: validate smoke duration before launching XCL #1080

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

@⁠broccolize on GitHub · 2026-11-24 11:23 UTC · original
broccolize:tooling/smoke-duration → main · +26 −1 · 2 files · 1 commits · open

An invalid smoke duration can reach process startup before the wait timeout is rejected. Validate the duration at parameter binding so XCL starts only with a timeout that fits the Windows process wait API.

What is in it

  • Require a positive -Seconds value and account for the 120-second shutdown grace period. The rebase preserves upstream's -Title parameter.
  • Cover negative, zero, and overflowing values, plus the two valid boundaries, without starting an executable.

Tested

  • Clean head c86fa9b055957129961edb23ae86b3c86a1b3794 on main cbc296a. Windows 11 build 26300.9974, Intel i5-10300H, NVIDIA GTX 1650 driver 617.14, Rust 1.100.0 MSVC, debug.
  • scripts/test-smoke-duration.tests.ps1 passed in PowerShell 7.6.9 and Windows PowerShell 5.1.26100.9818.
  • cargo build --locked --workspace passed. cargo test --locked --workspace --no-fail-fast -- --test-threads=4 reported 1,152 passed, 2 failed, and 46 ignored. The 25 SKIPPED diagnostics were 20 for no wave64, three for unsupported per-lane forms, one for heap windows being off, and one because the driver cache could not be disabled.
  • Both failing tests also failed in focused runs on clean main and the PR head: console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk and execute_indirect_reads_the_arguments_written_before_it.

Not tested

  • Retail title smoke runs.

AI use

  • OpenAI Codex (GPT-6) implemented and rebased the change and ran verification.
**@⁠broccolize** on GitHub · 2026-11-24 11:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/1080) `broccolize:tooling/smoke-duration` → `main` · +26 −1 · 2 files · 1 commits · open An invalid smoke duration can reach process startup before the wait timeout is rejected. Validate the duration at parameter binding so XCL starts only with a timeout that fits the Windows process wait API. **What is in it** - Require a positive `-Seconds` value and account for the 120-second shutdown grace period. The rebase preserves upstream's `-Title` parameter. - Cover negative, zero, and overflowing values, plus the two valid boundaries, without starting an executable. **Tested** - Clean head `c86fa9b055957129961edb23ae86b3c86a1b3794` on `main` `cbc296a`. Windows 11 build 26300.9974, Intel i5-10300H, NVIDIA GTX 1650 driver 617.14, Rust 1.100.0 MSVC, debug. - `scripts/test-smoke-duration.tests.ps1` passed in PowerShell 7.6.9 and Windows PowerShell 5.1.26100.9818. - `cargo build --locked --workspace` passed. `cargo test --locked --workspace --no-fail-fast -- --test-threads=4` reported 1,152 passed, 2 failed, and 46 ignored. The 25 `SKIPPED` diagnostics were 20 for no wave64, three for unsupported per-lane forms, one for heap windows being off, and one because the driver cache could not be disabled. - Both failing tests also failed in focused runs on clean `main` and the PR head: `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` and `execute_indirect_reads_the_arguments_written_before_it`. **Not tested** - Retail title smoke runs. **AI use** - OpenAI Codex (GPT-6) implemented and rebased the change and ran verification.
Reject nonpositive durations and timeouts that cannot fit in WaitForExit milliseconds, including the shutdown grace period.

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

@⁠futurepro62 on GitHub · 2026-11-24 14:15 UTC · original

Tested exact head 04fcd86, 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/test-smoke-duration.tests.ps1 at the head: exit 0.
  • The PR's test file(s) against current main's script (930e8b4): exit 1: main's smoke.ps1 does not check the duration first and fails later with no <...>.exe - build it first. 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.
**@⁠futurepro62** on GitHub · 2026-11-24 14:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1080#issuecomment-7134081494) Tested exact head `04fcd86`, 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/test-smoke-duration.tests.ps1` at the head: exit 0. - The PR's test file(s) against current main's script (`930e8b4`): exit 1: main's `smoke.ps1` does not check the duration first and fails later with `no <...>.exe - build it first`. 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 08:36 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 08:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1080#issuecomment-7157255995) 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 14:35 UTC · original · edited 2026-11-26 07:45 UTC

Verified c86fa9b055957129961edb23ae86b3c86a1b3794 through <shell> -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\smoke.ps1 -Game Fixture -Xcl <stub.exe> [-Seconds N]. The native stub recorded its inherited XCL_RUN_SECONDS, printed the fixture log path and exited immediately. Results matched in Windows PowerShell 5.1.26100.9711 and PowerShell 7.6.9:

Duration argument Child observed Smoke script exit
omitted 60 0
1 1 0
2,147,363 2,147,363 0
−1, 0, or 2,147,364 no child launched for any of the three 1

Each valid case also printed the matching seconds: field and exit: 0x0. scripts\test-smoke-duration.tests.ps1 passed in both shells. The upper-bound case exercised the actual process-wait call with a short-lived child. It does not measure an elapsed multi-day timeout.

Windows 11 26100.9711, i7-13700, RTX 4060. No retail run, Rust build or GPU workload. OpenAI Codex (GPT-6) ran the fixture and wrote the report.

Follow-up on review feedback

I checked the zero-duration review against the PR head and the smoke script from main b49be1836844. On Windows PowerShell 5.1 and PowerShell 7, main forwarded XCL_RUN_SECONDS=0 to an immediately exiting native stand-in and printed seconds: 0. The PR head rejected zero before starting the stand-in. The runtime source parses the value as u64 and passes it to Duration::from_secs.

Compatibility candidate keeps the 120-second grace period and the existing upper bound. On both shells, 0, 1 and 2147363 reached the child with their exact values. −1 and 2147364 exited before the child could write its marker. scripts/test-smoke-duration.tests.ps1 also passed in both shells. Actual title startup, GPU shutdown and a long-running child were outside these checks.

Parent of the PR-based candidate: c86fa9b055957129961edb23ae86b3c86a1b3794. OpenAI Codex (GPT-6) prepared the changes and ran the Windows CPU fixtures. No game, Rust workspace build or GPU workload.

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 14:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/1080#issuecomment-7165520206) · edited 2026-11-26 07:45 UTC Verified `c86fa9b055957129961edb23ae86b3c86a1b3794` through `<shell> -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\smoke.ps1 -Game Fixture -Xcl <stub.exe> [-Seconds N]`. The native stub recorded its inherited `XCL_RUN_SECONDS`, printed the fixture log path and exited immediately. Results matched in Windows PowerShell 5.1.26100.9711 and PowerShell 7.6.9: | Duration argument | Child observed | Smoke script exit | | --- | --- | --- | | omitted | 60 | 0 | | 1 | 1 | 0 | | 2,147,363 | 2,147,363 | 0 | | −1, 0, or 2,147,364 | no child launched for any of the three | 1 | Each valid case also printed the matching `seconds:` field and `exit: 0x0`. `scripts\test-smoke-duration.tests.ps1` passed in both shells. The upper-bound case exercised the actual process-wait call with a short-lived child. It does not measure an elapsed multi-day timeout. Windows 11 26100.9711, i7-13700, RTX 4060. No retail run, Rust build or GPU workload. OpenAI Codex (GPT-6) ran the fixture and wrote the report. **Follow-up on review feedback** I checked the zero-duration review against the PR head and the smoke script from main `b49be1836844`. On Windows PowerShell 5.1 and PowerShell 7, main forwarded `XCL_RUN_SECONDS=0` to an immediately exiting native stand-in and printed `seconds: 0`. The PR head rejected zero before starting the stand-in. The runtime source parses the value as `u64` and passes it to `Duration::from_secs`. [Compatibility candidate](https://github.com/RavenCurseBurg/xcl/commit/36050bb04d62915bfa2711f87944951d8644f256) keeps the 120-second grace period and the existing upper bound. On both shells, 0, 1 and 2147363 reached the child with their exact values. −1 and 2147364 exited before the child could write its marker. `scripts/test-smoke-duration.tests.ps1` also passed in both shells. Actual title startup, GPU shutdown and a long-running child were outside these checks. Parent of the PR-based candidate: `c86fa9b055957129961edb23ae86b3c86a1b3794`. OpenAI Codex (GPT-6) prepared the changes and ran the Windows CPU fixtures. No game, Rust workspace build or GPU workload.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 05:44 UTC · original · reviewed

Could the lower bound remain 0? -Seconds 0 currently reaches XCL as XCL_RUN_SECONDS=0; the host accepts that value and immediately writes its run report, flushes the log, and ends the title. With a mock launcher on both Windows PowerShell 5.1 and PowerShell 7, main produced a seconds: 0 smoke block, while this head rejected the parameter before launching. ValidateRange(0, 2147363) keeps the timeout bound and preserves that startup-diagnostic use; the fixture could move zero to the accepted cases. Verified at exact head c86fa9b055957129961edb23ae86b3c86a1b3794 with a mock, not a retail run. AI-assisted review with Codex.

**@⁠luckyteagirl** on GitHub · 2026-11-26 05:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/1080#pullrequestreview-6069115295) · **reviewed** Could the lower bound remain `0`? `-Seconds 0` currently reaches XCL as `XCL_RUN_SECONDS=0`; the host accepts that value and immediately writes its run report, flushes the log, and ends the title. With a mock launcher on both Windows PowerShell 5.1 and PowerShell 7, main produced a `seconds: 0` smoke block, while this head rejected the parameter before launching. `ValidateRange(0, 2147363)` keeps the timeout bound and preserves that startup-diagnostic use; the fixture could move zero to the accepted cases. Verified at exact head `c86fa9b055957129961edb23ae86b3c86a1b3794` with a mock, not a retail run. AI-assisted review with Codex.
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/1080/head:github-bot/gh-1080'
git switch 'github-bot/gh-1080'

Merge

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