Repository navigation
perf(agc): bind the address space's BDA table for writes inside writable imports - #4979
Conversation
|
Windows test (MinGW GCC 15.2, Release, Windows 10, RTX 4080 SUPER). Built on main
Not tested: no game run. The batch was built once, not per PR; nothing failed, so no bisect was needed. AI-assisted (Claude Code). |
…ble imports A build mapping only the cached address space but writing through V#s got a table keyed by its writes: a new key for nearly every set of written addresses, so each such build merged the space's imported ranges, stored them, then hashed and compared them in BdaResources. AddressRanges splits only ranges without write permission around the written intervals. When no written interval overlaps such a range of the space, its result is the space's own ranges, so the build binds the space's table by the space serial, as a build without writes does. A write overlapping a range without write permission keeps the per-writes table. Test: builds with one and two writes inside a writable import bind the serial and the ranges of the build without writes, equal to AddressRanges(), and keep the read-only import without write permission. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e4ac947 to
d95634b
Compare
|
Rebased onto current main. The only conflict was the test call list in |
|
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.
|
|
Checked the new path against |
What
GuestBufferMemory::CachedAddressTable()returns the cached address space's own BDA table (its serial and ranges) for a build whose writes all land in ranges that already have write permission, instead of building and keying a table per set of written addresses.AddressRanges()splits only the space's ranges without write permission around the written intervals. When no written interval overlaps such a range, its result is the space's own ranges, so the build binds the space's table by the space serial, as a build without writes does. The check is a bisection per written interval over the space's sorted, disjoint ranges. A write that overlaps a range without write permission (a writable image mirror inside a read-only import) keeps the per-writes table as before.No environment switch: the path is always on and exact.
Why
A build that maps only the cached space but writes through V#s got a table keyed by its writes: a new key for nearly every set of written addresses, so each such build merged the space's imported ranges (about 9000 in Sword of the Sea gameplay), stored them, then hashed and compared them in
BdaResources. In a CPU sample of the lab line (Sword of the Sea gameplay, RTX 5070)CachedAddressTableandhashRangeswere about 4 % of the q0 thread.This is independent of the read-list change and has no dependency on it. I did not measure it in isolation on
main; the figure above is a sampling share on the lab line, not a measured FPS gain.Tested
tests/BdaResources.cppspaceWritableWritesTests(inagc_driver_graphics), with a writable and a read-only import registered: builds with one write and with two writes inside the writable import bind the serial of the build without writes, and the cached ranges equalAddressRanges()(the full walk) and the ranges of the build without writes; the read-only import stays without write permission. Onmainthe serial differs per set of writes, so the test fails there.tools/check_conventions.py --base origin/main: passed.build.yml): Linux and Windows green, 0 failures (https://github.com/AlxcBTW/AnyPS5/actions/runs/38357743201), run before a rebase onto amainthat only addedtests/ShaderMemory.cppChecklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code