Linux (Proton/Wine) findings on 0a43566: KNOWN_HOLES never engages under Wine, and LAND_ECHO breaks head skin #59
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX#59
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Kayotic1337 on GitHub · 2026-11-26 00:40 UTC · original
Linux (Proton/Wine) findings on
0a43566: KNOWN_HOLES never engages under Wine, and LAND_ECHO breaks head skinTested the fork on Linux via Proton. Two Linux-specific problems found, one with a small patch. Measurements are from diagnostics logs (
--profile diag --features diagnostics) of one machine; scenes differ between runs, so read the numbers as direction, not exact gain.System
0a43566,cargo xwin build --locked --profile diag --features diagnostics -p victoryscripts/play.ps1defaults (not-Safe),--console series-xAutomatic hardware choices behave as intended under vkd3d: AMD is detected (vendor 0x1002, wave lanes 32/64), so
RDNA_FLOATand wide indirect dispatches are on; the 16 GB VRAM tier gives card buffers min 4 MiB / max 2048 MiB.1.
VICTORY_KNOWN_HOLESnever engages under Wine (big CPU cost)Symptom. On Linux the frame was ~78 ms (12.7 fps) in the world, with the log showing "asking about title memory" at 50-66 ms a frame and ~13,000-22,000 "questions about holes" per frame.
What perf showed (8 s of
perf record -e context-switches -gwhile playing):NtQueryVirtualMemory->fill_basic_memory_info-> a pthread lock wait onvirtual_mutex. That is Wine's single global lock for all virtual-memory calls (confirmed via ntdll.so symbols). ~47 threads were seen waiting on it, ~5 at any moment.watch::uncommitted_end<-watch::guard(99% of samples).NtGetWriteWatchitself is cheap. Proton already uses kernel write watches (userfaultfd WP_ASYNC +PAGEMAP_SCAN;+virtualtrace says "Using kernel write watches"). The cost is the lock convoy ofVirtualQuerycalls, not the write watch.Why.
watch::placeholder()detects the title's placeholders withNtQueryVirtualMemoryclass 7 (MemoryRegionInformationEx) and thePlaceholderReservationflag. Wine does not implement class 7 and returnsSTATUS_INVALID_INFO_CLASS. Its class 3 handler hard-codesRegionType = 0; /* FIXME */. Soplaceholder()is always false under Wine, no hole is everheld, and every hole is re-asked at every asking. That is exactly the costKNOWN_HOLESwas written to remove ("111 ms a frame of all threads' time", watch.rs). On Linux it was still being paid, and Wine's global lock makes it worse.Patch (keeps Windows unchanged: the fallback only runs when class 7 fails):
Reasoning: under Wine a plain
MEM_RESERVEhole in title memory is treated as a placeholder. Title commits go throughXMemVirtualAlloc, which callstitle_memory_allocated, andlook_at_holesre-checks 1% of held blocks every frame. The warning "a placeholder of the title's was filled with nobody telling" never appeared in any patched run. Caveat: the existing test "a reservation of the ordinary kind is no placeholder" (watch.rs, near thelook_at_holestest) would fail under Wine. I did not run the test suite.Effect (same build, patched vs unpatched):
A cleaner long-term fix is on the Wine side (implement
MemoryRegionInformationExand setPlaceholderReservationfromVPROT_PLACEHOLDER). I have not proposed that upstream.2.
VICTORY_LAND_ECHO(default on) breaks head skin of some characters on LinuxSymptom. In the boat cutscene two of the main characters have no facial skin: only eyes, teeth/mouth, hair and cap float in place. Another main character renders correctly. This happens with and without the patch above.
Bisect (each run reloaded the same save into the boat cutscene):
VICTORY_LAND_ECHO=0)With
VICTORY_LAND_ECHO=0and every otherplay.ps1setting on, faces are correct, with no measurable loss of frame rate in that scene. Likely cause (not proven): a page judged to hold "only what a landing put there" also has a later CPU write from the title, so it is never sent up and the skin pass reads stale data. Under Wine the timing differs from Windows. The-Safeswitch already setsLAND_ECHO=0. Making that the default on Wine, or checking that the compare cannot miss a CPU write after the landing, would fix it.Other observations (not fixed, for context)
0xc0000005in title code atvictory-image+0x4e9b4b2, reading0x830be2fff0(r15 =0x830be2ffe8, looks like a garbage pointer; nothing mapped), just after texture read-backs landed. Not seen again in the later sessions (the longest ~8 min so far). Cause unknown; I can't tie it to the patch.BVH_BUILDERoff.VICTORY_SKIP_PIPELINES=nonefromplay.ps1logs "expects 16-digit shader hashes hash="none"". Harmless, but the script value isn't accepted as intended.@zocram4cc on GitHub · 2026-11-26 06:50 UTC · original
@Kayotic1337 thanks for the class-7 finding: it holds on our rig too (Proton Experimental, RX 6900 XT, RADV 26.3.1, Ryzen 7 5800X3D). Numbers and one correction, in case you or @avatarmanz turn it into a PR.
Measured in-game (GTA VI 1.0.2.1, world, first 150 s; "questions about holes" from the host frame line, median of the last 20 lines):
0a43566-based, no fallbackThe frame itself did not move here (the title's own thread is the limit on this CPU), but the submitting thread's preparing dropped by a few ms and Wine's
virtual_mutexsees far fewer calls.One correction. As posted, any
MEM_RESERVEfirst page makes the block a known hole. A plain reservation (read-write, or aSEC_RESERVEview) can be committed by an ordinaryVirtualAllocnobody tells the runtime about, and it is then missed. Fourwatch::tests that pass without the fallback fail with it under Proton (known_runs_*×3,writes_in_partly_committed_view_blocks_are_reported: one page reported, two expected). Wine'sVirtualQuerydoes say how a placeholder was made, so this keeps them and asks about the rest:watch::under Proton: 54 passed, 1 failed with it (as posted: 50 / 5; no fallback: 52 / 3). The one left,holes_are_known_until_the_runtime_tells, asserts!placeholder(plain)for a plainPAGE_NOACCESSreservation, which only class 7 can tell apart. Windows is unchanged (class 7 answers there).Not tested on Windows. Investigation and code with an AI assistant (Claude), measured by me on the rig above.
github-bot referenced this issue2026-11-26 11:22:43 +00:00
@LOCKhart07 on GitHub · 2026-11-26 22:32 UTC · original
Same crash here on Windows:
0xc0000005in title code atvictory-image+0x4e9b4b2, so it's not Wine-specific.Machine: RX 9070 XT 16 GB (driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11.
Build: Belobug/VIctory-Belobug-AMD
a-publier@cd8dfc0+b148067(Belobug#252), release codegen with--features diagnostics.play.ps1defaults (not-Safe) plus--console series-s,VICTORY_UPSCALER=6,VICTORY_LAND_ECHO=0,VICTORY_SIZE_OWN_HANDLE=1, and one local byte patch at title+0x28d0d60(save loading, not on the GPU path). Pipelines precompiled withvictory warm.Crash (~7 min in, during a large firefight):
It's the same shape as yours: the address ends in
…fff0withr158 bytes below it. Frames #2–#5 are in the frame allocator's table copies (+0x4d9f…, the region your commit4da7c0behooks).Just before it, from the diagnostics lines: 6.5–8.7 fps, copies 116–192 MB per frame, about 32 MB per frame of shader writes landed back into title memory (~840–920 pieces), and heap-buffer passes up to 57 ms. There's no device loss and no Windows event. That fits your "just after texture read-backs landed" observation. First time in ~6 sessions here.