AGC: agc_driver_host_import_lifetime fails on Windows (Radeon 860M) in partialUnmap: the import's memory is freed before its buffer is seen destroyed #7601

Closed
opened 2026-10-18 16:35:26 +00:00 by LeandroLP23 · 10 comments
LeandroLP23 commented 2026-10-18 16:35:26 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T16:35:26Z.


agc_driver_host_import_lifetime, added by #7339, fails on every run here on unchanged main. #7339 ran it on Linux with an RTX 4090 and lists Windows as not run, so this may be the first Windows run.

Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release, main 6efb7261b.

ctest -R "^agc_driver_host_import_lifetime$" --output-on-failure
AGC graphics: host import Vulkan objects were destroyed out of order or more than once

3 runs of 3, and the same on a build with 14 unrelated open AGC PRs merged.

Which case

I printed the three conditions of requireFreed's second Require with a local line I have since removed:

PROBE destroyed=1 outOfOrder=0 frees=1   (x6)
PROBE destroyed=0 outOfOrder=1 frees=1

The first six requireFreed calls pass: descriptorFirstImport, idleUnmap and the four pendingRead cases. The seventh fails, the first check of partialUnmap, inside the Unmap callback of the middle third. So the import's vkFreeMemory ran while the test's vkDestroyBuffer hook had not yet seen the import's buffer, which is what sets outOfOrder. frees is 1, so the memory is not freed twice.

Two readings fit, and I haven't separated them:

  • the buffer is destroyed after the memory on this path;
  • the buffer is destroyed under a handle the hook doesn't match (state->buffer == buffer), for example a Windows alias of the import, so destroyed never becomes true.

I can't tell Windows from AMD here, since I have only this combination.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5911705798 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T16:35:26Z. --- `agc_driver_host_import_lifetime`, added by #7339, fails on every run here on unchanged `main`. #7339 ran it on Linux with an RTX 4090 and lists Windows as not run, so this may be the first Windows run. Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release, `main` `6efb7261b`. ``` ctest -R "^agc_driver_host_import_lifetime$" --output-on-failure AGC graphics: host import Vulkan objects were destroyed out of order or more than once ``` 3 runs of 3, and the same on a build with 14 unrelated open AGC PRs merged. ### Which case I printed the three conditions of `requireFreed`'s second `Require` with a local line I have since removed: ``` PROBE destroyed=1 outOfOrder=0 frees=1 (x6) PROBE destroyed=0 outOfOrder=1 frees=1 ``` The first six `requireFreed` calls pass: `descriptorFirstImport`, `idleUnmap` and the four `pendingRead` cases. The seventh fails, the first check of `partialUnmap`, inside the `Unmap` callback of the middle third. So the import's `vkFreeMemory` ran while the test's `vkDestroyBuffer` hook had not yet seen the import's buffer, which is what sets `outOfOrder`. `frees` is 1, so the memory is not freed twice. Two readings fit, and I haven't separated them: - the buffer is destroyed after the memory on this path; - the buffer is destroyed under a handle the hook doesn't match (`state->buffer == buffer`), for example a Windows alias of the import, so `destroyed` never becomes true. I can't tell Windows from AMD here, since I have only this combination. AI-assisted
MarcZX10 commented 2026-10-18 16:40:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T16:40:12Z.


I checked the fixture's requireFreed and freeMemory hook against the Vulkan memory-lifetime rule. The Vulkan memory chapter says memory may be freed while still bound to resources; the submitted commands that use it must have completed, and those resources must not be used afterward.

Here requireFreed treats !destroyed at vkFreeMemory entry as out-of-order, and the destroy hook stops tracking a later buffer destruction once freed is true. So destroyed=0, outOfOrder=1 by itself appears consistent with a permitted memory/resource lifetime. The accessibility checks before and after the real vkFreeMemory call are separate and still meaningful for the imported host pointer.

