xcl run: report process memory under Wine #1097

Open
github-bot wants to merge 4 commits from github-bot/gh-1097 into main AGit
Owner

@⁠Filip722 on GitHub · 2026-11-24 11:32 UTC · original
Filip722:wine-activity-memory → main · +40 −11 · 4 files · 4 commits · open

On 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

  • Prefer PrivateUsage whenever the OS supplies it. Query the cached Wine host name to select the Linux fallback. The guest title-memory APIs retain their existing counter selection.
  • Cover both counter choices and the macOS reservation case. The CrossOver 26.3 report on this PR measured 50,169 MiB of virtual size after an 8 GiB reservation, with no change after committing and writing 1 GiB. That value is unsuitable for the activity log.
  • Document that the Linux fallback estimates anonymous resident memory and swap.

Tested

  • Intel Core 7 240H, NVIDIA GeForce RTX 5060 Laptop GPU (8 GB, driver 615.78.08), Bazzite 44 Testing F44.20261011, kernel 7.2.9-ogc2.1.fc44.x86_64. Windows MSVC release binaries cross-built with Rust 1.98.1. Proton Experimental 11.0-20261112 and vkd3d-proton 3.1 build 4522cc1a8b1347f+ with local compatibility changes.
  • A headless Windows probe running the changed code under Proton identified the host as Linux. After reserving 8 GiB, the estimate stayed at 2,912,256 bytes when 32 MiB was committed and left untouched. Writing those pages raised it by exactly 32 MiB. Releasing the allocation returned it to 2,912,256 bytes. PrivateUsage remained zero.
  • Built the Windows release workspace and all 19 test harnesses with Cargo xwin. Under Proton, --test-threads=4 --nocapture reported 970 passed, 6 failed, 45 ignored. The new counter-selection regression and the existing guest title-budget test both passed again in isolation.
  • The depth/UAV placement check failed with the same assertion on current clean main. The other five failures also occurred in the earlier baseline run on this setup. They cover Opus and XMA2 source-voice lifetime, the synthetic title's hidden-window and voice checks, PLS quota error reporting and GPU predication.
  • There were 25 explicit SKIPPED subcases across the harnesses. Eighteen required wave64, three used unsupported per-lane conversions or arithmetic, two needed the D3D12 debug layer, one needed heap windows and one needed driver-cache disabling. Optional retail test fixtures were unset.
  • Two 25-second offline title smokes with identical starting title data and independent fresh driver and DXIL caches. Main reported 0 MB across 371 frames. The updated PR reported an estimated peak of 4,165 MB across 408 frames. Both exited normally. PowerShell ran the repository smoke script with a Proton launcher wrapper.

Regression run

Main

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: NVIDIA GeForce RTX 5060 Laptop GPU
title: bc4a7118
seconds: 25
exit: 0x0
frames shown: 371 (PresentX 371)
presents per 2 s (last 3): 26 26 1
device removals: 0
crashes: 0
peak commit: 0 MB

PR

xcl-smoke v1
commit: bdf09130d7b416823c1207e6df1e46cb70259c15
gpu: NVIDIA GeForce RTX 5060 Laptop GPU
title: bc4a7118
seconds: 25
exit: 0x0
frames shown: 408 (PresentX 408)
presents per 2 s (last 3): 4 21 61
device removals: 0
crashes: 0
peak commit: 4165 MB

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.

