Scripts: allow smoke artifacts in source log directory #2641

Open
luckyteagirl wants to merge 1 commit from upstream-pr/2651 into main
luckyteagirl commented 2026-11-26 05:04:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:04:36Z.


smoke.ps1 -OutDir fails when the destination is the title's own log directory: copying xcl.log or report.json onto itself throws before the manifest and smoke report are produced. Normalize the destination directory and leave in-place artifacts where they are.

What is in it

  • Skip copies when the source and destination names resolve to the same ordinary full path, including case variants on standard Windows directories.
  • Add an in-place artifact fixture, including destinations spelled with . and different casing; confirm the original log/report remain intact and the manifest and smoke block are emitted.

Tested

  • On current main b49be183, the original in-place fixture failed with a self-copy error. The case-variant fixture reproduced the reviewer's self-copy failure in Windows PowerShell 5.1 before the follow-up fix. PowerShell 7 normalized the path casing in that fixture. With this patch, scripts/test-smoke-artifacts.tests.ps1 and the existing scripts/smoke-title.tests.ps1 passed in both Windows PowerShell 5.1 and PowerShell 7.
  • git diff --check passed.

Regression run

  • Not applicable. Only the PowerShell smoke helper and its fixture changed; no runtime code changed.

Not tested

  • A retail title smoke pair, GPU/Rust tests, junction aliases, and directories explicitly configured for case-sensitive lookup. An -OutDir junction targeting the log directory can still cause a self-copy; this patch handles ordinary Windows paths.

AI use

  • Codex (GPT-6.2 Sol) implemented and tested the change; Codex independently reviewed it and prepared this description.
<!-- greyfinch-sync:ivall/xcl:issue:5504330951 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2651). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T05:04:36Z. --- `smoke.ps1 -OutDir` fails when the destination is the title's own log directory: copying `xcl.log` or `report.json` onto itself throws before the manifest and smoke report are produced. Normalize the destination directory and leave in-place artifacts where they are. **What is in it** - Skip copies when the source and destination names resolve to the same ordinary full path, including case variants on standard Windows directories. - Add an in-place artifact fixture, including destinations spelled with `.` and different casing; confirm the original log/report remain intact and the manifest and smoke block are emitted. **Tested** - On current main `b49be183`, the original in-place fixture failed with a self-copy error. The case-variant fixture reproduced the reviewer's self-copy failure in Windows PowerShell 5.1 before the follow-up fix. PowerShell 7 normalized the path casing in that fixture. With this patch, `scripts/test-smoke-artifacts.tests.ps1` and the existing `scripts/smoke-title.tests.ps1` passed in both Windows PowerShell 5.1 and PowerShell 7. - `git diff --check` passed. **Regression run** - Not applicable. Only the PowerShell smoke helper and its fixture changed; no runtime code changed. **Not tested** - A retail title smoke pair, GPU/Rust tests, junction aliases, and directories explicitly configured for case-sensitive lookup. An `-OutDir` junction targeting the log directory can still cause a self-copy; this patch handles ordinary Windows paths. **AI use** - Codex (GPT-6.2 Sol) implemented and tested the change; Codex independently reviewed it and prepared this description.
KDenKC commented 2026-11-26 07:03:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-26T06:44:58Z.


Small one at 28e26958: the self-copy guards (smoke.ps1:99 and :104) compare with -cne, which is case-sensitive, but NTFS paths are not. (Get-Item).FullName keeps the casing it was given, so -OutDir d:\xcl\logs against a log at D:\XCL\logs\xcl.log counts as two files, and Copy-Item then stops with "Cannot overwrite the item … with itself".

Reproduced on Windows 11 (Windows PowerShell 5.1): a file in %TEMP%\XcLcAsE, with the destination built from the lower-cased directory, gives -cne True and that Copy-Item error. -ne (case-insensitive, like the file system) avoids it.

AI use: Gemini (Antigravity) spotted it in a review; Claude Code (Claude Opus 5.5) reproduced it and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7184742453 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2651#issuecomment-7184742453). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-26T06:44:58Z. --- Small one at `28e26958`: the self-copy guards (`smoke.ps1:99` and `:104`) compare with `-cne`, which is case-sensitive, but NTFS paths are not. `(Get-Item).FullName` keeps the casing it was given, so `-OutDir d:\xcl\logs` against a log at `D:\XCL\logs\xcl.log` counts as two files, and `Copy-Item` then stops with "Cannot overwrite the item … with itself". Reproduced on Windows 11 (Windows PowerShell 5.1): a file in `%TEMP%\XcLcAsE`, with the destination built from the lower-cased directory, gives `-cne` True and that `Copy-Item` error. `-ne` (case-insensitive, like the file system) avoids it. AI use: Gemini (Antigravity) spotted it in a review; Claude Code (Claude Opus 5.5) reproduced it and wrote this.
luckyteagirl commented 2026-11-26 09:07:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T08:34:54Z.


Thanks for the reproducible case. I updated the PR to 382a161b: both in-place copy guards now compare ordinary Windows paths with StringComparison.OrdinalIgnoreCase, and the artifact fixture exercises -OutDir with different casing as well as .. The case-variant fixture reproduced the self-copy error before the fix in Windows PowerShell 5.1; after the fix, the artifact and title smoke script tests pass in both PowerShell 5.1 and 7. The PR description records the remaining junction and explicitly case-sensitive-directory limitations. Windows no-GPU CI is rerunning on the updated head.

AI use: GPT-6.2 Sol implemented and tested the follow-up; GPT-6.2 Astra reviewed the diff and report.