Could you check whether a command uses the buffer after the memory is freed, or whether the relevant Vulkan rule for VK_EXT_external_memory_host imposes a stricter order? Without that, I think the failure may be an overstrict lifetime assertion rather than a Windows-only production defect.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252416926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6252416926). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T16:40:12Z. --- I checked the fixture's `requireFreed` and `freeMemory` hook against the Vulkan memory-lifetime rule. The [Vulkan memory chapter](https://docs.vulkan.org/spec/latest/chapters/memory.html) says memory may be freed while still bound to resources; the submitted commands that use it must have completed, and those resources must not be used afterward. Here `requireFreed` treats `!destroyed` at `vkFreeMemory` entry as out-of-order, and the destroy hook stops tracking a later buffer destruction once `freed` is true. So `destroyed=0, outOfOrder=1` by itself appears consistent with a permitted memory/resource lifetime. The accessibility checks before and after the real `vkFreeMemory` call are separate and still meaningful for the imported host pointer. Could you check whether a command uses the buffer after the memory is freed, or whether the relevant Vulkan rule for `VK_EXT_external_memory_host` imposes a stricter order? Without that, I think the failure may be an overstrict lifetime assertion rather than a Windows-only production defect.
LeandroLP23 commented 2026-10-18 16:51:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T16:51:46Z.


@MarcZX100 I checked, and I agree it is the fixture, not the production order. I added two local prints, since removed: every vkDestroyBuffer that reaches the fixture's hook, and, in the vkFreeMemory hook, the buffer the fixture tracks for that memory. The end of the failing run:

destroyBuffer 00000247086ad9b0
freeMemory    000002470d7b7fd0  tracked buffer 00000247086ad9b0  destroyed=1
destroyBuffer 00000247086acf30
freeMemory    000002470d7b7fd0  tracked buffer 00000247086ac630  destroyed=0   <- the failing check
destroyBuffer 00000247086ac630
  • The production order holds: each vkFreeMemory comes right after a vkDestroyBuffer, and every path I read frees in that order (destroyImport, ~RetiredImport, the bindImport failure path).
  • For the failing free, the fixture's ImportState holds buffer …ac630. That handle was destroyed earlier in the run (the pendingRead cases, against memory …0d6e7710) and shows up again right after, as a new buffer. Memory handles are reused too: …0d6e7710 and …0d7b7fd0 each back several imports in one run.
  • So on this driver the fixture maps a reused memory handle to a state that still names an earlier, already destroyed buffer. destroyed never becomes true for it, and the check fires although the import's own buffer (…acf30) was destroyed just before. AMD's Windows driver recycles VkBuffer and VkDeviceMemory values quickly, which may be why the RTX 4090 run never hit it.

I have not traced which hook leaves the stale buffer in that state: an earlier entry for the same memory value surviving, or a bind the fixture doesn't see. Clearing a state's entry once its memory is freed, or keying states by import rather than by handle value, would avoid it.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252533727 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6252533727). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T16:51:46Z. --- @MarcZX100 I checked, and I agree it is the fixture, not the production order. I added two local prints, since removed: every `vkDestroyBuffer` that reaches the fixture's hook, and, in the `vkFreeMemory` hook, the buffer the fixture tracks for that memory. The end of the failing run: ``` destroyBuffer 00000247086ad9b0 freeMemory 000002470d7b7fd0 tracked buffer 00000247086ad9b0 destroyed=1 destroyBuffer 00000247086acf30 freeMemory 000002470d7b7fd0 tracked buffer 00000247086ac630 destroyed=0 <- the failing check destroyBuffer 00000247086ac630 ``` - The production order holds: each `vkFreeMemory` comes right after a `vkDestroyBuffer`, and every path I read frees in that order (`destroyImport`, `~RetiredImport`, the `bindImport` failure path). - For the failing free, the fixture's `ImportState` holds buffer `…ac630`. That handle was destroyed earlier in the run (the `pendingRead` cases, against memory `…0d6e7710`) and shows up again right after, as a new buffer. Memory handles are reused too: `…0d6e7710` and `…0d7b7fd0` each back several imports in one run. - So on this driver the fixture maps a reused memory handle to a state that still names an earlier, already destroyed buffer. `destroyed` never becomes true for it, and the check fires although the import's own buffer (`…acf30`) was destroyed just before. AMD's Windows driver recycles `VkBuffer` and `VkDeviceMemory` values quickly, which may be why the RTX 4090 run never hit it. I have not traced which hook leaves the stale `buffer` in that state: an earlier entry for the same memory value surviving, or a bind the fixture doesn't see. Clearing a state's entry once its memory is freed, or keying states by import rather than by handle value, would avoid it. AI-assisted
EagleBearerYS commented 2026-10-18 16:52:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T16:52:10Z.


