Tests: isolate the default data folder per process #1872

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

@⁠mokkamokacaffe on GitHub · 2026-11-24 22:26 UTC · original
mokkamokacaffe:tests/isolate-default-data-dir → main · +104 −1 · 1 files · 1 commits · open

Test processes without a boot record currently share %TEMP%\xcl_unit_data. Parallel test binaries can write the same shader, UMA, save and PLS state, while a later run can inherit files left by an earlier one. Give each process one stable fallback directory identified by its PID and a creation-time nonce. Real title runs continue to use Boot.data_dir unchanged.

What is in it

  • crates/xcl/src/state.rs: cache one fallback data directory per process with OnceLock.
  • Include both the process ID and a creation-time nonce, separating concurrent processes and stale prior runs.
  • Remove generated fallback directories only after they are at least 24 hours old and their owning PID is confirmed absent; access-denied process checks conservatively preserve data.
  • Add focused tests for deterministic construction, PID/nonce separation, cleanup decisions, and recognition of the current live process.

Tested

  • Current head a477b388b4fe6733267ec8cc2758f13cb5d5d98f: git diff --check passed; rebased cleanly onto main f5c5bdf0e91035f8f1404f46f4f2f7aedc259e7f.
  • Source/API audit: the fallback is used only when no Boot is installed; the Some(Boot) title path is unchanged. OpenProcess, PROCESS_QUERY_LIMITED_INFORMATION, GetLastError and ERROR_INVALID_PARAMETER were checked against windows-sys 0.61.2.
  • Predecessor eb088d2 on Windows 11 / RTX 3070: cargo test -p xcl --lib -- --skip gpu_sparse_vram --skip queue_slot_18 --test-threads=4 reported 925 passed, 0 failed and 25 ignored. The two skips were existing issues #1727 and #1487.
  • A later predecessor merged with then-current main passed cargo test -p xcl --lib on RTX 3060 Ti; one intermittent parallel-scheduling abort tracked by #1978 passed on a single-threaded rerun.
  • Predecessor 2876ff8 built successfully on Windows 11 / Intel Arc A770. Its focused path tests passed; the full workspace run reported 951 passed, 25 failed and 45 ignored, with the GPU/e2e failures documented in the contributor report and no matched-main attribution.

The Windows results above predate the current rebase and live-process cleanup test. They are supporting evidence, not exact-head test claims.

Regression run

Exact-head paired retail smoke from scripts/smoke.ps1; 60 seconds, release, same title and duration. This is a regression check only: the title path does not exercise the no-boot fallback changed by this PR.

main:

xcl-smoke v1
commit: f5c5bdf0e91035f8f1404f46f4f2f7aedc259e7f
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 22562 MB

PR:

xcl-smoke v1
commit: a477b388b4fe6733267ec8cc2758f13cb5d5d98f
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1603)
presents per 2 s (last 3): 60 44 54
device removals: 0
crashes: 0
peak commit: 24234 MB

The PR produced 98.9% of main frames and 107.4% of main peak commit, with no crash or device removal; both are within the repository limits. One pair does not establish a memory trend.

Not tested

  • Windows build or test suite on exact head a477b38; this Linux workspace has no Rust toolchain.
  • Concurrent exact-head Windows test binaries writing shader, UMA, save or PLS fallback state.
  • Exact-head stale-directory removal after a real owner process exits.
  • Paired scripts/smoke.ps1 retail-title runs.

AI use

  • OpenAI Codex with GPT-6.2 synchronized the fork with current upstream, traced every state::data_dir consumer, implemented the isolated fallback and cleanup tests, identified and fixed the long-running-process cleanup risk, verified the Windows API surface, rebased the branch and drafted this description.
  • Independent contributors used Claude Code or Codex to run and draft the predecessor Windows reports; those reports are identified above and are not presented as exact-head validation.
**@⁠mokkamokacaffe** on GitHub · 2026-11-24 22:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1872) `mokkamokacaffe:tests/isolate-default-data-dir` → `main` · +104 −1 · 1 files · 1 commits · open Test processes without a boot record currently share `%TEMP%\xcl_unit_data`. Parallel test binaries can write the same shader, UMA, save and PLS state, while a later run can inherit files left by an earlier one. Give each process one stable fallback directory identified by its PID and a creation-time nonce. Real title runs continue to use `Boot.data_dir` unchanged. **What is in it** - `crates/xcl/src/state.rs`: cache one fallback data directory per process with `OnceLock`. - Include both the process ID and a creation-time nonce, separating concurrent processes and stale prior runs. - Remove generated fallback directories only after they are at least 24 hours old and their owning PID is confirmed absent; access-denied process checks conservatively preserve data. - Add focused tests for deterministic construction, PID/nonce separation, cleanup decisions, and recognition of the current live process. **Tested** - Current head `a477b388b4fe6733267ec8cc2758f13cb5d5d98f`: `git diff --check` passed; rebased cleanly onto `main` `f5c5bdf0e91035f8f1404f46f4f2f7aedc259e7f`. - Source/API audit: the fallback is used only when no `Boot` is installed; the `Some(Boot)` title path is unchanged. `OpenProcess`, `PROCESS_QUERY_LIMITED_INFORMATION`, `GetLastError` and `ERROR_INVALID_PARAMETER` were checked against `windows-sys` 0.61.2. - Predecessor `eb088d2` on Windows 11 / RTX 3070: `cargo test -p xcl --lib -- --skip gpu_sparse_vram --skip queue_slot_18 --test-threads=4` reported 925 passed, 0 failed and 25 ignored. The two skips were existing issues #1727 and #1487. - A later predecessor merged with then-current `main` passed `cargo test -p xcl --lib` on RTX 3060 Ti; one intermittent parallel-scheduling abort tracked by #1978 passed on a single-threaded rerun. - Predecessor `2876ff8` built successfully on Windows 11 / Intel Arc A770. Its focused path tests passed; the full workspace run reported 951 passed, 25 failed and 45 ignored, with the GPU/e2e failures documented in the contributor report and no matched-main attribution. The Windows results above predate the current rebase and live-process cleanup test. They are supporting evidence, not exact-head test claims. **Regression run** Exact-head paired retail smoke from `scripts/smoke.ps1`; 60 seconds, release, same title and duration. This is a regression check only: the title path does not exercise the no-boot fallback changed by this PR. main: ```xcl-smoke xcl-smoke v1 commit: f5c5bdf0e91035f8f1404f46f4f2f7aedc259e7f gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1620 (PresentX 1620) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 22562 MB ``` PR: ```xcl-smoke xcl-smoke v1 commit: a477b388b4fe6733267ec8cc2758f13cb5d5d98f gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1603) presents per 2 s (last 3): 60 44 54 device removals: 0 crashes: 0 peak commit: 24234 MB ``` The PR produced 98.9% of main frames and 107.4% of main peak commit, with no crash or device removal; both are within the repository limits. One pair does not establish a memory trend. **Not tested** - Windows build or test suite on exact head `a477b38`; this Linux workspace has no Rust toolchain. - Concurrent exact-head Windows test binaries writing shader, UMA, save or PLS fallback state. - Exact-head stale-directory removal after a real owner process exits. - Paired `scripts/smoke.ps1` retail-title runs. **AI use** - OpenAI Codex with GPT-6.2 synchronized the fork with current upstream, traced every `state::data_dir` consumer, implemented the isolated fallback and cleanup tests, identified and fixed the long-running-process cleanup risk, verified the Windows API surface, rebased the branch and drafted this description. - Independent contributors used Claude Code or Codex to run and draft the predecessor Windows reports; those reports are identified above and are not presented as exact-head validation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:08:04 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 22:38 UTC · original

