xmem: create physical-page sections committed #367

Merged
Jerkin42 merged 1 commit from upstream-pr/367 into main 2026-11-28 09:22:22 +00:00
Jerkin42 commented 2026-11-28 04:19:55 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-28T04:19:55Z.


Summary

Every XMem physical-page batch is a SEC_RESERVE pagefile section that is then committed whole through one view. Under Wine, VirtualQuery on a view of a SEC_RESERVE section is answered by a wineserver request (get_committed_size), even once every page is committed. ProjectScarlett calls VirtualQuery on these views about 3,700 times a second. On GE-Proton 11-14 here, wineserver sat at 94% of a core, and the title screen ran at about 0.5 fps and never got past it.

shared_pages::Section now creates the section committed (PAGE_READWRITE without SEC_RESERVE), so these queries stay in the process. If that fails (for example at the commit limit), it falls back to the old path: a SEC_RESERVE section committed whole, and if that fails too, views commit their own range.

Tested

  • The checks relevant to this change passed (two Lanes cases that also fail on main here, see below)
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below
  • Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them: NVIDIA still needs to run them.

What changes is how many wineserver requests a query costs, not what it returns. Pages of a committed section read as committed, as before, and the existing xmem checks (physical allocation, views and working set) still pass. A Lanes scenario could count wineserver requests only through Wine internals, so I have not added one.

In ProjectScarlett: wineserver went from 94% to 16% of a core, and the title screen from about 0.5 to about 6 fps. The game then got past the title screen. These figures come from the same build with and without this commit.

GPU, driver and backend: AMD RX 9060 XT, Mesa RADV 26.1.8, Linux 7.3.1; checks on Proton Experimental, the game on GE-Proton 11-14

Commands run and their results:

python tuxbox.py check --proton ".../Proton - Experimental" --prefix <small check prefix> --windows-dxc <dxc 2505>
  passed   Build the shader compiler
  passed   Python tests
  passed   Shader compiler tests
  passed   DXBC tests
  passed   XG layout tests
  passed   Storage codec tests
  passed   D3D12 Windows typecheck
  passed   Build
  FAILED   Lanes and fixtures on the GPU   (2 FAIL: invalid-route, lanes-selftest-mesh-signature-none)
  FAILED   D3D12 regression controls       (mesh: word 76 expected 1548 observed 0; see below)
  passed   Shader translator on the GPU
tools/check_d3d12_regressions.py --case mesh, 22 runs on this branch: 20 passed, 2 failed (same word)
ProjectScarlett, GE-Proton 11-14: before - wineserver 94% of a core, title screen ~0.5 fps, never past it
                                  after  - wineserver 16%, title screen ~6 fps, past it

Both Lanes failures also happen on plain main (df4f27c) on this machine: invalid-route checks route-game.exe's exit status and has failed here before. lanes-selftest-mesh-signature-none was fixed on main by e5c17a4 after this branch was cut. Neither involves the code this changes.

The mesh regression control does not load xmem.dll (the runner copies it only for buffer-remap), and this branch's d3d12_xs.dll is plain main, so that failure cannot come from this change. It is an intermittent miss in the amplified dispatch's output (word 76 is the AS/MS case) on RADV: 2 of 22 runs here, 0 of 18 on another branch, which is not a significant difference.

Checks

No evidence JSON changes.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5536597739 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/367). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-28T04:19:55Z. --- ## Summary Every XMem physical-page batch is a `SEC_RESERVE` pagefile section that is then committed whole through one view. Under Wine, `VirtualQuery` on a view of a `SEC_RESERVE` section is answered by a wineserver request (`get_committed_size`), even once every page is committed. ProjectScarlett calls `VirtualQuery` on these views about 3,700 times a second. On GE-Proton 11-14 here, wineserver sat at 94% of a core, and the title screen ran at about 0.5 fps and never got past it. `shared_pages::Section` now creates the section committed (`PAGE_READWRITE` without `SEC_RESERVE`), so these queries stay in the process. If that fails (for example at the commit limit), it falls back to the old path: a `SEC_RESERVE` section committed whole, and if that fails too, views commit their own range. ## Tested - [x] The checks relevant to this change passed (two Lanes cases that also fail on `main` here, see below) - [x] Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below - [ ] Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them: **NVIDIA still needs to run them.** What changes is how many wineserver requests a query costs, not what it returns. Pages of a committed section read as committed, as before, and the existing `xmem` checks (physical allocation, views and working set) still pass. A Lanes scenario could count wineserver requests only through Wine internals, so I have not added one. In ProjectScarlett: wineserver went from 94% to 16% of a core, and the title screen from about 0.5 to about 6 fps. The game then got past the title screen. These figures come from the same build with and without this commit. GPU, driver and backend: AMD RX 9060 XT, Mesa RADV 26.1.8, Linux 7.3.1; checks on Proton Experimental, the game on GE-Proton 11-14 Commands run and their results: ```text python tuxbox.py check --proton ".../Proton - Experimental" --prefix <small check prefix> --windows-dxc <dxc 2505> passed Build the shader compiler passed Python tests passed Shader compiler tests passed DXBC tests passed XG layout tests passed Storage codec tests passed D3D12 Windows typecheck passed Build FAILED Lanes and fixtures on the GPU (2 FAIL: invalid-route, lanes-selftest-mesh-signature-none) FAILED D3D12 regression controls (mesh: word 76 expected 1548 observed 0; see below) passed Shader translator on the GPU tools/check_d3d12_regressions.py --case mesh, 22 runs on this branch: 20 passed, 2 failed (same word) ProjectScarlett, GE-Proton 11-14: before - wineserver 94% of a core, title screen ~0.5 fps, never past it after - wineserver 16%, title screen ~6 fps, past it ``` Both Lanes failures also happen on plain `main` (df4f27c) on this machine: `invalid-route` checks `route-game.exe`'s exit status and has failed here before. `lanes-selftest-mesh-signature-none` was fixed on `main` by e5c17a4 after this branch was cut. Neither involves the code this changes. The `mesh` regression control does not load `xmem.dll` (the runner copies it only for `buffer-remap`), and this branch's `d3d12_xs.dll` is plain `main`, so that failure cannot come from this change. It is an intermittent miss in the amplified dispatch's output (word 76 is the AS/MS case) on RADV: 2 of 22 runs here, 0 of 18 on another branch, which is not a significant difference. ## Checks No evidence JSON changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Jerkin42 commented 2026-11-28 04:20:10 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-28T04:20:10Z.


I only have an AMD card (RX 9060 XT, RADV), so the NVIDIA half of the checks is still open. If someone with an NVIDIA GPU can run python tuxbox.py check on this branch and post the summary, that would cover the vendor row. Thank you!

<!-- greyfinch-sync:brcly/TuxBox:comment:7233938280 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/367#issuecomment-7233938280). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-28T04:20:10Z. --- I only have an AMD card (RX 9060 XT, RADV), so the NVIDIA half of the checks is still open. If someone with an NVIDIA GPU can run `python tuxbox.py check` on this branch and post the summary, that would cover the vendor row. Thank you!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox!367
No description provided.