@LeandroLP23 thanks for the detailed report. Your second reading is the right one: the buffer the hook tracks isn't the import's own but an alias that our #6678 binds to the import's memory for its settle read on Windows.

  • When the alias exists: on Windows, a host import under 1 MiB is settled by a batched 4-byte read. When the settle queue is in another queue family than the import's, the batch reads through that alias and destroys it when it reaps the batch. AMD's Windows driver has one graphics queue, so settles go to a transfer family. A device with spare graphics queues settles in the same family and never makes an alias, which fits this showing on the 860M.
  • The order: the unmap path (releaseSettleRetired) waits for the batch, then releases the import, destroying its buffer and freeing its memory. The alias stays bound to that memory until the next reap. The test's vkBindBufferMemory hook keeps the last buffer bound to the memory, which is the alias, so partialUnmap sees the memory freed before "its" buffer is destroyed: your destroyed=0 outOfOrder=1 frees=1.
  • @MarcZX10's point holds: Vulkan permits that free once the batch has completed, and the unmap path waits for it first. No command uses the alias afterwards, so there's no GPU hazard. The fix restores the order the test checks, which the batch's reap and drain paths already keep: it destroys a finished batch's aliases before releasing the imports.

The fix is on fix/agc-settle-alias-before-import-free (d6335722ce). It adds a variant of the test that forces the settles onto another queue family, so GPUs with spare graphics queues take the same path. We'll open it once it's been checked on a Windows GPU. If you have time, running agc_driver_host_import_lifetime on the 860M with that branch would confirm it there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252537651 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6252537651). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T16:52:10Z. --- @LeandroLP23 thanks for the detailed report. Your second reading is the right one: the buffer the hook tracks isn't the import's own but an alias that our #6678 binds to the import's memory for its settle read on Windows. - **When the alias exists:** on Windows, a host import under 1 MiB is settled by a batched 4-byte read. When the settle queue is in another queue family than the import's, the batch reads through that alias and destroys it when it reaps the batch. AMD's Windows driver has one graphics queue, so settles go to a transfer family. A device with spare graphics queues settles in the same family and never makes an alias, which fits this showing on the 860M. - **The order:** the unmap path (`releaseSettleRetired`) waits for the batch, then releases the import, destroying its buffer and freeing its memory. The alias stays bound to that memory until the next reap. The test's `vkBindBufferMemory` hook keeps the last buffer bound to the memory, which is the alias, so `partialUnmap` sees the memory freed before "its" buffer is destroyed: your `destroyed=0 outOfOrder=1 frees=1`. - **@MarcZX10's point holds:** Vulkan permits that free once the batch has completed, and the unmap path waits for it first. No command uses the alias afterwards, so there's no GPU hazard. The fix restores the order the test checks, which the batch's reap and drain paths already keep: it destroys a finished batch's aliases before releasing the imports. The fix is on [`fix/agc-settle-alias-before-import-free`](https://github.com/EagleBearerYS/AnyPS5/tree/fix/agc-settle-alias-before-import-free) (d6335722ce). It adds a variant of the test that forces the settles onto another queue family, so GPUs with spare graphics queues take the same path. We'll open it once it's been checked on a Windows GPU. If you have time, running `agc_driver_host_import_lifetime` on the 860M with that branch would confirm it there.
EagleBearerYS commented 2026-10-18 17:08:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T17:08:47Z.


@LeandroLP23 thanks, that trace pins it down, and it fits the settle alias from my comment above. …ac630 isn't a stale entry. It's a new buffer that reuses an earlier handle value: the alias #6678 binds to the import's memory for its settle read when the settle queue is in another queue family.

  • …acf30 is the import's own buffer, bound to …7fd0 first. The fixture's bind hook then sees the alias's vkBindBufferMemory to the same memory, so the state ends up naming …ac630.
  • The unmap path destroys …acf30 and frees …7fd0 while the alias is still bound. The alias goes at the settle batch's next reap, which is the destroyBuffer …ac630 right after the failing free.
  • One print would confirm it: in the bind hook, a second vkBindBufferMemory to …7fd0, with …ac630, after the one with …acf30.

So the import's own buffer is destroyed before its memory, as you found, but one more buffer is bound to that memory. A fixture that tracks only the import's own buffer would pass too, though it would no longer check that order for the alias. d6335722ce keeps the test as it is and has the unmap path destroy the aliases first, as the reap and drain paths already do. Which way to go is the maintainers' call, since the test is from #7339.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252710117 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6252710117). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T17:08:47Z. --- @LeandroLP23 thanks, that trace pins it down, and it fits the settle alias from my comment above. `…ac630` isn't a stale entry. It's a new buffer that reuses an earlier handle value: the alias #6678 binds to the import's memory for its settle read when the settle queue is in another queue family. - `…acf30` is the import's own buffer, bound to `…7fd0` first. The fixture's bind hook then sees the alias's `vkBindBufferMemory` to the same memory, so the state ends up naming `…ac630`. - The unmap path destroys `…acf30` and frees `…7fd0` while the alias is still bound. The alias goes at the settle batch's next reap, which is the `destroyBuffer …ac630` right after the failing free. - One print would confirm it: in the bind hook, a second `vkBindBufferMemory` to `…7fd0`, with `…ac630`, after the one with `…acf30`. So the import's own buffer is destroyed before its memory, as you found, but one more buffer is bound to that memory. A fixture that tracks only the import's own buffer would pass too, though it would no longer check that order for the alias. d6335722ce keeps the test as it is and has the unmap path destroy the aliases first, as the reap and drain paths already do. Which way to go is the maintainers' call, since the test is from #7339.
EagleBearerYS commented 2026-10-18 17:14:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T17:14:47Z.


@LeandroLP23 a correction to my two comments above: d6335722ce doesn't make the test pass on our Windows GPUs. agc_driver_host_import_lifetime_other_family still fails on an RTX 3070, and the plain test on an AMD iGPU, with the same message as before the change. So please don't spend a build on that branch. The alias reading needs another look before we say more, and we'll report back here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252771746 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6252771746). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T17:14:47Z. --- @LeandroLP23 a correction to my two comments above: d6335722ce doesn't make the test pass on our Windows GPUs. `agc_driver_host_import_lifetime_other_family` still fails on an RTX 3070, and the plain test on an AMD iGPU, with the same message as before the change. So please don't spend a build on that branch. The alias reading needs another look before we say more, and we'll report back here.
LeandroLP23 commented 2026-10-18 17:19:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T17:19:43Z.


@EagleBearerYS thanks for the explanation. I ran your branch on the 860M, and both tests still fail there.

Build: your fix/agc-settle-alias-before-import-free at d6335722c (newer than the fa2f320eeb in your comment) merged onto main 6efb7261b, clean merge. Radeon 860M, driver 32.0.13058.8001, Windows 11 26300, WinLibs GCC 15.2.0 r7, Release.

test result
agc_driver_host_import_lifetime fails, 3/3
agc_driver_host_import_lifetime_other_family fails, 3/3
other host_import tests (9) pass, agc_host_import_sparse skipped

Both fail with host import Vulkan objects were destroyed out of order or more than once, still at the seventh requireFreed check (partialUnmap). The same local prints as before, since removed, show the end of each run:

agc_driver_host_import_lifetime
  destroyBuffer …17918b14fe0
  freeMemory    …17918acf530  tracked buffer …17918b144e0  destroyed=0
  destroyBuffer …17918b144e0
agc_driver_host_import_lifetime_other_family
  destroyBuffer …237220f4ee0
  freeMemory    …2371c10d830  tracked buffer …237220f48e0  destroyed=0
  destroyBuffer …237220f48e0

The buffer the hook tracks, the alias by your reading, is still destroyed right after the import's memory is freed. So on this path the alias outlives the free with the fix too. partialUnmap goes through Mutation::Unmap on part of the allocation, so maybe it releases the import by a route other than the reap and drain paths your change orders.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252824161 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6252824161). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T17:19:43Z. --- @EagleBearerYS thanks for the explanation. I ran your branch on the 860M, and both tests still fail there. Build: your `fix/agc-settle-alias-before-import-free` at `d6335722c` (newer than the `fa2f320eeb` in your comment) merged onto `main` `6efb7261b`, clean merge. Radeon 860M, driver 32.0.13058.8001, Windows 11 26300, WinLibs GCC 15.2.0 r7, Release. | test | result | |---|---| | `agc_driver_host_import_lifetime` | fails, 3/3 | | `agc_driver_host_import_lifetime_other_family` | fails, 3/3 | | other `host_import` tests (9) | pass, `agc_host_import_sparse` skipped | Both fail with `host import Vulkan objects were destroyed out of order or more than once`, still at the seventh `requireFreed` check (`partialUnmap`). The same local prints as before, since removed, show the end of each run: ``` agc_driver_host_import_lifetime destroyBuffer …17918b14fe0 freeMemory …17918acf530 tracked buffer …17918b144e0 destroyed=0 destroyBuffer …17918b144e0 agc_driver_host_import_lifetime_other_family destroyBuffer …237220f4ee0 freeMemory …2371c10d830 tracked buffer …237220f48e0 destroyed=0 destroyBuffer …237220f48e0 ``` The buffer the hook tracks, the alias by your reading, is still destroyed right after the import's memory is freed. So on this path the alias outlives the free with the fix too. `partialUnmap` goes through `Mutation::Unmap` on part of the allocation, so maybe it releases the import by a route other than the reap and drain paths your change orders. AI-assisted
LeandroLP23 commented 2026-10-18 17:26:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T17:26:54Z.