**@⁠Filip722** on GitHub · 2026-11-24 11:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/1097) `Filip722:wine-activity-memory` → `main` · +40 −11 · 4 files · 4 commits · open On 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** - Prefer PrivateUsage whenever the OS supplies it. Query the cached Wine host name to select the Linux fallback. The guest title-memory APIs retain their existing counter selection. - Cover both counter choices and the macOS reservation case. The CrossOver 26.3 report on this PR measured 50,169 MiB of virtual size after an 8 GiB reservation, with no change after committing and writing 1 GiB. That value is unsuitable for the activity log. - Document that the Linux fallback estimates anonymous resident memory and swap. **Tested** - Intel Core 7 240H, NVIDIA GeForce RTX 5060 Laptop GPU (8 GB, driver 615.78.08), Bazzite 44 Testing F44.20261011, kernel 7.2.9-ogc2.1.fc44.x86_64. Windows MSVC release binaries cross-built with Rust 1.98.1. Proton Experimental 11.0-20261112 and vkd3d-proton 3.1 build `4522cc1a8b1347f+` with local compatibility changes. - A headless Windows probe running the changed code under Proton identified the host as Linux. After reserving 8 GiB, the estimate stayed at 2,912,256 bytes when 32 MiB was committed and left untouched. Writing those pages raised it by exactly 32 MiB. Releasing the allocation returned it to 2,912,256 bytes. PrivateUsage remained zero. - Built the Windows release workspace and all 19 test harnesses with Cargo xwin. Under Proton, `--test-threads=4 --nocapture` reported **970 passed, 6 failed, 45 ignored**. The new counter-selection regression and the existing guest title-budget test both passed again in isolation. - The depth/UAV placement check failed with the same assertion on current clean main. The other five failures also occurred in the earlier baseline run on this setup. They cover Opus and XMA2 source-voice lifetime, the synthetic title's hidden-window and voice checks, PLS quota error reporting and GPU predication. - There were 25 explicit SKIPPED subcases across the harnesses. Eighteen required wave64, three used unsupported per-lane conversions or arithmetic, two needed the D3D12 debug layer, one needed heap windows and one needed driver-cache disabling. Optional retail test fixtures were unset. - Two 25-second offline title smokes with identical starting title data and independent fresh driver and DXIL caches. Main reported 0 MB across 371 frames. The updated PR reported an estimated peak of 4,165 MB across 408 frames. Both exited normally. PowerShell ran the repository smoke script with a Proton launcher wrapper. **Regression run** Main ``` xcl-smoke v1 commit: 689f2db477c3c062cf162649781640ef8a977c18 gpu: NVIDIA GeForce RTX 5060 Laptop GPU title: bc4a7118 seconds: 25 exit: 0x0 frames shown: 371 (PresentX 371) presents per 2 s (last 3): 26 26 1 device removals: 0 crashes: 0 peak commit: 0 MB ``` PR ``` xcl-smoke v1 commit: bdf09130d7b416823c1207e6df1e46cb70259c15 gpu: NVIDIA GeForce RTX 5060 Laptop GPU title: bc4a7118 seconds: 25 exit: 0x0 frames shown: 408 (PresentX 408) presents per 2 s (last 3): 4 21 61 device removals: 0 crashes: 0 peak commit: 4165 MB ``` **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.
Wine leaves PrivateUsage unset, which makes the activity log report zero process memory. Reuse the existing title-memory fallback to PagefileUsage so pressure is visible during a run.

Assisted-by: OpenAI Codex (GPT-6.2-Sol high)
CrossOver on macOS includes uncommitted address space in PagefileUsage. Use that counter for activity reporting only when Wine identifies its host as Linux. Keep the guest title-memory API behavior.

Assisted-by: OpenAI Codex (GPT-6.2-astra)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:43:22 +00:00
Author
Owner

@⁠ezamelczyk on GitHub · 2026-11-24 13:21 UTC · original

