Walking stalls of 0.5-0.7 s are CopyPageMappings remaps on leonida-alias (RX 7900 XT): could they be tile mappings on the card? #2848
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?
Imported from ubiquitarianism/leonida. Originally posted by Yassan01 on 2026-12-01T08:27:09Z.
Summary
Walking in the open world on an RX 7900 XT, most frames are 40-50 ms, but every few seconds a frame takes 0.2-1.5 s. With
LEONIDA_TIMELINE+LEONIDA_TIMELINE_STALL_MS=300, the two stalls caught (518 ms and 677 ms) were almost entirely theleonida-aliasthread in "page mappings behind the title's call", with the line of submissions waiting behind it. None of the existing mapping switches changed this measurably. This is a question more than a bug: could the title's page-mapping copies be done as tile mappings on the card instead of host view remaps?Setup
diagbuild (--features diagnostics,mimalloc) at407f71a2, Series X profile, 2560x1440 outputLEONIDA_MAP_THREADS=1), plusLEONIDA_TWIN_BIAS=0,LEONIDA_DSTORAGE_IO=overlapped,LEONIDA_TEXTURE_BUDGET_MB=7168,LEONIDA_HELD_GREY=1,LEONIDA_NO_WATCHDOG=1,LEONIDA_SHADER_LOOP_LIMIT=4096leonida warm): 0.0 s of pipeline waits in these runsLEONIDA_ABphases of 2 sWhat the stall traces show
Stall 1 (518 ms between two presents):
Stall 2 (677 ms):
The title remapped about 2,500-2,700 pages a second over a run (
LEONIDA_ALIAS_SAME: 787,441 pages by 312 s,same=0, so none were already showing the page asked for).What was tried (walking A/B, frames over 50 ms per 2 s phase)
LEONIDA_MAP_THREADS8 against 1: 5.49 against 5.46, no differenceLEONIDA_ALIAS_CHUNK=0against the default 16: 4.33 against 5.04 over two runs (282 phases); phases with a frame over 200 ms 7 against 6, so the long stalls stayLEONIDA_WRITE_SITES(34 sites learned, 13 patched): no measurable changeLEONIDA_PAGE_ASK: 4.96 against 5.04, no difference; the title's write faults asked Windows about regions at most 14 times a frame (0.16 ms)The idea
The comment on
alias_behindinqueue.rssays the title's CPU does not read the addresses these copies map (the GPU's side of its tiled heap), and the comment onside_by_sideinxmem.rssays each host map or unmap waits for the address-space lock that the guards' protection changes also take (100,000 a second in the world). On the console the same call is a change of the GPU's page tables.Could
CopyPageMappingsBatchXdestinations be backed by a reserved resource on the card, with the call turned intoUpdateTileMappingson the queue in the title's order? The pool pages would then need to be in a heap of the card's (a CPU-visible one where Resizable BAR is on, so the title's and DirectStorage's writes into the pool land there). The open parts I can see: the texture refreshes that read title memory today, and what else reads the pool on the host.tiles.rsalready gives reserved textures tiles on the queue, so some of the pieces may be there.The trace
.txtsummaries and the logs are available if useful.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T21:48:02Z.
Independent walking-stall comparison point on NVIDIA + Windows 10 (
MEASURED):Setup
621.40), Ryzen 9 5950X (16C/32T), 64 GiB RAM, Windows 10 Pro 22H2 (build 19045).diagprofile (diagnostics,dlss,mimalloc) atmain1e3e316c5, Series X profile,-NoFrameGen, defaultplay-nvidia.ps1flags (includingLEONIDA_MAP_THREADS=1,LEONIDA_ALIAS_DIRECT=1), plusLEONIDA_TIMELINE_STALL_MS=200,LEONIDA_TIMELINE_AT=195,LEONIDA_ALIAS_SAME=1, and scripted walking (LEONIDA_KEYSalternating W / turn / W over ~160 s in the world; 32 world frame samples, median 20.9 fps / 47.8 ms, 3,456 median / 7,819 max draws,gpu_wait 0.0 ms, 0 errors / 0 device lost).Measurements
LEONIDA_ALIAS_SAMEconfirms the exact samesame=0pattern:calls=2,048,pages=342,760,same=0(matching the 0% already-mapped rate observed on RX 7900 XT).leonida-aliasper-frame cost was much smaller here than the 477--529 ms stalls seen on Win11 / RX 7900 XT:queue::behind(LEONIDA_ALIAS_LATER) samples (142 non-zero): peak was8.7batches/frame and33.2ms/frame (top 5 samples:33.2,25.5,22.9,18.1,12.7ms/frame;the runtime's changes of mapping per framepeaked around25.2with2.12 msholding title memory still, longest1.61 ms).LEONIDA_TIMELINE_STALL_MS=200):113.04 ms--ahead of a frame: textures picked by index("leonida-ahead-textures",115.84 mson thread)34.71 ms--streaming: reading the source(dstoragethreads)11.34 ms--submit: the lists' steps("leonida-submit",23.58 mson thread)10.17 ms--a copy's refresh+8.51 ms--a texture's refresh("leonida-wide-*")2.68 ms--kernel: VirtualFree,2.19 ms--kernel: GetWriteWatch,0.43 ms--kernel: VirtualProtectpage mappings behind the title's callwas only8.35 msacross 2 spans (longest5.91 ms),the title's CopyPageMappingswas0.12 msacross 2 spans, andthe title's XMemMapPhysicalPageswas16.71 msacross 1,444 spans (longest0.78 ms).0.8 fps,7,819draws) occurred after the one-shot stall capture had already fired; in that windowleonida-aliaswas3.4 batches / 1.9 ms/frame, while recording reported122.0 ms waiting for pipelines(pipelines were not pre-warmed withleonida warmbefore this run).Takeaway for #2848
same=0remap volume (~2,100+ pages/s during scripted walking) reproduces identically across vendors/OS, so reducing host remap work (or moving destinations to GPUUpdateTileMappings) still targets a real, universal workload.leonida-aliasdid not appear in this Windows 10 22H2 +LEONIDA_ALIAS_DIRECT=1run (peaking at33.2 ms/frameinstead of477--529 ms), suggesting OS memory-manager / address-space lock behavior (Windows 11 build 26200 vs Windows 10 build 19045) orLEONIDA_ALIAS_DIRECTmay amplify those long tail spikes.AI-assisted: Antigravity