<!-- greyfinch-sync:ivall/xcl:comment:7186768111 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2651#issuecomment-7186768111). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T08:34:54Z. --- Thanks for the reproducible case. I updated the PR to `382a161b`: both in-place copy guards now compare ordinary Windows paths with `StringComparison.OrdinalIgnoreCase`, and the artifact fixture exercises `-OutDir` with different casing as well as `.`. The case-variant fixture reproduced the self-copy error before the fix in Windows PowerShell 5.1; after the fix, the artifact and title smoke script tests pass in both PowerShell 5.1 and 7. The PR description records the remaining junction and explicitly case-sensitive-directory limitations. Windows no-GPU CI is rerunning on the updated head. AI use: GPT-6.2 Sol implemented and tested the follow-up; GPT-6.2 Astra reviewed the diff and report.
KDenKC commented 2026-11-26 16:31:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-26T16:31:51Z.


Checked at 382a161b: both self-copy guards now compare with [StringComparison]::OrdinalIgnoreCase (smoke.ps1:99, :104). Thanks @luckyteagirl.

AI use: Claude Code (Claude Opus 5.5) checked the source at that head and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7197766226 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2651#issuecomment-7197766226). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-26T16:31:51Z. --- Checked at `382a161b`: both self-copy guards now compare with `[StringComparison]::OrdinalIgnoreCase` (`smoke.ps1:99`, `:104`). Thanks @luckyteagirl. AI use: Claude Code (Claude Opus 5.5) checked the source at that head and wrote this.
github-actions[bot] commented 2026-12-01 02:35:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:35:14Z.


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:7298775939 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2651#issuecomment-7298775939). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:35:14Z. --- 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 08:34:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:34:22Z.


Triage (#1607) – head 382a161

#2716 (same author, draft) is stacked on this PR: it carries this commit plus literal-path lookups. That is not a duplicate. No other open or merged PR makes this change.
No problems found in the diff: smoke.ps1 skips copying xcl.log / report.json onto themselves when -OutDir is their own folder, and the test covers run\. and a case variant.
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:7305494923 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2651#issuecomment-7305494923). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:34:22Z. --- **Triage (#1607)** – head 382a161 #2716 (same author, draft) is stacked on this PR: it carries this commit plus literal-path lookups. That is not a duplicate. No other open or merged PR makes this change. No problems found in the diff: `smoke.ps1` skips copying `xcl.log` / `report.json` onto themselves when `-OutDir` is their own folder, and the test covers `run\.` and a case variant. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Decodere commented 2026-12-02 09:14:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:14:10Z.


merge-check
base: 1c8b551475
head: 382a161b3e
merge: clean (git merge --no-edit onto 1c8b5514, git diff --check clean; scripts/smoke.ps1 +9/-3, scripts/test-smoke-artifacts.tests.ps1 +16/-1)
build: not run (Tier 0 PowerShell script diff touching only scripts/; no Rust code changed)
tests: Windows PowerShell 5.1 (5.1.26100.8457): scripts/test-smoke-artifacts.tests.ps1 -> ok (test-smoke-artifacts: all assertions passed successfully.); other passing scripts (perf-compare.tests.ps1, perf-run.tests.ps1, smoke-title.tests.ps1) -> 3/3 ok. test-native-stderr.tests.ps1 fails with exit 127 identically on clean base 1c8b5514 (its mock cargo.cmd does not handle the cargo bench call in scripts/test.ps1). Rust workspace tests not run (Tier 0); PowerShell 7 not installed here.
review: Read the full merged diff (scripts/smoke.ps1:101-110, scripts/test-smoke-artifacts.tests.ps1). Resolving $OutDir via (Get-Item -LiteralPath $OutDir).FullName and skipping Copy-Item when $log or $report matches its destination under [StringComparison]::OrdinalIgnoreCase prevents self-copy errors when -OutDir points to the source log directory (including . and case-variant paths). The updated fixture verifies both in-place paths and unchanged original files. Clean, minimal, no regressions.
performance: none (script-only change in scripts/; zero runtime impact)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Windows PowerShell 5.1.26100.8457, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7340581811 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2651#issuecomment-7340581811). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T09:14:10Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 382a161b3eb112d2676825913bd451e9744232a7 merge: clean (`git merge --no-edit` onto `1c8b5514`, `git diff --check` clean; `scripts/smoke.ps1` +9/-3, `scripts/test-smoke-artifacts.tests.ps1` +16/-1) build: not run (Tier 0 PowerShell script diff touching only `scripts/`; no Rust code changed) tests: Windows PowerShell 5.1 (`5.1.26100.8457`): `scripts/test-smoke-artifacts.tests.ps1` -> ok (`test-smoke-artifacts: all assertions passed successfully.`); other passing scripts (`perf-compare.tests.ps1`, `perf-run.tests.ps1`, `smoke-title.tests.ps1`) -> 3/3 ok. `test-native-stderr.tests.ps1` fails with exit 127 identically on clean base `1c8b5514` (its mock `cargo.cmd` does not handle the `cargo bench` call in `scripts/test.ps1`). Rust workspace tests not run (Tier 0); PowerShell 7 not installed here. review: Read the full merged diff (`scripts/smoke.ps1:101-110`, `scripts/test-smoke-artifacts.tests.ps1`). Resolving `$OutDir` via `(Get-Item -LiteralPath $OutDir).FullName` and skipping `Copy-Item` when `$log` or `$report` matches its destination under `[StringComparison]::OrdinalIgnoreCase` prevents self-copy errors when `-OutDir` points to the source log directory (including `.` and case-variant paths). The updated fixture verifies both in-place paths and unchanged original files. Clean, minimal, no regressions. performance: none (script-only change in `scripts/`; zero runtime impact) verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Windows PowerShell 5.1.26100.8457, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
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/2651:upstream-pr/2651'
git switch 'upstream-pr/2651'

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