Retail title reaches its title screen and menus: GPU title memory in large pages, to_zero pruned once #203
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!203
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-203"
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?
@Sr-0w on GitHub · 2026-11-23 20:40 UTC · original
Sr-0w:gta6-title-memory→main· +29 −8 · 2 files · 1 commits · openRetail title on screen
With this PR together with #163, #170, #164, #168, #169/#192 and #187, plus compute pipelines built at their first use (#162), the retail title shows its title screen and the Navigation menu, reacts to the pad (Y on the keyboard's E), and ran for more than 5 minutes without a crash on an RX 7800 XT:
Still wrong, and visible above: full-screen quads draw only one triangle (the diagonal), and part of the text is missing. More on that in a follow-up.
The fixes in this PR
1. GPU title memory in large pages. The retail title allocates its index and vertex data with
VirtualAlloc(MEM_LARGE_PAGES | MEM_RESERVE | MEM_COMMIT, protection 0x22004), in blocks of 1.2 GB, 0.6 GB and 0.6 GB. These carry neitherMEM_GRAPHICSnorMEM_64K_PAGES, so they got plain process memory. The GPU then faulted on the index buffers there: a driver timeout (0x887a0006) about 50 s in. Radeon GPU Detective showed a page fault during aDrawIndexed, at an address with no resource, inside thatVirtualAlloc.Large-page allocations with protection bit
0x20000now get a sparse window, likeMEM_64K_PAGESones. They are placed from the highest window down, so that the title's physical pages (6.3 GB in one piece) keep the lower windows. Without #187 (page homes out of GPU space), everything does not fit:AllocateTitlePhysicalPages(99776): no room in UMA, then the title's assertion.2.
sparse::decommit_tileswalked all ofto_zeroat every decommit that unmapped a tile. That list grows until the nextExecuteCommandLists. While the retail title maps gigabytes of physical pages during loading, this took seconds per page: rendering froze, and the title's watchdog ended the game (mov [0], 0at+0x2215c35). The list is now pruned once, where the runs are taken. The unit test is adapted accordingly.Testing
cargo test --release -p xcl --lib: 535 passed, and 1 failed,gpu_wave64_ps_whole_wave_reductions, which already fails on main on this machine.🤖 Generated with Claude Code
@Kalmarv on GitHub · 2026-11-23 20:44 UTC · original
Great result. The two problems still visible in your screenshots each have an open PR you could try on the same stack:
report.json. XCL refuses every BCPack chunk today, and the log shows only the first one. WithXCL_DSTORAGE_BCPACK_FILL=1, #201 also fills each refused texture with solid magenta. If the missing letters turn into magenta boxes, they come from BCPack (most likely BC7). If they don't, the cause is elsewhere.AI-assisted (Claude Code).
@WarmMilkCodes on GitHub · 2026-11-23 20:45 UTC · original
FYI on the one test failure:
gpu_wave64_ps_whole_wave_reductionsfailing on main on an RX 7800 XT is a known AMD issue, fixed by #155. RDNA2 and RDNA3 report 32–64 lanes, but the driver runs wave64 pixel shaders in 32-lane waves, sov_readlane32 wraps to lane 0 (the test sums twice: 928 vs 464). #155 gives VS / PS theupper_lanes32-lane form whenever the GPU can run 32-lane waves. It has been confirmed on an RX 6600 XT and on two RX 7800 XTs (one at 32.0.32015.7029, one at 32.0.32029.2010), with no change on an RTX 4080 Super. It's on top of current main.Not claiming it's related to the missing text, but with #155 that test should pass on your 7800 XT too, which takes it out of the picture when you narrow that down.
@Kalmarv on GitHub · 2026-11-23 21:20 UTC · original
Two findings on a merge with main
6da33fa, neither blocking the menus:kernelx.rs:196passes 64 KiB where the existing graphics path asks for 2 MiB.sparse.rs:191): after a full unmap and a new pool tile at the same VA, the old 4 KiB clear is kept. Redundant work only; reused tiles are fully cleared anyway.The tagged allocation itself works: it lands in sparse window 2 and both GPU dispatches read the expected words, where main reads 0 instead of 1077.
Tested
The tagged allocation reached sparse window 2 and returned the expected 64 words in each of two GPU dispatches, including after replacing the input descriptor. I found a 2 MiB alignment regression and a stale clear on VA reuse.
6da33fa123538b390ef710x20003000, protection0x22004MEM_GRAPHICS, first 64 KiB of window 2 occupied0x10000At PR-head
crates/xcl/src/hle/kernelx.rs:196, the new branch passes 64 KiB alignment even when the existing graphics path would request 2 MiB. The fallback also aligns to 64 KiB. On all current-main builds, protection0x2404and the ordinary-page control went to coherent window 3. The 64 KiB page control went to sparse window 1.At
crates/xcl/src/hle/d3d12x/sparse.rs:191, decommitting one page, decommitting the rest of its tile, then installing a different pool tile at the same VA before pruning retained the old page clear. This demonstrates redundant work. Reused pool tiles already receive a full clear.RTX 5070 Ti, 610.74, Windows x64.
cargo test -p xcl --lib --no-run -j 2, then serial kernelx, sparse and tagged-dispatch tests. All three builds returned 27 passed, 3 failed, 1 ignored. On main, submit 1 read 0 instead of 1077 at lane 0 and two probes expected sparse placement. On both merges, the dispatch passed and the three failures were the two alignment checks and the stale clear. Direct head7cbd008also passed both dispatches. Against the original956a476control the tagged allocation was outside UMA, and the 6 GiB home required #187. On6da33fathat capacity check succeeds without #187. The updated sparse unit test calls a helper absent on956a476, so I used its original unit test and the same remap probe on the control. The local #187 stack uses8c0346d's CPU-home implementation and preserves main's coherent-allocation branch.Not tested
Retail boot, frame output, or pre-device timing. With the D3D12 debug layer enabled, the original baseline, PR and stack all hit
CreateReservedResource(E_OUTOFMEMORY)before GPU readback. The reported readbacks used native D3D12 with the layer off.AI use — Codex, GPT-6.2 Astra.
@mrp1no on GitHub · 2026-11-23 21:47 UTC · original
NVIDIA + Intel result: with this PR and #187, GTA VI goes through its whole first-boot flow on an RTX 3060.
Setup:
XCL_NETWORK=0, Series X profile (the default).0f34407+ this PR (7cbd008) + #187 (c74b03a) + #242. #242 is only needed on the Series S profile.These are frames the title presented, written by
XCL_FRAME_DUMPat a quarter of each side (960x540):A 420 s timed run presented 1,554 frames. The menus ran at 4–7 fps.
Account prompt. A (Enter) picks PLAYER1.
The intro movie plays, but every frame is solid green. That colour is exactly BT.601 YUV (0, 0, 0) → RGB (0, 136, 0), so the Bink planes the title registers (
BinkGetFrameBuffersInfo/BinkRegisterFrameBuffers, decoded on the CPU and drawn by itsPS_Bink*shaders) reach the GPU as zeros. I'm looking into it.The first-boot screens, with their text readable:
After confirming those, a black screen while it loads:
It was still loading when the timed run ended.
Without this PR on the same machine, the title's hang watchdog ends the game at ~32 s. At that point XCL's thread dump shows a thread in
XMemMapPhysicalPagesScatter→sparse::decommit_tiles, walkingto_zero, so this PR's second fix is what gets an Intel + NVIDIA machine past that point too.No game files attached; the screenshots are XCL frame dumps. AI-assisted (Claude Code).
@shelbykb2 on GitHub · 2026-11-23 22:20 UTC · original
RDNA2 test report: AMD Radeon RX 6800 (16 GB), driver 32.0.21045.29003, Windows 11, release build,
XCL_NETWORK=0, a newer retail game.This stack – main
956a476+ #170 (aeadb23) + #164 (ce0cb0a) + #168 (070a737) + #192 (50cff5d) + #187 (8c0346d) + #162 (7db28b0) + this PR (7cbd008), withXCL_TRACE_FRAME=1: firstPresentXat 6.0 s; at 48.4 s a write to address 0 inside the C runtime'smemset, and the title ended. We traced it toGetGPUVirtualAddressanswering 0 for some placed textures (#168 covered only those that become a resource of their own).mainnow gives those textures their title address, and the crash has not come back in our runs onmain0f34407(with and without a local memory-routing change), which get past that point on this card.Where the empty V#s point –
main0f34407plus a local census logger (no routing change), 512 MB coherent window, at 30 s: 3 844 empty V#s. By the allocation their address lies in:XMemVirtualAlloctype 0x20003000, protect 0x2404 (one call, 2.25 GB, committed): 3 103 SRV + 349 UAVSo the 0x2404 block is read by shaders too; the large-page rule here (protect bit 0x20000) covers the 0x22004 allocations only.
Not measured: the same census with the coherent window sized for the title's whole ask.
Report written with Claude Code, from our own runs.
@simnJS on GitHub · 2026-11-23 22:39 UTC · original
Tested on Linux (Wine, NVIDIA): as is the title does not start; merged on current
mainit runs, same picture asmain.Tested commits:
7cbd008(head of #203; its base956a476is 126 commits behindmain9ab7d76) and a local merge ofmain+ #203,e7c27cc(no conflict). Compared withmainat9ab7d76, same machine, same protocol.Tested
x86_64-pc-windows-gnu.cargo build --release --locked --target x86_64-pc-windows-gnu -p xcl.7cbd008as is: the game dies 2.9 s in,unhandled exception 0x80000003 in game_scarlett_master.exe+0x19f5291, right afterAllocateTitlePhysicalPages(99776): no room in UMA(WARN). The branch lacks the commits merged since its base, so I do not know whether this is #203's own doing.main+ #203 (e7c27cc): starts, 70 s without a crash, 60 presents per 2 s (30 fps), draws per 2 s 360 → 1320 (main: 360 → 1920; this run was cut at 70 s before the Brightness panel was drawn, so the higher count was not reached). The log now saysAllocateTitlePhysicalPages(99776): no room in unified memory – their home is plain memory(INFO), once. No newWARN/ERRORagainstmain(same 64 distinct lines, 75 total).(0,135,0)) → grey(63,63,63)at the last dump, which shows only the grey background and the white diagonal (the "Brightness Level" panel was not drawn yet when the 70 s run ended), so I could not judge the text of this build from the dumps.main.7e33aac, no conflict): starts, no crash in 70 s, no newWARN/ERROR, the same "Brightness Level" screen with the same missing letters asmain.Not tested
scripts/smoke.ps1were not run.AI use
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@GreemSC on GitHub · 2026-11-24 11:38 UTC · original
Test report (Linux, RDNA3): the
to_zeropart shortens the freeze after the intro from 6.1 s to 4.5 s. No crash, and the title screen is unchanged.Setup
0bb64c5).XCL_NETWORK=0,XCL_PSO_PRELOAD=0(see #1035).x86_64-pc-windows-msvcrelease, built on Linux with the xwin SDK.main384f7f7+ #871 + #684, with and without this PR's head7cbd008. It applies withgit apply --3wayand no conflict.The long frames right after the freeze are there on both sides (base: 1023 and 390 ms; with #203: one of 368 ms). The game's memory (RAM + swap) peaked at 5.0–5.4 GB on both sides.
Why it helps, measured on the base
XCL_THREAD_DUMP_AT, every 0.25 s through the freeze) put the title's thread inMapTitlePhysicalPages→move_awayfor most of it.decommit_tilesshowed thatto_zerostays at ~10 770 entries for the whole load, because nothing submits to empty it. It was walked end to end about 9 300 times a second: 441 Mmappedlookups in 4.4 s.What is left of the freeze (dumps with this PR)
VirtualFreeunder Wine, and the page copies.WaitFrameEventXwhile no CPU thread is busy.Not tested: the suite (no Windows here), the large-page half of the PR on its own (it changed nothing visible in these runs: no GPU fault, same video memory), world loading (this setup stops at #505), other GPUs.
AI use: Claude Code (Claude Opus 5.5) ran the runs and the dumps, added the temporary counter (not in any PR), and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 15:19 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@DavidM1911 on GitHub · 2026-11-26 02:46 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.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.