D3D12.X: defer GPU-owned target pages until first use #3395

Open
lnqigr wants to merge 2 commits from upstream-pr/3395 into main
lnqigr commented 2026-11-29 13:06:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lnqigr on 2026-11-29T13:06:45Z.


Stacked on #3443; only the top commit (bdf38bf4) belongs here.

Adds opt-in XCL_LAZY_TARGETS=1. GPU-owned placed targets bind their 64 KiB video-memory tiles at first use, so a title can create render targets without allocating tiles it may never use. Related to #3211 and #1773.

What is in it

  • Track deferred targets and copied RTV/DSV handles in vram.rs. Bind the tiles before command-list or upload use.
  • Look for lazy targets bound through descriptor tables in every SRV/UAV range the root signature declares, with #3443's range walk (for_each_declared_table_slot in bind.rs), not only in the first 64 slots of each table. Test: lazy_targets_are_mapped_in_every_declared_table_range.
  • Reject a command list when first use cannot allocate the tiles. A later recording can retry. Added tests for first-use rendering, copied descriptors, and submission refusal. Documented the flag in README.md.

Tested

  • Windows 11 build 26300.9974, Intel Core i9-14900HX, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, driver 610.88), Rust 1.100.0.
  • At 6a4c17fd, the four-thread workspace run aborted in the PSO library tests on the test fixture address 0x4332. The two-pass cache integration test failed once and passed on the repeat. The full library target passed on the main baseline. The parallel failure on the candidate remains unresolved.
  • cargo test --offline --locked --workspace --no-fail-fast -j 4 -- --test-threads=1 --show-output completed with 2,621 passed, 0 failed, 49 ignored, and 30 SKIPPED reports.
  • The focused VRAM tests ran on the GPU (71 passed, 0 failed, 1 ignored, 0 SKIPPED). The command-list refusal test passed in both four-thread attempts.
  • At bdf38bf4 (this commit on #3443's 7afecf84): .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4) completed with 2,743 passed, 0 failed, 49 ignored, and 31 SKIPPED reports. The new table-range test fails when the old 64-slot walk is put back (it finds the view at slot 10, not the one at slot 100).
  • cargo build --offline --locked --release -p xcl -j 4 and 60 s of scripts/smoke.ps1 on title dc7b94e1 for each configuration. On 6a4c17fd, enabling the flag reduced local VRAM from 6,057 to 3,048 MB (−3,009 MB, −49.7%) and target-pool capacity from 3,584 to 576 MB at the final activity sample. The PR blocks below are from bdf38bf4, without input; on that run the flag lowered peak commit from 16,363 to 13,323 MB.

Regression run

Main baseline

xcl-smoke v1
commit: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: dc7b94e1
seconds: 60
exit: 0x0
frames shown: 1499 (PresentX 1499)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14690 MB

PR head with the flag off

xcl-smoke v1
commit: bdf38bf4361a4d7a7af678cce7d9a5e4e356e1ef
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: dc7b94e1
seconds: 60
exit: 0x0
frames shown: 1636 (PresentX 1636)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16363 MB

PR head with the flag on

xcl-smoke v1
commit: bdf38bf4361a4d7a7af678cce7d9a5e4e356e1ef
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: dc7b94e1
seconds: 60
exit: 0x0
frames shown: 1641 (PresentX 1641)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13323 MB

Not tested

  • A title that binds a lazy target past slot 64 of a table: only the unit test covers the range walk.
  • AMD, Intel, gameplay beyond the tested menu loop, and direct bindless UAV accesses that bypass the tracked paths. The D3D12 debug layer was unavailable.
  • Actual GPU memory exhaustion during a retail run. The command-list refusal test exercises the failure-handling path.

AI use

Antigravity (Gemini 4 Neon) wrote the original implementation and GPU tests, and ran the initial benchmarks. Codex (GPT-6) reviewed it, implemented the allocation-failure handling and its regression test, ran the final tests and smoke checks, and edited this description. Claude Code (Claude Opus 5.5) moved the commit onto #3443, made the lazy-target scan walk the declared table ranges, added its test, reran the suite and the two PR smoke runs, and updated this description.

<!-- greyfinch-sync:ivall/xcl:issue:5550998874 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3395). Originally posted by [lnqigr](https://github.com/lnqigr) on 2026-11-29T13:06:45Z. --- Stacked on #3443; only the top commit (`bdf38bf4`) belongs here. Adds opt-in `XCL_LAZY_TARGETS=1`. GPU-owned placed targets bind their 64 KiB video-memory tiles at first use, so a title can create render targets without allocating tiles it may never use. Related to #3211 and #1773. **What is in it** - Track deferred targets and copied RTV/DSV handles in `vram.rs`. Bind the tiles before command-list or upload use. - Look for lazy targets bound through descriptor tables in every SRV/UAV range the root signature declares, with #3443's range walk (`for_each_declared_table_slot` in `bind.rs`), not only in the first 64 slots of each table. Test: `lazy_targets_are_mapped_in_every_declared_table_range`. - Reject a command list when first use cannot allocate the tiles. A later recording can retry. Added tests for first-use rendering, copied descriptors, and submission refusal. Documented the flag in `README.md`. **Tested** - Windows 11 build 26300.9974, Intel Core i9-14900HX, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, driver 610.88), Rust 1.100.0. - At `6a4c17fd`, the four-thread workspace run aborted in the PSO library tests on the test fixture address `0x4332`. The two-pass cache integration test failed once and passed on the repeat. The full library target passed on the main baseline. The parallel failure on the candidate remains unresolved. - `cargo test --offline --locked --workspace --no-fail-fast -j 4 -- --test-threads=1 --show-output` completed with **2,621 passed, 0 failed, 49 ignored**, and **30 SKIPPED** reports. - The focused VRAM tests ran on the GPU (71 passed, 0 failed, 1 ignored, 0 `SKIPPED`). The command-list refusal test passed in both four-thread attempts. - At `bdf38bf4` (this commit on #3443's `7afecf84`): `.\scripts\test.ps1` (`cargo test --workspace -- --test-threads=4`) completed with **2,743 passed, 0 failed, 49 ignored**, and **31 SKIPPED** reports. The new table-range test fails when the old 64-slot walk is put back (it finds the view at slot 10, not the one at slot 100). - `cargo build --offline --locked --release -p xcl -j 4` and 60 s of `scripts/smoke.ps1` on title `dc7b94e1` for each configuration. On `6a4c17fd`, enabling the flag reduced local VRAM from 6,057 to 3,048 MB (−3,009 MB, −49.7%) and target-pool capacity from 3,584 to 576 MB at the final activity sample. The PR blocks below are from `bdf38bf4`, without input; on that run the flag lowered peak commit from 16,363 to 13,323 MB. **Regression run** Main baseline ``` xcl-smoke v1 commit: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0 gpu: NVIDIA GeForce RTX 4060 Laptop GPU title: dc7b94e1 seconds: 60 exit: 0x0 frames shown: 1499 (PresentX 1499) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14690 MB ``` PR head with the flag off ``` xcl-smoke v1 commit: bdf38bf4361a4d7a7af678cce7d9a5e4e356e1ef gpu: NVIDIA GeForce RTX 4060 Laptop GPU title: dc7b94e1 seconds: 60 exit: 0x0 frames shown: 1636 (PresentX 1636) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16363 MB ``` PR head with the flag on ``` xcl-smoke v1 commit: bdf38bf4361a4d7a7af678cce7d9a5e4e356e1ef gpu: NVIDIA GeForce RTX 4060 Laptop GPU title: dc7b94e1 seconds: 60 exit: 0x0 frames shown: 1641 (PresentX 1641) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13323 MB ``` **Not tested** - A title that binds a lazy target past slot 64 of a table: only the unit test covers the range walk. - AMD, Intel, gameplay beyond the tested menu loop, and direct bindless UAV accesses that bypass the tracked paths. The D3D12 debug layer was unavailable. - Actual GPU memory exhaustion during a retail run. The command-list refusal test exercises the failure-handling path. **AI use** Antigravity (Gemini 4 Neon) wrote the original implementation and GPU tests, and ran the initial benchmarks. Codex (GPT-6) reviewed it, implemented the allocation-failure handling and its regression test, ran the final tests and smoke checks, and edited this description. Claude Code (Claude Opus 5.5) moved the commit onto #3443, made the lazy-target scan walk the declared table ranges, added its test, reran the suite and the two PR smoke runs, and updated this description.
Aniseto commented 2026-11-29 13:37:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-29T13:37:37Z.


Ran the lazy-target deferral tests at 6a4c17fd on an NVIDIA Blackwell desktop part.

System

  • GPU: NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, mesh shaders), driver 32.0.16.2140 (621.40)
  • CPU: Intel Core i5-12400F, 64 GB RAM
  • OS: Windows 11 Pro build 26200 x64
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5
  • Build: debug

Results

  • XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_lazy_target_defers_vram_until_first_use_and_renders_correctly -- --test-threads=1: 1 passed, 0 failed, 0 ignored. The GPU test ran here, with no SKIPPED line.
  • XCL_ADAPTER=NVIDIA cargo test -p xcl --lib target_view_copy_pieces_and_table_follow_handles -- --test-threads=1: 1 passed, 0 failed, 0 ignored.

What this adds
Both tests pass: VRAM for a GPU-owned placed target is deferred until first use and the render still reads correctly, and copied RTV/DSV handles follow the target views. The thread has no comments yet, so this is the first datapoint in it and the first from an RTX 5070 Ti. Synthetic GPU tests only; no title run.

Not tested
A retail title, a paired smoke run, the full workspace suite here, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - ran the commands above on this machine and wrote this report; no game data was used.

<!-- greyfinch-sync:ivall/xcl:comment:7256679866 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3395#issuecomment-7256679866). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-29T13:37:37Z. --- Ran the lazy-target deferral tests at `6a4c17fd` on an NVIDIA Blackwell desktop part. **System** - GPU: NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, mesh shaders), driver 32.0.16.2140 (621.40) - CPU: Intel Core i5-12400F, 64 GB RAM - OS: Windows 11 Pro build 26200 x64 - Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5 - Build: debug **Results** - `XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_lazy_target_defers_vram_until_first_use_and_renders_correctly -- --test-threads=1`: 1 passed, 0 failed, 0 ignored. The GPU test ran here, with no SKIPPED line. - `XCL_ADAPTER=NVIDIA cargo test -p xcl --lib target_view_copy_pieces_and_table_follow_handles -- --test-threads=1`: 1 passed, 0 failed, 0 ignored. **What this adds** Both tests pass: VRAM for a GPU-owned placed target is deferred until first use and the render still reads correctly, and copied RTV/DSV handles follow the target views. The thread has no comments yet, so this is the first datapoint in it and the first from an RTX 5070 Ti. Synthetic GPU tests only; no title run. **Not tested** A retail title, a paired smoke run, the full workspace suite here, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - ran the commands above on this machine and wrote this report; no game data was used.
KDenKC commented 2026-11-29 22:40:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T22:40:07Z.