Ran it, since the description says "Not run": RTX 3070 8 GB, driver 616.56, Windows 11, debug, eb088d2 on main 689f2db. cargo test -p xcl --lib -- --skip gpu_sparse_vram --skip queue_slot_18 --test-threads=4: 925 passed, 0 failed, 25 ignored. (Those two skips are #1727 and #1487, not this PR.)

One side effect: each test process leaves its folder behind. After this one run, %TEMP%\xcl_unit_data_<pid>_<nonce> stays, at 2 KB (gamesave, pls, saves). It's small, but one accumulates per test binary run. Removing it when the process exits, or cleaning xcl_unit_data_* folders older than a day at startup, would keep %TEMP% tidy.

AI-assisted (Claude Code). Synthetic tests only.

**@⁠upipibi** on GitHub · 2026-11-24 22:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/1872#issuecomment-7146472142) Ran it, since the description says "Not run": RTX 3070 8 GB, driver 616.56, Windows 11, debug, `eb088d2` on `main` `689f2db`. `cargo test -p xcl --lib -- --skip gpu_sparse_vram --skip queue_slot_18 --test-threads=4`: 925 passed, 0 failed, 25 ignored. (Those two skips are #1727 and #1487, not this PR.) One side effect: each test process leaves its folder behind. After this one run, `%TEMP%\xcl_unit_data_<pid>_<nonce>` stays, at 2 KB (`gamesave`, `pls`, `saves`). It's small, but one accumulates per test binary run. Removing it when the process exits, or cleaning `xcl_unit_data_*` folders older than a day at startup, would keep `%TEMP%` tidy. AI-assisted (Claude Code). Synthetic tests only.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 01:45 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 01:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1872#issuecomment-7149929256) 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

@⁠JJAutoCompare on GitHub · 2026-11-25 03:08 UTC · original

PR #1872 — STOR-WINLAB verification

Tested detached head 2876ff856810d5c0cb7a897ed1c46eb4f942ccea (“Tests: isolate the default data folder per process”). The diff caches a PID-and-time-nonce fallback path per process when no boot configuration exists and attempts to clean up matching directories at least 24 hours old.

Tested

  • STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB on driver 32.0.101.9175 (wave range 8–32, DoublePrecisionFloatShaderOps=0, no d3d12SDKLayers.dll).
  • Rust 1.100.0 (0ef1bc386 2026-11-09), DXC/DXIL 1.9.2609.5, unoptimized builds with debug info disabled, XCL_ADAPTER=A770.
  • cargo build --workspace and cargo test --workspace --no-run both succeeded.
  • cargo test -p xcl default_data_folders_are_stable_per_process_and_separate_between_processes -- --nocapture had 1 passed, 0 failed, 0 ignored, 0 skips. It checks path construction and name validation.
  • cargo test -p xcl save_folder_async -- --nocapture ran twice, each with 1 passed, 0 failed, 0 ignored, 0 skips. File inspection found a fresh xcl_unit_data_<pid>_<nonce>/saves/scid-1 directory after each process. The first directory remained after the second run. Both focused tests also passed in the full suite.

Full workspace suite

cargo test --workspace --no-fail-fast -- --test-threads=4 ran once under the shared Arc lock and exited 101. Across 20 result summaries, libtest reported 951 passed, 25 failed, 45 ignored. The log had 22 SKIPPED lines, which do not count as coverage.

  • 24 library GPU failures. Twenty reported CreateComputePipelineState error 0x80070057. Four reported mismatches in fused FMA, pixel sampling LOD, f16 high-half preservation, or pixel wave reductions.
  • One E2E failure. The test title’s RSSetDepthBiasX check drew blue where it expected green.
  • Skip reasons were 17 missing wave64, 3 refused wave32 per-lane forms, 1 driver cache that could not be disabled, and 1 missing heap windows.

Not tested

A main baseline, simultaneous process stress, stale-directory eviction, retail titles or samples (XCL_SAMPLE_* unset), and other GPUs or drivers.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1872-suite.log and published this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1872#issuecomment-7151630141) # PR #1872 — STOR-WINLAB verification Tested detached head `2876ff856810d5c0cb7a897ed1c46eb4f942ccea` (“Tests: isolate the default data folder per process”). The diff caches a PID-and-time-nonce fallback path per process when no boot configuration exists and attempts to clean up matching directories at least 24 hours old. **Tested** - STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB on driver 32.0.101.9175 (wave range 8–32, `DoublePrecisionFloatShaderOps=0`, no `d3d12SDKLayers.dll`). - Rust `1.100.0 (0ef1bc386 2026-11-09)`, DXC/DXIL 1.9.2609.5, unoptimized builds with debug info disabled, `XCL_ADAPTER=A770`. - `cargo build --workspace` and `cargo test --workspace --no-run` both succeeded. - `cargo test -p xcl default_data_folders_are_stable_per_process_and_separate_between_processes -- --nocapture` had 1 passed, 0 failed, 0 ignored, 0 skips. It checks path construction and name validation. - `cargo test -p xcl save_folder_async -- --nocapture` ran twice, each with 1 passed, 0 failed, 0 ignored, 0 skips. File inspection found a fresh `xcl_unit_data_<pid>_<nonce>/saves/scid-1` directory after each process. The first directory remained after the second run. Both focused tests also passed in the full suite. **Full workspace suite** `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once under the shared Arc lock and exited 101. Across 20 result summaries, libtest reported **951 passed, 25 failed, 45 ignored**. The log had **22 `SKIPPED` lines**, which do not count as coverage. - 24 library GPU failures. Twenty reported `CreateComputePipelineState` error `0x80070057`. Four reported mismatches in fused FMA, pixel sampling LOD, f16 high-half preservation, or pixel wave reductions. - One E2E failure. The test title’s `RSSetDepthBiasX` check drew blue where it expected green. - Skip reasons were 17 missing wave64, 3 refused wave32 per-lane forms, 1 driver cache that could not be disabled, and 1 missing heap windows. **Not tested** A `main` baseline, simultaneous process stress, stale-directory eviction, retail titles or samples (`XCL_SAMPLE_*` unset), and other GPUs or drivers. **AI use** T3 Code / Codex (`gpt-6.2-sol`, `reasoningEffort: high`) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, `gemini-4-neon`) verified counts against `pr1872-suite.log` and published this report.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 10:47 UTC · original

Code review on a477b38:

  • Scoping fallback state::data_dir() to xcl_unit_data_<pid>_<nonce> with 24h dead-PID cleanup (ERROR_INVALID_PARAMETER check) cleanly isolates parallel test processes without removing live or access-denied directories.
  • Diff audited and CI workflow approved (running).

Remaining before merge: Build and test finishing green plus verification on a477b38.

**@⁠raylitebull** on GitHub · 2026-11-25 10:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/1872#issuecomment-7160178936) Code review on `a477b38`: - Scoping fallback `state::data_dir()` to `xcl_unit_data_<pid>_<nonce>` with 24h dead-PID cleanup (`ERROR_INVALID_PARAMETER` check) cleanly isolates parallel test processes without removing live or access-denied directories. - Diff audited and CI workflow approved (running). **Remaining before merge:** `Build and test` finishing green plus verification on `a477b38`.
Author
Owner

@⁠Anon64 on GitHub · 2026-11-25 10:54 UTC · original

Regression run: a retail title, from scripts/smoke.ps1 as printed. 60 s, release, default settings, A pressed every 4 s from 20 s. RTX 3060 12 GB, Windows 11, Rust 1.100.0. The base is this PR's merge base with main.

base (f5c5bdf):

xcl-smoke v1
commit: f5c5bdf0e91035f8f1404f46f4f2f7aedc259e7f
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 22562 MB

this PR:

xcl-smoke v1
commit: a477b388b4fe6733267ec8cc2758f13cb5d5d98f
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1603)
presents per 2 s (last 3): 60 44 54
device removals: 0
crashes: 0
peak commit: 24234 MB

