AGC: overlapping 2560x1440 storage images in MXGP 26 are recreated and re-uploaded through the CPU path hundreds of times #6998
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 boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T03:32:04Z.
What happens
In some runs of MXGP 26 (PPSA30839), overlapping 2560x1440 storage images keep re-uploading each other from guest memory through the CPU path. A normal run uploads about 10 storage images in 130 s. A run with this behaviour uploads 220–500,
memmovetakes about 29% of all samples, and in builds with #6921 the 100–110 s window drops from about 51 to about 24 presents.Setup: Linux 6.8, NVIDIA GeForce RTX 4070 Ti (595.99.02), Release, pad input.
maindoesn't reach this scene, so all runs usemain143f130553plus the PRs MXGP needs (#6814, #6094, #6160, #6308, #6184, #6455) and #6896's trace timer. It happens with and without #6917 and #6921 (details on #6921).What a log of each CPU-path upload shows
The log is local, not for merging. In
StorageTexture's CPU upload path it prints the address, size,uploadReasonandversion. A run with the re-uploads (252 uploads), the 2560x1440 ones near the start of the burst:0x1224720000+0xf00000covers0x1224760000and0x1224b70000.reason first,version 0: a newStorageTextureeach time).store30,first18,flushed13 andkeys1. In two earlier logged runs, two of these images then upload alternately, dozens of times.HostImportForreturns null for these ranges, the pages are accessible and committed, and the keys are uncompressed. So the cost comes from the number of uploads, not from the path changing.APS5_TRACE_HOST_IMPORT=1: 0 failures, about 4.4 GiB live).How often
The log only adds work in that path (a
HostImportForandDescribeCommittedcall per upload), and it makes the behaviour much more likely. That suggests the title's placement of these targets, or the order in which they're created, depends on timing, and the emulator handles an overlapping placement by flushing and recreating the images, not by aliasing them.Not checked
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T04:52:22Z.
Likely cause, and a PR that addresses it: #6197.
StorageTexture::Refreshtakes another image's pending units on the device (the alias exemption,borrowUnits) only whenHostImportForreturns an import for the range. MXGP's 15 MiB storage images each cross an 8 MiB import window, so they never get one: every upload takes the CPU path, and overlapping images flush and re-upload each other instead. With #6197 (d7f5ffb043) on the same stack, those images import through a joined import:Details on #6197. I'll close this once #6197 is merged and the burst stays away on
main.AI-assisted: yes (Claude Code)