Repository navigation
fix(agc): retry failed host imports after range replacement - #1357
Conversation
|
Rebased on Fedora 44 Release: |
7076406 to
23e69a9
Compare
23e69a9 to
04bc4e5
Compare
|
Heads-up: this branch no longer compiles when merged onto
#1359 carries the same commits, so it fails the same way. Since the description says this supersedes #1239, I think the rebase only needs |
|
On Windows, spans are still refused here ( Once both are in, the In Poppy Playtime: Chapter 4 (UE5) on Windows, views crossing adjacent registered ranges were being copied (about 158 GB per 10 s of gameplay). Importing them over the span cut that to about 260 MB of reads and roughly doubled the frame rate (local build with other open PRs). |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the work here. This can't be merged as is:
- It is stacked on #1324, which is still open and now conflicts with
mainitself (GuestBufferMemory.cpp). Nothing here can land before it. - On top of that, this head conflicts with
maininVulkanDevice.cpp,GuestBufferMemory.{hpp,cpp},Texture.cpp,tests/Recorder.cpp,GuestAllocations.{hpp,cpp},DirectMemory.cpp,tests/GuestMemory.cppandTechnicalDebt.md. These touch the import/lifetime logic, so they need the author to resolve them, not a mechanical rebase. - Windows: spans are still refused (
importRangereturnsnullptrunder_WIN32), see @Angel21PC's comment and #2254. Please say how this PR and #2254 combine, or keep the limitation documented in TechnicalDebt. - @oneandonlydean measured #1324 alone with no frame-time change; the same question applies to this stack: please name the title and scene where spanning imports gives a measurable gain (before/after numbers).
Please rebase once #1324 is merged (or fold the stack in a way that keeps one topic per PR) and we will review it again.
Retain weak identities and the full failed span so a replacement of either owner or a shorter remaining run retries the import. Keep unchanged failures cached across unrelated mapping changes without pinning their allocations. Existing upstream import lifetime, span windows and Windows fallback remain in place. AI-assisted implementation.
04bc4e5 to
2441a4b
Compare
|
@adriadam10 @popcoder565 Narrowed and rebased onto main The remaining bug reproduces independently: a failed import is keyed only by base address, so replacing either range in a span can leave the new backing permanently rejected. The new fixture injects a failure, checks unchanged/unrelated mappings keep it cached, then replaces each owner and shrinks a span. Unchanged main fails Six focused CTests plus conventions/whitespace checks pass on Fedora 44; native integration cases ran on RADV with core/synchronization validation. No fresh Windows or title-speedup claim. Full platform CI and re-review remain. AI-assisted implementation and validation. |
That review was of the old stack; 2441a4b is a two-file fix on main alone.
What
Retry a rejected host import when any registered owner of its span is replaced at the same address, or when the span changes. Failed decisions retain weak owner identities and their full extent, so they cannot pin freed allocations. An unchanged failure stays cached across unrelated mapping changes.
Narrowed to the remaining correctness issue on main
d146ec1b6: this is now two files, independent of #1324. Main already contains import retirement/lifetime handling, adjacent-range imports (#3158), Windows alias fallback (#3324), and aligned import windows (#3425); those implementations are preserved. The earlier stacked span-import optimization and its performance claims are removed from this PR. No duplicateClearHostImportsor stale Windows early-return implementation remains.Tested
Fedora 44, GCC 16 Release. The new graphics fixture injects a failed Vulkan allocation, checks repeated failures and an unrelated mutation do not retry, replaces either the first or second span owner at the same address, and checks the retry succeeds without pinning the old owner. It also covers shrinking a failed span to its surviving range.
With unchanged main
GuestBufferMemory.cppand this fixture, graphics tests fail withsame-address remap retained a failed import decision. Restoring the fix passes. Six focused CTests pass: graphics, guest memory, import unmap, storage upload lifetime/failure, and descriptor pool recycling. The Vulkan integration cases ran on RX 6600/RADV with core/synchronization validation; the injected-failure fixture uses mock Vulkan. Conventions and whitespace checks pass.No title speedup or Windows result is claimed. A separate current-main Skyrim boot stops at unsupported NGS2 reverb channel conversion before a usable frame-time comparison; it does not establish title impact of this fix. Full platform CI and maintainer re-review remain.
Checklist
d146ec1b6; overlapping upstream work checked.