A note from reading 6a4c17fd (code reading, not a run): ensure_table_lazy_targets in hle/d3d12x/bind.rs (around lines 1567-1601, called from bind.rs ~5256 and console_list.rs ~1056) checks readable(base, 64 * 32) and then loops for k in 0..64usize, so it only looks at the first 64 slots of each Param::Table. A lazy GPU-owned target bound past slot 64 (a bindless SRV/UAV range or an explicit offset) would never reach vram::ensure_target_mapped, so with XCL_LAZY_TARGETS=1 its tiles stay unmapped: writes dropped, reads zero.

#3443 (Lakanya, open) handles the same kind of fixed slot cap in the superseded-target scan: it records each table's declared SRV/UAV ranges (Layout::table_ranges), caps unbounded ranges with console_heap::view_heap_remaining_slots, and scans in 256-slot chunks (scan_superseded_in_tables_with). Walking the declared ranges the same way here (skipping CBV and sampler ranges) would close the gap without touching the rest of the deferral.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash; I checked the lines above against the pinned commit.

<!-- greyfinch-sync:ivall/xcl:comment:7263855431 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3395#issuecomment-7263855431). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-29T22:40:07Z. --- A note from reading `6a4c17fd` (code reading, not a run): `ensure_table_lazy_targets` in `hle/d3d12x/bind.rs` (around lines 1567-1601, called from `bind.rs` ~5256 and `console_list.rs` ~1056) checks `readable(base, 64 * 32)` and then loops `for k in 0..64usize`, so it only looks at the first 64 slots of each `Param::Table`. A lazy GPU-owned target bound past slot 64 (a bindless SRV/UAV range or an explicit offset) would never reach `vram::ensure_target_mapped`, so with `XCL_LAZY_TARGETS=1` its tiles stay unmapped: writes dropped, reads zero. #3443 (Lakanya, open) handles the same kind of fixed slot cap in the superseded-target scan: it records each table's declared SRV/UAV ranges (`Layout::table_ranges`), caps unbounded ranges with `console_heap::view_heap_remaining_slots`, and scans in 256-slot chunks (`scan_superseded_in_tables_with`). Walking the declared ranges the same way here (skipping CBV and sampler ranges) would close the gap without touching the rest of the deferral. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash; I checked the lines above against the pinned commit.
Foniass commented 2026-12-01 09:01:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:01:54Z.


