fix(agc): copy an imported range once a merge extends it past its import #1489
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1489"
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 boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-08T09:08:02Z.
What
In an address-based build, a buffer view that runs from one host-imported registered range into the next is bound past the first range's import:
UploadPreparemerges the view into that range's region and keeps the import (Region::direct).Descriptorthen returns the import's buffer withoffset + rangepast its size, andAddressRangesmaps the whole region, the next range included, through the import's device address.mainstored into the first range in place.guest buffer view exceeds its GPU owner(190 skips in 3,000 s); a view across two imported ranges gives the same error, but the draws' V# comes from SRT memory and is not traced.UploadPrepare.Tested
main9619edff: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 405/405 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_driver_graphics(mock device, newvkGetMemoryHostPointerPropertiesEXTstub): a view across two imported ranges and one inside the second read their bytes in bounds; no BDA range runs past its buffer. Fails onmain; with #1270 it fails atexceeds its GPU owner.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)Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-08T13:18:13Z.
Tested on AMD under Linux, since this PR wasn't: RX 9070 XT (RDNA4, GFX1201), RADV / Mesa 26.2.4, Linux 7.2.9 (CachyOS), GCC Release build.
ctest: this PR merged ontomain07c2405c, all 452 tests pass withctest -j8(main alone: 452/452 on the same machine).main+ #759 (needed to boot this title onmain) + this PR, then one scripted run headless from boot through the title screen. No error and no amdgpu fault came from this change.main+ #759 alone: 226, 229, 226.storage image access to depth/stencil surface ... is not implemented(the gap #425 fills). So nothing past the title screen is covered.AI-assisted: the runs and this write-up were done by Claude (Claude Code) on my machine.
Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T01:25:24Z.
Tested with Stray (PPSA02100 v1.05, Unreal Engine 4). It hits this bug, and this PR fixes it.
Setup: Linux (Nobara 44, kernel 7.2), RTX 5070 Ti, NVIDIA 595.91.07. Base is
main1be6f9f1+ #861 + #1836 + #1837 + #1893 + #1902 + #1904 + #1928 + #1934.Without this PR, Stray aborts about 3 minutes in:
The compute shader's buffer V# covers 0x2020230000 + 0x7f800. The registered allocation there is 0x50000 bytes and host imported.
UploadPreparemerges the two regions into 0x2020230000 to 0x20202b0000 but keepsdirecton the 0x50000 import.Descriptorthen checks the view against the import's end at 0x2020280000 and throws on the second check. With this PR merged, that error no longer occurs and the run goes on to an unrelated one (#1409).I also wrote the same case as a test on a real device (NVIDIA, through the recorder test binary):
agc_driver_graphics(this PR's mock test)mainguest buffer view exceeds its GPU ownerI checked whether a merged region can also drop below its import's base. Regions are sorted by
begin, and a merge where the import sits on the later region keeps only the earlier region's fields, so the end-side check covers it.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:56:03Z.
Could you rebase onto current main? The full build checks out this branch with main's workflow, and it stops at
tools/check_test_registration.pynot being on the branch yet, so nothing gets compiled. After a rebase it can get a full build and go in.Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-09T10:00:39Z.
Rebased onto current main (
43972e69a1), so the branch has the registration check now. It was a clean rebase. I built it here, andcheck_test_registration.pyandagc_driver_graphicsboth pass.