kernelx: LOAD_LIBRARY_AS_DATAFILE honors the VFS mount and whiteouts #1770
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1780"
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 Luislariosss on 2026-11-24T20:36:11Z.
LoadLibraryExWwithLOAD_LIBRARY_AS_DATAFILEreached the host copy of a game file even when the VFS had a whiteout for it, and a console path with no source left a path error instead ofERROR_FILE_NOT_FOUND.What is in it
load_as_datadelegates to a newload_as_data_in(vfs, ...), which resolves through the VFS first: a visible file loads from its source (console path and host path alike); a whited-out file fails withERROR_FILE_NOT_FOUNDbefore the host fallback is reached.load_library_ex_as_data_respects_vfs_mount_and_whiteouts: a DLL in the game folder loads through both the console path and the host path; afterdelete_filewhites it out, both paths fail withERROR_FILE_NOT_FOUND.Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2609.5 throughXCL_DXC_DIR;CARGO_PROFILE_TEST_DEBUG=0.cargo test -p xcl --lib kernelxat the head: 37 passed, 0 failed, 1 ignored. The new test fails without the fix.cargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4): 876 passed, 0 failed, 38 ignored (20 test binaries;SKIPPED:pso_measurement_compiles_an_exact_synthetic_record— cannot disable the driver cache;heap_window_out_of_memory_falls_back_to_the_switch_form— no heap windows).title:line readsretail-title, the folder name is withheld):main (
85e3826, clean tree):head (
0c65342, clean tree):Not tested
AI use
Imported from ivall/xcl. Originally posted by frenziedcoder on 2026-11-24T20:55:49Z.
NVIDIA test report for
0c65342: an NVIDIA run next to the RX 9060 XT one in the description. Full suite green, the PR's own test passing, and a clean smoke pair (1654 vs 1654 frames).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head0c65342d87d6355b431b75bb1f17ef489830c9ea, no local changes.cargo build --workspace && cargo test --workspace -- --test-threads=4(debug): 876 passed, 0 failed, 42 ignored;load_library_ex_as_data_respects_vfs_mount_and_whiteoutspasses. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Regression run (
scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen;XCL_PSO_PRELOAD=0for both builds, because this machine's preload list holds the program of #1307)base (
4178e88, this PR's base; the same base run as in my report on #1747):this PR:
Not tested: a title loading a whited-out file as a data DLL; the world load; AMD.
AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.
upstream-sync referenced this pull request2026-11-25 00:07:29 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T23:35:58Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
upstream-sync referenced this pull request2026-11-25 02:08:30 +00:00
upstream-sync referenced this pull request2026-11-25 05:07:03 +00:00
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T21:01:50Z.
Head
0c65342d87d6355b431b75bb1f17ef489830c9ea, merge-base85e38262ff94aecd75d6f83fa8156a8b7697bd13. Windows 11 Pro 26100, rustc 1.100.0 MSVC, debug, CPU only (no GPU opened). One-file fix inkernelx.rs:LOAD_LIBRARY_AS_DATAFILEnow resolves through the VFS, so a whited-out file givesERROR_FILE_NOT_FOUND.cargo test -p xcl --lib kernelx:: -- --test-threads=1: head 36 passed, 0 failed, 1 ignored; merge-base 35 passed, 0 failed, 1 ignored. The new test passes alone on head; it calls the newload_as_data_in, so it does not build on base.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 github-actions[bot] on 2026-12-01T02:35:39Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:46:14Z.
Triage (#1607) – head
0c65342No open or merged PR makes the same change. On main,
load_as_datastill falls back to the host path whenreal_path_for_readreturns None (a whiteout), so a deleted game file still loads from the game folder.No problems found in the diff. The mount was already honoured on main; the fix is the whiteout case.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-02T20:22:31Z.
merge-check
base:
5ad98adbc3head:
0c65342d87merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 52 ignored (3004 / 0 / 52 on
817eb1f, plus this PR's test and 1 that main gained since); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none. This is the second run. In the first, the lib test binary ended with 0xc0000005 while it was writing thread dumps, before this PR's test ran. That matches #3586, which happens on main too.review: read the whole diff (1 file, +52 -1). No blocking findings. Main still loads a file the title deleted.
real_path_for_readreturns nothing only for a file the title deleted (a whiteout).LOAD_LIBRARY_AS_DATAFILE, with main's lookup and with this PR's: system DLLs by name and by path, game DLLs by console, host and relative path, missing files, an unmounted drive, an empty name. With nothing deleted, all 15 gave the same result in both. With the game folder as the working folder anddata/res.dlldeleted by the title:resforres.dll)The other 9 names were the same in both.
3) Not blocking: the last row is a gap that stays. Windows adds
.dllafter the VFS has looked upres, so the deleted file is still found.4) Not from this PR: with the game folder as the working folder,
version.dllby its bare name gives error 2 on main too, because the VFS turns it into a path in the game folder and the system folder is never searched.5) This head shows only the
PR descriptioncheck.Build and test (Windows, no GPU)has not run on it, so it needs a CI run before the merge. It builds and passes here.6) Not tested: a retail title (none on this machine).
performance: none
verdict: safe to merge
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.