Skip to content

GPU: tell private reservations apart under Wine - #1

Merged
aycow merged 1 commit into
aycow:fix/direct-indexed-buffer-coherencyfrom
desplmfao:fix/wine-private-allocation
Nov 24, 2026
Merged

aycow merged 1 commit into
aycow:fix/direct-indexed-buffer-coherencyfrom
desplmfao:fix/wine-private-allocation

Conversation

@desplmfao

@desplmfao desplmfao commented Nov 24, 2026 •

Copy link
Copy Markdown

A small fix for Marvisak#185 under Wine (Proton), against this branch.

Problem

watch::allocation reads the Private bit from the flags of QueryVirtualMemoryInformation(MemoryRegionInfo). Wine fills no flags for any region (all zero), so under Wine every reservation looks like a view: Allocation::private is always false, is_private_span never holds, and the grouping by reservation in Shadow::update_ready never takes the private path; ranges in private memory are asked about one by one.

Change

When the flags are all zero, take the allocation type from VirtualQuery (Type == MEM_PRIVATE) instead. On Windows the flags are set and nothing changes.

Tested

per world frame Marvisak#185 Marvisak#185 + this
write-watch questions 147,000 116,000
time in them 750 ms 644 ms
frame time 2.9 s 2.6 s (within run-to-run spread)

With this, private memory is grouped here as on Windows. Most of the remaining questions are ranges of different host copies in one reservation; sharing one question across copies on top of this took them to about 4,500 per frame (24 ms), which I'm following up separately (Marvisak#600). Frame time does not follow the questions much: what remains of a world frame here is not in them.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

watch::allocation reads the Private bit from the flags of
QueryVirtualMemoryInformation's region information. Wine fills no flags
for any region, so under Wine every reservation looked like a view: the
grouping by reservation in Shadow::update_ready never took the private
path, and each range was asked about on its own.

When the flags are all zero, take the allocation type from VirtualQuery
(MEM_PRIVATE) instead. On Windows the flags are set and nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants