Skip to content

Scripts: smoke.ps1 finds xcl.exe without -Xcl when started with -File - #593

Open
SpaghettiMaster545 wants to merge 1 commit into
xcl-dev:mainfrom
SpaghettiMaster545:scripts-smoke-default-xcl
Open

SpaghettiMaster545 wants to merge 1 commit into
xcl-dev:mainfrom
SpaghettiMaster545:scripts-smoke-default-xcl

Conversation

@SpaghettiMaster545

@SpaghettiMaster545 SpaghettiMaster545 commented Nov 24, 2026 •

Copy link
Copy Markdown

scripts/smoke.ps1 started with powershell -File (or dot-sourced) under Windows PowerShell 5.1 stopped before doing anything when -Xcl was left out:

Join-Path : Cannot bind argument to parameter 'Path' because it is an empty string.

Windows PowerShell 5.1 leaves $PSScriptRoot empty in the parameter defaults of a script that has [Parameter()] attributes when the script is started with -File, and the default was -Xcl (Join-Path $PSScriptRoot '..\target\release\xcl.exe'). Started with & from an open PowerShell session it works, so the usage line in the script's header was not affected. #451's description mentions the same problem ("Windows PowerShell 5.1 does not set $PSScriptRoot in the parameter default, hence -Xcl"), and the tests in #282 and #521 pass -Xcl explicitly.

I searched open and closed PRs and issues for "PSScriptRoot", "smoke.ps1 PowerShell 5.1" and "smoke.ps1 -Xcl". #318 (merged) fixed the other Windows PowerShell 5.1 problems of this script (New-TemporaryFile, Start-Process), not this one.

What is in it

  • scripts/smoke.ps1: -Xcl has no default in param(); the script sets it right after, where $PSScriptRoot is always set. Nothing else changes.
  • scripts/smoke-default-xcl.tests.ps1: runs a copy of smoke.ps1 outside the repository through -File without -Xcl and checks that it looks for target\release\xcl.exe next to its own folder (the copy finds no xcl.exe, so nothing runs). It compares the child's error text without whitespace, ANSI escapes and the | that PowerShell 7 puts before wrapped error lines (reported by @fladit123 and @Alpha325 in review).

Tested

  • AMD Ryzen 7 9800X3D, NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.2124), Windows 11 10.0.26100, Windows PowerShell 5.1.26100.9818, Rust 1.100.0, debug.
  • powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\smoke-default-xcl.tests.ps1 on this PR's head (0a5f23c): exit 0. With scripts/smoke.ps1 put back to 9ce2070's, the same test fails with the Join-Path error above (exit 1), so it still catches the bug.
  • PowerShell 7: the first version of the test failed there on its formatting although the fix works (7.6.10 and 7.6.9, in the review). The normalisation in 0a5f23c is the one @fladit123 and @Alpha325 checked on those versions; I could not run PowerShell 7 here.
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4 at 3766ff0: 684 passed, 0 failed, 41 ignored (lib 644 / 0 / 21). 0a5f23c changes only the .ps1 test since.
  • SKIPPED on this adapter: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).
  • powershell.exe -NoProfile -File <repo>\scripts\smoke.ps1 -Game <retail title> -Seconds 30 without -Xcl, release build of this PR (at ed85053, before the rebase onto 9ce2070, which changed only Rust files): the script found target\release\xcl.exe and printed its xcl-smoke block (590 frames shown, 0 crashes, 0 device removals). On main the same command stops at the Join-Path error.

Not tested

  • PowerShell 7 myself (the PowerShell 7 results above are the reviewers').
  • No regression run: the change is to a script only, not to crates/xcl/src.

AI use

  • Claude Code with Claude Opus 5.5: found the cause, wrote the change, the test and this description, and ran the commands above.

🤖 Generated with Claude Code

@futurepro62

Copy link
Copy Markdown

Tested exact head 3766ff0.

Tested

  • Windows 11 Home 26300, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 on this machine).
  • powershell -NoProfile -File scripts/smoke-default-xcl.tests.ps1 on 3766ff0: passed (exit 0).
  • Control: the same test file against scripts/smoke.ps1 of the parent commit 9ce2070: fails (exit 1) with a Join-Path error (ParameterArgumentValidationErrorEmptyStringNotAllowed): the default xcl.exe path is built from an empty string when started with -File. So the test catches what the PR fixes.
  • scripts/test-native-stderr.tests.ps1 on 3766ff0: 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.

