Skip to content

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

Merged
ivall merged 1 commit into
xcl-dev:mainfrom
BlestTerror:tests/wine-host-differences
Nov 23, 2026
Merged

ivall merged 1 commit into
xcl-dev:mainfrom
BlestTerror:tests/wine-host-differences

Conversation

@BlestTerror

Copy link
Copy Markdown
Contributor

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

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
@Kalmarv

Kalmarv commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

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

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:

  • 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

@BlestTerror

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

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.

@ivall
ivall merged commit 4c1630b into xcl-dev:main Nov 23, 2026
@ivall

ivall commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants