Repository navigation
Conversation
|
Additional platform validation on standalone PR head Windows: passed — Windows 11, supported WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja. Release / Tests: Reproduce after building the test targets: Vulkan: native AMD RX 6900 XT, driver 32.0.21045.5002. Integration limitation: a local merge against main |
|
Hi! This PR currently conflicts with
It builds, and The rebased branch is available to pull: Feel free to ignore this if you'd rather rebase yourself. |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks. This is stacked on #1330, and both conflict with main now. main changed the same code since (GuestAllocationsAcquireAll, the sparseHeap region flag, refreshSparseMirror), so the rebase isn't mechanical.
- Please rebase on
mainonce #1330 is in (the #157 commit is already merged, drop its copy). @blawesom mentions a rebased branch; it isn't pushed here, so the head I looked at is still7e8c2c1. - Re-run
agc_driver_graphics/guest_memoryafter the rebase, including the newBdaResourcesandGuestAllocationscases. - The description says "perf" but has no numbers. Please add before/after timing for the
UploadPrepare/DescribeCommittedpath (same tree, several runs), as in #1330.
The change itself reads fine: storeChanged returns early on whole, and every other partialRanges use is guarded by !whole.
Keep full commitment checks allocation-free and coalesce owned regions in place while preserving partial mappings and overlapping snapshot validation. Written with AI assistance.
7e8c2c1 to
d44adcb
Compare
|
@adriadam10 Updated to Preserved main's Fedora 44 Release: Added a reproducible Ready for another review. |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the update. d44adcb4e still conflicts with main (GuestBufferMemory.cpp, tests/Graphics.cpp, tests/GuestAllocations.cpp), and it isn't mechanical:
GuestBufferMemory::UploadPrepareonmainnow sorts anorderindex vector and walksregions[order[i]](the merge loop starts atGuestBufferMemory.cpp:2759). The in-placemergediterator compaction needs redoing against that loop, with themergeBackedsparse handling kept.addDescriptorRegion(~GuestBufferMemory.cpp:2413) has a newcommitted.rangesuse that has to move topartialRanges.--benchmark-buffer-rangescollides withmain's--sparse-buffer-holesentry intests/Graphics.cpp; keep both.GuestAllocations.cpp:RunGuestAllocationTestsnow callsleaseSnapshotTests(); keep it next tocommittedRangeTests().
After the rebase, please re-run agc_driver_graphics and guest_memory and redo the before/after table against the current main, since the merge loop you measured has changed. Consider keeping the benchmark harness out of the test binary (a separate target or the PR description), as it is ~50 lines of non-test code in Graphics.cpp.
|
Closing for now: no title or measured gain is shown. With the queue this large we're closing stalled perf PRs that don't show a gain in a title; reopen it with before/after numbers from a title scene (the summary lines from the performance report form) if you pick it up again. |
What
Coalesce overlapping buffer regions in place instead of allocating a second owner vector. A wholly committed memory range no longer allocates a list of partial ranges. Preserve snapshot contents, conflicting-overlap rejection, sparse heaps, and mirror refresh/writeback.
Rebased directly on main
d146ec1b6. Removed the #1330 permission-cache prerequisite and the already-merged #157 copy; this branch now contains only buffer-range normalization and its tests. The newer sparse-mirror callers useCommittedRangeswhen they need an explicit full range. Main'ssparseHeapflag andGuestAllocationsAcquireAllbehavior are preserved.Depends on: none.
Tested
Fedora 44, GCC 16.2.1, Release: built
agc_driver_graphics_testsandguest_memory_tests;agc_driver_graphicsandguest_memorypass (3.33 seconds total). The graphics suite includes the BDA resources and guest-allocation cases.Regression coverage includes reordered overlapping snapshots, disjoint views, inconsistent overlapping bytes, empty/full/partial mappings, clipped bounds, read-only pages, unmapped/decommitted gaps and address reuse. The new commitment test has native Linux and Windows paths; Windows runtime was not run in this pass. Contribution checks and
git diff --checkpass.Isolated measurements on Ryzen 5 5600, CPU 3, same compiler/Release flags and benchmark source. Baseline uses main
d146ec1b6production files; comparison adds only this PR. Three ABBA cycles (six processes per variant), each reporting the median of nine measured batches after one warm-up:DescribeCommitted, 0 bytesDescribeCommitted, fully mapped 4 KiBDescribeCommitted, fully mapped 16 KiBUploadPrepare, 0 snapshot regionsUploadPrepare, 1 snapshot regionUploadPrepare, 8 overlapping/disjoint snapshot regionsUploadPrepare, 64 overlapping/disjoint snapshot regionsAll checksums match. Upload preparation is timed with imports enabled and upload completion outside the measured interval; the harness uses the graphics suite's mock Vulkan functions. These are CPU component measurements, not GPU or title frame times. The 64-region run-median ranges overlap (main 5169–6126 ns, PR 4521–5412 ns); the table reports medians across all six processes, not the best run.
Command for each variant after building the same harness:
For the baseline, use main's
Execution/include/GuestMemory.hpp,Execution/src/GuestMemory.cppandGraphics/src/GuestBufferMemory.cppundercore/libs/prx/libSceAgcDriver, keeping the benchmark source identical. Keep main'stests/GuestAllocations.cppfor that baseline build because the new assertions refer topartialRanges. The benchmark mode does not run those assertions.Checklist