@NAbobo101

Copy link
Copy Markdown

Ran this end to end with a retail title, on the exact head 3766ff0f392d7ededab642bfd3a5c8926995d22e (it merges cleanly onto main dd2ae9a).

I ran into the bug myself before finding this PR. I was making regression runs for another change, and on main dd2ae9a this command stopped right away:

powershell -NoProfile -File scripts/smoke.ps1 -Game <title folder>

Join-Path : Cannot bind argument to parameter 'Path' because it is an empty string.

(My Windows is in Portuguese, so that's the English wording of the same error.) It's line 11, the -Xcl default. Passing -Xcl by hand worked around it.

Tested

  • Windows 11 Pro 26300, Windows PowerShell 5.1.26100.9818, RTX 5060 (driver 621.14), Rust 1.100.0 MSVC. Built with cargo build --release -p xcl on the PR head.
  • powershell -NoProfile -File scripts/smoke-default-xcl.tests.ps1 passes (exit 0).
  • The same smoke.ps1 command as above, still without -Xcl and with -Seconds 15, now finds target\release\xcl.exe, runs the title and prints its block:
xcl-smoke v1
commit: 3766ff0f392d7ededab642bfd3a5c8926995d22e
gpu: NVIDIA GeForce RTX 5060
title: GTA6.Xbox.v1.0.2.1
seconds: 15
exit: 0x0
frames shown: 222 (PresentX 222)
presents per 2 s (last 3): 60 30 60
device removals: 0
crashes: 0
peak commit: 8850 MB

Not tested

  • PowerShell 7.
  • Starting the script with & from an open session. That path didn't change.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands and drafted this comment. I checked the results.

@fladit123

Copy link
Copy Markdown

Found a small issue with the regression test on PowerShell 7.6.10. The actual smoke.ps1 fix works, but the test fails because PowerShell 7 inserts formatting characters into the exception output.

Tested

  • Windows 11 Pro build 26300
  • Windows PowerShell 5.1 and PowerShell 7.6.10
  • Base: 9ce2070eccf436d7bd38601c90407da447df34f3
  • PR head: 3766ff0f392d7ededab642bfd3a5c8926995d22e

Running pwsh -NoProfile -NonInteractive -File scripts/smoke-default-xcl.tests.ps1 on the unmodified PR returns exit 1, even though the correct executable path appears in the output.

Suggested fix

In smoke-default-xcl.tests.ps1, replace:

$flat = $output -replace '\s', ''

with:

$flat = $output -replace '\x1b\[[0-?]*[ -/]*[@-~]', '' -replace '[\s|]', ''

I validated this change using temporary copies of the scripts:

Configuration PS 5.1 PS 7.6.10
Unmodified PR PASS FAIL
Base with normalized test FAIL PASS
PR with normalized test PASS PASS

The baseline still fails with the expected Join-Path empty-string error on PS 5.1. The proposed normalization preserves detection of the original bug while fixing the false negative

@Alpha325

Copy link
Copy Markdown

I also hit the fixture’s formatting failure on PowerShell 7.6.9. To check executable selection separately, I ran smoke.ps1 with -File from an unrelated working directory and put distinguishable stub executables at both the default path and the explicit override path. The checkout and override paths contained spaces.

Revision PowerShell Omitted -Xcl Explicit -Xcl
Base 9ce2070 5.1.26100.9818 Join-Path empty-path error, exit 1 Override stub, exit 0
PR 3766ff0 5.1.26100.9818 Default stub, exit 0 Override stub, exit 0
Base 9ce2070 7.6.9 Default stub, exit 0 Override stub, exit 0
PR 3766ff0 7.6.9 Default stub, exit 0 Override stub, exit 0

The default stub reported 7 synthetic frames and the override reported 11, so each successful run confirmed which executable launched. The original fixture passed on 5.1 and failed on 7.6.9. Stripping the leading | prefixes from wrapped error lines made it pass on both, and the patched fixture still caught the original 5.1 failure against the base script.

Scope: Windows 11 build 26200, synthetic executables only. AI use: OpenAI Codex (GPT-6) wrote and ran the probe and drafted this report.

@SpaghettiMaster545

Copy link
Copy Markdown
Author

Thanks @fladit123 and @Alpha325: you're right, the fix worked on PowerShell 7 but the test's comparison did not. 0a5f23c (folded into the PR's one commit) takes your normalisation: the child's output is compared without whitespace, ANSI escapes and the | before wrapped error lines, and the expected text without whitespace and |.

On Windows PowerShell 5.1 here, the test passes on 0a5f23c, and with scripts/smoke.ps1 put back to 9ce2070's it still fails with the Join-Path error. I could not run PowerShell 7 on this machine, so for 7.x the PR relies on your two checks; the description says so.

(Claude Code, Claude Opus 5.5.)

@fladit123 fladit123 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for incorporating the normalization!

Retested the exact updated head 0a5f23c3b5ddc331ea941e19ccfaae30b9eb529a on Windows 11 Pro build 26300.

Test PowerShell 5.1 PowerShell 7.6.10
smoke-default-xcl.tests.ps1 PASS PASS
test-native-stderr.tests.ps1 PASS PASS

All four commands returned exit code 0. The worktree remained clean.

The previously reported PowerShell 7 fixture failure is resolved. I reviewed the updated normalization and have no remaining blocking findings within the tested scope.

No Rust workspace or retail tests were rerun for this revision.

AI use: ChatGPT (GPT-6.2) assisted with review, test planning and reporting. All tests were executed locally by me.

@SpaghettiMaster545

Copy link
Copy Markdown
Author

The required CI workflow on this PR is waiting for maintainer approval (action_required, my first PR from a fork), so only PR checks has run. The suite counts under Tested come from my own GPU run.

@tiagonleal

Copy link
Copy Markdown
Contributor

Tested #593 (0a5f23c) and #629 (7728d19) on Windows PowerShell 5.1 (powershell.exe, Windows 11 Pro 26300), each smoke.ps1 started with -File and no -Xcl from a checkout without a release build:

smoke.ps1 from result
main 47efa2e Join-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
#593 no …\scripts\..\target\release\xcl.exe - build it first (…)
#629 the same as #593

#593's scripts/smoke-default-xcl.tests.ps1 on 5.1: exits 1 with main's smoke.ps1, 0 with #593's. The smoke.ps1 change is the same in both PRs (#593 was opened first and adds the test).

Not tested: PowerShell 7; a full smoke run through either default (I pass -Xcl for those).

AI-assisted (Claude Code).

@omeyasawant

Copy link
Copy Markdown

Independent Windows PowerShell 5.1 check of this fix at 0a5f23c3b5ddc331ea941e19ccfaae30b9eb529a.

Tested

  • Windows 11 Pro 10.0.26200, Windows PowerShell 5.1 (powershell.exe), i7-14700K / RTX 5090.
  • Main b9b6ea62080cc62fc19e212033372d01c6214e5c: invoking smoke.ps1 via powershell.exe -NoProfile -ExecutionPolicy Bypass -File, without -Xcl, fails at the parameter default with Join-Path: Cannot bind argument to parameter Path because it is an empty string.
  • This PR: powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/smoke-default-xcl.tests.ps1 exits 0.
  • Main's explicit -Xcl workaround runs the smoke harness successfully. No runtime source changes were made for this check.

Not tested
PowerShell 7, or this PR's complete workspace (this check is limited to the script regression). Main's full workspace was tested separately and reported in #42.

AI use
OpenAI Codex executed these checks and drafted the report at the account owner's request; exact runtime model identifier unavailable.

@throny throny added off-goal Does not bear on the current goal (world loading); waits until it is reached and removed off-goal Does not bear on the current goal (world loading); waits until it is reached labels Nov 25, 2026
@JJAutoCompare

Copy link
Copy Markdown

Empirical test report (0a5f23c)

Hardware / environment

  • Commit 0a5f23c3b5ddc331ea941e19ccfaae30b9eb529a, detached and clean.
  • AMD Ryzen 7 3800X 8-Core Processor, Windows 11 Enterprise Evaluation build 26200, Windows PowerShell 5.1.26100.9818.
  • Script-only run outside the Arc test wrapper. Temporary fixtures used deliberately invalid executables to stop at the launch attempt.

Commands and results

  • [System.Management.Automation.Language.Parser]::ParseFile($source, [ref]$tokens, [ref]$errors) on the checked-out smoke script returned 0 parse errors.
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts\smoke.ps1 -Game . from the fixture root reported the missing default.
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File ..\scripts\smoke.ps1 -Game . reported the missing default with a decoy in the caller's directory and reached process launch when the script-relative default existed.
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File ..\scripts\smoke.ps1 -Game . -Xcl .\custom.exe reached process launch with the default absent.
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File ..\scripts\smoke.ps1 -Game . -Xcl .\missing.exe reported the missing override with the default present.
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File baseline\scripts\smoke.ps1 -Game . reproduced the empty Join-Path argument on merge base 9ce2070e.
  • All six child invocations exited 1 as expected. Harness exit 0. 7 passed, 0 failed, including the parse check.

Observed behavior

Omitting -Xcl selects the release executable relative to the script directory across working directories. Explicit -Xcl takes precedence. Windows rejected both invalid executables at process start.

Not tested

Real game smoke run and Rust workspace GPU tests.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr593-focused.log and published.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

Windows PowerShell 5.1 leaves $PSScriptRoot empty in the parameter
defaults of a script that has [Parameter()] attributes when the script is
started with `powershell -File` (or dot-sourced), so the default
`-Xcl (Join-Path $PSScriptRoot ...)` failed with "Cannot bind argument to
parameter 'Path' because it is an empty string" before the script did
anything. Started with `&` from an open PowerShell session it works, which
is why it went unnoticed.

The default is now set in the script's body, where $PSScriptRoot is set
in every case. scripts/smoke-default-xcl.tests.ps1 runs a copy of the
script outside the repository through -File without -Xcl and checks that
it looks for target\release\xcl.exe next to its own folder. It compares
the child's error text without whitespace, ANSI escapes and the `|` that
PowerShell 7 puts before wrapped error lines (found by fladit123 and
Alpha325 on PowerShell 7.6.10 and 7.6.9 in the PR's review).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SpaghettiMaster545

Copy link
Copy Markdown
Author

Rebased onto main 1a0bbe3 (now f35fc87). The conflict was in smoke.ps1's param(): main added -Title and -OutDir next to -Xcl (9683e7a, 9c8c048). Both are kept, and -Xcl still has no default there; it is set after param() as before. main's smoke.ps1 still has the Join-Path default, so the bug is still on main.

Tested on f35fc87 (Windows 11 10.0.26100, Windows PowerShell 5.1.26100.9818, RTX 5070 Ti):

  • powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\smoke-default-xcl.tests.ps1: exit 0.
  • The same test with main's (1a0bbe3) smoke.ps1 in place: exit 1, with Join-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
  • scripts\test-native-stderr.tests.ps1: exit 0.

Not tested: PowerShell 7, a smoke run on a title after the rebase, and the Rust suite (the PR changes no Rust).

AI use: Claude Code did the rebase, ran the checks above and drafted this comment.

@RavenCurseBurg

RavenCurseBurg commented Nov 25, 2026 •

Copy link
Copy Markdown

Verified the rebased head f35fc877abc7e35928f6018d2688082b4d81065e on Windows 11 build 26100.9711 (i7-13700, RTX 4060). In Windows PowerShell 5.1.26100.9711 and PowerShell 7.6.9, <shell> -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\smoke-default-xcl.tests.ps1 exited 0.

I also started smoke.ps1 by absolute path from an unrelated directory with -Game SyntheticFolder -Title fixture -OutDir <unused-path>. In each shell, omitting -Xcl produced the missing-executable diagnostic for the release path relative to the script. Passing an explicit, missing -Xcl path containing a space reported that exact path. All four invocations exited 1 as expected before launching a process.

Scope was path selection in the scripts. No XCL build, GPU workload or game run. OpenAI Codex (GPT-6) ran the checks and wrote this report.

@SpaghettiMaster545

Copy link
Copy Markdown
Author

@DavidM1911 the merge conflict you hit is resolved: the branch is rebased onto main (head f35fc87, details in the comment above) and GitHub shows it as mergeable with today's main too, so it's ready for your RTX 3060 Ti check.

AI use: drafted with Claude Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.