xcl run: report process memory under Wine #1097
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1097
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Filip722 on GitHub · 2026-11-24 11:32 UTC · original
Filip722:wine-activity-memory→main· +40 −11 · 4 files · 4 commits · openOn Linux Wine, XCL's activity log and smoke summary report 0 MB even while title memory use grows. The activity log now uses Wine's PagefileUsage estimate when PrivateUsage is missing and Wine identifies its host as Linux.
What is in it
Tested
4522cc1a8b1347f+with local compatibility changes.--test-threads=4 --nocapturereported 970 passed, 6 failed, 45 ignored. The new counter-selection regression and the existing guest title-budget test both passed again in isolation.Regression run
Main
PR
Not tested
The updated head has not been run here on macOS or native Windows. The CrossOver numbers come from the tester's standalone probe on the previous PR head. The Linux title smoke covered startup.
AI use
OpenAI Codex with GPT-6.2-Sol high investigated the original Wine behavior and ran the original checks. OpenAI Codex with GPT-6.2-astra implemented the Linux host check, tested the revision and drafted this update.
@ezamelczyk on GitHub · 2026-11-24 13:21 UTC · original
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
@Filip722 on GitHub · 2026-11-24 23:10 UTC · original
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.
@Lucasyudi on GitHub · 2026-11-24 21:21 UTC · original · edited 2026-11-24 23:13 UTC
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.@DavidM1911 on GitHub · 2026-11-25 08:36 UTC · original
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!
@vakaobr on GitHub · 2026-11-25 09:38 UTC · original
@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.
@ClosetPie107 on GitHub · 2026-11-25 12:19 UTC · original
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.
@throny on GitHub · 2026-11-25 17:37 UTC · original
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.
@Filip722 on GitHub · 2026-11-25 21:31 UTC · original
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.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.