Test report for 54221a0 (this PR's head) against main 47efa2e, on AMD RDNA4 under Linux. Your runs were on NVIDIA; this covers AMD / RADV.

Tested

  • AMD Radeon RX 9070 XT (RADV GFX1201, Mesa 26.3.1), 12 threads, 32 GB RAM, CachyOS, kernel 7.3.6
  • Wine from GE-Proton 11-14 (has kernel write watches), vkd3d-proton v3.1 + the #257 patch (-Db_ndebug=true), DXVK from GE-Proton 11-14, VKD3D_CONFIG=ignore_shared_fence, DXC 1.9.2609.5
  • rustc 1.99.1, x86_64-pc-windows-msvc cross-built with clang + lld and an xwin SDK; tests debug, smoke runs release
  • cargo test --workspace --no-fail-fast --target x86_64-pc-windows-msvc -- --test-threads=4 with wine as the runner:
    • head 54221a0: 734 passed, 7 failed, 41 ignored
    • main 47efa2e: 731 passed, 10 failed, 41 ignored. That is the same 7, plus placed_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.
    • The 7 fail on both and are Wine / RADV differences with existing issues or PRs: gpu_f64_roots and gpu_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_lifetime and the e2e XMA2 / hidden-window checks (#890, #794), disk_free_space_ex_reports_pls_quota (#810), set_predication_buffer_state_and_kickoff.
    • SKIPPED: none printed. Output was captured, so this is not a full list.
  • Retail title 1.0.2.1, 60 s smoke runs (scripts/linux/smoke.sh from #257), main then head, back to back. The commit line is the point of this PR: main reports 0 MB and the head reports real numbers.

Regression run (from smoke.sh under Wine)

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: AMD Radeon RX 9070 XT (RADV GFX1201)
title: game_dump
seconds: 60
exit: 0x0
frames shown: 10 (PresentX 14)
presents per 2 s (last 3): 0 0 1
device removals: 0
crashes: 0
peak commit: 0 MB
xcl-smoke v1
commit: 54221a06832467622d78af242796e4adf43414f8
gpu: AMD Radeon RX 9070 XT (RADV GFX1201)
title: game_dump
seconds: 60
exit: 0x0
frames shown: 12 (PresentX 15)
presents per 2 s (last 3): 0 1 0
device removals: 0
crashes: 0
peak commit: 6571 MB

An earlier pair of head runs gave 6243 MB. The first main run 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

  • Windows. On Windows PrivateUsage is set, so the fallback is not used there.
  • Whether PagefileUsage under Wine tracks the commit charge as closely as PrivateUsage does on Windows. I only checked that it is non-zero and grows over the run (4277 → 6179 MB).

AI use

  • Claude Code (Claude Opus 5.5) set up the Wine environment, ran the builds, tests and smoke runs on this machine, and wrote this report. I checked the results.
**@⁠ezamelczyk** on GitHub · 2026-11-24 13:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/1097#issuecomment-7132726452) Test report for `54221a0` (this PR's head) against `main` `47efa2e`, on AMD RDNA4 under Linux. Your runs were on NVIDIA; this covers AMD / RADV. **Tested** - AMD Radeon RX 9070 XT (RADV GFX1201, Mesa 26.3.1), 12 threads, 32 GB RAM, CachyOS, kernel 7.3.6 - Wine from GE-Proton 11-14 (has kernel write watches), vkd3d-proton v3.1 + the #257 patch (`-Db_ndebug=true`), DXVK from GE-Proton 11-14, `VKD3D_CONFIG=ignore_shared_fence`, DXC 1.9.2609.5 - rustc 1.99.1, `x86_64-pc-windows-msvc` cross-built with clang + lld and an xwin SDK; tests debug, smoke runs release - `cargo test --workspace --no-fail-fast --target x86_64-pc-windows-msvc -- --test-threads=4` with `wine` as the runner: - head `54221a0`: **734 passed, 7 failed, 41 ignored** - `main` `47efa2e`: 731 passed, 10 failed, 41 ignored. That is the same 7, plus `placed_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. - The 7 fail on both and are Wine / RADV differences with existing issues or PRs: `gpu_f64_roots` and `gpu_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_lifetime` and the e2e XMA2 / hidden-window checks (#890, #794), `disk_free_space_ex_reports_pls_quota` (#810), `set_predication_buffer_state_and_kickoff`. - SKIPPED: none printed. Output was captured, so this is not a full list. - Retail title 1.0.2.1, 60 s smoke runs (`scripts/linux/smoke.sh` from #257), `main` then head, back to back. The commit line is the point of this PR: `main` reports 0 MB and the head reports real numbers. **Regression run** (from `smoke.sh` under Wine) ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: AMD Radeon RX 9070 XT (RADV GFX1201) title: game_dump seconds: 60 exit: 0x0 frames shown: 10 (PresentX 14) presents per 2 s (last 3): 0 0 1 device removals: 0 crashes: 0 peak commit: 0 MB ``` ``` xcl-smoke v1 commit: 54221a06832467622d78af242796e4adf43414f8 gpu: AMD Radeon RX 9070 XT (RADV GFX1201) title: game_dump seconds: 60 exit: 0x0 frames shown: 12 (PresentX 15) presents per 2 s (last 3): 0 1 0 device removals: 0 crashes: 0 peak commit: 6571 MB ``` An earlier pair of head runs gave 6243 MB. The first `main` run 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** - Windows. On Windows `PrivateUsage` is set, so the fallback is not used there. - Whether `PagefileUsage` under Wine tracks the commit charge as closely as `PrivateUsage` does on Windows. I only checked that it is non-zero and grows over the run (4277 → 6179 MB). **AI use** - Claude Code (Claude Opus 5.5) set up the Wine environment, ran the builds, tests and smoke runs on this machine, and wrote this report. I checked the results.
Author
Owner

@⁠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.

**@⁠Filip722** on GitHub · 2026-11-24 23:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/1097#issuecomment-7147090669) 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.
Author
Owner

@⁠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_version under CrossOver 26.3 returns sysname=Darwin release=27.2.0 (a plain probe that calls it the way util::linux_wine does), so linux_wine() is false here and the activity log keeps 0 MB on a Mac, as on main, instead of the virtual size. That is the behaviour the README line now describes.
  • cargo test -p xcl --lib filtered to activity_commit, title_memory_status and util::: 7 passed, 0 failed (activity_commit_uses_pagefile_only_when_allowed included). xcl.exe builds.
  • Still not measured: a memory: line from this build (the test title ends before the first tick here). The title-facing TitleMemoryStatus keeps the PagefileUsage fallback, so on a Mac a title still sees the virtual size there; you kept that on purpose and it is unchanged from main, so only a note.

Test report for 2ba567b (this PR's head) on macOS, since shortside noted on #258 that peak commit reads 0 MB in every Mac smoke block. On CrossOver for macOS the PagefileUsage fallback 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 K32GetProcessMemoryInfo with PROCESS_MEMORY_COUNTERS_EX, the call process_private_bytes makes, after each step, in MB:

    step WorkingSetSize PagefileUsage PrivateUsage
    start 14 41974 0
    VirtualAlloc reserve 8 GB 16 50169 0
    commit 1 GB of it, untouched 16 50169 0
    write the 1 GB 1040 50169 0
    release 16 41977 0

    PagefileUsage follows the reservation (+8 GB) and ignores commit and touch; WorkingSetSize follows the pages written. PeakPagefileUsage reads 0.

  • The PR build itself: cargo build --workspace at 2ba567b, then the test title with XCL_ACTIVITY=1 under CrossOver. It ends before the first 2 s activity tick on this host (the D3DMetal stop in #258), so I have no memory: 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 PagefileUsage when 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.

**@⁠Lucasyudi** on GitHub · 2026-11-24 21:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/1097#issuecomment-7144826153) · edited 2026-11-24 23:13 UTC **Update for `bdf0913`** (same Mac, same toolchain): - `wine_get_host_version` under CrossOver 26.3 returns `sysname=Darwin release=27.2.0` (a plain probe that calls it the way `util::linux_wine` does), so `linux_wine()` is false here and the activity log keeps 0 MB on a Mac, as on `main`, instead of the virtual size. That is the behaviour the README line now describes. - `cargo test -p xcl --lib` filtered to `activity_commit`, `title_memory_status` and `util::`: 7 passed, 0 failed (`activity_commit_uses_pagefile_only_when_allowed` included). `xcl.exe` builds. - Still not measured: a `memory:` line from this build (the test title ends before the first tick here). The title-facing `TitleMemoryStatus` keeps the `PagefileUsage` fallback, so on a Mac a title still sees the virtual size there; you kept that on purpose and it is unchanged from `main`, so only a note. --- Test report for `2ba567b` (this PR's head) on macOS, since shortside noted on #258 that `peak commit` reads 0 MB in every Mac smoke block. On CrossOver for macOS the `PagefileUsage` fallback 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 `K32GetProcessMemoryInfo` with `PROCESS_MEMORY_COUNTERS_EX`, the call `process_private_bytes` makes, after each step, in MB: | step | WorkingSetSize | PagefileUsage | PrivateUsage | |---|---|---|---| | start | 14 | 41974 | 0 | | `VirtualAlloc` reserve 8 GB | 16 | 50169 | 0 | | commit 1 GB of it, untouched | 16 | 50169 | 0 | | write the 1 GB | 1040 | 50169 | 0 | | release | 16 | 41977 | 0 | `PagefileUsage` follows the reservation (+8 GB) and ignores commit and touch; `WorkingSetSize` follows the pages written. `PeakPagefileUsage` reads 0. - The PR build itself: `cargo build --workspace` at `2ba567b`, then the test title with `XCL_ACTIVITY=1` under CrossOver. It ends before the first 2 s activity tick on this host (the D3DMetal stop in #258), so I have no `memory:` 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 `PagefileUsage` when 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.
Author
Owner

@⁠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!

**@⁠DavidM1911** on GitHub · 2026-11-25 08:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1097#issuecomment-7157253122) 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!
Author
Owner

@⁠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:

counter start 256 MB committed pages touched + 1 GB reserved freed
K32GetProcessMemoryInfo PrivateUsage (Wine returns cb = 72, the plain struct) 0 0 0 0 0
PagefileUsage 41991 MB 41991 41991 41991 41991
NtQueryInformationProcess(ProcessVmCounters) VirtualSize 42011 MB 42011 42267 42268 42012
WorkingSetSize 20 MB 20 276 277 21
VirtualQuery sum of MEM_COMMIT + MEM_PRIVATE regions 7 MB 263 263 263 7

Only the VirtualQuery sum 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_bytes falls back to PagefileUsage when PrivateUsage is 0, and TitleMemoryStatus / XMemGetWorkingSetStatistics use it. On this Mac that's ~42 GB, so used = 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 PrivateUsage is 0 and the host isn't Linux, use the VirtualQuery sum, for the activity log and for process_private_bytes alike. 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, on main'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 what peak commit needs), 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 MB on 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, main 568e7db; the probe and the two kernelx tests (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.

**@⁠vakaobr** on GitHub · 2026-11-25 09:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/1097#issuecomment-7158604449) @⁠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: | counter | start | 256 MB committed | pages touched | + 1 GB reserved | freed | |---|---|---|---|---|---| | `K32GetProcessMemoryInfo` `PrivateUsage` (Wine returns `cb` = 72, the plain struct) | 0 | 0 | 0 | 0 | 0 | | `PagefileUsage` | 41991 MB | 41991 | 41991 | 41991 | 41991 | | `NtQueryInformationProcess(ProcessVmCounters)` `VirtualSize` | 42011 MB | 42011 | 42267 | 42268 | 42012 | | `WorkingSetSize` | 20 MB | 20 | 276 | 277 | 21 | | `VirtualQuery` sum of `MEM_COMMIT` + `MEM_PRIVATE` regions | 7 MB | **263** | **263** | **263** | **7** | Only the `VirtualQuery` sum 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_bytes` falls back to `PagefileUsage` when `PrivateUsage` is 0, and `TitleMemoryStatus` / `XMemGetWorkingSetStatistics` use it. On this Mac that's ~42 GB, so `used = 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 `PrivateUsage` is 0 and the host isn't Linux, use the `VirtualQuery` sum, for the activity log and for `process_private_bytes` alike. 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, on `main`'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 what `peak commit` needs), 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 MB` on 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, `main` `568e7db`; the probe and the two `kernelx` tests (`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.
Author
Owner

@⁠ClosetPie107 on GitHub · 2026-11-25 12:19 UTC · original

Linux / AMD RDNA4 (RADV) test report for head bdf0913 merged locally onto main 1a0bbe3 (clean merge).

Environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton v3.1 (#257 + dxil-spirv 53aac418), DXVK v3.1.1-209, DXC 1.9.2609.5, x86_64-pc-windows-gnu cross-compile

Tested (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.

**@⁠ClosetPie107** on GitHub · 2026-11-25 12:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/1097#issuecomment-7162220533) Linux / AMD RDNA4 (RADV) test report for head `bdf0913` merged locally onto `main` `1a0bbe3` (clean merge). **Environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS - Proton Experimental (`experimental-11.0-20261112`), vkd3d-proton v3.1 (`#257` + `dxil-spirv` `53aac418`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, `x86_64-pc-windows-gnu` cross-compile **Tested** (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.
Author
Owner

@⁠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.

**@⁠throny** on GitHub · 2026-11-25 17:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/1097#issuecomment-7169768174) <!-- xcl-1607-hint:D103 --> 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.
Author
Owner

@⁠Filip722 on GitHub · 2026-11-25 21:31 UTC · original

I compared #2362's VirtualQuery count with the Linux PagefileUsage fallback 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:

Step PagefileUsage Committed private regions
Commit 256 MiB +0 MiB +256 MiB
Touch each committed page +256 MiB +256 MiB
Free the region +0 MiB +0 MiB

PrivateUsage stayed 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 reported PagefileUsage follows 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.

**@⁠Filip722** on GitHub · 2026-11-25 21:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/1097#issuecomment-7175180402) I compared #2362's `VirtualQuery` count with the Linux `PagefileUsage` fallback 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: | Step | `PagefileUsage` | Committed private regions | | --- | ---: | ---: | | Commit 256 MiB | +0 MiB | +256 MiB | | Touch each committed page | +256 MiB | +256 MiB | | Free the region | +0 MiB | +0 MiB | `PrivateUsage` stayed 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 reported `PagefileUsage` follows 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.
This pull request has changes conflicting with the target branch.
  • README.md
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.
git fetch -u origin '+refs/pull/1097/head:github-bot/gh-1097'
git switch 'github-bot/gh-1097'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1097'
git switch 'github-bot/gh-1097'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1097'
git switch 'github-bot/gh-1097'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1097'
git switch 'main'
git merge --squash 'github-bot/gh-1097'
git switch 'main'
git merge --ff-only 'github-bot/gh-1097'
git switch 'main'
git merge 'github-bot/gh-1097'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.