No device removal or crash. Frames are 98.9 % of the base's and peak commit is 107.4 %, within the limits. Peak commit varies by a few GB between runs on this machine, so one pair doesn't show a memory change. This is a regression check only: the run uses the given game folder, so it doesn't exercise the default data folder this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both commits, ran the smoke pair and wrote this comment.

**@⁠Anon64** on GitHub · 2026-11-25 10:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/1872#issuecomment-7160327365) **Regression run:** a retail title, from `scripts/smoke.ps1` as printed. 60 s, release, default settings, A pressed every 4 s from 20 s. RTX 3060 12 GB, Windows 11, Rust 1.100.0. The base is this PR's merge base with `main`. base (`f5c5bdf`): ``` xcl-smoke v1 commit: f5c5bdf0e91035f8f1404f46f4f2f7aedc259e7f gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1620 (PresentX 1620) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 22562 MB ``` this PR: ``` xcl-smoke v1 commit: a477b388b4fe6733267ec8cc2758f13cb5d5d98f gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1603) presents per 2 s (last 3): 60 44 54 device removals: 0 crashes: 0 peak commit: 24234 MB ``` No device removal or crash. Frames are 98.9 % of the base's and peak commit is 107.4 %, within the limits. Peak commit varies by a few GB between runs on this machine, so one pair doesn't show a memory change. This is a regression check only: the run uses the given game folder, so it doesn't exercise the default data folder this PR changes. **AI use:** Claude Code (Claude Opus 5.5) built both commits, ran the smoke pair and wrote this comment.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 06:41 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 06:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1872#issuecomment-7184680492) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
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/1872/head:github-bot/gh-1872'
git switch 'github-bot/gh-1872'

Merge

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