D3D12.X: retain reserved backing through the final tile mapping #3734

Open
jeroenhaentjens wants to merge 1 commit from upstream-pr/3734 into main
jeroenhaentjens commented 2026-12-02 21:36:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jeroenhaentjens on 2026-12-02T21:36:13Z.


What & Why

Part 4 of the review split of Draft #3682. Keep the tiles and heaps of every mapped reserved texture alive through active and retiring submit queues and the separate tile-mapping queue's final NULL mapping. This applies with XCL_LATE_RELEASE=0 as well. A texture that cannot return to the pool still receives a final NULL mapping and fence before native release.

What is in it

  • Keep the tile backing in RecycleInfo::backing until the mapping fence completes. make_spares uses the same pending recycle path.
  • Include active and retiring queue completion in release batches. Retry failed queue markers per queue without reopening submissions. Keep parked backing associated with an unmarked device until its retirement dependency is recovered.
  • Cover installed and recovered retirement marks in late_release.rs, the failed-signal spare case in an isolated WARP process, and the final upload and NULL-mapping gates in the GPU regression.
  • Queue completion is included here because it must be established before the final mapping retires the backing.

Tested

  • Commit ec06277bd3. Intel Core i7-9750H, NVIDIA Quadro RTX 3000 (driver 597.06 / 32.0.15.9706), Windows 11 25H2 build 26200.9974, Rust MSVC 1.100.0 and DXC 1.9.2609.5.
  • git diff --check passed. cargo test --locked --workspace -- --test-threads=4 completed with 3,010 passed, 0 failed, 52 ignored and 26 SKIPPED diagnostics. The reserved-backing GPU regression recorded 0 D3D12 Debug Layer messages.
  • The failed-signal spare test passed three consecutive isolated WARP runs. The two late-release marker tests and the registry recovery test also passed.
  • cargo build --locked --release succeeded for the candidate. Both 60-second runs used the same shader cache and input schedule.

Regression run

Baseline (main)

xcl-smoke v1
commit: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd
gpu: NVIDIA Quadro RTX 3000
title: 0ba91dcb
seconds: 60
exit: 0x0
frames shown: 1520 (PresentX 1520)
presents per 2 s (last 3): 59 62 61
device removals: 0
crashes: 0
peak commit: 13865 MB

PR head

xcl-smoke v1
commit: ec06277bd366db39b2861941cceb0bc529a59d84
gpu: NVIDIA Quadro RTX 3000
title: 0ba91dcb
seconds: 60
exit: 0x0
frames shown: 1539 (PresentX 1539)
presents per 2 s (last 3): 60 61 61
device removals: 0
crashes: 0
peak commit: 13945 MB

Not tested

AMD, Linux, and scenes with sustained bursts of mapped texture release. The GPU regression covers the ordering directly.

AI use

OpenAI Codex (GPT-6, specific revision unavailable) assisted with the implementation, tests and PR update.

