D3D12.X: allocator pool retains internal fences after command queue release #1899

Open
opened 2026-11-24 23:00:26 +00:00 by DEViANCEVxXXxM · 4 comments
DEViANCEVxXXxM commented 2026-11-24 23:00:26 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-24T23:00:26Z.


D3D12.X: allocator pool retains internal fences after command queue release

Follow-up to #1668 and #1691, tested on revision 81f6397.

The updated queue lifetime fix passes all 12 synthetic validation runs. However, additional live-object diagnostics show persistent fence retention after all test workers have joined.

Observations

  • 1,024 successful copy operations covering 1,048,576 32-bit words.
  • No D3D12 errors, OOM or timeouts.
  • Live command queue count returns to its baseline.
  • In a diagnostic build, 40 allocator-pool fences remain visible five seconds after workload completion.
  • All 40 have Refcount: 2, IntRef: 0.
  • Eight separately named fixture fences remain with Refcount: 1.

Source inspection shows that alloc_pool::State.fences retains per-queue fence references without an explicit queue-release cleanup path.

The global real::FENCES registry may also contribute to retention.

Limitations

The diagnostic changes only extend live-object logging and assign object names. Individual reference owners have not been directly verified. Unbounded growth has not yet been established.

Synthetic tests only. No retail title testing.

AI assistance: ChatGPT (GPT-6.2) assisted with diagnostics, source review and report preparation.

<!-- greyfinch-sync:ivall/xcl:issue:6593132160 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1909). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-24T23:00:26Z. --- ## D3D12.X: allocator pool retains internal fences after command queue release Follow-up to #1668 and #1691, tested on revision `81f6397`. The updated queue lifetime fix passes all 12 synthetic validation runs. However, additional live-object diagnostics show persistent fence retention after all test workers have joined. ### Observations - 1,024 successful copy operations covering 1,048,576 32-bit words. - No D3D12 errors, OOM or timeouts. - Live command queue count returns to its baseline. - In a diagnostic build, 40 allocator-pool fences remain visible five seconds after workload completion. - All 40 have `Refcount: 2`, `IntRef: 0`. - Eight separately named fixture fences remain with `Refcount: 1`. Source inspection shows that `alloc_pool::State.fences` retains per-queue fence references without an explicit queue-release cleanup path. The global `real::FENCES` registry may also contribute to retention. ### Limitations The diagnostic changes only extend live-object logging and assign object names. Individual reference owners have not been directly verified. Unbounded growth has not yet been established. Synthetic tests only. No retail title testing. AI assistance: ChatGPT (GPT-6.2) assisted with diagnostics, source review and report preparation.
DEViANCEVxXXxM commented 2026-11-24 23:08:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-24T23:05:49Z.


<html>

Follow-up: accumulation confirmed across sequential workloads in a single process.

I ran three consecutive synthetic workloads of 1,024 copy operations each, with all workers joined and a five-second idle period before each live-object report.

Metric | Baseline | Cycle 1 | Cycle 2 | Cycle 3 -- | -- | -- | -- | -- Allocator-pool fences | 0 | 47 | 67 | 84 Fixture fences | 0 | 8 | 16 | 24 Total live fences | 2 | 60 | 89 | 115 Device Refcount | 46 | 107 | 136 | 162 Live command queues | 1 | 1 | 1 | 1

All previously observed fence address/name pairs remained visible in subsequent snapshots. All 84 allocator-pool fences reported Refcount: 2, IntRef: 0 at the final snapshot.

  • 3,072 successful copy operations.

  • 3,145,728 verified 32-bit words.

  • Zero D3D12 errors, OOM or timeouts.

  • No additional live command queues.

The results demonstrate cumulative fence retention within the measured workload, rather than merely a transient increase during GPU activity.

