Tests: isolate the default data folder per process #1862
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1872"
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 mokkamokacaffe on 2026-11-24T22:26:19Z.
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 useBoot.data_dirunchanged.What is in it
crates/xcl/src/state.rs: cache one fallback data directory per process withOnceLock.Tested
On
a477b388, upipibi ran the three state tests three times on an RTX 3070. All passed. The library run excluding XAudio2 reported 1,092 passed, 0 failed and 26 ignored. Contributor reportCurrent head
a477b388b4fe6733267ec8cc2758f13cb5d5d98f:Build and test (Windows, no GPU): passed.main:cargo test -p xcl --libreported all tests passed, 0 failed and 27 ignored.git diff --check: passed; the branch is mergeable with currentmain.Source/API audit: the fallback is used only when no
Bootis installed; theSome(Boot)title path is unchanged.OpenProcess,PROCESS_QUERY_LIMITED_INFORMATION,GetLastErrorandERROR_INVALID_PARAMETERwere checked againstwindows-sys0.61.2.Predecessor
2876ff8built 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.Independent exact-head Windows/NVIDIA merge-check by @throny: the review and run used base
beeb81be, passed cargo build --workspace, and reported 2,597 passed, 0 failed and 49 ignored on the PR versus 2,594 passed, 0 failed and 49 ignored on the base. The reviewer read every hunk, confirmed the cleanup guards and one temp-directory scan per process, and reported no blocking finding.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:
PR:
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
beeb81be.AI use
state::data_dirconsumer, implemented the isolated fallback and cleanup tests, identified and fixed the long-running-process cleanup risk, verified the Windows API surface, rebased the branch, reconciled exact-head test/smoke evidence, and drafted this description.Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T22:38:29Z.
Ran it, since the description says "Not run": RTX 3070 8 GB, driver 616.56, Windows 11, debug,
eb088d2onmain689f2db.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 cleaningxcl_unit_data_*folders older than a day at startup, would keep%TEMP%tidy.AI-assisted (Claude Code). Synthetic tests only.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T01:45:54Z.
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!
upstream-sync referenced this pull request2026-11-25 04:08:41 +00:00
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:08:32Z.
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
DoublePrecisionFloatShaderOps=0, nod3d12SDKLayers.dll).1.100.0 (0ef1bc386 2026-11-09), DXC/DXIL 1.9.2609.5, unoptimized builds with debug info disabled,XCL_ADAPTER=A770.cargo build --workspaceandcargo test --workspace --no-runboth succeeded.cargo test -p xcl default_data_folders_are_stable_per_process_and_separate_between_processes -- --nocapturehad 1 passed, 0 failed, 0 ignored, 0 skips. It checks path construction and name validation.cargo test -p xcl save_folder_async -- --nocaptureran twice, each with 1 passed, 0 failed, 0 ignored, 0 skips. File inspection found a freshxcl_unit_data_<pid>_<nonce>/saves/scid-1directory 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=4ran once under the shared Arc lock and exited 101. Across 20 result summaries, libtest reported 951 passed, 25 failed, 45 ignored. The log had 22SKIPPEDlines, which do not count as coverage.CreateComputePipelineStateerror0x80070057. Four reported mismatches in fused FMA, pixel sampling LOD, f16 high-half preservation, or pixel wave reductions.RSSetDepthBiasXcheck drew blue where it expected green.Not tested
A
mainbaseline, 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 againstpr1872-suite.logand published this report.Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:47:33Z.
Code review on
a477b38:state::data_dir()toxcl_unit_data_<pid>_<nonce>with 24h dead-PID cleanup (ERROR_INVALID_PARAMETERcheck) cleanly isolates parallel test processes without removing live or access-denied directories.Remaining before merge:
Build and testfinishing green plus verification ona477b38.Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-25T10:54:16Z.
Regression run: a retail title, from
scripts/smoke.ps1as 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 withmain.base (
f5c5bdf):this PR:
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:41:16Z.
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
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T17:43:53Z.
NVIDIA re-run for
a477b38(onmainf5c5bdf): RTX 3070 8 GB (Ampere, driver 616.56), Windows 11, debug. Earlier I raneb088d2(925 passed).New tests,
cargo test -p xcl --lib state::tests -- --test-threads=4, 3 runs: 3 passed, 0 failed, 0 skipped each.Whole lib (
--skip hle::xaudio2 --test-threads=4): 1092 passed, 0 failed, 26 ignored. SKIPPED: 20 no wave64, 3 per-lane forms the translator refuses, 1 needs Developer Mode.One
%TEMP%\xcl_unit_data_<pid>_<nonce>folder is left after a run, as expected: the new cleanup only removes dead-PID folders older than 24 h.Lib tests only; no title run.
AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T21:07:45Z.
merge-check claim
head:
a477b388b4Imported from ivall/xcl. Originally posted by throny on 2026-11-28T21:36:59Z.
merge-check
base:
beeb81behead:
a477b388b4merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2597 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at
beeb81be(main after the merge of nvidia-dev): 2594 passed, 0 failed, 49 ignored.review: no blocking finding; all hunks read, the deletion with extra care. A folder is removed only when its name is exactly the generated form (prefix, a process id, a number), it has not been modified for a day, and the process id belongs to no process at all; "access denied" and a reused process id both count as running and keep the folder. The removal does not follow links or junctions. To know: the changed function also serves commands that run without a boot configuration, which now get a folder per process and one scan of the temp folder at first use; I did not trace which commands reach it. A folder's modification time does not change when files deep inside change, but the process check covers a live owner.
performance: one directory listing of the temp folder per process.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T02:31:16Z.
merge-check claim
head:
a477b388b4Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T02:33:49Z.
merge-check
base:
53e85fb1head:
a477b388b4merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2791 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in
--test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base53e85fb1alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its three new tests passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.review: no blocking finding; one file, every hunk read.
data_dir()keeps the per-process folder in aOnceLock, so a test process sees one folder for its whole life, and the name carries both the pid and a nanosecond nonce, so two processes cannot collide even when Windows reuses a pid. The cleanup is narrow on purpose: only names that parse asxcl_unit_data_<pid>_<nonce>, only after a day untouched, and only when the owning process has ended — andOpenProcessfailing for any reason other than an invalid pid counts as "still running", which is the safe direction. Every step of the cleanup is best-effort and leaves the data alone on error. It only runs on the no-BOOTpath, which is the test/bin path, not a title run. Notes, not blocking: the 24-hour age and the nonce live in one place each, andSystemTimebefore the epoch would yield nonce 0 (harmless, and the tests pin the name shape). No duplicate: nothing else touches the no-BOOTdata folder.performance: one
read_dirof the temp folder per test process, at its firstdata_dir()call; nothing in a title run.verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T02:36:56Z.
@relativespace2K Stop taking already claimed PRs. Are you even checking that they've been claimed???
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T02:37:17Z.
merge-check
base:
53e85fb124head:
a477b388b4merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2795 passed, 1 failed, 49 ignored; SKIPPED: 30 (22 no wave64, 3 per-lane #1426 refused, 2 no heap windows, 2 no xgameruntime.dll, 1 cannot disable the driver cache 0x887A002D); failing: hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (also fails on base
53e85fb1alone)review: none (read the full +104/-1 diff in crates/xcl/src/state.rs: isolates no-boot data_dir() per process via OnceLock(xcl_unit_data_{pid}_{nonce}) leaving Boot.data_dir untouched, and cleans up %TEMP% dirs matching the exact prefix/pid/nonce form that are >=24h old and whose PID returns ERROR_INVALID_PARAMETER from OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION); all 3 new state::tests passed; no duplicates found; not tested: stale-dir deletion after a real owner process exits)
performance: one std::fs::read_dir of %TEMP% once per no-boot process; zero cost for real title runs with Boot
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4070 SUPER (32.0.16.2140), AMD Ryzen 7 7800X3D, Windows 11 Pro 26300, rustc 1.100.0, debug / Antigravity (Gemini 4 Hydrogen)
Imported from ivall/xcl. Originally posted by mokkamokacaffe on 2026-11-30T02:40:59Z.
@saintwolf Could you fix this error 0x887A002D and try again? And xgameruntime.dll? I'd reinstall the Microsoft GDK..
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-30T02:43:49Z.
Hey, I appreciate you checking this, just make sure that there isn't already people who have merged checked.
We don't need 3-4 people checking merges, just 2 or 3 is fine.
Please make sure you are spacing them out, and not commenting based on activity.
Thanks.