xcl run: report process memory under Wine #1088
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1097"
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 Filip722 on 2026-11-24T11:32:20Z.
On Linux Wine, XCL's activity log and smoke summary still report 0 MB while title memory use grows. The activity snapshot now uses Wine's estimate from anonymous resident memory and swap when private usage is unavailable.
What is in it
PagefileUsagefallback atmemory_report::process_commit, the shared source for the memory lines. Keep native Windows private usage, the CrossOver behavior and the guest memory-budget APIs unchanged.Tested
memory_report::testsreported 5 / 0 / 0, 0 runtime skips (passed / failed / ignored).title_memory_status_reports_budgetreported 1 / 0 / 0, 0 runtime skips (passed / failed / ignored).Regression run
Both Windows MSVC release builds ran the same 20-second offline startup smoke with independent title data and caches.
Main
PR head
Not tested
The refreshed head was not tested on native Windows or CrossOver. The increase from 0 MB is a change in measurement, not an increase in allocated memory. A complete workspace comparison is pending. The clean main workspace attempt hit a device removal in the parallel library harness (NVIDIA Xid 109 here). The matched retail smoke ran separately with no device removals.
AI use
Codex GPT-6.2-Sol High refreshed the change on main, ran the tests and smoke, and updated this description.
Imported from ivall/xcl. Originally posted by ezamelczyk on 2026-11-24T13:21:59Z.
Test report for
54221a0(this PR's head) againstmain47efa2e, on AMD RDNA4 under Linux. Your runs were on NVIDIA; this covers AMD / RADV.Tested
-Db_ndebug=true), DXVK from GE-Proton 11-14,VKD3D_CONFIG=ignore_shared_fence, DXC 1.9.2609.5x86_64-pc-windows-msvccross-built with clang + lld and an xwin SDK; tests debug, smoke runs releasecargo test --workspace --no-fail-fast --target x86_64-pc-windows-msvc -- --test-threads=4withwineas the runner:54221a0: 734 passed, 7 failed, 41 ignoredmain47efa2e: 731 passed, 10 failed, 41 ignored. That is the same 7, plusplaced_title_textures_share_vram_and_preserve_pixels(#718, flaky) and two tests that hit its poisoned lock. All three pass when run on their own.gpu_f64_rootsandgpu_f64_math_random(rsq of a negative f64 gives 0, not NaN; #530),gpu_nonfused_mad_and_mac_prevent_fma_contraction(#472),xma2_source_voice_decodes_and_manages_lifetimeand the e2e XMA2 / hidden-window checks (#890, #794),disk_free_space_ex_reports_pls_quota(#810),set_predication_buffer_state_and_kickoff.scripts/linux/smoke.shfrom #257),mainthen head, back to back. The commit line is the point of this PR:mainreports 0 MB and the head reports real numbers.Regression run (from
smoke.shunder Wine)An earlier pair of head runs gave 6243 MB. The first
mainrun on a fresh data folder showed 603 frames. Later runs of both builds show 10–15, so the frame count depends on the title's saved state, not on this change.Not tested
PrivateUsageis set, so the fallback is not used there.PagefileUsageunder Wine tracks the commit charge as closely asPrivateUsagedoes on Windows. I only checked that it is non-zero and grows over the run (4277 → 6179 MB).AI use
Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T15:44:16Z.
Review: COMMENTED
Tested on RDNA2 under Proton: no new failures.
Tested (head
54221a0, merged ontomain930e8b4: no conflicts)-Db_ndebug=true, dxil-spirv53aac418from #775), DXVK v3.1.1-209dxgi, DXC 1.9.2609.5, libopus 1.5.2,XCL_REQUIRE_GPU=wave64,mesh(0 SKIPPED)x86_64-pc-windows-msvc(clang-cl / lld-link, xwin SDK 10.0.26100), Rust 1.99.1, debugcargo test -p xcl --lib -- --test-threads=1plus every integration test (--test '*' -- --test-threads=1), compared per test with the same runs onmain930e8b4.mainhere: 8 stable Wine-lane failures (#530 ×2, #676, #890 ×2, e2e,pls_quota#810,predication_e2e#1272). Separately,title_textures::{placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted}andvram::d32s8_targets…fail together in 2 of 5mainruns (the #718 family), so I do not count a pass of those as a fix either way.main: 740 / 11 / 41, with the #718 flakes failing in that run). No test fails here that passes onmain. The PR adds no test, so none of these runs exercise the WinePrivateUsage= 0 path itself.Not tested
XCL_SAMPLE_*was set, so the tests that read them (about 66) pass without running.xcl run's activity log under Wine with a title (no game here), which is what the PR changes.AI use
Imported from ivall/xcl. Originally posted by Lucasyudi on 2026-11-24T21:21:38Z.
Update for
bdf0913(same Mac, same toolchain):wine_get_host_versionunder CrossOver 26.3 returnssysname=Darwin release=27.2.0(a plain probe that calls it the wayutil::linux_winedoes), solinux_wine()is false here and the activity log keeps 0 MB on a Mac, as onmain, instead of the virtual size. That is the behaviour the README line now describes.cargo test -p xcl --libfiltered toactivity_commit,title_memory_statusandutil::: 7 passed, 0 failed (activity_commit_uses_pagefile_only_when_allowedincluded).xcl.exebuilds.memory:line from this build (the test title ends before the first tick here). The title-facingTitleMemoryStatuskeeps thePagefileUsagefallback, so on a Mac a title still sees the virtual size there; you kept that on purpose and it is unchanged frommain, so only a note.Test report for
2ba567b(this PR's head) on macOS, since shortside noted on #258 thatpeak commitreads 0 MB in every Mac smoke block. On CrossOver for macOS thePagefileUsagefallback gives a number, but it is the process's virtual size, reservations included, not commit or resident memory. So on a Mac the figure moves from 0 MB to about 40 GB plus whatever XCL reserves.Tested
Apple M4 Pro, macOS 27.2.1, CrossOver 26.3 (Wine 11.0), Rosetta 2. mingw-w64 (GCC 16.2.0) cross-build.
A plain probe (no XCL) calling
K32GetProcessMemoryInfowithPROCESS_MEMORY_COUNTERS_EX, the callprocess_private_bytesmakes, after each step, in MB:VirtualAllocreserve 8 GBPagefileUsagefollows the reservation (+8 GB) and ignores commit and touch;WorkingSetSizefollows the pages written.PeakPagefileUsagereads 0.The PR build itself:
cargo build --workspaceat2ba567b, then the test title withXCL_ACTIVITY=1under CrossOver. It ends before the first 2 s activity tick on this host (the D3DMetal stop in #258), so I have nomemory:line from the PR's own log; the numbers above are from the probe only.What it means here: on Linux Wine the README line in this PR (anonymous resident memory and swap) matches what you measured. On macOS Wine it does not, and with the 125 % peak-commit rule in mind (#1103), a smoke pair on a Mac would compare virtual sizes. Either saying "Linux Wine" in the README line, or not taking
PagefileUsagewhen it is far above the working set, would avoid that; your call, I haven't tried either.Not tested: Linux, Windows, a retail title, the
memory:line from this build on a Mac.AI use: Claude Code with Claude Opus 5.5 (
claude-opus-5-5) wrote the probe, ran it and drafted this report.Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-24T23:10:04Z.
Thanks for measuring the reserve, commit and touch steps on CrossOver. In
bdf0913, the activity log uses the PagefileUsage fallback only when Wine reports Linux as its host. The regression test uses the 50,169 MiB reservation figure from your probe.On Linux Proton, committing 32 MiB without touching it left the estimate unchanged. Writing all 32 MiB increased the estimate by exactly that amount. The RTX 5060 Laptop startup smoke reported 0 MB on main and a 4,165 MB estimated peak on the revised head, with both runs exiting normally. macOS validation of the revised head is still open.
OpenAI Codex with GPT-6.2-astra wrote and tested this follow-up.
upstream-sync referenced this pull request2026-11-25 04:08:41 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:36:45Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-25T09:38:29Z.
@Filip722 the macOS side of this, measured, since this PR leaves it at 0 on purpose: on CrossOver one counter does follow the commit, and the title-memory API has the same problem worse.
What each counter does under CrossOver 26.3 (Wine 11.0) on macOS. A probe commits 256 MB with
VirtualAlloc, touches every page, reserves 1 GB more, then frees both:K32GetProcessMemoryInfoPrivateUsage(Wine returnscb= 72, the plain struct)PagefileUsageNtQueryInformationProcess(ProcessVmCounters)VirtualSizeWorkingSetSizeVirtualQuerysum ofMEM_COMMIT+MEM_PRIVATEregionsOnly the
VirtualQuerysum follows the commit (+256 MB, back on free). The walk took about 0.1 ms for 146 regions in the test process.The title-memory side.
kernelx::process_private_bytesfalls back toPagefileUsagewhenPrivateUsageis 0, andTitleMemoryStatus/XMemGetWorkingSetStatisticsuse it. On this Mac that's ~42 GB, soused = min(42 GB, budget)and titles are told 0 bytes of title memory are available. This PR keeps that fallback for the guest APIs, so on a Mac it stays that way.What I'd suggest: keep your Linux choice, and where
PrivateUsageis 0 and the host isn't Linux, use theVirtualQuerysum, for the activity log and forprocess_private_bytesalike. A unit test that commits 256 MB and expects the counter to rise by at least 192 MB passes with that on the Mac and fails without it (44647677952 -> 44647682048, 4 KB for a 256 MB commit, onmain's fallback). One caveat: memory D3DMetal allocates on the macOS side, outside Wine's views, isn't in the sum, so a Mac figure compares with another Mac run (main against a PR, which is whatpeak commitneeds), not with Windows.If you'd like to fold it in here, the diff (+44/-15 with the test) is ready and I'll post it; otherwise I'll open it as a PR stacked on this one once you're happy with the Linux part. Either way the Mac smoke pairs (
peak commit: 0 MBon every Mac block in #258 so far) get a number the merge rule can compare.Tested: MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26.3 / Wine 11.0, Rust 1.100.0
x86_64-pc-windows-gnu, debug,main568e7db; the probe and the twokernelxtests (process_private_bytes_counts_a_commit,title_memory_status_reports_budget) each in their own process. Not tested: Windows, Linux, a title.AI use: Claude Code. A Claude Opus 5.5 agent wrote the probe and the fix and ran them; Claude Opus 5.5 checked the code paths and wrote this comment.
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T12:19:30Z.
Linux / AMD RDNA4 (RADV, Wine + vkd3d-proton): full test suite on
6a57fd7Merged onto
main5eaadb54(clean merge) and compared withmainrun twice on the same machine.Setup
v3.1-83-gcae8353edand DXVKdxgi.dllfrom GE-Proton11-16, DXC 1.9.2609.5x86_64-pc-windows-msvcwithcargo-xwin; test binaries run under WineTested:
cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-fail-fast -- --test-threads=4 --skip <31 tests>main5eaadb54main: none.activity_commit_uses_pagefile_only_on_linux_wine).main:gpu::recomp::tests::gpu_qsad_and_mqsad(flaky onmainunder Wine).About the failures on
mainand the 31 skipped tests (same for every PR in this batch)main's 177 failures under Wine come from #175: once a test has set up the real device, vkd3d-proton refuses the command allocators XCL adopts (d3d12_command_list_Reset: Invalid command allocator), and later tests getE_INVALIDARG(0x80070057). Running vkd3d-proton master with its vtable check taken out,hle::d3d12x::sparse::testsgoes from 106 passed / 38 failed to 144 / 0.std::terminate()(Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private), which kills the whole test binary. They are the split-wave64, dispatch-chain and bridged-mask GPU tests,gpu_compute_mode_dispatch_abi,gpu_compute_thread_limits_leave_the_lanes_past_them_out, the twogpu_mesh_mode_*tests, andconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back, plusserialize_root_signature_strips_console_flags_and_preserves_pc_flags, whose null descriptor vkd3d-proton dereferences. The dxil-spirv ones crash the same way with vkd3d-proton master (f8c1cae8, dxil-spirv93ab44c5).mainwas run twice: same counts, same failure set.SKIPPEDlines (same asmain): no heap windows (2), no D3D12 debug layer (2-3), driver cache control not implemented in vkd3d-proton (1).Not tested: Windows, NVIDIA, a retail title /
scripts/smoke.ps1, a review of the diff. This is a test report, not amerge-check.AI use: omp (Claude Opus 5.5) merged, built and ran the suites on this machine, compared the results with
main, and drafted this report. The user asked for it to be posted.Earlier report (older head)
Linux / AMD RDNA4 (RADV) test report for head
bdf0913merged locally ontomain1a0bbe3(clean merge).Environment
experimental-11.0-20261112), vkd3d-proton v3.1 (#257+dxil-spirv53aac418), DXVKv3.1.1-209, DXC1.9.2609.5,x86_64-pc-windows-gnucross-compileTested (debug test binary under Wine,
--test-threads=1 --nocapture)activity: 1 passed, 0 failed, 0 ignored, 0 skipped (hle::kernelx::tests::activity_commit_uses_pagefile_only_when_allowed, 0.00 s).Not tested: full workspace suite, retail title run on this head, native Windows or macOS.
AI use: T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the test on this machine, and drafted this report.
Imported from ivall/xcl. Originally posted by throny on 2026-11-25T17:37:26Z.
Two contributors checked independently and found that #2362 solves the same problem in a different way: #1607, group D103. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-25T21:31:00Z.
I compared #2362's
VirtualQuerycount with the LinuxPagefileUsagefallback on Bazzite 44 under GE-Proton 11-14. A standalone, asset-free probe reserved 1 GiB, committed 256 MiB of it, touched each page, and freed the region. Measured relative to the reserved state:PagefileUsagePrivateUsagestayed zero throughout. This confirms the two methods overlap in the activity log and measure different things under Linux Wine. I'd keep the touched-page estimate for Linux and use the committed-region count on CrossOver, where the reportedPagefileUsagefollows virtual size. We can share one host-aware helper if we combine the activity and guest API fixes. The guest budget behavior on Linux deserves a separate check before changing its counter.Codex (GPT-6) ran the synthetic probe and drafted this update.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:44:08Z.
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-01T04:48:12Z.
Triage (#1607) – head
bdf0913#2362 (draft) addresses the same problem, the commit in the memory log reading 0 under Wine, differently: it sums committed private regions with VirtualQuery for both the log and the guest title-memory APIs. This PR uses PagefileUsage only for the activity log and only when Wine reports a Linux host. The two are alternatives, not the same change.
The conflict is real. On main the log line in host.rs now takes its commit from
memory_report::process_commit(PrivateUsage only), so thehost.rshunk no longer applies. A rebase has to routeprocess_committhroughprocess_commit_bytes(linux_wine()).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 mokkamokacaffe on 2026-12-01T13:14:06Z.
Independent D103 review at
bdf0913. I agree with Foniass on the scope. One detail worth preserving through the conflict repair is the distinction inactivity_commit_uses_pagefile_only_when_allowed: with zero private usage and a large pagefile value, the activity estimate must stay zero when the Linux-Wine fallback is disabled. Guest title-memory queries still allow the fallback. #2362 changes those guest queries too.Group D103 review on #1607. AI use: OpenAI Codex (GPT-6) read and compared both diffs. No builds or tests were run for this review.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T10:42:14Z.
Follow-up review (head
6a57fd78, sincebdf0913, diff read, not a merge-check):process_commit): fixed. The PR is one commit on currentmain, andmemory_report::process_commit(memory_report.rs~87) now goes throughcommit_bytes(c.PrivateUsage, c.PagefileUsage, crate::util::linux_wine()), which feeds thememory:line (host.rs~177 / ~195) and the smokepeak commit. #2362 is still an open draft with another approach in the same file, so whichever merges second rebases.New: none.
Fine: Linux is detected through Wine's own
wine_get_host_versionexport (util.rs~136-150), cached in aOnceLock, and false when the export is missing orsysnameis null; on native Windowscommit_bytesreturnsPrivateUsageunchanged; a failed query still givesNone; the selector has a unit test and the README says the Wine figure is an estimate. Notemain's smoke block readspeak commit: 0 MB, so the 125 % peak-commit comparison means nothing for this pair.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
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.