Review (head bdf38bf4, diff read, not a merge-check; draft, off by default (XCL_LAZY_TARGETS=1 turns it on), PR description red):

  • With the switch on, every draw and dispatch pays a table scan that never stops. It runs while any lazy target has no tiles (bind.rs ~5362), and targets the title never uses never get tiles. The scan is #3443's: unbounded ranges are read to the end of the view heap, the global HEAPS lock is taken per table, and there are two LAZY_UNMAPPED lookups per view. For a heap of 1M descriptors that is 32 MB read per bind. The smoke runs are capped at 60 fps, so this is unmeasured.
  • First uses that can be missed (reasoned): shaders that index the heap directly, descriptors written into a table after the draw is recorded, and tables set through ExecuteIndirect arguments. A missed target reads zeros and drops its writes. Placement needs tiled-resource tier 2, so it's not a device removal. Transition barriers (list_x.rs ~6454) are the only other net.
  • A change with the switch off. real.rs ~4125 / ~4131 now read the poison flag after flush_two_pass and before_close, and a poisoned list skips note_list_closed. It isn't in the description and has no test.
  • Tiles are now bound on the title's recording threads, under the global PAGES lock, possibly creating a 64 MiB pool heap mid-frame. Before, that happened when the target was made. The ordering is sound: mappings go on the dedicated queue, and before_execute makes the submitting queue wait.
  • Tests.
    • The GPU test calls ensure_target_view_mapped directly. No test goes through the hooked set-targets, barrier, copy or clear paths.
    • vram.rs ~5893 raises LAZY_UNMAPPED_COUNT for the whole process, which turns the lazy paths on for tests running beside it. ~5929 sets the test flag before the skip check. Either may explain the four-thread abort the description mentions (unverified).
  • Measurements.
    • The -3,009 MB VRAM figure is from 6a4c17fd, not this head.
    • With the switch off the PR's run is about 11 % above main in peak commit (16,363 vs 14,690 MB), with no explanation. The PR's base is about 200 commits behind main.
  • Size. The PR carries #3443, which should land first. This PR's own commit (+749) splits into a stack:
    1. the vram.rs tracking, not yet called, with its tests;
    2. the cl_close poison change, with a test;
    3. the first-use hooks plus the switch and README;
    4. the page_owners stats.