@EagleBearerYS I think I found the missing piece. With it added to d6335722c, both lifetime tests pass on the 860M.

Why d6335722c alone isn't enough. releaseSettleRetired only reaches imports that a batch holds in retired. retireImport puts an import there only when forgetSettle returns its batch, and forgetSettle does that only while settleBatchRunning, that is while the fence is still unsignaled. A batch the GPU has finished but that has not been reaped yet is still busy and still holds its aliases. For that batch forgetSettle returns nullptr. The RetiredImport is then dropped at the end of retireImport, which destroys the import's buffer and frees its memory, and the alias goes later, at the next reap. That is the destroyBuffer <import> / freeMemory / destroyBuffer <alias> sequence in my trace.

The change, on top of d6335722c:

@@ SettleBatch* forgetSettle(HostImports& state, std::uint64_t base) {
     if (const auto settle = state.settles.find(found->second.device); found->second.phase == SettlePhase::Submitted && settle != state.settles.end()) {
         auto& batch = settle->second.batches[found->second.batch];
-        if (settleBatchRunning(settle->second, settle->first, batch)) running = &batch;
+        if (batch.busy) running = &batch;
     }

The import then stays with its batch until the batch is reaped or released. Both reapSettleBatches and your releaseSettleRetired destroy the aliases before they drop retired.

Results, Radeon 860M, driver 32.0.13058.8001, Windows 11 26300, main 6efb7261b + d6335722c + the change above:

Build host_import tests (11)
main + d6335722c agc_driver_host_import_lifetime and _other_family fail, 3/3
main + the change alone agc_driver_host_import_lifetime fails, 3/3
main + d6335722c + the change all pass, 5 runs of 5 (agc_host_import_sparse skipped)

The full agc_* run on the last build: 715 of 717 pass. The 2 failures, agc_driver_quad_pixel_mask and agc_driver_layered_volume_vertex_no_gpl, also fail on unchanged main here (#6255, #5271).

The cost is that a finished batch keeps its imports' Vulkan objects until it is reaped, instead of releasing them at once. I haven't measured that. Feel free to take the change into your branch.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252901330 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6252901330). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T17:26:54Z. --- @EagleBearerYS I think I found the missing piece. With it added to `d6335722c`, both lifetime tests pass on the 860M. **Why `d6335722c` alone isn't enough.** `releaseSettleRetired` only reaches imports that a batch holds in `retired`. `retireImport` puts an import there only when `forgetSettle` returns its batch, and `forgetSettle` does that only while `settleBatchRunning`, that is while the fence is still unsignaled. A batch the GPU has finished but that has not been reaped yet is still `busy` and still holds its aliases. For that batch `forgetSettle` returns `nullptr`. The `RetiredImport` is then dropped at the end of `retireImport`, which destroys the import's buffer and frees its memory, and the alias goes later, at the next reap. That is the `destroyBuffer <import> / freeMemory / destroyBuffer <alias>` sequence in my trace. **The change**, on top of `d6335722c`: ```diff @@ SettleBatch* forgetSettle(HostImports& state, std::uint64_t base) { if (const auto settle = state.settles.find(found->second.device); found->second.phase == SettlePhase::Submitted && settle != state.settles.end()) { auto& batch = settle->second.batches[found->second.batch]; - if (settleBatchRunning(settle->second, settle->first, batch)) running = &batch; + if (batch.busy) running = &batch; } ``` The import then stays with its batch until the batch is reaped or released. Both `reapSettleBatches` and your `releaseSettleRetired` destroy the aliases before they drop `retired`. **Results**, Radeon 860M, driver 32.0.13058.8001, Windows 11 26300, `main` `6efb7261b` + `d6335722c` + the change above: | Build | `host_import` tests (11) | |---|---| | `main` + `d6335722c` | `agc_driver_host_import_lifetime` and `_other_family` fail, 3/3 | | `main` + the change alone | `agc_driver_host_import_lifetime` fails, 3/3 | | `main` + `d6335722c` + the change | all pass, 5 runs of 5 (`agc_host_import_sparse` skipped) | The full `agc_*` run on the last build: 715 of 717 pass. The 2 failures, `agc_driver_quad_pixel_mask` and `agc_driver_layered_volume_vertex_no_gpl`, also fail on unchanged `main` here (#6255, #5271). The cost is that a finished batch keeps its imports' Vulkan objects until it is reaped, instead of releasing them at once. I haven't measured that. Feel free to take the change into your branch. AI-assisted
EagleBearerYS commented 2026-10-18 17:30:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T17:30:27Z.


@LeandroLP23 thank you, and sorry for the build it cost you; our holding note crossed with your run. Your result matches ours on an RTX 3070 (the forced-family test) and an AMD iGPU (the plain test). Your prints also show that on the partialUnmap path the alias still outlives the import's free with that change, so it doesn't cover every route that releases the import. A corrected change for that route is being checked on our AMD iGPU first, and we'll post here when it passes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252938543 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6252938543). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T17:30:27Z. --- @LeandroLP23 thank you, and sorry for the build it cost you; our holding note crossed with your run. Your result matches ours on an RTX 3070 (the forced-family test) and an AMD iGPU (the plain test). Your prints also show that on the `partialUnmap` path the alias still outlives the import's free with that change, so it doesn't cover every route that releases the import. A corrected change for that route is being checked on our AMD iGPU first, and we'll post here when it passes.
EagleBearerYS commented 2026-10-18 17:44:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T17:44:53Z.


@LeandroLP23 thank you, that's the missing piece, and sorry that my last comment crossed with yours. We've taken your change into the branch as your own commit (e22b41c56c, authored by you), between the unmap-path change and the forced-family test: fix/agc-settle-alias-before-import-free at 8a1e737182. We're checking it on our RTX 3070 and AMD iGPU before opening the PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253087045 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6253087045). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T17:44:53Z. --- @LeandroLP23 thank you, that's the missing piece, and sorry that my last comment crossed with yours. We've taken your change into the branch as your own commit (e22b41c56c, authored by you), between the unmap-path change and the forced-family test: [`fix/agc-settle-alias-before-import-free`](https://github.com/EagleBearerYS/AnyPS5/tree/fix/agc-settle-alias-before-import-free) at 8a1e737182. We're checking it on our RTX 3070 and AMD iGPU before opening the PR.
savvaniss commented 2026-10-18 21:53:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-18T21:53:19Z.


Windows data from two more GPUs: agc_driver_host_import_lifetime passes on an Intel UHD 770 and an AMD RX 9070 XT.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (RDNA 4, 1002:7550), driver 32.0.31041.1004, with VkCache emptied first. Unchanged main f3059421f.

agc_driver_host_import_lifetime, ×5 UHD 770 RX 9070 XT
main f3059421f 5 of 5 pass (0.21–0.55 s) 5 of 5 pass (0.22–0.40 s)

So on this machine the out-of-order free in partialUnmap doesn't show up, either on a discrete RDNA 4 card or on an Intel iGPU. This main is later than your 6efb7261b and includes #6097 (a7730cb9e), which changes import probes in GuestBufferMemory.cpp. I haven't checked whether that alone changes the Radeon 860M result.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255605164 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7601#issuecomment-6255605164). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-18T21:53:19Z. --- Windows data from two more GPUs: `agc_driver_host_import_lifetime` passes on an Intel UHD 770 and an AMD RX 9070 XT. Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, `ANYPS5_NO_SHADER_CACHE=1`, serial CTest. Intel UHD Graphics 770 (`8086:a780`), driver 32.0.101.7088. AMD Radeon RX 9070 XT (RDNA 4, `1002:7550`), driver 32.0.31041.1004, with `VkCache` emptied first. Unchanged `main` `f3059421f`. | `agc_driver_host_import_lifetime`, ×5 | UHD 770 | RX 9070 XT | |---|---|---| | `main` `f3059421f` | 5 of 5 pass (0.21–0.55 s) | 5 of 5 pass (0.22–0.40 s) | So on this machine the out-of-order free in `partialUnmap` doesn't show up, either on a discrete RDNA 4 card or on an Intel iGPU. This `main` is later than your `6efb7261b` and includes #6097 (`a7730cb9e`), which changes import probes in `GuestBufferMemory.cpp`. I haven't checked whether that alone changes the Radeon 860M result. AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#7601
No description provided.