Scripts: restore caller directory and list XCL_SAMPLE_FSPX in test.ps1 #2142
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by HumanlyDev on 2026-11-25T06:24:47Z.
Restore 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.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T07:04:48Z.
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!
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T11:03:22Z.
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).Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T13:05:33Z.
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.Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:28:32Z.
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.Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-28T04:29:36Z.
The benchmark smoke step on main now overlaps this PR’s directory-restoration change. I prepared a current-main integration candidate on
e429936c, including the earlier literal-path fix for bracketed checkout directories.On Windows PowerShell 5.1 and PowerShell 7, the previous fixture returned 127 when it reached the new benchmark command. On the candidate, both shells passed the fake-Cargo fixture for success, build failure (42) and benchmark failure (43). The fixture checks that Cargo receives the benchmark smoke arguments, that a failed benchmark stops the tests and that the caller gets its working directory back. Both shells also rejected controls that removed literal-path handling or omitted the benchmark’s
--testargument.I ran
scripts/test-native-stderr.tests.ps1andgit diff --check. No Rust build, GPU or game run. AI use — OpenAI Codex (GPT-6) prepared the integration and ran the checks.Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-28T21:14:09Z.
Closing as a duplicate of #776 (confirmed by 2+ contributors in #1607, group D145). Thanks for the contribution — feel free to comment if this covers something #776 does not.
Pull request closed