Fine: off by default, with one relaxed atomic load per hook. Two threads mapping one target are serialised under PAGES. A failed allocation poisons the list and KickoffX refuses it. Copies of RTV / DSV handles are tracked, and release bookkeeping is right. The two red CI runs are standin::tests::concurrent_shell_miss_..., which main fixed in 54544682 (not in this PR's base).

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7306115190 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3395#issuecomment-7306115190). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:01:54Z. --- Review (head bdf38bf4, diff read, not a merge-check; draft, off by default (`XCL_LAZY_TARGETS=1` turns it on), `PR description` red): - **With the switch on, every draw and dispatch pays a table scan that never stops.** It runs while any lazy target has no tiles (`bind.rs` ~5362), and targets the title never uses never get tiles. The scan is #3443's: unbounded ranges are read to the end of the view heap, the global `HEAPS` lock is taken per table, and there are two `LAZY_UNMAPPED` lookups per view. For a heap of 1M descriptors that is 32 MB read per bind. The smoke runs are capped at 60 fps, so this is unmeasured. - **First uses that can be missed** (reasoned): shaders that index the heap directly, descriptors written into a table after the draw is recorded, and tables set through ExecuteIndirect arguments. A missed target reads zeros and drops its writes. Placement needs tiled-resource tier 2, so it's not a device removal. Transition barriers (`list_x.rs` ~6454) are the only other net. - **A change with the switch off.** `real.rs` ~4125 / ~4131 now read the poison flag after `flush_two_pass` and `before_close`, and a poisoned list skips `note_list_closed`. It isn't in the description and has no test. - **Tiles are now bound on the title's recording threads,** under the global `PAGES` lock, possibly creating a 64 MiB pool heap mid-frame. Before, that happened when the target was made. The ordering is sound: mappings go on the dedicated queue, and `before_execute` makes the submitting queue wait. - **Tests.** - The GPU test calls `ensure_target_view_mapped` directly. No test goes through the hooked set-targets, barrier, copy or clear paths. - `vram.rs` ~5893 raises `LAZY_UNMAPPED_COUNT` for the whole process, which turns the lazy paths on for tests running beside it. ~5929 sets the test flag before the skip check. Either may explain the four-thread abort the description mentions (unverified). - **Measurements.** - The -3,009 MB VRAM figure is from 6a4c17fd, not this head. - With the switch off the PR's run is about 11 % above main in peak commit (16,363 vs 14,690 MB), with no explanation. The PR's base is about 200 commits behind main. - **Size.** The PR carries #3443, which should land first. This PR's own commit (+749) splits into a stack: 1. the `vram.rs` tracking, not yet called, with its tests; 2. the `cl_close` poison change, with a test; 3. the first-use hooks plus the switch and README; 4. the `page_owners` stats. Fine: off by default, with one relaxed atomic load per hook. Two threads mapping one target are serialised under `PAGES`. A failed allocation poisons the list and KickoffX refuses it. Copies of RTV / DSV handles are tracked, and release bookkeeping is right. The two red CI runs are `standin::tests::concurrent_shell_miss_...`, which main fixed in 54544682 (not in this PR's base). AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Foniass commented 2026-12-01 09:53:43 +00:00 (Migrated from github.com)

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


Triage (#1607) – head bdf38bf

Stacked on #3443: the lines shared with it are #3443's commit (7afecf84), and only bdf38bf4 belongs here, so it is not a duplicate. Read the top commit. XCL_LAZY_TARGETS is opt-in, but two default-path changes come with it, both in real.rs. cl_close now reads the poison state after flush_two_pass/before_close and skips note_list_closed for a poisoned list. The KickoffX/Close warnings no longer name the cause. ensure_target_mapped binds tiles while a list is recording. The diff does not show how the tile mapping is ordered before that list runs on the GPU, as vram::before_execute does for level pages.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7307363019 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3395#issuecomment-7307363019). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:53:43Z. --- **Triage (#1607)** – head bdf38bf Stacked on #3443: the lines shared with it are #3443's commit (`7afecf84`), and only `bdf38bf4` belongs here, so it is not a duplicate. Read the top commit. `XCL_LAZY_TARGETS` is opt-in, but two default-path changes come with it, both in `real.rs`. `cl_close` now reads the poison state after `flush_two_pass`/`before_close` and skips `note_list_closed` for a poisoned list. The KickoffX/Close warnings no longer name the cause. `ensure_target_mapped` binds tiles while a list is recording. The diff does not show how the tile mapping is ordered before that list runs on the GPU, as `vram::before_execute` does for level pages. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 15:18:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T15:18:28Z.


Queued an in-world A/B of this on an RTX 4080 16 GB: current main + this head bdf38bf4, same build with XCL_LAZY_TARGETS unset vs =1, 900 s each with XCL_RESIDENCY_PRIORITY=1 and XCL_GPU_PROFILE=1. Our runs are ~3.3 GB over the video-memory budget with render targets the largest part (~6.4 GB), so this is the case it targets; numbers here when done.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7315690939 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3395#issuecomment-7315690939). Originally posted by [throny](https://github.com/throny) on 2026-12-01T15:18:28Z. --- Queued an in-world A/B of this on an RTX 4080 16 GB: current `main` + this head `bdf38bf4`, same build with `XCL_LAZY_TARGETS` unset vs `=1`, 900 s each with `XCL_RESIDENCY_PRIORITY=1` and `XCL_GPU_PROFILE=1`. Our runs are ~3.3 GB over the video-memory budget with render targets the largest part (~6.4 GB), so this is the case it targets; numbers here when done. AI use: Claude Code (Claude Opus 5.5).
throny commented 2026-12-01 16:37:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T16:37:34Z.


In-world result, RTX 4080 16 GB (621.40), current main 6bfb5c51 + this head bdf38bf4 (plus our local input-timing patch), same build, 900 s each, XCL_RESIDENCY_PRIORITY=1, default two-pass reserve, no draws skipped in either run:

run XCL_LAZY_TARGETS presents/s after 240 s video memory peak / budget
389 unset 3.31 19.1 / 15.1 GB
390 1 2.77 18.0 / 15.0 GB

So it saves about 1.1 GB of video memory (render-target pages 6.6 → 5.4 GB at the end of a run) but costs ~16 % presents/s here, where the card stays over budget either way. No device removal or crash. (An earlier pair at XCL_TWO_PASS_MB=512 is not comparable: that limit made XCL skip 41 % of draws in the run without the switch and 1.4 % with it.)

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7317916521 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3395#issuecomment-7317916521). Originally posted by [throny](https://github.com/throny) on 2026-12-01T16:37:34Z. --- In-world result, RTX 4080 16 GB (621.40), current `main` `6bfb5c51` + this head `bdf38bf4` (plus our local input-timing patch), same build, 900 s each, `XCL_RESIDENCY_PRIORITY=1`, default two-pass reserve, no draws skipped in either run: | run | `XCL_LAZY_TARGETS` | presents/s after 240 s | video memory peak / budget | |---|---|---|---| | 389 | unset | 3.31 | 19.1 / 15.1 GB | | 390 | 1 | 2.77 | 18.0 / 15.0 GB | So it saves about 1.1 GB of video memory (render-target pages 6.6 → 5.4 GB at the end of a run) but costs ~16 % presents/s here, where the card stays over budget either way. No device removal or crash. (An earlier pair at `XCL_TWO_PASS_MB=512` is not comparable: that limit made XCL skip 41 % of draws in the run without the switch and 1.4 % with it.) AI use: 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/3395:upstream-pr/3395'
git switch 'upstream-pr/3395'

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/3395'
git switch 'upstream-pr/3395'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3395'
git switch 'upstream-pr/3395'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3395'
git switch 'main'
git merge --squash 'upstream-pr/3395'
git switch 'main'
git merge --ff-only 'upstream-pr/3395'
git switch 'main'
git merge 'upstream-pr/3395'
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!3395
No description provided.