Base revision: 81f6397 (#1691), with diagnostic-only object naming and expanded live-object logging.

Three cycles do not establish unbounded growth. Individual COM reference owners still require verification.

AI assistance: ChatGPT (GPT-6.2). Synthetic tests only.

</html>
<!-- greyfinch-sync:ivall/xcl:comment:7147008527 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1909#issuecomment-7147008527). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-24T23:05:49Z. --- <html> <body> <!--StartFragment--><p><strong><span>Follow-up: accumulation confirmed across sequential workloads in a single process.</span></strong></p><p><span>I ran three consecutive synthetic workloads of 1,024 copy operations each, with all workers joined and a five-second idle period before each live-object report.</span></p> Metric | Baseline | Cycle 1 | Cycle 2 | Cycle 3 -- | -- | -- | -- | -- Allocator-pool fences | 0 | 47 | 67 | 84 Fixture fences | 0 | 8 | 16 | 24 Total live fences | 2 | 60 | 89 | 115 Device Refcount | 46 | 107 | 136 | 162 Live command queues | 1 | 1 | 1 | 1 <p><span>All previously observed fence address/name pairs remained visible in subsequent snapshots. All 84 allocator-pool fences reported </span><code><span>Refcount: 2, IntRef: 0</span></code><span> at the final snapshot.</span></p><ul><li><p><span>3,072 successful copy operations.</span></p></li><li><p><span>3,145,728 verified 32-bit words.</span></p></li><li><p><span>Zero D3D12 errors, OOM or timeouts.</span></p></li><li><p><span>No additional live command queues.</span></p></li></ul><p><span>The results demonstrate cumulative fence retention within the measured workload, rather than merely a transient increase during GPU activity.</span></p><p><span>Base revision: </span><code><span>81f6397</span></code><span> (#1691), with diagnostic-only object naming and expanded live-object logging.</span></p><p><span>Three cycles do not establish unbounded growth. Individual COM reference owners still require verification.</span></p><p><span>AI assistance: ChatGPT (GPT-6.2). Synthetic tests only.</span></p><!--EndFragment--> </body> </html>
DEViANCEVxXXxM commented 2026-11-25 00:08:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-24T23:12:12Z.


Related PR overlap review

I checked current main (689f2db) and the related PRs #1691, #867 and #1422.

PR #867 already introduces create_raw_fence for internal synchronization objects, which may address the global fence registry's contribution to the observed retention.

However, neither #867 nor #1422 currently appears to remove per-queue entries from alloc_pool::State.fences when queues are released.

To avoid duplicating existing work, I suggest coordinating the remaining allocator-cache lifetime issue with these PRs rather than introducing another internal fence creation mechanism.

This is based on static source review; combined runtime validation has not yet been performed.

<!-- greyfinch-sync:ivall/xcl:comment:7147132323 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1909#issuecomment-7147132323). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-24T23:12:12Z. --- **Related PR overlap review** I checked current main (`689f2db`) and the related PRs #1691, #867 and #1422. PR #867 already introduces `create_raw_fence` for internal synchronization objects, which may address the global fence registry's contribution to the observed retention. However, neither #867 nor #1422 currently appears to remove per-queue entries from `alloc_pool::State.fences` when queues are released. To avoid duplicating existing work, I suggest coordinating the remaining allocator-cache lifetime issue with these PRs rather than introducing another internal fence creation mechanism. This is based on static source review; combined runtime validation has not yet been performed.
DEViANCEVxXXxM commented 2026-11-25 00:08:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-24T23:25:06Z.


<html>

Combined validation of #1691 and #867

I tested both PRs together using the same synthetic fixture and three sequential workloads.

Metric | #1691 | #1691 + #867 -- | -- | -- Allocator-pool fences | 84 | 84 Allocator fence Refcount | 2 | 1 Total live fences | 115 | 111 Device Refcount | 162 | 158 Successful copy operations | 3072 | 3072 Errors | 0 | 0

PR #867 appears to address the additional reference associated with internal fence creation. However, allocator-pool fence accumulation remains observable.

The remaining issue appears to be the lifetime of per-queue entries in alloc_pool::State.fences.

To avoid duplicating #867, I suggest focusing further work on allocator-cache ownership and coordination with #1691.

Tested revisions: 81f6397 and a4c5a82, combined locally with diagnostic naming and expanded logging.

One run per configuration; individual reference owners and unbounded growth are not conclusively established.

</html>
<!-- greyfinch-sync:ivall/xcl:comment:7147375930 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1909#issuecomment-7147375930). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-24T23:25:06Z. --- <html> <body> <!--StartFragment--><p><strong><span>Combined validation of #1691 and #867</span></strong></p><p><span>I tested both PRs together using the same synthetic fixture and three sequential workloads.</span></p> Metric | #1691 | #1691 + #867 -- | -- | -- Allocator-pool fences | 84 | 84 Allocator fence Refcount | 2 | 1 Total live fences | 115 | 111 Device Refcount | 162 | 158 Successful copy operations | 3072 | 3072 Errors | 0 | 0 <p><span>PR #867 appears to address the additional reference associated with internal fence creation. However, allocator-pool fence accumulation remains observable.</span></p><p><span>The remaining issue appears to be the lifetime of per-queue entries in </span><code><span>alloc_pool::State.fences</span></code><span>.</span></p><p><span>To avoid duplicating #867, I suggest focusing further work on allocator-cache ownership and coordination with #1691.</span></p><p><span>Tested revisions: </span><code><span>81f6397</span></code><span> and </span><code><span>a4c5a82</span></code><span>, combined locally with diagnostic naming and expanded logging.</span></p><p><span>One run per configuration; individual reference owners and unbounded growth are not conclusively established.</span></p><!--EndFragment--> </body> </html>
JJAutoCompare commented 2026-11-25 01:10:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T00:30:51Z.


I compared the two current allocator-pool fixes. Both add cleanup on final command-queue Release, so they overlap on #1909. I’d advance #1945 (907cf34) over #1967 (61db31a). On adopted devices #1967 still creates the internal fence through the hook that retains a reference in real::FENCES, and leaves a pending mark keyed by the old queue address. #1945 bypasses that registry and preserves pending marks when a queue address is reused.

Before merging #1945, the synthetic fence’s completion value should be synchronized. The test writes a Cell<u64> outside the pool lock while another queue cleanup can scan retired fences under that lock. The GPU test covers the adopted-device release path. I confirmed both candidates merge cleanly into main@8c4a46a with git merge-tree --write-tree. I did not rerun either PR’s GPU suite. Code triage assisted by Codex (gpt-6.2-sol).

<!-- greyfinch-sync:ivall/xcl:comment:7148586252 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1909#issuecomment-7148586252). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T00:30:51Z. --- I compared the two current allocator-pool fixes. Both add cleanup on final command-queue Release, so they overlap on #1909. I’d advance #1945 (`907cf34`) over #1967 (`61db31a`). On adopted devices #1967 still creates the internal fence through the hook that retains a reference in `real::FENCES`, and leaves a pending mark keyed by the old queue address. #1945 bypasses that registry and preserves pending marks when a queue address is reused. Before merging #1945, the synthetic fence’s completion value should be synchronized. The test writes a `Cell<u64>` outside the pool lock while another queue cleanup can scan retired fences under that lock. The GPU test covers the adopted-device release path. I confirmed both candidates merge cleanly into `main@8c4a46a` with `git merge-tree --write-tree`. I did not rerun either PR’s GPU suite. Code triage assisted by Codex (`gpt-6.2-sol`).
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
xcl-dev/xcl#1899
No description provided.