<!-- greyfinch-sync:ivall/xcl:issue:5615124495 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3734). Originally posted by [jeroenhaentjens](https://github.com/jeroenhaentjens) on 2026-12-02T21:36:13Z. --- **What & Why** Part 4 of the review split of Draft #3682. Keep the tiles and heaps of every mapped reserved texture alive through active and retiring submit queues and the separate tile-mapping queue's final NULL mapping. This applies with XCL_LATE_RELEASE=0 as well. A texture that cannot return to the pool still receives a final NULL mapping and fence before native release. **What is in it** - Keep the tile backing in RecycleInfo::backing until the mapping fence completes. make_spares uses the same pending recycle path. - Include active and retiring queue completion in release batches. Retry failed queue markers per queue without reopening submissions. Keep parked backing associated with an unmarked device until its retirement dependency is recovered. - Cover installed and recovered retirement marks in late_release.rs, the failed-signal spare case in an isolated WARP process, and the final upload and NULL-mapping gates in the GPU regression. - Queue completion is included here because it must be established before the final mapping retires the backing. **Tested** - Commit ec06277bd366db39b2861941cceb0bc529a59d84. Intel Core i7-9750H, NVIDIA Quadro RTX 3000 (driver 597.06 / 32.0.15.9706), Windows 11 25H2 build 26200.9974, Rust MSVC 1.100.0 and DXC 1.9.2609.5. - git diff --check passed. cargo test --locked --workspace -- --test-threads=4 completed with 3,010 passed, 0 failed, 52 ignored and 26 SKIPPED diagnostics. The reserved-backing GPU regression recorded 0 D3D12 Debug Layer messages. - The failed-signal spare test passed three consecutive isolated WARP runs. The two late-release marker tests and the registry recovery test also passed. - cargo build --locked --release succeeded for the candidate. Both 60-second runs used the same shader cache and input schedule. **Regression run** Baseline (main) ``` xcl-smoke v1 commit: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd gpu: NVIDIA Quadro RTX 3000 title: 0ba91dcb seconds: 60 exit: 0x0 frames shown: 1520 (PresentX 1520) presents per 2 s (last 3): 59 62 61 device removals: 0 crashes: 0 peak commit: 13865 MB ``` PR head ``` xcl-smoke v1 commit: ec06277bd366db39b2861941cceb0bc529a59d84 gpu: NVIDIA Quadro RTX 3000 title: 0ba91dcb seconds: 60 exit: 0x0 frames shown: 1539 (PresentX 1539) presents per 2 s (last 3): 60 61 61 device removals: 0 crashes: 0 peak commit: 13945 MB ``` **Not tested** AMD, Linux, and scenes with sustained bursts of mapped texture release. The GPU regression covers the ordering directly. **AI use** OpenAI Codex (GPT-6, specific revision unavailable) assisted with the implementation, tests and PR update.
Foniass commented 2026-12-02 21:43:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T21:43:53Z.


Review of d9ca1779 (code reading only, not a merge-check) · 4 medium

In short: This PR keeps a released reserved texture's tiles, and so their pool heaps, until the title's queues are done with it and the NULL tile mapping has completed. It also changes late_release to wait for the marks of retiring queues, ignore the device-removed u64::MAX value, and hold back parked backing while a queue on the same device has no retirement mark. It is #3682's fd938727 with the texture-budget gates removed, and it builds against main on its own. The mechanism holds up, and the GPU test would fail without it. It is now on by default, though; a failed queue retirement keeps backing forever, and the new sealing rules are untested.

Medium

  1. A failed queue retirement holds reserved backing forever.

    • queue_completion_snapshot_for_release (present.rs ~496) reports a Retiring::Failed queue as unmarked. A Failed entry never leaves the registry (sweep removes only Retiring::Mark), and nothing retries its mark.
    • After one failure, Dead::blocked_backing (late_release.rs ~40, ~132) holds back every mapped reserved texture released later on that device, with its tiles and heaps, for the rest of the run.
    • Held::is_empty then never becomes true, so every pinned hold waits its full IDLE_WAIT.

    Fix: retry the retirement mark, as #3682's later commits do, or put a bound on the hold.

  2. The default path changes, where in #3682 this was behind the budget.

    • Here it applies to every mapped reserved texture (real.rs ~2518, vram.rs ~3136). Each release of one that does not go back to the pool (render targets, depth, textures with private data) now queues a NULL UpdateTileMappings and a Signal on the mapping queue. Before, its tiles went idle at release.
    • With XCL_LATE_RELEASE=0, mapped reserved textures are now held and recycled through the reserved pool, because forget_pages gets held = true.
    • The description should say both paths change. The one 60 s smoke run does not measure the cost in a scene with many releases.
  3. The new sealing rules have no tests.

    • unmarked_retirement_does_not_hold_unrelated_releases (late_release.rs ~501) only shows that entries that are not parked pass.
    • No test parks backing on an unmarked device and checks that it stays in open, keeps its order, and goes once the mark is installed.
    • No test checks that a batch waits for a retiring mark: every test passes &[] for retiring.
  4. Two changes in one PR, over the size target. The late_release / present.rs rework (retiring marks in the batch, open_prefix revisions, unmarked-device blocking, the u64::MAX check in take_gone) stands apart from keeping the tile backing through the NULL mapping. Together they are about 540 changed lines. The u64::MAX handling also overlaps #3125. Splitting the queue-snapshot part out would make each half reviewable on its own.

Checked and fine
  • Builds on main alone: no texture-budget symbol from #3682 is used. Compared with fd938727, the texture_budget_enabled() gates and the L0 test setup are gone, and a simpler unmarked-device rule stands in for #3682's later failed-retirement handling. If both stay open, #3682 will need reworking onto this one.
  • The NULL mapping is covered: unmap_range signals after UpdateTileMappings, recycle_ready takes pages.mark() after it, and tiles are released only in collect_released once that value has completed.
  • Textures with private data lose their pool key but still park their backing, and are released natively after the NULL mapping. Spares from make_spares keep backing: None.
  • open[..count] cannot go out of bounds: only begin_seal and a failed end_seal remove from open, and both bump open_revision.
  • Lock order is HELD then PARKING, with no reverse path.
  • PAGES keys and GetDevice both give the raw pointer of the hooked device, so blocked_backing compares like with like.
  • The GPU test runs in a child process with XCL_LATE_RELEASE=0, skips without tiled-resources tier 2, and on main would fail at the tile-users assertion. README updated.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7359699619 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3734#issuecomment-7359699619). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T21:43:53Z. --- **Review** of `d9ca1779` (code reading only, not a merge-check) · 4 medium **In short:** This PR keeps a released reserved texture's tiles, and so their pool heaps, until the title's queues are done with it and the NULL tile mapping has completed. It also changes `late_release` to wait for the marks of retiring queues, ignore the device-removed `u64::MAX` value, and hold back parked backing while a queue on the same device has no retirement mark. It is #3682's `fd938727` with the texture-budget gates removed, and it builds against `main` on its own. The mechanism holds up, and the GPU test would fail without it. It is now on by default, though; a failed queue retirement keeps backing forever, and the new sealing rules are untested. #### Medium 1. **A failed queue retirement holds reserved backing forever.** - `queue_completion_snapshot_for_release` (`present.rs` ~496) reports a `Retiring::Failed` queue as unmarked. A `Failed` entry never leaves the registry (`sweep` removes only `Retiring::Mark`), and nothing retries its mark. - After one failure, `Dead::blocked_backing` (`late_release.rs` ~40, ~132) holds back every mapped reserved texture released later on that device, with its tiles and heaps, for the rest of the run. - `Held::is_empty` then never becomes true, so every pinned `hold` waits its full `IDLE_WAIT`. Fix: retry the retirement mark, as #3682's later commits do, or put a bound on the hold. 2. **The default path changes, where in #3682 this was behind the budget.** - Here it applies to every mapped reserved texture (`real.rs` ~2518, `vram.rs` ~3136). Each release of one that does not go back to the pool (render targets, depth, textures with private data) now queues a NULL `UpdateTileMappings` and a `Signal` on the mapping queue. Before, its tiles went idle at release. - With `XCL_LATE_RELEASE=0`, mapped reserved textures are now held and recycled through the reserved pool, because `forget_pages` gets `held = true`. - The description should say both paths change. The one 60 s smoke run does not measure the cost in a scene with many releases. 3. **The new sealing rules have no tests.** - `unmarked_retirement_does_not_hold_unrelated_releases` (`late_release.rs` ~501) only shows that entries that are not parked pass. - No test parks backing on an unmarked device and checks that it stays in `open`, keeps its order, and goes once the mark is installed. - No test checks that a batch waits for a `retiring` mark: every test passes `&[]` for `retiring`. 4. **Two changes in one PR, over the size target.** The `late_release` / `present.rs` rework (retiring marks in the batch, `open_prefix` revisions, unmarked-device blocking, the `u64::MAX` check in `take_gone`) stands apart from keeping the tile backing through the NULL mapping. Together they are about 540 changed lines. The `u64::MAX` handling also overlaps #3125. Splitting the queue-snapshot part out would make each half reviewable on its own. <details><summary>Checked and fine</summary> - Builds on `main` alone: no texture-budget symbol from #3682 is used. Compared with `fd938727`, the `texture_budget_enabled()` gates and the L0 test setup are gone, and a simpler unmarked-device rule stands in for #3682's later failed-retirement handling. If both stay open, #3682 will need reworking onto this one. - The NULL mapping is covered: `unmap_range` signals after `UpdateTileMappings`, `recycle_ready` takes `pages.mark()` after it, and tiles are released only in `collect_released` once that value has completed. - Textures with private data lose their pool key but still park their backing, and are released natively after the NULL mapping. Spares from `make_spares` keep `backing: None`. - `open[..count]` cannot go out of bounds: only `begin_seal` and a failed `end_seal` remove from `open`, and both bump `open_revision`. - Lock order is `HELD` then `PARKING`, with no reverse path. - `PAGES` keys and `GetDevice` both give the raw pointer of the hooked device, so `blocked_backing` compares like with like. - The GPU test runs in a child process with `XCL_LATE_RELEASE=0`, skips without tiled-resources tier 2, and on `main` would fail at the tile-users assertion. README updated. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
jeroenhaentjens commented 2026-12-02 22:28:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jeroenhaentjens on 2026-12-02T22:28:27Z.


@Foniass I isolated the failed-signal spare test in a WARP process and verified it three times. Failed retirement markers now retry per queue. The new tests cover waiting on an installed marker and keeping parked backing in order until the recovered marker completes. The description includes the scope with XCL_LATE_RELEASE=0 and the updated 60-second head run.

<!-- greyfinch-sync:ivall/xcl:comment:7360741986 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3734#issuecomment-7360741986). Originally posted by [jeroenhaentjens](https://github.com/jeroenhaentjens) on 2026-12-02T22:28:27Z. --- @Foniass I isolated the failed-signal spare test in a WARP process and verified it three times. Failed retirement markers now retry per queue. The new tests cover waiting on an installed marker and keeping parked backing in order until the recovered marker completes. The description includes the scope with XCL_LATE_RELEASE=0 and the updated 60-second head run.
Foniass commented 2026-12-02 22:33:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T22:33:57Z.


Follow-up review of ec06277b, since d9ca1779 (code reading only, not a merge-check) · 1 medium

In short: Since d9ca1779 a failed queue retirement is retried: the retirement worker re-signals the queue every 250 ms and turns the failed entry into a mark. New tests cover retiring marks and parked backing on an unmarked device. The spare test that failed CI now runs in its own WARP process. The description now says the change also applies with XCL_LATE_RELEASE=0. Three of the four earlier points are fixed and nothing new turned up. The PR is still two changes in one.

Medium

  1. Two changes in one PR, over the size target (still open).

    • It is now 555+/167-, about 720 changed lines. Roughly half is the queue-completion rework, which this push made bigger:
      • retiring marks in the batch, open_prefix / open_revision and unmarked-device blocking (late_release.rs ~40-160);
      • queue_completion_snapshot_for_release and the retry worker (present.rs ~505-700).
    • The other half keeps the tile backing through the NULL mapping (vram.rs, real.rs).
    • The description says queue completion "must be established before the final mapping retires the backing". That is an order, and two stacked PRs give the same order.
    • The u64::MAX handling and checked_add(1).filter(|&next| next != u64::MAX) in late_release.rs still repeat #3125.

    Fix: make the queue-completion part its own PR and stack this one on it.

Checked and fine
  • Earlier finding fixed: a failed retirement held backing forever. retry_failed_retirements (present.rs ~645) re-signals each Retiring::Failed queue outside the registry lock, and recover_retiring (~424) turns it into Retiring::Mark. sweep can then remove it, Dead::blocked_backing lets go, and Held::is_empty can become true. A queue on a removed device is skipped.
  • Earlier finding fixed: the description now says the change applies with XCL_LATE_RELEASE=0, and that a texture that cannot return to the pool still gets a final NULL mapping and fence. Scenes with bursts of releases are under Not tested.
  • Earlier finding fixed: the sealing rules have tests.
    • release_waits_for_a_retiring_queue_mark (late_release.rs ~520): a batch waits for a retiring mark.
    • parked_backing_waits_in_order_for_the_recovered_queue_mark (~536): parked backing on an unmarked device stays in open, in order, while other entries go, and goes once the mark completes.
    • failed_retirement_stays_pinned_until_its_recovered_mark: the registry goes from failed to marked to swept.
  • spares_without_their_signal_are_released runs in a child process on WARP. On d9ca1779 it saw another test's mapping value on a reused device and poisoned PAGES for two later tests.
  • retire_released_queue now uses the same retirement_device / signal_retirement helpers as the retry.
  • queue_completion_snapshot_for_release does not wait on Preparing, so a release during a retirement cannot block on its own queue.
  • A seal that fails part-way takes nothing from open. Blocked entries go back to the front in order.
  • Lock order is still HELD then PARKING. drain_recycled reads fence values outside PAGES and checks that the fence is still the same one.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7360865264 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3734#issuecomment-7360865264). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T22:33:57Z. --- **Follow-up review** of `ec06277b`, since `d9ca1779` (code reading only, not a merge-check) · 1 medium **In short:** Since `d9ca1779` a failed queue retirement is retried: the retirement worker re-signals the queue every 250 ms and turns the failed entry into a mark. New tests cover retiring marks and parked backing on an unmarked device. The spare test that failed CI now runs in its own WARP process. The description now says the change also applies with `XCL_LATE_RELEASE=0`. Three of the four earlier points are fixed and nothing new turned up. The PR is still two changes in one. #### Medium 1. **Two changes in one PR, over the size target (still open).** - It is now 555+/167-, about 720 changed lines. Roughly half is the queue-completion rework, which this push made bigger: - retiring marks in the batch, `open_prefix` / `open_revision` and unmarked-device blocking (`late_release.rs` ~40-160); - `queue_completion_snapshot_for_release` and the retry worker (`present.rs` ~505-700). - The other half keeps the tile backing through the NULL mapping (`vram.rs`, `real.rs`). - The description says queue completion "must be established before the final mapping retires the backing". That is an order, and two stacked PRs give the same order. - The `u64::MAX` handling and `checked_add(1).filter(|&next| next != u64::MAX)` in `late_release.rs` still repeat #3125. Fix: make the queue-completion part its own PR and stack this one on it. <details><summary>Checked and fine</summary> - Earlier finding fixed: a failed retirement held backing forever. `retry_failed_retirements` (`present.rs` ~645) re-signals each `Retiring::Failed` queue outside the registry lock, and `recover_retiring` (~424) turns it into `Retiring::Mark`. `sweep` can then remove it, `Dead::blocked_backing` lets go, and `Held::is_empty` can become true. A queue on a removed device is skipped. - Earlier finding fixed: the description now says the change applies with `XCL_LATE_RELEASE=0`, and that a texture that cannot return to the pool still gets a final NULL mapping and fence. Scenes with bursts of releases are under **Not tested**. - Earlier finding fixed: the sealing rules have tests. - `release_waits_for_a_retiring_queue_mark` (`late_release.rs` ~520): a batch waits for a `retiring` mark. - `parked_backing_waits_in_order_for_the_recovered_queue_mark` (~536): parked backing on an unmarked device stays in `open`, in order, while other entries go, and goes once the mark completes. - `failed_retirement_stays_pinned_until_its_recovered_mark`: the registry goes from failed to marked to swept. - `spares_without_their_signal_are_released` runs in a child process on WARP. On `d9ca1779` it saw another test's mapping value on a reused device and poisoned `PAGES` for two later tests. - `retire_released_queue` now uses the same `retirement_device` / `signal_retirement` helpers as the retry. - `queue_completion_snapshot_for_release` does not wait on `Preparing`, so a release during a retirement cannot block on its own queue. - A seal that fails part-way takes nothing from `open`. Blocked entries go back to the front in order. - Lock order is still `HELD` then `PARKING`. `drain_recycled` reads fence values outside `PAGES` and checks that the fence is still the same one. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
fromthemoonx commented 2026-12-03 13:41:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-03T13:41:14Z.


merge-check
base: a815de932c
head: ec06277bd3
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3023 passed, 0 failed, 56 ignored (two runs, same counts); SKIPPED: 25 in the first run (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same list as on main 395405e4, and 26 in the second (one pso_async test found no room for a build ahead, "short of commit"); failing: none. The vram, late_release and present tests at 8 threads: 23 of 23 runs pass.
review: read the whole diff (5 files, +555 -167). No blocking finding.

  1. The new GPU test catches the bug it is for. With the backing released at once again (if held && was_mapped in forget_pages disabled), it fails with "the native release must retain the tile user" (left 0, right 1). On the PR it passes with 0 debug-layer messages.
  2. Low: a burst of releases costs more, as the description leaves open. I measured it with scratch code: 2000 mapped 512x512 render targets released in a row, three times, then 4 made and released about every 2 ms for 4 s. Debug build, 4 alternating runs of each side, default settings:
main this PR
2000 releases, first burst 48–72 ms 117–168 ms
2000 releases, later bursts 17–28 ms 9–105 ms
until everything held is gone 5–205 ms 326–477 ms
steady churn: worst step 19–31 ms 20–29 ms
steady churn: peak 64 MiB pools 125 113

So a large burst keeps its tiles for up to about half a second longer, and steady churn needs no more memory. With XCL_LATE_RELEASE=0 the releases themselves are faster than on main (106–172 ms against 318–361 ms), because the thread does the work now.
3) Low: when the new GPU test fails, its process may not end. With the change of point 1, 2 of my 4 runs never exited after the failure (one thread left, not killable). The parent waits with Command::output() and no time limit, so cargo test would hang there instead of reporting the failure. I did not find the cause. The passing test never did this.
4) With XCL_LATE_RELEASE=0 set for the test run, a_pipeline_xcl_lets_go_is_released_by_the_thread fails on every run. It fails on main too, so it is not from this PR.
5) For the maintainer: Foniass' point that this is two changes (queue completion, then the backing) is still open. I checked them together and did not test them apart.
6) Not tested: a retail title, AMD, a queue whose retirement signal really fails (only the unit tests cover the retry).
performance: measured in point 2 for bursts of releases. I ran no smoke comparison (no retail title here); the author's has 1539 frames against 1520 and 13945 MB against 13865 MB.
verdict: safe to merge
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7380212718 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3734#issuecomment-7380212718). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-03T13:41:14Z. --- merge-check base: a815de932c4dc8da3b383ca44f4b094aa406fec9 head: ec06277bd366db39b2861941cceb0bc529a59d84 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3023 passed, 0 failed, 56 ignored (two runs, same counts); SKIPPED: 25 in the first run (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same list as on main 395405e4, and 26 in the second (one `pso_async` test found no room for a build ahead, "short of commit"); failing: none. The `vram`, `late_release` and `present` tests at 8 threads: 23 of 23 runs pass. review: read the whole diff (5 files, +555 -167). No blocking finding. 1) **The new GPU test catches the bug it is for.** With the backing released at once again (`if held && was_mapped` in `forget_pages` disabled), it fails with "the native release must retain the tile user" (left 0, right 1). On the PR it passes with 0 debug-layer messages. 2) **Low: a burst of releases costs more, as the description leaves open.** I measured it with scratch code: 2000 mapped 512x512 render targets released in a row, three times, then 4 made and released about every 2 ms for 4 s. Debug build, 4 alternating runs of each side, default settings: | | main | this PR | |---|---|---| | 2000 releases, first burst | 48–72 ms | 117–168 ms | | 2000 releases, later bursts | 17–28 ms | 9–105 ms | | until everything held is gone | 5–205 ms | 326–477 ms | | steady churn: worst step | 19–31 ms | 20–29 ms | | steady churn: peak 64 MiB pools | 125 | 113 | So a large burst keeps its tiles for up to about half a second longer, and steady churn needs no more memory. With `XCL_LATE_RELEASE=0` the releases themselves are faster than on main (106–172 ms against 318–361 ms), because the thread does the work now. 3) **Low: when the new GPU test fails, its process may not end.** With the change of point 1, 2 of my 4 runs never exited after the failure (one thread left, not killable). The parent waits with `Command::output()` and no time limit, so `cargo test` would hang there instead of reporting the failure. I did not find the cause. The passing test never did this. 4) With `XCL_LATE_RELEASE=0` set for the test run, `a_pipeline_xcl_lets_go_is_released_by_the_thread` fails on every run. It fails on main too, so it is not from this PR. 5) For the maintainer: Foniass' point that this is two changes (queue completion, then the backing) is still open. I checked them together and did not test them apart. 6) Not tested: a retail title, AMD, a queue whose retirement signal really fails (only the unit tests cover the retry). performance: measured in point 2 for bursts of releases. I ran no smoke comparison (no retail title here); the author's has 1539 frames against 1520 and 13945 MB against 13865 MB. verdict: safe to merge hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3734:upstream-pr/3734'
git switch 'upstream-pr/3734'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3734'
git switch 'upstream-pr/3734'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3734'
git switch 'upstream-pr/3734'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3734'
git switch 'main'
git merge --squash 'upstream-pr/3734'
git switch 'main'
git merge --ff-only 'upstream-pr/3734'
git switch 'main'
git merge 'upstream-pr/3734'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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!3734
No description provided.