Scripts: restore caller directory and list XCL_SAMPLE_FSPX in test.ps1 #2152
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2152
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2152"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@HumanlyDev on GitHub · 2026-11-25 06:24 UTC · original
HumanlyDev:scripts/test-ps1-cwd-and-fspx→main· +66 −30 · 2 files · 1 commits · openRestore the caller's working directory on exit (including build/test failures) and list
XCL_SAMPLE_FSPXin the skipped-samples notice inscripts/test.ps1, with unit test coverage inscripts/test-native-stderr.tests.ps1. Non-runtime change underscripts/.What is in it
scripts/test.ps1:'XCL_SAMPLE_FSPX'to the$missingsample-variable list (matchingcrates/xcl/src/gpu/recomp/tests.rsgating onXCL_SAMPLE_FSPX).Set-LocationwithPush-Location (Join-Path $PSScriptRoot '..'); try { ... } finally { Pop-Location }so runningscripts/test.ps1from any directory restores the caller's location on both success and failure.scripts/test-native-stderr.tests.ps1:test.ps1restores the caller's working directory on both a passing run and a failingcargo build(XCL_TEST_CARGO_FAIL=1), and printsXCL_SAMPLE_FSPXin the skipped-samples notice when unset.Tested
32.0.16.1088), AMD Ryzen 5 7600, Windows 11 Pro10.0.26200(build26200), Windows PowerShell 5.1,rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.8.2502.11.powershell -ExecutionPolicy Bypass -File .\scripts\test-native-stderr.tests.ps1: passed (exit code0, all assertions ok)..\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4, RTX 4060, debug): 1154 passed, 0 failed, 46 ignored across 21 targets (25 SKIPPED GPU checks: 20no wave64, 3per-lane form#1426refusals, 1no heap windows, 1cannot disable the driver cache (Windows Developer Mode is required)).Regression run
scripts/(no runtime files undercrates/xcl/src/modified).Not tested
XCL_SAMPLE_*sample runs (no game/sample files on this machine), PowerShell 7 (pwsh) on CI, AMD RDNA3/4, Linux / Wine.AI use
scripts/test.ps1, implemented thePush-Location/Pop-LocationandXCL_SAMPLE_FSPXfixes and tests, ran the verification scripts, and drafted this PR description.@DavidM1911 on GitHub · 2026-11-25 07:04 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!
@raylitebull on GitHub · 2026-11-25 11:03 UTC · original
Code review on
18e9f70(scripts/test.ps1,scripts/test-native-stderr.tests.ps1):scripts/test.ps1inPush-Location ... / try { ... } finally { Pop-Location }ensures caller working directory is restored on both pass and non-zerocargo buildexits,XCL_SAMPLE_FSPXis included in$missing, and both CI checks are green.Remaining before merge: Independent PowerShell 5.1/7 verification of
scripts/test-native-stderr.tests.ps1on18e9f70(the prior--librun did not execute the PowerShell test).@raylitebull on GitHub · 2026-11-25 18:28 UTC · original
Review note on
18e9f70:@RavenCurseBurgcaught a genuine edge case on bracketed checkout directories (Push-Location -LiteralPath (Join-Path $PSScriptRoot '..')needed instead of barePush-Location). Fixing that and getting fresh PowerShell 5.1/7 + dual-vendor verification will unblock merge.@RavenCurseBurg on GitHub · 2026-11-25 13:05 UTC · original · edited 2026-11-25 18:43 UTC
Following the bracketed-checkout feedback, here is a standalone fix and regression test directly on this PR's
18e9f70. The mock Cargo prints its actual working directory with bothcheckout [a]andcheckout apresent. On the original runner, the new assertion failed in both Windows PowerShell 5.1.26100.9711 and PowerShell 7.6.9. WithPush-Location -LiteralPath,scripts/test-native-stderr.tests.ps1passed in both, including the existing caller restoration, exit 42 and sample-notice assertions. Tested with a synthetic Cargo process on Windows 11; no dual-vendor GPU run. OpenAI Codex (GPT-6) adapted the previous fix to this head and ran the checks.Tested
18e9f7065726ac12879e5f6919da64b5415cbd18on Windows 11 24H2, build 26100.9711 (i7-13700). This used a temporary mock Cargo executable.Tested
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/test-native-stderr.tests.ps1and the same command withpwsh.exeboth exited 0. This covers a successful build/test and a build returning 42, with the caller's directory restored. Versions were Windows PowerShell 5.1.26100.9711 and PowerShell 7.6.9.XCL_SAMPLE_FSPXset. Mock Cargo returned 0 for build and 17 for test. Both shells propagated 17, restored the caller's directory, forwarded an extra test argument, and omitted FSPX from the missing-samples list.Not tested
Rust compilation, GPU tests or retail sample files.
AI use
OpenAI Codex (GPT-6) ran the fixture, wrote and ran the additional process-exit check, and drafted this report.
Follow-up on
18e9f7065726ac12879e5f6919da64b5415cbd18: bracketed checkout names. My earlier fixture checked restoration from a plain checkout. With the runner undercheckout [A]\scriptsand a siblingcheckout A\scripts, native Cargo logged the sibling as its working directory, even though the caller's location was correctly restored. I ran the same eight cases in each shell (plain/bracketed path, success/build failure/test failure/missing Cargo). The three bracketed cases that invoked Cargo picked the wrong directory. Changing the existing call toPush-Location -LiteralPath (Join-Path $PSScriptRoot '..')fixed all eight in both shells. Equivalent fix and regression on the related #776 branch. Tested on Windows PowerShell 5.1 and PowerShell 7.6.9 with mock Cargo. OpenAI Codex (GPT-6) ran this follow-up.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.