Tests: pls_quota expects ERROR_PATH_NOT_FOUND for a missing path below S:\, Wine returns ERROR_FILE_NOT_FOUND #810

Open
opened 2026-11-26 04:33:20 +00:00 by github-bot · 1 comment
Owner

@⁠nicklin11 on GitHub · 2026-11-24 05:43 UTC · original

disk_free_space_ex_reports_pls_quota (crates/xcl/tests/pls_quota.rs) fails under Wine at the line that checks the error of GetDiskFreeSpaceExW on a path below the PLS drive that does not exist. It expects ERROR_PATH_NOT_FOUND (3) and gets ERROR_FILE_NOT_FOUND (2).

What happens

thread 'disk_free_space_ex_reports_pls_quota' panicked at crates/xcl/tests/pls_quota.rs:144:9:
assertion `left == right` failed
  left: (0, 2)
 right: (0, 3)

Line 144 is assert_eq!((result, error), (0, ERROR_PATH_NOT_FOUND)); after GetDiskFreeSpaceExW(S:\missing, …). The runtime log of the same run:

xcl: GetDiskFreeSpaceExW(S:\missing) (host …\data\pls\missing) failed (error 2)

Where the error code comes from

S:\missing is a translated path, so disk_free_ex in crates/xcl/src/vfs_hooks.rs forwards the host path data\pls\missing to the real GetDiskFreeSpaceExW (pls_disk_free_ex → orig), and Wine's own error code reaches the test. The hook does not produce the code itself on that path (it uses ERROR_FILE_NOT_FOUND only for Target::Game paths). I did not run the test on Windows; the test's expectation of 3 is what I take to be the native behaviour.

The test stops at the first failed assertion, so the checks after line 144 (the quota filling up, etc.) did not run under Wine.

Setup

  • main at d208e14, debug, cross-built on Linux for x86_64-pc-windows-gnu (mingw-w64 GCC 16.2, posix threads, Rust 1.100.0)
  • Wine 11.22 Staging (Arch package), clean 64-bit prefix, vkd3d-proton 3.1 and DXVK 3.1.1 installed in it (not used by this test)
  • Command: wine pls_quota-<hash>.exe (cwd crates/xcl)
  • Result: 0 passed; 1 failed

For context, the same build under Wine: cargo test -p xcl --lib without hle::d3d12x:: and gpu::: 277 passed, 0 failed, 2 ignored. The Wine error-code failures listed in #175 for get_proc_address_and_load_library_ex_reject_null_name, vfs::truncate_existing_validation_errors and vfs_hooks::move_case_only_and_self_rename_preserve_file no longer fail.

