Renderer port 1 never places the 32-bit heap (Scattered); arrange from ab113ff is never reached - RTX 4070 Ti, Series S and Series X #23
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/DoubleGhosty--cool_fox#23
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?
@Spaghetih on GitHub · 2026-11-26 17:23 UTC · original
Machine: Windows 11, i7-13700KF, 32 GB, RTX 4070 Ti 12 GB. Game build 1.0.2.1. Built from source at
472e841(release + diagnostics), merged into a local branch that only adds a host FidelityFX path; the memory code is yours.What happens
With
VICTORY_PORT_CONSTANTS=1(andVICTORY_PORT_CBV=1), renderer port 1 never places the 32-bit graphics heap. Every run logs once:and from then on, every second:
So port 5 places nothing either. Same result in all of these (5 runs, 2.5-5 min each, no device removal):
--console series-s,VICTORY_THIN=1,VICTORY_JOIN_PARTS=8, otherwisePlay-VIctory.cmd's switches--console series-s,VICTORY_THIN=0,VICTORY_JOIN_PARTS=0--console series-x,THIN=0,JOIN_PARTS=0,TEXTURE_GUARD=0,AMBIENT=constant:0.8, both ports onThe heap's start address changes between runs (
0x15090000,0x4b40000,0x4f80000,0x37030000); the length is always 182452224.arrange(ab113ff) never runsarrangelogs"... given their section's slices in address order"when it moves pages. That line never shows. I added a line at each of its early returns (no reservation noted for a 32-bit mapping, atdebug; pages with no section; section size different from the reservation's or pages of other sections, atinfo) withVICTORY_LOG=info,victory_hle::modules::xmem=debug. None of them shows either, soarrangeis not reached for this heap at all.One thing I noticed:
XMemMapPhysicalPagesScatterwithside_by_side() > 1goes toscatter(&wanted)and does not pass throughXMemMapPhysicalPages, wherearrangeis called. I made the scatter path callarrangeon each run of consecutive addresses first. That changed nothing here, so the heap is reserved or mapped through yet another path (or the reservation is never pushed toLOW_RESERVATIONS: it is only noted forplaceholder && constrained && ADDRESS_32BIT).What would help
ab113ff("N regions ... in place" with N > 0)? If yes, which--consoleand switches?XMemMapPhysicalPages, the scatter variant,map_alias/CopyPageMappingsBatchX, ...), I can check whether it is the same here.Happy to re-run with more logging.
@Spaghetih on GitHub · 2026-11-26 17:36 UTC · original
Found it, and port 1 now places the heap here.
Cause
The title reserves its 185 MB heap with
kind=0x42000 flags=0x7(32-bit, no commit).XMemVirtualAlloconly pushes a reservation toLOW_RESERVATIONSwhenplaceholder && constrained && ADDRESS_32BIT, andplaceholder(kind & PAGES_64K == PAGES_64K && kind & MEM_COMMIT == 0) is false for0x42000. So the reservation was never noted andarrangereturned at its firstlet ... elseon every mapping.What the title does (logged with port 1 on, sizes of 16 MB or more):
Fix
Note any reservation without commit of 16 MB or more asked below 4 GiB, not only 64 KiB placeholders:
(I also made
XMemMapPhysicalPagesScatter's side-by-side path callarrangeon runs of consecutive addresses, since it does not go throughXMemMapPhysicalPages; not needed for this heap, which is mapped byXMemMapPhysicalPages.)Result (RTX 4070 Ti, Series S, THIN, 5 min)
Data sent up per frame dropped from 38-48 MB to 25 MB. Frame rate unchanged (17.3 fps median, prep 49 ms) on this machine. No device removal and no exception in 5 minutes (issue #15 saw one about 3 minutes in with both ports, so this is not a long enough test to rule it out).
Port 5 on NVIDIA
Port 5 still places nothing here:
copied as before: 962 not in place, 7404 not on 16 bytes. The second counter is misleading:constant_raw_atreturnsfalsebecauseself.twin(index)isNone: on NVIDIA the view heap is capped at 1,000,000 views, so raw twins are off (host view heaps hold 1000000 views ... raw_twins=false), andcopied(false)counts that as "not on 16 bytes". So port 5 cannot place anything on NVIDIA as it stands. This may also be behind #15's missing road withPORT_CBV=1alone on an RTX 4060 Ti (shaders translated to read constants through raw twins on a host that makes none), though I have not checked that.@DoubleGhosty on GitHub · 2026-11-26 20:30 UTC · original
Resolved in commit
46714eb: Low-address placeholder tracking (using VirtualAlloc MEM_RESERVE_PLACEHOLDER and MapViewOfFile3) ensures Renderer Port 1 in-place mapping succeeds consistently on Windows.