Tests under Wine: Windows' own answers are checked only on Windows #213

Manually merged
github merged 1 commit from gh-pr/213/head into gh-pr/213/base 2026-11-26 04:15:40 +00:00
Owner

@⁠BlestTerror on GitHub · 2026-11-23 21:07 UTC · original
BlestTerror:tests/wine-host-differences → main · +28 −6 · 5 files · 1 commits · merged 2026-11-23 21:24 UTC

Three --lib tests compared XCL with the host's own Win32 behaviour, which Wine does not reproduce. XCL's answers are the Windows ones in all three:

  • GetProcAddress(module, NULL): Windows sets ERROR_INVALID_PARAMETER, Wine ERROR_PROC_NOT_FOUND. XCL's code is now checked against ERROR_INVALID_PARAMETER, the host's only on Windows.
  • CreateFileW on a directory with FILE_FLAG_BACKUP_SEMANTICS + TRUNCATE_EXISTING: Wine answers ERROR_FILE_EXISTS. The VFS decision is still checked against the Windows codes.
  • A case-only MoveFileExW inside the overlay: Wine succeeds but keeps the old name, so the overlay entry is compared without case there.

The Wine check from the loader (#93) is now util::under_wine().

Wine 11.20, cross-built x86_64-pc-windows-msvc: non-GPU, non-d3d12x tests 229 passed / 3 failed → 232 / 0. Not run on Windows here; the Windows assertions are unchanged except that the GetProcAddress one names the code. Related: #175 (Linux), #200 (another windows-gnu / Wine test fix). Rebased on eaa36b6.

🤖 Generated with Claude Code

**@⁠BlestTerror** on GitHub · 2026-11-23 21:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/213) `BlestTerror:tests/wine-host-differences` → `main` · +28 −6 · 5 files · 1 commits · merged 2026-11-23 21:24 UTC Three `--lib` tests compared XCL with the host's own Win32 behaviour, which Wine does not reproduce. XCL's answers are the Windows ones in all three: - `GetProcAddress(module, NULL)`: Windows sets `ERROR_INVALID_PARAMETER`, Wine `ERROR_PROC_NOT_FOUND`. XCL's code is now checked against `ERROR_INVALID_PARAMETER`, the host's only on Windows. - `CreateFileW` on a directory with `FILE_FLAG_BACKUP_SEMANTICS` + `TRUNCATE_EXISTING`: Wine answers `ERROR_FILE_EXISTS`. The VFS decision is still checked against the Windows codes. - A case-only `MoveFileExW` inside the overlay: Wine succeeds but keeps the old name, so the overlay entry is compared without case there. The Wine check from the loader (#93) is now `util::under_wine()`. Wine 11.20, cross-built `x86_64-pc-windows-msvc`: non-GPU, non-`d3d12x` tests 229 passed / 3 failed → 232 / 0. Not run on Windows here; the Windows assertions are unchanged except that the `GetProcAddress` one names the code. Related: #175 (Linux), #200 (another windows-gnu / Wine test fix). Rebased on `eaa36b6`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Three unit tests compared XCL with the host's own Win32 behaviour, which Wine
does not reproduce; XCL's answers are the Windows ones in all three:

- GetProcAddress(module, NULL): Windows sets ERROR_INVALID_PARAMETER, Wine
  ERROR_PROC_NOT_FOUND. XCL's code is now checked against
  ERROR_INVALID_PARAMETER; the host's only on Windows.
- CreateFileW on a directory with FILE_FLAG_BACKUP_SEMANTICS and
  TRUNCATE_EXISTING: Wine answers ERROR_FILE_EXISTS. The VFS decision is
  still checked against the Windows codes.
- A case-only MoveFileExW inside the overlay: Wine succeeds but keeps the old
  name, so the overlay entry is compared without case there.

The Wine check from the loader (ntdll's wine_get_version) is now
util::under_wine().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011Qu7u1UaLUhn6MfAcvkdjG
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:15:38 +00:00
github manually merged commit 8fde77a63a into gh-pr/213/base 2026-11-26 04:15:40 +00:00
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-23 21:11 UTC · original

Ran this on a Wine stack other than yours: Kron4ek's Wine 11.21 Staging (wow64 build), so under_wine() gets checked on a second Wine build. On it, this PR turns exactly the three Wine-only failures into passes, and nothing else changes.

Tested

  • Ubuntu 24.04, RTX 2060 (Turing), NVIDIA 595.91.07. vkd3d-proton master 30b0eb9 (relaxed as in #175) and DXVK 3.1.1 dxgi.
  • XCL cross-built for x86_64-pc-windows-gnu (mingw-w64 13), release.
  • main eaa36b6 vs this PR 8fde77a (based on eaa36b6, so head = merge result). Full --lib, --test-threads=1, GPU tests included.
passed failed ignored
main eaa36b6 538 10 19
this PR 8fde77a 541 7 19
  • The three that flip to passing:

    • hle::kernelx::tests::get_proc_address_and_load_library_ex_reject_null_name
    • vfs::tests::truncate_existing_validation_errors
    • vfs_hooks::tests::move_case_only_and_self_rename_preserve_file

    That means under_wine(), i.e. wine_get_version in ntdll, detects this build. Without it, these three would fail as they do on main.

  • Nothing real is hidden:

    • In each test, XCL's own answer is still asserted on every host: the GetProcAddress(NULL) code is ERROR_INVALID_PARAMETER, open_decision returns Decision::Fail(expected), and the overlay holds one entry equal to Hello.txt ignoring case. Only the comparison with the host's own answer is skipped under Wine.
    • On Windows the GetProcAddress assertion is stricter than before: XCL is checked against the fixed code, and the host is checked as well.
    • One weakening under Wine only: the case-only rename's final case is no longer checked. That is Wine's MoveFileExW, not XCL.
  • The 7 left are not Wine API differences:

    • Five memory-window GPU tests read zeros on this stack: Wine without userfaultfd write watches, explained in #175.
    • legacy_console_iids_map_to_their_own_slots comes from the windows-gnu build (two copies of register_token4); #200 fixes it (merged in 6da33fa).
    • list_x::tests::draw_indexed_x_routes_through_bind_and_restores_index_buffer passes alone (2 of 2) and fails only in the full run, on main and here alike. An earlier test has opened UMA, so the index buffer at 0x100001000 is outside it and gets mirrored ("each draw copies what it reads"), and the assertion at list_x.rs:2971 sees the mirror's address. It's an ordering dependence between tests, not a Wine one. It may show up on Windows too in a full run.
  • My first full run of main lost the device (0x887a0005) in gpu_float_compares_random, and 46 more GPU tests failed after it. The rerun had no device loss, and that rerun is the row above. The card is shared with other services on this machine, so I count it as transient.

Not tested

  • Windows, and the x86_64-pc-windows-msvc build.
  • Wine with HideWineExports set (Staging can hide wine_get_version; detection would then say "not Wine").
  • The integration and e2e test binaries.
  • The vkd3d-proton vtable-identity assertions are not --lib failures here, because this stack uses a relaxed build.

AI use: Claude Code, Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-23 21:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/213#issuecomment-7114131871) Ran this on a Wine stack other than yours: Kron4ek's **Wine 11.21 Staging** (wow64 build), so `under_wine()` gets checked on a second Wine build. On it, this PR turns exactly the three Wine-only failures into passes, and nothing else changes. ### Tested - Ubuntu 24.04, RTX 2060 (Turing), NVIDIA 595.91.07. vkd3d-proton `master` 30b0eb9 (relaxed as in #175) and DXVK 3.1.1 `dxgi`. - XCL cross-built for **`x86_64-pc-windows-gnu`** (mingw-w64 13), release. - `main` `eaa36b6` vs this PR `8fde77a` (based on `eaa36b6`, so head = merge result). Full `--lib`, `--test-threads=1`, GPU tests included. | | passed | failed | ignored | |---|---|---|---| | `main` `eaa36b6` | 538 | 10 | 19 | | this PR `8fde77a` | **541** | **7** | 19 | - **The three that flip to passing:** - `hle::kernelx::tests::get_proc_address_and_load_library_ex_reject_null_name` - `vfs::tests::truncate_existing_validation_errors` - `vfs_hooks::tests::move_case_only_and_self_rename_preserve_file` That means `under_wine()`, i.e. `wine_get_version` in ntdll, detects this build. Without it, these three would fail as they do on `main`. - **Nothing real is hidden:** - In each test, XCL's own answer is still asserted on every host: the `GetProcAddress(NULL)` code is `ERROR_INVALID_PARAMETER`, `open_decision` returns `Decision::Fail(expected)`, and the overlay holds one entry equal to `Hello.txt` ignoring case. Only the comparison with the host's own answer is skipped under Wine. - On Windows the `GetProcAddress` assertion is stricter than before: XCL is checked against the fixed code, and the host is checked as well. - One weakening under Wine only: the case-only rename's final case is no longer checked. That is Wine's `MoveFileExW`, not XCL. - **The 7 left are not Wine API differences:** - Five memory-window GPU tests read zeros on this stack: Wine without `userfaultfd` write watches, explained in #175. - `legacy_console_iids_map_to_their_own_slots` comes from the windows-gnu build (two copies of `register_token4`); #200 fixes it (merged in 6da33fa). - `list_x::tests::draw_indexed_x_routes_through_bind_and_restores_index_buffer` passes alone (2 of 2) and fails only in the full run, on `main` and here alike. An earlier test has opened UMA, so the index buffer at `0x100001000` is outside it and gets mirrored ("each draw copies what it reads"), and the assertion at `list_x.rs:2971` sees the mirror's address. It's an ordering dependence between tests, not a Wine one. It may show up on Windows too in a full run. - My first full run of `main` lost the device (`0x887a0005`) in `gpu_float_compares_random`, and 46 more GPU tests failed after it. The rerun had no device loss, and that rerun is the row above. The card is shared with other services on this machine, so I count it as transient. ### Not tested - Windows, and the `x86_64-pc-windows-msvc` build. - Wine with `HideWineExports` set (Staging can hide `wine_get_version`; detection would then say "not Wine"). - The integration and e2e test binaries. - The vkd3d-proton vtable-identity assertions are not `--lib` failures here, because this stack uses a relaxed build. AI use: Claude Code, Claude Opus 5.5
Author
Owner

@⁠BlestTerror on GitHub · 2026-11-23 21:18 UTC · original

Thanks for running it on a second Wine build. On the list_x one you were right that it's the copy, not a Wine difference: bisecting the 319 tests before it, the one that leaves the state is gpu_sparse_vram_descriptors_buffers_and_xmem (its sparse VRAM windows map memory at 0x1_0000_xxxx, so the fixed index-buffer addresses become readable and the draw binds a copy). Fix in #224: the test reserves its own inaccessible addresses.

**@⁠BlestTerror** on GitHub · 2026-11-23 21:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/213#issuecomment-7114293033) Thanks for running it on a second Wine build. On the `list_x` one you were right that it's the copy, not a Wine difference: bisecting the 319 tests before it, the one that leaves the state is `gpu_sparse_vram_descriptors_buffers_and_xmem` (its sparse VRAM windows map memory at `0x1_0000_xxxx`, so the fixed index-buffer addresses become readable and the draw binds a copy). Fix in #224: the test reserves its own inaccessible addresses.
Author
Owner

@⁠BlestTerror on GitHub · 2026-11-23 21:21 UTC · original

Correction to the above: the list_x fix to look at is #222 (Kalmarv's, opened first); #224 was the same change and is closed as its duplicate.

**@⁠BlestTerror** on GitHub · 2026-11-23 21:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/213#issuecomment-7114349980) Correction to the above: the `list_x` fix to look at is #222 (Kalmarv's, opened first); #224 was the same change and is closed as its duplicate.
Author
Owner

@⁠ivall on GitHub · 2026-11-23 21:24 UTC · original

Merged (main d4f17ca). Checked on an RX 9070 (RDNA4) with 11 PRs merged together on main af20b4b: cargo build --workspace && cargo test --workspace -- --test-threads=4 - 605 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed; and the retail game still reaches its first menu at 30 fps (720 draws per 2 s).

**@⁠ivall** on GitHub · 2026-11-23 21:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/213#issuecomment-7114416328) Merged (main d4f17ca). Checked on an RX 9070 (RDNA4) with 11 PRs merged together on main af20b4b: `cargo build --workspace && cargo test --workspace -- --test-threads=4` - 605 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed; and the retail game still reaches its first menu at 30 fps (720 draws per 2 s).
This discussion has been locked. Commenting is limited to contributors.
No description provided.