The title's 32-bit graphics heap as private write-watched memory (VICTORY_LOW_HEAP_PRIVATE=1, off by default) #4874
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!4874
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4873"
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?
@Liliallen on GitHub · 2026-12-01 12:20 UTC · original
Liliallen:pr-low-heap-private→main· +67 −0 · 1 files · 1 commits · openWhat it changes
The game reserves a 185 MB heap below 4 GiB as a placeholder, splits it in five, maps the pages of one
XMemAllocatePhysicalPagesinto the pieces once, and never maps those pages anywhere else. As views of physical pages the heap can only be watched by page protection (the kernel watches no view), so every first write to a block there is a write fault on a title thread and a protection change. In play, 54 % of the title's write faults were in this heap.VICTORY_LOW_HEAP_PRIVATE=1(off by default) makes that heap one private allocation of its own, committed and write-watched, in place of the placeholder. The title's placeholder splits, page mappings and frees inside it do nothing (logged). It stays off with renderer port 1 (port_on()) and under Wine.shortcut: pages mapped there that were written through another mapping first, or mapped elsewhere afterwards, would not show the same bytes. The game does neither in the runs below; it is logged if it happens.
How it was tested
main5fabb46e) has not been run; the numbers above are from the older base. Not tested on Series S, AMD, Intel or under Wine.cargo test --locked -p victory-hle -p victory-gpuon this branch: victory-gpu passed (1095 passed, 66 ignored). victory-hle: 468 passed, 1 failed,modules::kernel::tests::the_narrow_command_line_is_in_the_ansi_code_page, which fails the same way onmain5fabb46eon this PC (#4539 is about it).a_read_by_range_waits_only_for_a_remapping_that_meets_itfailed in some full runs on both this branch andmain, and passed alone (#2439, #4419).cargo clippy --locked -p victory-gpu -p victory-hle --all-targets -- -D warnings: 5 findings, all inhost/font.rs,host/menu.rsandhost/panel.rs, which this PR does not touch; the same onmain. No finding inxmem.rs.Checked for overlap
xmem.rs; the nearest are #3859 and #2923 (renderer port 1, which this switch stays out of) and #4761 (page mapping inXMemMapPhysicalPages).🤖 Generated with Claude Code
https://claude.ai/code/session_01KXyvvT4sXPGBobHa74YXgA
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.