Under Wine: title pages shown with the host's mmap, and renderer port 1's heap opened in place (VICTORY_WINE_MAP, VICTORY_PORT_HOME) #2455
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2455
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2455"
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?
@borntofrag34 on GitHub · 2026-11-29 13:13 UTC · original
borntofrag34:wine-map-port-home→main· +1702 −37 · 8 files · 3 commits · openTwo changes for running under Wine/Proton, each behind its own switch. On Windows nothing changes: both act only when ntdll exports
wine_get_version. They come from borntofrag34/VIctory-7900XTX'slinux-winebranch, where they have been in use since 2026-11-26/27. They are ported here onto this tree'sxmem, which has soft and lazy views, file-backed sections and the batched page mapper.What changes
VICTORY_WINE_MAP(on under Wine;=0brings back today's behaviour)is_valid_view_addr,find_mapped_view). It does that while the calling thread holds ntdll'svirtual_mutex, the lock everyNtProtectVirtualMemory,NtGetWriteWatch, query and fault also takes. (docs/linux-proton.mdalready describes this list, with a patched wineserver as the workaround.)mmap(MAP_SHARED | MAP_FIXED; the descriptor comes fromwine_server_handle_to_fd), then committing the range.MEM_DECOMMIT.VirtualFreeof placeholders (split, coalesce, release) is done on pieces of the reservation that we keep track of.title_view_space, whichwatch'sis_view/readable_view/placeholderandinplace::private_wholeuse.VICTORY_PORT_HOME(on withVICTORY_PORT_CONSTANTS=1andVICTORY_WINE_MAP;=0: off)amdgpu_ttm_tt_get_user_pages) also takes memory by address only as one mapping that the process owns.port.rsopens the heap right there, with no view of ours. It checks through the card that the bytes really arrive, makes up to four attempts, and otherwise gives the stretch up (copied and guarded as before).Side note, not changed here: with
VICTORY_PORT_CONSTANTSunset, the GPU side's port is on by default (except on Ampere), butxmem's half (port_on, which runsarrange) defaults to off. The 32-bit heap is then never in one stretch, the log saysnot one native-import-eligible stretch of a section: Scattered, and nothing is ported. I think the same happens on Windows, but I have not checked.VICTORY_PORT_HOMEonly acts whereVICTORY_PORT_CONSTANTS=1is set explicitly.Measured
victory playsettings with the frame clock at 16.667 ms. A save another player shared (issue 332) in a town, the same scripted walk each time. 300 s per run, read from 150 s on, diagnostics build, one run per setting.main829188e9(+ #2048 to build diagnostics)VICTORY_WINE_MAP=0VICTORY_PORT_CONSTANTS=1VICTORY_WINE_MAPalone does not make the frame shorter here. It takes the Wine server from 6.1 % to 0.4 % of a processor, the write-watch askings from 7.1 to 3.1 ms a frame and the texture refreshes from 9.9 to 5.5 ms. This tree's soft views and section windows already avoid most mapping calls. In the fork, which has neither, the same change took the guards' wait from 171 to 23 ms a frame and protection changes from 48 to 11 ms (first scene, 4K).maintoo.docs/linux-proton.md.Not verified
on_wine(), but nothing was measured there.VICTORY_WINE_MAPis on by default under Wine for every card. Whether NVIDIA's driver imports private memory the same way was not checked; the port's own check through the card guards against zeros.VICTORY_SOFT_VIEWScovering the pool (1orpool), the 32-bit heap is shown lazily and the port finds it uncommitted, so it falls back to copies. The launcher usescopies, which is fine.Tests (under Wine, in a headless gamescope, on the card)
victory-hlexmemandwine_map: 49 passed, 1 failed. The failure,a_read_by_range_waits_only_for_a_remapping_that_meets_it, also fails onmain.maingives 44 passed, 2 failed (that one anda_title_thread_goes_on_using_the_rest_of_a_view).under_wine_the_32_bit_heap_is_shown_as_memory_of_its_own;under_wine_a_stretch_at_home_is_opened_where_it_is_and_a_view_only_if_shared, which runs on the card;pages_at_home_are_never_made_read_only;wine_map's three.victory-gpuwatch::,inplace::,port::: 73 passed, 4 failed. The four aremany_askers_tests×3 andwhat_is_left_alone_is_no_known_hole;maingives 71 passed and the same 4 failed.cargo clippy -D warningsandcargo xtask policyalready fail onmain(victory-shader, victory-loader,heap_sites/frame_users.rs).🤖 Generated with Claude Code
@borntofrag34 on GitHub · 2026-11-29 13:40 UTC · original
Follow-up on "each protection change still costs about 60 µs here … not explained yet": a run with
VICTORY_AB=10,VICTORY_FAULT_UNLOCKED(run 294, same town walk, 600 s, 22 phases each side) explains it. With unlocked faults (default) protections are 20.4 ms a frame and the faults never wait for the guards' lock. With the locked way they are 6.2 ms, but the faults wait 28.9 ms for the guards' lock, and the frame is the same (45.5 against 46.4 ms). About 310 faults a frame either way. The 55-60 µs is the faults'VirtualProtectcalls queuing on Wine'svirtual_mutexwith each other, so the wait only moves from one counter to the other. Nothing to change there; the gap to the fork is elsewhere (its submitting thread works ~30 ms a frame here against ~40).@Kassadd on GitHub · 2026-11-29 21:41 UTC · original
A Wine run on the current tree, and one number that may be worth a look.
Built
mainatcec481f4(the tree of v2026.11.29.03) with this PR merged on top — itapplied with no conflict — plus #2585, and ran it under Proton.
Environment: RTX 4080 SUPER 16 GB, i9-14900K, 62 GB, CachyOS, Hyprland (Wayland),
NVIDIA 620.73.04, Proton Experimental
...-20261128(vkd3d-proton71cae0), Series X1.0.2.1,--res 1080to1440, shader cache emptied first as the release notes ask.The start-up check runs. The log has
wine_map: title pages are shown with the host's mmap, beside Wine's server (VICTORY_WINE_MAP=0: as views), then theVirtualFreelines for reservations that standfor placeholders. Nothing warns and nothing falls back to views.
VICTORY_PORT_HOMEIdid not test separately.
The run: 6m 13s, 19–29 fps, up to 11,795 draws/frame, no
Xidin the kernel log andno
device lost; I stopped it, it did not die. That is the longest run I have had underWine, but I cannot attribute it to this PR. Three runs, one variable apart:
0xc000001dThe difference between the last two is 1m 7s and I did not exercise
VICTORY_WINE_MAP=0to isolate it, so I am not claiming the extra minute as this PR's. What this run does
establish is that the Wine
mmappath works for six minutes of play without a fault ofits own.
The number I think matters. With the camera still, a frame is 51 ms, and the layer's
own breakdown puts 34 ms in
preparing, 18 ms of it incopiesfor 77 MB, with thecard at 3.8 ms (7% busy) and 67,000 list calls a frame. Turning the camera makes it
worse — the frame goes to 8 fps — but I do not have that breakdown for a turning frame,
so I cannot say the 34 ms is what grows. If this PR is meant to help the memory path
rather than to fix a fault, that 18 ms is where I would expect it to show, and on this
one machine and this one measurement I did not see it move. I have no A/B for
copieswithout the PR, so that is an observation to check, not a finding against it.
What I did not do: Windows, a patched wineserver to compare against, or a longer run.
Logs and the exact invocation are available on request.
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.