Renderer port 1 under VICTORY_PORT_ALL=1 leaves xmem's half off: the 182 MB 32-bit graphics heap is refused as Scattered #365
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#365
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?
@Jesper-Andersson on GitHub · 2026-11-26 19:44 UTC · original
With
VICTORY_PORT_ALL=1alone (whatscripts/play.ps1sets), renderer port 1 is on invictory-gpu, but xmem's half of it is off. The 32-bit graphics pages are not put in address order, so their 182 MB heap is refused as "Scattered" and copied as before.Where
crates/victory-hle/src/modules/xmem.rs:1087at2de9980(main):crates/victory-gpu/src/port.rson(), by contrast, saysVICTORY_PORT_ALL"turns the port on by itself":arrange()(xmem) runs only when xmem'sport_on()is true. It gives the freshly mapped physical pages of the 32-bit graphics reservation their slices in address order.Why it matters
Every
play.ps1run (not-Safe) logs this, about 340 times in a 4-minute run:The run also logs no "given their section's slices in address order" line. The same heap is then handled the old way.
Seen on an RTX 2070 SUPER 8 GB, Series S, local branch on top of main. Per frame of gameplay:
Runs with
VICTORY_PORT_CONSTANTS=1set directly, on the same PC, log the line below and the heap placed (title memory in place ... len=182452224):So everyone who runs port 1 through
play.ps1gets port 1 without its main part, the constants heap. Measurements taken with onlyPORT_ALLset are measurements of port 1 with that heap left out.Suggestion
port_on()acceptVICTORY_PORT_ALL=1too, the same wayport::on()does. Or read one shared switch, so the two halves cannot disagree again.Not checked
AI use
Log reading, source reading and write-up with AI assistance (Claude Code). The runs are my own.
@Jesper-Andersson on GitHub · 2026-11-26 21:04 UTC · original
A correction to my suggestion above: on this card, turning xmem's half on makes the frame slower, so "have
port_on()acceptVICTORY_PORT_ALL" is not the fix to take without measuring.I built the change with a switch to undo it (
VICTORY_PORT_ARRANGE=0) and ran both with the same build, save and route.play.ps1defaults, includingVICTORY_CARD_BUFFERS_MIN_KB=64andMB=1024.the card's clock)With the 182 MB heap in place, the fills that read it can no longer be done on the card from its host copy (
VICTORY_CARD_STEPS=2). They are done by the CPU, about 12,000 a frame, and the card waits more. With the heap left as a copy, card steps do them on the card, and that is clearly faster here.So the mismatch is real: with
PORT_ALLalone, port 1 is on but its main region is refused. Whether to close it depends on the card. It is a gain where card steps are off or the card reads PC memory cheaply (the README's 7900 XTX numbers), and a loss here. It would be better settled on purpose than by default: for example, keepPORT_ALLas it is and document that it does not place the 32-bit heap. Or place the heap only where card steps are off.Not checked: other cards, and
VICTORY_CARD_STEPS=0with the heap in place.AI use: log reading and write-up with AI assistance (Claude Code). The runs are my own.