Possible directions (not decided, a maintainer's call)

  • Test only: keep the exact assertion for Windows and accept 2 or 3 when the process runs under Wine.
  • Runtime: map the code to 3 under Wine in the hook, so a title sees the same code as on Windows. That is a crates/xcl/src change.

I have not written either. Related: #175 (Linux / Wine), #106 (PLS quota), #231 (merged, added the quota in GetDiskFreeSpaceEx).

AI use: Claude Code, Claude Sonnet 5.5. It ran the cross-build and the tests and read the code. The Windows behaviour was not checked.

**@⁠nicklin11** on GitHub · 2026-11-24 05:43 UTC · [original](https://github.com/xcl-dev/xcl/issues/810) `disk_free_space_ex_reports_pls_quota` (`crates/xcl/tests/pls_quota.rs`) fails under Wine at the line that checks the error of `GetDiskFreeSpaceExW` on a path below the PLS drive that does not exist. It expects `ERROR_PATH_NOT_FOUND` (3) and gets `ERROR_FILE_NOT_FOUND` (2). **What happens** ``` thread 'disk_free_space_ex_reports_pls_quota' panicked at crates/xcl/tests/pls_quota.rs:144:9: assertion `left == right` failed left: (0, 2) right: (0, 3) ``` Line 144 is `assert_eq!((result, error), (0, ERROR_PATH_NOT_FOUND));` after `GetDiskFreeSpaceExW(S:\missing, …)`. The runtime log of the same run: ``` xcl: GetDiskFreeSpaceExW(S:\missing) (host …\data\pls\missing) failed (error 2) ``` **Where the error code comes from** `S:\missing` is a translated path, so `disk_free_ex` in `crates/xcl/src/vfs_hooks.rs` forwards the host path `data\pls\missing` to the real `GetDiskFreeSpaceExW` (`pls_disk_free_ex` → `orig`), and Wine's own error code reaches the test. The hook does not produce the code itself on that path (it uses `ERROR_FILE_NOT_FOUND` only for `Target::Game` paths). I did not run the test on Windows; the test's expectation of 3 is what I take to be the native behaviour. The test stops at the first failed assertion, so the checks after line 144 (the quota filling up, etc.) did not run under Wine. **Setup** - `main` at `d208e14`, debug, cross-built on Linux for `x86_64-pc-windows-gnu` (mingw-w64 GCC 16.2, posix threads, Rust 1.100.0) - Wine 11.22 Staging (Arch package), clean 64-bit prefix, vkd3d-proton 3.1 and DXVK 3.1.1 installed in it (not used by this test) - Command: `wine pls_quota-<hash>.exe` (cwd `crates/xcl`) - Result: `0 passed; 1 failed` For context, the same build under Wine: `cargo test -p xcl --lib` without `hle::d3d12x::` and `gpu::`: 277 passed, 0 failed, 2 ignored. The Wine error-code failures listed in #175 for `get_proc_address_and_load_library_ex_reject_null_name`, `vfs::truncate_existing_validation_errors` and `vfs_hooks::move_case_only_and_self_rename_preserve_file` no longer fail. **Possible directions** (not decided, a maintainer's call) - Test only: keep the exact assertion for Windows and accept 2 or 3 when the process runs under Wine. - Runtime: map the code to 3 under Wine in the hook, so a title sees the same code as on Windows. That is a `crates/xcl/src` change. I have not written either. Related: #175 (Linux / Wine), #106 (PLS quota), #231 (merged, added the quota in `GetDiskFreeSpaceEx`). **AI use:** Claude Code, Claude Sonnet 5.5. It ran the cross-build and the tests and read the code. The Windows behaviour was not checked.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:33:20 +00:00
Author
Owner

@⁠ettehn on GitHub · 2026-11-24 06:26 UTC · original

I took on and completed the native Windows verification on Windows 11 25H2 x64 (build 26200.9974), using the reported revision d208e14 and rustc 1.97.1 (MSVC).

A standalone GetDiskFreeSpaceExW call succeeded on an existing data\pls directory. Both data\pls\missing and data\pls\missing\child returned FALSE with last error 3 (ERROR_PATH_NOT_FOUND).

I ran cargo test --locked -p xcl --test pls_quota -- --nocapture. XCL also logged error 3 for S:\missing. The later quota assertions passed, including the check for zero free space after filling the quota. Result: 1 passed, 0 failed, 0 ignored. This confirms the existing assertion on this Windows build. The Wine result of 2 comes from the original report.

AI use: OpenAI Codex (GPT-6) wrote and ran the native probe, ran the existing integration test, and drafted this comment.

**@⁠ettehn** on GitHub · 2026-11-24 06:26 UTC · [original](https://github.com/xcl-dev/xcl/issues/810#issuecomment-7123943291) I took on and completed the native Windows verification on Windows 11 25H2 x64 (build 26200.9974), using the reported revision `d208e14` and rustc 1.97.1 (MSVC). A standalone `GetDiskFreeSpaceExW` call succeeded on an existing `data\pls` directory. Both `data\pls\missing` and `data\pls\missing\child` returned `FALSE` with last error `3` (`ERROR_PATH_NOT_FOUND`). I ran `cargo test --locked -p xcl --test pls_quota -- --nocapture`. XCL also logged error `3` for `S:\missing`. The later quota assertions passed, including the check for zero free space after filling the quota. Result: **1 passed, 0 failed, 0 ignored**. This confirms the existing assertion on this Windows build. The Wine result of `2` comes from the original report. **AI use:** OpenAI Codex (GPT-6) wrote and ran the native probe, ran the existing integration test, and drafted this comment.
This discussion has been locked. Commenting is limited to contributors.
No description provided.