Repository navigation
perf(agc): keep adjacent ranges one import serves as one region of the cached address space - #4428
Conversation
|
@hypermoist I tested this on Sword of the Sea (PPSA25344) in the opening cutscene. In this scene, partial overlaps used to dissolve the cached address space in about a third of all address-based builds. With this PR the dissolves are gone. Setup. Windows 11, RTX 5070 Laptop (616.92). Two 900 s in-scene rows, each a lab branch of
For context only: the before-row spent 132 s of 247 s of dispatch resource time in "resources: A locked (bda)", the locked stage A of address-based builds, which includes the dissolve and re-merge. The after-row spent 2 s of 78 s there (cumulative AI-assisted: yes (Claude Code) |
|
Rebase handoff — rebased onto current One test-file conflict with main's newer BDA tests: both sides add independent test functions at the same spot — kept main's Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
To pick it up: Head is |
…e cached address space A V# spanning two registered ranges dissolved the shared space into the build's own regions (about 10k regions copied, sorted and looked up per build in Killing Floor 3), although the import covering the run binds it in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uzy15wqYTt6iWyxYXEzUWo
e42cfad to
6bf9ab8
Compare
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
|
Tested on Minecraft Dungeons II (PPSA16064) gameplay at the Squid Coast spawn: Windows 11, RTX 5070, trace window 25-40 s after the HUD (#4526 trace, On MCD2 this removes a run-to-run bimodality. In about half the runs, about 4 address-based dispatches per frame dissolved the cached space ( Together with #4248, #4012 and #4603, interleaved, 3 runs each: p50 118.6 / 130.6 / 129.1 ms -> 110.9 / 110.8 / 111.9 ms, p99 127-141 -> 121-127 ms. Not run: Linux, AMD, the PR's own tests. AI-assisted (Claude Code). |
|
Checked the region merge in |
What
GuestBufferMemory::AcquireRegisteredpublishes a cached address space with one region per registered range, while one host import can serve a whole run of adjacent ranges (importRun). A V# that crosses the boundary between two such ranges is then not inside any one region, so the build dissolves the shared space into its own regions: on Killing Floor 3 (PPSA08427) that is about 10k regions copied, sorted and looked up, 700-1,300 times per 10 s at the title screen.When the space is published, adjacent ranges served by the same import (same import, contiguous, same writability, no mirror, not sparse, inside the import) are kept as one region. A V# across them is inside that region and is bound in place from the import, the same binding a V# inside one range already gets.
Tested
Linux (CachyOS, kernel 7.2.9), RTX 3060 (NVIDIA 615.78.08), GCC 16.2.1, Release.
agc_driver_graphicsgets a case (spaceImportRunTestsintests/BdaResources.cpp): two adjacent 64 KiB read-only ranges one import serves, and a V# across their boundary. On currentmainit fails (a V# across one import's ranges dissolved the cached address space); with this change the second build is a space hit and nothing dissolves.mainalone: it stops before its first frame atclip distances, layer, viewport or auxiliary vertex exports is unsupported (register 0x207 = 0x0040000f)(feat(agc): vertex clip and cull distances #423).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01Uzy15wqYTt6iWyxYXEzUWo