Repository navigation
Small fixes found running the tests and the test title under Wine - #270
Conversation
Wine's GetProcessMemoryInfo fills PROCESS_MEMORY_COUNTERS only, PrivateUsage of the _EX form stays 0: TitleMemoryStatus reported the whole budget as available and XMemGetWorkingSetStatistics a use of 0 (the test title's check wants more than 0). PagefileUsage is the same number on Windows, where PrivateUsage is never 0: no change there. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmXSjLgBbFAokwc63ad
The crate has no tests, and with the GNU toolchain (x86_64-pc-windows-gnu) the empty harness keeps the raw-dylib import of kernelx.dll: the exe cannot start and `cargo test --workspace` fails on it (the MSVC linker drops the unused import). The DLL itself is built by `cargo build --workspace` as before. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmXSjLgBbFAokwc63ad
Console code calls descriptor heap ivall#9 / ivall#10 (GetCPU / GetGPUDescriptorHandleForHeapStart) with only `this` and takes the handle in rax, as the real backend already answers it (real.rs heap_cpu_start_x). The null device used the PC form and wrote the handle through rdx, whatever the caller had left there. Under Wine 11.22 with no D3D12 device (no GPU), the test title runs its GPU checks on the null device: its rdx pointed into its read-only .rdata and the title ended with 0xC0000005 in Heap_GetHandleStart (where rdx happens to be writable, the stray write goes unnoticed). The handle now comes back in rax and rdx is not touched. Windows: the same for the null device (no D3D12 device or graphics = "null"); the real backend is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmXSjLgBbFAokwc63ad
The preflight warning said task queues and networking are missing without the PC's XGameRuntime, and the runtime log line said XTaskQueue/XAsync are unavailable. XCL uses its own XAsync / XTaskQueue / XThread then (QueryApiImpl fallback), and XNetworking is always XCL's. What is missing is what goes to the PC runtime: the XGameUi dialogs and text entry, game invites, game streaming and the other classes XCL does not implement. The module doc said XNetworking goes to the PC runtime and did not say what happens without it; it now says both. Seen under Wine, which has no xgameruntime.dll: the warning is printed on every run. Wording and comments only, the levels are unchanged. Windows: the same text where Gaming Services is not installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmXSjLgBbFAokwc63ad
The e2e test staged the game and data folders in <repo>/target/e2e whatever the target directory was, so with CARGO_TARGET_DIR set elsewhere it still wrote into the repository: seen under Wine 11.22, where a target/e2e folder appeared in the repository after an e2e run with CARGO_TARGET_DIR pointing to another folder. Cargo hands integration tests a scratch folder inside the target directory, CARGO_TARGET_TMPDIR; the staging is now there (target\tmp\e2e, target\<triple>\tmp\e2e with --target). Windows: the same test, the folder moves from target\e2e to target\tmp\e2e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmXSjLgBbFAokwc63ad
|
Please tighten the null-heap regression test. Slots 9 and 10 now point to a one-argument function. The test calls them through a two-argument Rust function pointer, which violates Rust’s ABI compatibility rule even on Win64. It also passes if both slots always return Tested Windows 11 Pro 26200.9711, Ryzen 9 9950X, RTX 5070 Ti, NVIDIA 610.74, Rust 1.99 MSVC, debug. Tested PR head
The six unit filters passed 48/48 (kernelx 18, null 2, preflight 6, runtime API 16, frame 4, modules 2). With the three e2e tests, 51 passed, 0 failed, 0 skipped on the merge. The frame-clock control also passed in 20/20 fresh processes. Pairwise Not tested Wine, MinGW, a Windows installation without Gaming Services, the retail game, or runtime behavior of the three merge combinations. 🤖 GPT-6.2 Astra |
From ivall/xcl#270 by @cmt8, squashed.
|
Tested Pass: 652 passed, 0 failed, 40 ignored. GPU skips: the same 2 as on Run and written with Claude Code (Claude Opus 5.5). |
…ir real signature The test for descriptor heap ivall#9 / ivall#10 called them through a two-argument fn pointer (`this` plus a stray pointer) although they take only `this`: a Rust call through a fn pointer of another signature is undefined behaviour, even where Win64 lets it pass. Its checks were also weak: a start that is not 0 and not the stray pointer, so ivall#9 / ivall#10 returning the constant 1 still passed. The test now creates two heaps and reads each heap's start from the object (CreateDescriptorHeap's handle range: not 0, a different one per heap), then calls ivall#9 and ivall#10 as `fn(this) -> u64` and wants exactly that start. On x86_64 Windows it also calls them through a small asm shim that passes `this` in rcx and leaves a writable sentinel pointer in rdx, as console code can: the sentinel must be unchanged and rax the exact start. Checked under Wine: ivall#9 / ivall#10 returning 1 fails the test, and so does the old PC form that wrote the handle through rdx. Test only, the null device is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmZMiGWQ8zSxFiGaz6b
I've posted a fix for this as a new commit in the PR |
New section 0: scripts/linux-smoke.sh in the owner's Arch distrobox on a Radeon RX 7900 XTX (Mesa 26.3.1, Wine 11.22, vkd3d-proton 3.1, DXVK 3.1.1), on wine-bringup rebased onto upstream a6f5f7a, with the answers to section 5's questions in order and the log each rests on. Every test of the binaries that aborted was re-run in its own process; all 717 results are in docs/linux-wine/tests-gpu-radv.tsv (663 pass, 5 fail, 8 abort, 41 ignored). What it showed: Wine uses its kernel (userfaultfd) write watch in the distrobox (no seccomp filter), XCL's UMA import check says ok and the 4 GiB window, wave64 and mesh tests pass. The new blocker is finding 16: vkd3d-proton 3.1 asserts that heaps, fences, resources and root signatures handed back to it carry its own vtable, and XCL's real backend has replaced it (real::adopt) - this ends the test title (exit 0x3), the e2e test and 8 more tests. Findings 17 and 18: v_rsq_f64 of a negative number or NaN gives 0, and v_fma_f32 (HLSL mad) is not fused. Options for 16 are listed, none made. Presentation, submit cost and the shader cache location were not reached. A legend entry [ran, GPU] marks what this run observed; [read] / [guess] are changed only where a line from it supports the statement (findings 1, 4, 7, 8, 9, "What we know now"). Section 4: the five fixes are now upstream (PR ivall#270), the branch carries none. Section 5: the script's three fixes from this run. Nothing was run on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmV74bPu5j5TBXjrNug
New section 0: scripts/linux-smoke.sh in the owner's Arch distrobox on a Radeon RX 7900 XTX (Mesa 26.3.1, Wine 11.22, vkd3d-proton 3.1, DXVK 3.1.1), on wine-bringup rebased onto upstream a6f5f7a, with the answers to section 5's questions in order and the log each rests on. Every test of the binaries that aborted was re-run in its own process; all 717 results are in docs/linux-wine/tests-gpu-radv.tsv (663 pass, 5 fail, 8 abort, 41 ignored). What it showed: Wine uses its kernel (userfaultfd) write watch in the distrobox (no seccomp filter), XCL's UMA import check says ok and the 4 GiB window, wave64 and mesh tests pass. The new blocker is finding 16: vkd3d-proton 3.1 asserts that heaps, fences, resources and root signatures handed back to it carry its own vtable, and XCL's real backend has replaced it (real::adopt) - this ends the test title (exit 0x3), the e2e test and 8 more tests. Findings 17 and 18: v_rsq_f64 of a negative number or NaN gives 0, and v_fma_f32 (HLSL mad) is not fused. Options for 16 are listed, none made. Presentation, submit cost and the shader cache location were not reached. A legend entry [ran, GPU] marks what this run observed; [read] / [guess] are changed only where a line from it supports the statement (findings 1, 4, 7, 8, 9, "What we know now"). Section 4: the five fixes are now upstream (PR ivall#270), the branch carries none. Section 5: the script's three fixes from this run. Nothing was run on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmV74bPu5j5TBXjrNug
New section 0: scripts/linux-smoke.sh in the owner's Arch distrobox on a Radeon RX 7900 XTX (Mesa 26.3.1, Wine 11.22, vkd3d-proton 3.1, DXVK 3.1.1), on wine-bringup rebased onto upstream a6f5f7a, with the answers to section 5's questions in order and the log each rests on. Every test of the binaries that aborted was re-run in its own process; all 717 results are in docs/linux-wine/tests-gpu-radv.tsv (663 pass, 5 fail, 8 abort, 41 ignored). What it showed: Wine uses its kernel (userfaultfd) write watch in the distrobox (no seccomp filter), XCL's UMA import check says ok and the 4 GiB window, wave64 and mesh tests pass. The new blocker is finding 16: vkd3d-proton 3.1 asserts that heaps, fences, resources and root signatures handed back to it carry its own vtable, and XCL's real backend has replaced it (real::adopt) - this ends the test title (exit 0x3), the e2e test and 8 more tests. Findings 17 and 18: v_rsq_f64 of a negative number or NaN gives 0, and v_fma_f32 (HLSL mad) is not fused. Options for 16 are listed, none made. Presentation, submit cost and the shader cache location were not reached. A legend entry [ran, GPU] marks what this run observed; [read] / [guess] are changed only where a line from it supports the statement (findings 1, 4, 7, 8, 9, "What we know now"). Section 4: the five fixes are now upstream (PR ivall#270), the branch carries none. Section 5: the script's three fixes from this run. Nothing was run on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmV74bPu5j5TBXjrNug
New section 0: scripts/linux-smoke.sh in the owner's Arch distrobox on a Radeon RX 7900 XTX (Mesa 26.3.1, Wine 11.22, vkd3d-proton 3.1, DXVK 3.1.1), on wine-bringup rebased onto upstream a6f5f7a, with the answers to section 5's questions in order and the log each rests on. Every test of the binaries that aborted was re-run in its own process; all 717 results are in docs/linux-wine/tests-gpu-radv.tsv (663 pass, 5 fail, 8 abort, 41 ignored). What it showed: Wine uses its kernel (userfaultfd) write watch in the distrobox (no seccomp filter), XCL's UMA import check says ok and the 4 GiB window, wave64 and mesh tests pass. The new blocker is finding 16: vkd3d-proton 3.1 asserts that heaps, fences, resources and root signatures handed back to it carry its own vtable, and XCL's real backend has replaced it (real::adopt) - this ends the test title (exit 0x3), the e2e test and 8 more tests. Findings 17 and 18: v_rsq_f64 of a negative number or NaN gives 0, and v_fma_f32 (HLSL mad) is not fused. Options for 16 are listed, none made. Presentation, submit cost and the shader cache location were not reached. A legend entry [ran, GPU] marks what this run observed; [read] / [guess] are changed only where a line from it supports the statement (findings 1, 4, 7, 8, 9, "What we know now"). Section 4: the five fixes are now upstream (PR ivall#270), the branch carries none. Section 5: the script's three fixes from this run. Nothing was run on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019twRmV74bPu5j5TBXjrNug
Small fixes found running the tests and the test title under Wine. More significant fixes forthcoming, especially in the GPU dept. These are from my very first test run and cross compile. The following is an AI written summary of the changes:
Small fixes to XCL found while running the workspace's test suite and the repository's own test title (
tests/testtitle) under Wine, built with the GNU toolchain (x86_64-pc-windows-gnu). Only changes to XCL itself are included: no Linux scripts, documentation or other tooling. Each commit is one fix and is based on currentmain.The commits
kernelx: memory in use from PagefileUsage where PrivateUsage is 0GetProcessMemoryInfofills only thePROCESS_MEMORY_COUNTERSfields;PrivateUsageof the_EXform stays 0.TitleMemoryStatusthen reported the whole budget as available andXMemGetWorkingSetStatisticsa use of 0.PagefileUsageis used whenPrivateUsageis 0.PrivateUsageis filled and is still the value used.hle::kernelx::tests::title_memory_status_reports_budget(new assertion: memory in use > 0)testgame-mw: no unit-test harnesskernelx.dll, so the exe cannot start andcargo test --workspacefails on it.test = falsein itsCargo.toml.cargo build --workspace.cargo test -p testgame-mw(nothing to start, exits 0)d3d12x null device: descriptor heap start handles in raxGetCPU/GPUDescriptorHandleForHeapStart) with onlythisand takes the handle in rax, asreal.rs(heap_cpu_start_x/heap_gpu_start_x) already answers it. The null device used the PC form and wrote the handle through rdx, i.e. through whatever the caller left there..rdataand the title died with 0xC0000005 inHeap_GetHandleStart.hle::d3d12x::null::tests::heap_start_handles_come_back_in_rax(new)xgameruntime: say what is missing without System32\xgameruntime.dllpreflight::tests::each_missing_piece_is_reported_with_a_fix(new assertion)e2e: stage the test title under CARGO_TARGET_TMPDIR<repo>/target/e2eregardless of the target directory, so withCARGO_TARGET_DIRset elsewhere it still wrote into the repository. It now usesCARGO_TARGET_TMPDIR.CARGO_TARGET_DIRset elsewhere (seen under Wine 11.22).Two other fixes from the same work were left out because current
mainalready has an equivalent fix:describe_addresspanicking when Wine names the main executable for address 0: fixed by 1b0c610 (module_offset, PR modules: a crash report survives an address below its module's base #147).WaitFrameEventX: fixed by 488e5fe (publish_originholds the queue lock across the release). The 20-run counts below are for that code.How this was tested
Everything was built and run on Linux under Wine with Rust 1.97.0 for
x86_64-pc-windows-gnu(mingw-w64 GCC 13), on this branch's final commit. Wine versions: 9.0 (Ubuntu package 9.0~repack-4build3) and 11.22. Tests were run with--test-threads=1, underxvfb-run, with no GPU.cargo build --workspace --target x86_64-pc-windows-gnu(workspace crates rebuilt from clean): no warnings.cargo clippy --workspace --all-targets: no lint on any changed line.hle::kernelx::tests::(incl.title_memory_status_reports_budget)hle::d3d12x::null::tests::(incl.heap_start_handles_come_back_in_rax)preflight::tests::hle::xgameruntime::api::tests::hle::d3d12x::frame::tests::modules::tests::cargo test -p testgame-mwframe::tests::statistics_name_each_frames_origin_and_rescheduled_handles_outlive_the_clock_tick, 20 separate runscargo test -p xcl --target x86_64-pc-windows-gnu --test e2e, Wine 11.22, once, withCARGO_TARGET_DIRoutside the repository): the staging folders were created in<target dir>/x86_64-pc-windows-gnu/tmp/e2e/{game,data}, and notargetfolder appeared in the checkout. The test itself fails in this setup: there is no D3D12 device and no Gaming Services, 13 of the title's checks that need the GPU or a real window fail, and the title ends with 0xC0000409 after a panic ingpu/tiling.rs:419(slice index out of range) during the DirectStorage check.tiling.rsis not touched here, but the title only reaches that point now that the null device's descriptor heap crash is fixed; the panic was not investigated.Not tested: anything on Windows, the MSVC toolchain, and anything on a GPU (there is none in this setup). CI on this PR will be the first Windows / MSVC build of these changes.
Notes for review
target\e2etotarget\tmp\e2e(target\<triple>\tmp\e2ewith--target).scripts/test.ps1does not refer totarget\e2e; anything local that looks there would need the new path. The debug-layer e2e test still usestarget\e2e-debug-layer; it was not changed. CI skipstest_title_runs_and_game_folder_is_untouched(ci.yml), so the new staging path is only exercised byscripts\test.ps1on a PC.Heap_GetHandleStartnow has the same shape asreal.rs'sheap_cpu_start_x/heap_gpu_start_x(thisonly, handle in rax). Worth a look with the null device on Windows (no D3D12 device, or graphics = "null").PagefileUsageis read only whenPrivateUsageis 0. On Windows both are the process's commit charge, so the value used there should not change; please confirmPrivateUsageis non-zero on a real title.test = falsealso skips building its (empty) test harness under MSVC; no tests are lost.