D3D12.X: XCL_PAIR_PAGES=1 puts a GPU-owned texture on pages at an address its layout allows #3282

Open
Pipodi wants to merge 4 commits from upstream-pr/3282 into main
Pipodi commented 2026-11-29 04:06:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-29T04:06:51Z.


Stacked on #3281; only the top two commits belong here.

A compute pass of a retail title reads R9G9B9E5 views placed at the same address as R32_UINT 1280x720 textures. XG (xg_xs.dll of GDK 261000, measured) sizes the view at 0x3c0000 (layout 2) or 0x398000 (layout 0), against the texture's 0x384000. The title places its next texture at +0x384000, which supersedes the view and unmaps its tiles, so the view reads zero. #3281 caps the view to the texture's size, but only when the texture is on the shared pages. The views are at 0x107cb80000 and 0x107cf04000. The second address is 16 KiB-aligned but not 64 KiB-aligned, so main gives that texture a committed resource and the cap never applies. With XCL_PAIR_PAGES=1, a texture that is GPU-owned (UAV, not depth, single-sample) and sits at an address that is not 64 KiB-aligned goes on the shared pages, if the address meets the console alignment that XG gives its layout. The switch is off by default, and with it off the code paths are the same as on main.

Scope: with XCL_PAIR_PAGES=1, every such UAV texture with a size and alignment from XG moves to the pages, not only the two textures of this pass.

Note for the maintainer: the sizes and alignments were found by measuring the layout functions of the local GDK's xg_xs.dll. Nothing from it is copied into the code: the placement uses XCL's own XG model (Texture::alignment()), and the measured values appear only as expected results in a test in xg.rs.

Related: #3094 (XCL_ALIAS_COPY) fixes the same defect by copying. The two are alternatives: with both on, the copy is redundant.

What is in it

  • 82d9248c D3D12.X: name the rule that keeps a small render target in step with memory: cpu_filled_small_target in crates/xcl/src/hle/d3d12x/title_textures.rs. This commit changes no behaviour.
  • ea91c5f4 D3D12.X: XCL_PAIR_PAGES=1 puts a GPU-owned texture on pages at an address its layout allows: the alignment rule and place_with (vram.rs), the console alignment passed from CreatePlacedResourceX (device_x.rs), and tests of the XG model against the measured sizes and alignments (crates/xcl/src/hle/xg.rs). Small CPU-filled render targets (glyph caches) keep their old path.
  • Review fixes, squashed into ea91c5f4: create_placed_resource_x asks for gpu_owned_page_align only with XCL_PAIR_PAGES=1 on, and only for a format gpu_owned_layout lays out (others stay committed, as on main); the comment at the require_aligned = false call names its other effects (failure log, recycle_key, texel accounting).

Tested

  • NVIDIA GeForce RTX 4090, driver 621.40, i9-13900K, Windows 11 Pro 10.0.26300, rustc 1.100.0 (0ef1bc386 2026-11-09), debug build for the suite, release builds for the smoke runs.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on ea91c5f4 (on #3281's head b02b2c34, main 493dbd3d): 2920 passed, 0 failed, 51 ignored, 25 SKIPPED. Each commit alone: cargo check -p xcl --tests passes.
  • SKIPPED (25): no wave64 (22), no heap windows (2), pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache: Developer Mode is required) (1).
  • On 27abece7 (same patches as 12a5bb2d; only #3281's comment and commit message changed since): with the alignment rule reverted (unaligned_on_pages false at an unaligned address), a_gpu_owned_texture_at_an_unaligned_address_needs_its_console_alignment and gpu_an_unaligned_gpu_owned_texture_shares_pages_with_its_view fail (the XG and glyph tests do not reach that rule); with the alignment given to every GPU-owned texture (no glyph exclusion), a_glyph_cache_gets_no_console_alignment_but_a_720p_target_does fails (left Some(8192), right None). Unmutated, all four pass.
  • A retail title with XCL_PAIR_PAGES=1:
    • On an older local tree with the same mechanism: all 14 dispatches of the compute program read non-zero data on both views, against 0 before.
    • On the previous head 475a5325 (before the restack onto #3281's current head) plus local press diagnostics: both views are capped (the "pair pages:" lines), 0 of 2 are superseded, against 2 of 2 with the switch off, and the glyph-cache count is unchanged.

Regression run

The same retail title for 60 s on both sides, scripts/smoke.ps1 on clean trees, release builds, XCL_PREPARE=0 and XCL_PRESS_AT=16:A on both sides, RTX 4090 (driver 621.40).

main (6bfb5c51):

xcl-smoke v1
commit: 6bfb5c5153ccc23517daf30aa1071ddb0fadb53c
gpu: NVIDIA GeForce RTX 4090
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1611 (PresentX 1611)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 17826 MB

This PR's head (ea91c5f4, on #3281's head b02b2c34):

xcl-smoke v1
commit: ea91c5f450620540e29f9b05f1ed0e0a769561d6
gpu: NVIDIA GeForce RTX 4090
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1703 (PresentX 1703)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17843 MB

The PR's run got 105.7 % of main's frames and 100.1 % of its peak commit.

Not tested

  • The per-dispatch result on this tree. The full cinematic did not finish on the main-based tree: in most runs the title's frame loop stopped during start-up, with the switch on, with it off, and on plain main too.
  • XCL_PAIR_PAGES=1 in the 60 s smoke run.
  • AMD and other GPUs, and other titles.
  • The glyph exclusion stays because nothing shows that glyph targets lack the UAV flag.
  • The title run on this restacked head: the per-view result above is from 475a5325, whose parent still had #3281's old partner rule.
  • No unit test reaches the fallback for a failed register_gpu_owned.
  • The intermittent STATUS_ACCESS_VIOLATION of the lib test binary during gpu::dxil::compact_tests was seen in this PR's first suite run (an earlier head), not in the run on 12a5bb2d; it was not seen on main in 3 runs, and is pre-existing as far as we can tell (this PR does not touch that code).

AI use

  • Claude Code, Claude Opus 5.5 (main session) planned the fix, checked it against the GDK and wrote this description; Claude Sonnet 5.5 subagents wrote the code and the tests and ran the tests and the title runs; a Claude Opus 5.5 reviewer agent reviewed the branches. For the restack onto #3281's current head and the rebase onto main 493dbd3d, Claude Sonnet 5.5 agents replayed the commits, resolved the conflicts and ran the suite, the smoke pair and the mutation checks; a Claude Opus 5.5 reviewer checked the result.
  • The review fixes on ea91c5f4 (and the restack onto #3281's b02b2c34): Claude Code, Claude Opus 5.5 (main session) orchestrated them and updated this description; Claude Opus 5.5 subagents checked the review points, made the fixes and reviewed them; Claude Sonnet 5.5 subagents ran the suite and the smoke pair.
<!-- greyfinch-sync:ivall/xcl:issue:5547414241 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-29T04:06:51Z. --- Stacked on #3281; only the top two commits belong here. A compute pass of a retail title reads R9G9B9E5 views placed at the same address as R32_UINT 1280x720 textures. XG (`xg_xs.dll` of GDK 261000, measured) sizes the view at 0x3c0000 (layout 2) or 0x398000 (layout 0), against the texture's 0x384000. The title places its next texture at +0x384000, which supersedes the view and unmaps its tiles, so the view reads zero. #3281 caps the view to the texture's size, but only when the texture is on the shared pages. The views are at 0x107cb80000 and 0x107cf04000. The second address is 16 KiB-aligned but not 64 KiB-aligned, so `main` gives that texture a committed resource and the cap never applies. With `XCL_PAIR_PAGES=1`, a texture that is GPU-owned (UAV, not depth, single-sample) and sits at an address that is not 64 KiB-aligned goes on the shared pages, if the address meets the console alignment that XG gives its layout. The switch is off by default, and with it off the code paths are the same as on `main`. Scope: with `XCL_PAIR_PAGES=1`, every such UAV texture with a size and alignment from XG moves to the pages, not only the two textures of this pass. Note for the maintainer: the sizes and alignments were found by measuring the layout functions of the local GDK's `xg_xs.dll`. Nothing from it is copied into the code: the placement uses XCL's own XG model (`Texture::alignment()`), and the measured values appear only as expected results in a test in `xg.rs`. Related: #3094 (`XCL_ALIAS_COPY`) fixes the same defect by copying. The two are alternatives: with both on, the copy is redundant. **What is in it** - `82d9248c` `D3D12.X: name the rule that keeps a small render target in step with memory`: `cpu_filled_small_target` in `crates/xcl/src/hle/d3d12x/title_textures.rs`. This commit changes no behaviour. - `ea91c5f4` `D3D12.X: XCL_PAIR_PAGES=1 puts a GPU-owned texture on pages at an address its layout allows`: the alignment rule and `place_with` (`vram.rs`), the console alignment passed from `CreatePlacedResourceX` (`device_x.rs`), and tests of the XG model against the measured sizes and alignments (`crates/xcl/src/hle/xg.rs`). Small CPU-filled render targets (glyph caches) keep their old path. - Review fixes, squashed into `ea91c5f4`: `create_placed_resource_x` asks for `gpu_owned_page_align` only with `XCL_PAIR_PAGES=1` on, and only for a format `gpu_owned_layout` lays out (others stay committed, as on `main`); the comment at the `require_aligned = false` call names its other effects (failure log, `recycle_key`, texel accounting). **Tested** - NVIDIA GeForce RTX 4090, driver 621.40, i9-13900K, Windows 11 Pro 10.0.26300, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, debug build for the suite, release builds for the smoke runs. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` on `ea91c5f4` (on #3281's head `b02b2c34`, main `493dbd3d`): **2920 passed, 0 failed, 51 ignored**, 25 SKIPPED. Each commit alone: `cargo check -p xcl --tests` passes. - SKIPPED (25): no wave64 (22), no heap windows (2), `pso_measurement_compiles_an_exact_synthetic_record` (cannot disable the driver cache: Developer Mode is required) (1). - On `27abece7` (same patches as `12a5bb2d`; only #3281's comment and commit message changed since): with the alignment rule reverted (`unaligned_on_pages` false at an unaligned address), `a_gpu_owned_texture_at_an_unaligned_address_needs_its_console_alignment` and `gpu_an_unaligned_gpu_owned_texture_shares_pages_with_its_view` fail (the XG and glyph tests do not reach that rule); with the alignment given to every GPU-owned texture (no glyph exclusion), `a_glyph_cache_gets_no_console_alignment_but_a_720p_target_does` fails (left `Some(8192)`, right `None`). Unmutated, all four pass. - A retail title with `XCL_PAIR_PAGES=1`: - On an older local tree with the same mechanism: all 14 dispatches of the compute program read non-zero data on both views, against 0 before. - On the previous head `475a5325` (before the restack onto #3281's current head) plus local press diagnostics: both views are capped (the "pair pages:" lines), 0 of 2 are superseded, against 2 of 2 with the switch off, and the glyph-cache count is unchanged. **Regression run** The same retail title for 60 s on both sides, `scripts/smoke.ps1` on clean trees, release builds, `XCL_PREPARE=0` and `XCL_PRESS_AT=16:A` on both sides, RTX 4090 (driver 621.40). main (`6bfb5c51`): ``` xcl-smoke v1 commit: 6bfb5c5153ccc23517daf30aa1071ddb0fadb53c gpu: NVIDIA GeForce RTX 4090 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1611 (PresentX 1611) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 17826 MB ``` This PR's head (`ea91c5f4`, on #3281's head `b02b2c34`): ``` xcl-smoke v1 commit: ea91c5f450620540e29f9b05f1ed0e0a769561d6 gpu: NVIDIA GeForce RTX 4090 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1703 (PresentX 1703) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17843 MB ``` The PR's run got 105.7 % of `main`'s frames and 100.1 % of its peak commit. **Not tested** - The per-dispatch result on this tree. The full cinematic did not finish on the `main`-based tree: in most runs the title's frame loop stopped during start-up, with the switch on, with it off, and on plain `main` too. - `XCL_PAIR_PAGES=1` in the 60 s smoke run. - AMD and other GPUs, and other titles. - The glyph exclusion stays because nothing shows that glyph targets lack the UAV flag. - The title run on this restacked head: the per-view result above is from `475a5325`, whose parent still had #3281's old partner rule. - No unit test reaches the fallback for a failed `register_gpu_owned`. - The intermittent `STATUS_ACCESS_VIOLATION` of the lib test binary during `gpu::dxil::compact_tests` was seen in this PR's first suite run (an earlier head), not in the run on `12a5bb2d`; it was not seen on `main` in 3 runs, and is pre-existing as far as we can tell (this PR does not touch that code). **AI use** - Claude Code, Claude Opus 5.5 (main session) planned the fix, checked it against the GDK and wrote this description; Claude Sonnet 5.5 subagents wrote the code and the tests and ran the tests and the title runs; a Claude Opus 5.5 reviewer agent reviewed the branches. For the restack onto #3281's current head and the rebase onto main `493dbd3d`, Claude Sonnet 5.5 agents replayed the commits, resolved the conflicts and ran the suite, the smoke pair and the mutation checks; a Claude Opus 5.5 reviewer checked the result. - The review fixes on `ea91c5f4` (and the restack onto #3281's `b02b2c34`): Claude Code, Claude Opus 5.5 (main session) orchestrated them and updated this description; Claude Opus 5.5 subagents checked the review points, made the fixes and reviewed them; Claude Sonnet 5.5 subagents ran the suite and the smoke pair.
Foniass commented 2026-11-29 14:58:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-11-29T14:58:06Z.


merge-check
base: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0
head: ab6adf3710b9c708bf776d83378d7c80a0260913
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2624 passed, 4 failed, 49 ignored; SKIPPED: 44; failing: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (driver E_OUTOFMEMORY, same on base on this machine)
review: stacked on #3281 (this merge includes it) and opt-in through XCL_PAIR_PAGES=1. The address math looks right. The "address its layout allows" check filters almost nothing: every unaligned UAV texture with a known size moves to the pages, which the description should say. The sizes come from measuring the SDK's xg_xs.dll, a provenance call for the maintainer.
performance: 60 s smoke with the switch off (the default): 1675 frames (100.2 %), peak commit 16936 MB (94.4 %)
verdict: safe to merge (opt-in; the description should state the scope)
hardware / tool and model: RTX 5070 Ti (driver 32.0.16.2114), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

Note: since this run the PR conflicts with main (3b6a91ed). The result above is for this head merged onto the base named above.

Merge-check run and written with Claude Code (Claude Opus 5.5): a test merge onto the base above, the full suite, and a 60 s scripts/smoke.ps1 run of a retail title against main on the same machine. The 4 fuzz_validate_and_gpu_* failures happen on main on this machine too.

<!-- greyfinch-sync:ivall/xcl:comment:7257715263 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7257715263). Originally posted by [Foniass](https://github.com/Foniass) on 2026-11-29T14:58:06Z. --- ```text merge-check base: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0 head: ab6adf3710b9c708bf776d83378d7c80a0260913 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2624 passed, 4 failed, 49 ignored; SKIPPED: 44; failing: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (driver E_OUTOFMEMORY, same on base on this machine) review: stacked on #3281 (this merge includes it) and opt-in through XCL_PAIR_PAGES=1. The address math looks right. The "address its layout allows" check filters almost nothing: every unaligned UAV texture with a known size moves to the pages, which the description should say. The sizes come from measuring the SDK's xg_xs.dll, a provenance call for the maintainer. performance: 60 s smoke with the switch off (the default): 1675 frames (100.2 %), peak commit 16936 MB (94.4 %) verdict: safe to merge (opt-in; the description should state the scope) hardware / tool and model: RTX 5070 Ti (driver 32.0.16.2114), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 ``` Note: since this run the PR conflicts with main (3b6a91ed). The result above is for this head merged onto the base named above. Merge-check run and written with Claude Code (Claude Opus 5.5): a test merge onto the base above, the full suite, and a 60 s `scripts/smoke.ps1` run of a retail title against main on the same machine. The 4 `fuzz_validate_and_gpu_*` failures happen on main on this machine too.
andrewDoing commented 2026-11-29 18:03:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T18:03:47Z.


I routed the existing unaligned pair fixture through CreatePlacedResourceX on current head fb4478d7, RTX 5070 (616.92), Ryzen 7 5700X3D, Windows 11 26300.10075, debug. The test used the 1280×720 R32_UINT writer at a 16 KiB-aligned address, its R9G9B9E5 view, and the adjacent texture. XCL_ALIAS_COPY=0 throughout.

  • With XCL_PAIR_PAGES=1 and XCL_TEXTURE_LEVEL_PAGES=0, the entry point placed the writer and view on the same pages and capped the view from 0x398000 to 0x384000. Native GPU readback matched all 720 alias rows and all 64 adjacent rows after writing separate patterns.
  • With XCL_PAIR_PAGES=0, all three resource creations succeeded and the unaligned writer stayed off the shared pages. This control checked placement.
  • With both switches on, the view had the same cap but started with no mapped mip group. A native GPU copy read zero in all 720 rows after writing the backing writer. Explicit vram::map_levels(view, Some(&[0])) restored all 720 expected rows. The fixture explicitly mapped the separate lazy neighbour before writing its pattern and verified that all 64 of its rows survived.
  • A test-only placement control kept lazy levels enabled globally and made the capped view eager when the matching address and tile count already had an eagerly backed resource. The first read matched all 720 view rows without an explicit map_levels call for the view. The neighbour still started lazy and all 64 rows survived after its explicit map and write.

The fixtures ran in fresh processes with zero skips. The lazy-mode result isolates a first-use mapping problem for this GPU-written alias. The eager control is scoped to the tested capped pair. The measurements are from synthetic GPU readback. Retail frames, total VRAM usage, and performance remain unmeasured. Codex with GPT-6.2 Sol adapted and ran the fixture.

<!-- greyfinch-sync:ivall/xcl:comment:7260179369 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7260179369). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-29T18:03:47Z. --- I routed the existing unaligned pair fixture through `CreatePlacedResourceX` on current head `fb4478d7`, RTX 5070 (616.92), Ryzen 7 5700X3D, Windows 11 26300.10075, debug. The test used the 1280×720 R32_UINT writer at a 16 KiB-aligned address, its R9G9B9E5 view, and the adjacent texture. `XCL_ALIAS_COPY=0` throughout. - With `XCL_PAIR_PAGES=1` and `XCL_TEXTURE_LEVEL_PAGES=0`, the entry point placed the writer and view on the same pages and capped the view from `0x398000` to `0x384000`. Native GPU readback matched all 720 alias rows and all 64 adjacent rows after writing separate patterns. - With `XCL_PAIR_PAGES=0`, all three resource creations succeeded and the unaligned writer stayed off the shared pages. This control checked placement. - With **both switches on**, the view had the same cap but started with no mapped mip group. A native GPU copy read zero in all 720 rows after writing the backing writer. Explicit `vram::map_levels(view, Some(&[0]))` restored all 720 expected rows. The fixture explicitly mapped the separate lazy neighbour before writing its pattern and verified that all 64 of its rows survived. - A test-only placement control kept lazy levels enabled globally and made the capped view eager when the matching address and tile count already had an eagerly backed resource. The first read matched all 720 view rows without an explicit `map_levels` call for the view. The neighbour still started lazy and all 64 rows survived after its explicit map and write. The fixtures ran in fresh processes with zero skips. The lazy-mode result isolates a first-use mapping problem for this GPU-written alias. The eager control is scoped to the tested capped pair. The measurements are from synthetic GPU readback. Retail frames, total VRAM usage, and performance remain unmeasured. Codex with GPT-6.2 Sol adapted and ran the fixture.
Aniseto commented 2026-11-29 18:39:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-29T18:39:49Z.


Ran the paired-page alignment tests at fb4478d7 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_an_unaligned_gpu_owned_texture_shares_pages_with_its_view -- --test-threads=1: 1 passed, 0 failed, 0 ignored.
  • XCL_ADAPTER=NVIDIA cargo test -p xcl --lib a_gpu_owned_texture_at_an_unaligned_address_needs_its_console_alignment -- --test-threads=1: 1 passed, 0 failed, 0 ignored.
  • XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_register_takes_the_cap_from_the_pair -- --test-threads=1: 1 passed, 0 failed, 0 ignored.
  • XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_a_sampled_pairs_last_tiles_are_not_the_next_textures -- --test-threads=1: 1 passed, 0 failed, 0 ignored.
  • XCL_ADAPTER=NVIDIA cargo test -p xcl --lib a_written_texture_and_its_views_have_the_alignments_the_console_gives -- --test-threads=1: 1 passed, 0 failed, 0 ignored.

What this adds
All five focused tests pass, including the GPU-backed ones: an unaligned GPU-owned texture shares pages with its view, the console alignment rule is applied, the registered texture takes the cap from its pair, and the last tiles of a sampled pair are not the next texture. The thread has a run on an RTX 5070; this adds a Blackwell datapoint on driver 32.0.16.2140. Synthetic tests only; no title run with XCL_PAIR_PAGES=1.

Not tested
A retail title, a paired smoke run, the full workspace suite, 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:7260659619 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7260659619). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-29T18:39:49Z. --- Ran the paired-page alignment tests at `fb4478d7` 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_an_unaligned_gpu_owned_texture_shares_pages_with_its_view -- --test-threads=1`: 1 passed, 0 failed, 0 ignored. - `XCL_ADAPTER=NVIDIA cargo test -p xcl --lib a_gpu_owned_texture_at_an_unaligned_address_needs_its_console_alignment -- --test-threads=1`: 1 passed, 0 failed, 0 ignored. - `XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_register_takes_the_cap_from_the_pair -- --test-threads=1`: 1 passed, 0 failed, 0 ignored. - `XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_a_sampled_pairs_last_tiles_are_not_the_next_textures -- --test-threads=1`: 1 passed, 0 failed, 0 ignored. - `XCL_ADAPTER=NVIDIA cargo test -p xcl --lib a_written_texture_and_its_views_have_the_alignments_the_console_gives -- --test-threads=1`: 1 passed, 0 failed, 0 ignored. **What this adds** All five focused tests pass, including the GPU-backed ones: an unaligned GPU-owned texture shares pages with its view, the console alignment rule is applied, the registered texture takes the cap from its pair, and the last tiles of a sampled pair are not the next texture. The thread has a run on an RTX 5070; this adds a Blackwell datapoint on driver 32.0.16.2140. Synthetic tests only; no title run with `XCL_PAIR_PAGES=1`. **Not tested** A retail title, a paired smoke run, the full workspace suite, 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.
thehollowedone commented 2026-12-01 00:54:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T00:54:14Z.


Source check on the current stacked heads: #3282 475a5325 still has the older pair_bytes(targets, va, total, ...) rule: it takes the smallest known size among any mapped same-address, same-tile-count target. The current parent #3281 ddd5c6ca instead selects current GPU-writable partners and checks the placement registry, with regressions for a writer created second and a superseded partner before deferred unmap.

Please replay #3282's own changes on that current #3281 head before a merge check, retaining the parent's partner-selection tests as well as #3282's unaligned-placement test. GitHub's CLEAN status is against main; it does not show that the updated parent is in this branch. The existing #3282 suite and smoke receipts also predate that replay. This is a source comparison; I did not run tests on a combined head.

AI use: OpenAI Codex (GPT-6.2 Sol) compared the exact PR-head source and drafted this note.

<!-- greyfinch-sync:ivall/xcl:comment:7296870702 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7296870702). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-12-01T00:54:14Z. --- Source check on the current stacked heads: [#3282 `475a5325`](https://github.com/xcl-dev/xcl/commit/475a5325cb58454390f8c98aa5b4283b6d970cf8) still has the older `pair_bytes(targets, va, total, ...)` rule: it takes the smallest known size among *any mapped* same-address, same-tile-count target. The current parent [#3281 `ddd5c6ca`](https://github.com/xcl-dev/xcl/commit/ddd5c6ca38d13495dfbe80d49f9f410edd35ad69) instead selects current GPU-writable partners and checks the placement registry, with regressions for a writer created second and a superseded partner before deferred unmap. Please replay #3282's own changes on that current #3281 head before a merge check, retaining the parent's partner-selection tests as well as #3282's unaligned-placement test. GitHub's `CLEAN` status is against `main`; it does not show that the updated parent is in this branch. The existing #3282 suite and smoke receipts also predate that replay. This is a source comparison; I did not run tests on a combined head. AI use: OpenAI Codex (GPT-6.2 Sol) compared the exact PR-head source and drafted this note.
Pipodi commented 2026-12-01 07:35:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-01T07:35:44Z.


Thanks, you were right: 475a5325 still sat on #3281's old commits. Restacked onto #3281's current head ddd5c6ca; the new head is c2452da5, and only the top two commits belong here (2e20260a, c2452da5).

  • The partner selection, the registry check and the "no cap on a GPU-written texture" rule are #3281's, unchanged. #3282 never used pair_bytes; the one call that changed is place_on_pages in place_with (vram.rs), which now passes pair && known.is_some(), the parent's pair_pages() && known.
  • All of #3281's tests and #3282's four tests are kept and pass.
  • Whole suite on c2452da5 (RTX 4090, driver 621.40): 2766 passed, 0 failed, 49 ignored, 28 SKIPPED. 2e20260a alone passes cargo check -p xcl --tests.
  • Mutation checks rerun on c2452da5, and a new smoke pair (main 0fe06eb0 against c2452da5: 1586 against 1614 frames, 20653 against 20413 MB peak, no removal or crash). The description is updated with both.
  • Not redone on this head: the title run with XCL_PAIR_PAGES=1 (now labelled as 475a5325's in the description).

AI use: Claude Code. Claude Sonnet 5.5 did the restack and the runs; Claude Opus 5.5 reviewed it and wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7304249204 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7304249204). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-12-01T07:35:44Z. --- Thanks, you were right: `475a5325` still sat on #3281's old commits. Restacked onto #3281's current head `ddd5c6ca`; the new head is `c2452da5`, and only the top two commits belong here (`2e20260a`, `c2452da5`). - The partner selection, the registry check and the "no cap on a GPU-written texture" rule are #3281's, unchanged. #3282 never used `pair_bytes`; the one call that changed is `place_on_pages` in `place_with` (`vram.rs`), which now passes `pair && known.is_some()`, the parent's `pair_pages() && known`. - All of #3281's tests and #3282's four tests are kept and pass. - Whole suite on `c2452da5` (RTX 4090, driver 621.40): 2766 passed, 0 failed, 49 ignored, 28 SKIPPED. `2e20260a` alone passes `cargo check -p xcl --tests`. - Mutation checks rerun on `c2452da5`, and a new smoke pair (main `0fe06eb0` against `c2452da5`: 1586 against 1614 frames, 20653 against 20413 MB peak, no removal or crash). The description is updated with both. - Not redone on this head: the title run with `XCL_PAIR_PAGES=1` (now labelled as `475a5325`'s in the description). AI use: Claude Code. Claude Sonnet 5.5 did the restack and the runs; Claude Opus 5.5 reviewed it and wrote this reply.
Pipodi commented 2026-12-01 08:15:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-01T08:15:03Z.


Rebased again, with #3281, onto main 493dbd3d: c2452da5 conflicted with #2753 in device_x.rs (its console_bytes / volume_texel_bytes sit where this PR adds gpu_owned_page_align; both are kept). New head 12a5bb2d on #3281's b0192a85; this PR's two commits have the same patches as before apart from that conflict.

Whole suite on 12a5bb2d: 2914 passed, 0 failed, 51 ignored, 25 SKIPPED. Smoke against main 493dbd3d: 1612 against 1614 frames, 18783 against 19892 MB peak, no removal or crash. The description is updated.

AI use: Claude Code. Claude Sonnet 5.5 agents did the rebase and the runs; Claude Opus 5.5 reviewed it and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7305069679 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7305069679). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-12-01T08:15:03Z. --- Rebased again, with #3281, onto main `493dbd3d`: `c2452da5` conflicted with #2753 in `device_x.rs` (its `console_bytes` / `volume_texel_bytes` sit where this PR adds `gpu_owned_page_align`; both are kept). New head `12a5bb2d` on #3281's `b0192a85`; this PR's two commits have the same patches as before apart from that conflict. Whole suite on `12a5bb2d`: 2914 passed, 0 failed, 51 ignored, 25 SKIPPED. Smoke against main `493dbd3d`: 1612 against 1614 frames, 18783 against 19892 MB peak, no removal or crash. The description is updated. AI use: Claude Code. Claude Sonnet 5.5 agents did the rebase and the runs; Claude Opus 5.5 reviewed it and wrote this comment.
Foniass commented 2026-12-01 09:48:05 +00:00 (Migrated from github.com)

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


Triage (#1607) – head c3145f9

Stacked on #3281: the 307 shared added lines are #3281's two commits. Only 7307ba5d and c3145f90 belong here. #3340 and #3491 carry the same #3281 commits underneath them as well.
#3094 (XCL_ALIAS_COPY) and #3340 (XCL_CAST_LIST) target the same R32_UINT / R9G9B9E5 aliasing in the retail title with copies and cast lists. This PR instead puts unaligned GPU-owned textures on the shared pages. These are different approaches, not duplicates.
In vram::place, the unaligned case passes require_aligned = false to place_on_pages. That flag also gates the failure log, the reserved-pool recycle_key and memory-report texels. So unaligned GPU-owned textures now skip the log and get texel accounting when the memory report is on. The pool stays off for them (UAV flag). c3145f90 now says so in the comment at the call.
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:7307226372 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7307226372). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:48:05Z. --- **Triage (#1607)** – head c3145f9 Stacked on #3281: the 307 shared added lines are #3281's two commits. Only `7307ba5d` and `c3145f90` belong here. #3340 and #3491 carry the same #3281 commits underneath them as well. #3094 (`XCL_ALIAS_COPY`) and #3340 (`XCL_CAST_LIST`) target the same R32_UINT / R9G9B9E5 aliasing in the retail title with copies and cast lists. This PR instead puts unaligned GPU-owned textures on the shared pages. These are different approaches, not duplicates. In `vram::place`, the unaligned case passes `require_aligned = false` to `place_on_pages`. That flag also gates the failure log, the reserved-pool `recycle_key` and memory-report `texels`. So unaligned GPU-owned textures now skip the log and get texel accounting when the memory report is on. The pool stays off for them (UAV flag). c3145f90 now says so in the comment at the call. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Foniass commented 2026-12-01 10:09:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:09:25Z.


merge-check
base: 493dbd3dd0
head: 12a5bb2df9
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2914 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: stacked on #3281, its own commits d88d30f2 and 12a5bb2d read (+266/-15). With XCL_PAIR_PAGES unset behaviour is unchanged (!unaligned_on_pages(..) is true, and d88d30f2's condition is equivalent), but gpu_owned_page_align(&x) (device_x.rs ~1293) runs on every GPU-owned CreatePlacedResourceX regardless. That builds the XG layout a second time (console_bytes already did) and runs the glyph check, and the result is thrown away when the switch is off. Computing it only when pair_pages() is on avoids that. The run below has a second smoke with XCL_PAIR_PAGES=1. Findings, switch on only: (1) "An address its layout allows" filters almost nothing. Texture::alignment() is the largest swizzle block (0x100 / 0x1000 / 0x10000), and for these textures it is 0x100. The mapping puts tile i at first + i*64K and skips the partial first page, ignoring the alignment and the mip tail. The description says the scope is broad, so this is a design remark. (2) CPU writes stop being uploaded for an unaligned UAV texture. On main it's committed and goes through register; here it goes through register_gpu_owned (cpu_backed: false). That matches the 64 KiB-aligned GPU-owned path, but nothing checks that a UAV flag means the CPU never fills it. (3) The glyph exclusion is dead code today: unaligned_on_pages requires the UAV flag and the glyph descriptor has none, as the description says. (4) andrewDoing's report (capped views read zero with XCL_TEXTURE_LEVEL_PAGES=1 too) has no answer yet. Fine: checked_next_multiple_of and saturating_add keep the arithmetic safe. When the page pool runs out, the arena refuses the address and the texture gets a committed resource as on main. The placements range covers only the owned pages, the same rule as #3281. The tests use place_with(.., pair=true) rather than the environment, hold VRAM_TEST_LOCK, and skip without hardware.
performance: 60 s smoke of a retail title, main 493dbd3d vs this merge (12a5bb2d): 1670 -> 1675 frames shown (100 %; last presents per 2 s: 60 61 60), peak commit 17083 -> 17897 MB, 0 device removals, 0 crashes. A second 60 s run of the same merge with XCL_PAIR_PAGES=1: 1677 frames shown (last presents per 2 s: 60 60 60), peak commit 17124 MB, 0 device removals, 0 crashes; the log shows 6 pair-pages placements, but none names this PR's unaligned path, so that path is likely not reached in 60 s.
verdict: safe to merge after #3281 (gating gpu_owned_page_align on pair_pages() would remove the extra layout parse with the switch off)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7307756539 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7307756539). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T10:09:25Z. --- merge-check base: 493dbd3dd0cd50b4c3e8d28f73ab9b504fcd8158 head: 12a5bb2df9dab3c4ba45201fcfa0dd1ecf22d63e merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2914 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: stacked on #3281, its own commits d88d30f2 and 12a5bb2d read (+266/-15). With `XCL_PAIR_PAGES` unset behaviour is unchanged (`!unaligned_on_pages(..)` is true, and d88d30f2's condition is equivalent), but `gpu_owned_page_align(&x)` (`device_x.rs` ~1293) runs on every GPU-owned `CreatePlacedResourceX` regardless. That builds the XG layout a second time (`console_bytes` already did) and runs the glyph check, and the result is thrown away when the switch is off. Computing it only when `pair_pages()` is on avoids that. The run below has a second smoke with `XCL_PAIR_PAGES=1`. Findings, switch on only: (1) **"An address its layout allows" filters almost nothing.** `Texture::alignment()` is the largest swizzle block (0x100 / 0x1000 / 0x10000), and for these textures it is 0x100. The mapping puts tile i at `first + i*64K` and skips the partial first page, ignoring the alignment and the mip tail. The description says the scope is broad, so this is a design remark. (2) **CPU writes stop being uploaded** for an unaligned UAV texture. On main it's committed and goes through `register`; here it goes through `register_gpu_owned` (`cpu_backed: false`). That matches the 64 KiB-aligned GPU-owned path, but nothing checks that a UAV flag means the CPU never fills it. (3) The glyph exclusion is dead code today: `unaligned_on_pages` requires the UAV flag and the glyph descriptor has none, as the description says. (4) andrewDoing's report (capped views read zero with `XCL_TEXTURE_LEVEL_PAGES=1` too) has no answer yet. Fine: `checked_next_multiple_of` and `saturating_add` keep the arithmetic safe. When the page pool runs out, the arena refuses the address and the texture gets a committed resource as on main. The placements range covers only the owned pages, the same rule as #3281. The tests use `place_with(.., pair=true)` rather than the environment, hold `VRAM_TEST_LOCK`, and skip without hardware. performance: 60 s smoke of a retail title, main 493dbd3d vs this merge (12a5bb2d): 1670 -> 1675 frames shown (100 %; last presents per 2 s: 60 61 60), peak commit 17083 -> 17897 MB, 0 device removals, 0 crashes. A second 60 s run of the same merge with `XCL_PAIR_PAGES=1`: 1677 frames shown (last presents per 2 s: 60 60 60), peak commit 17124 MB, 0 device removals, 0 crashes; the log shows 6 pair-pages placements, but none names this PR's unaligned path, so that path is likely not reached in 60 s. verdict: safe to merge after #3281 (gating `gpu_owned_page_align` on `pair_pages()` would remove the extra layout parse with the switch off) hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
KDenKC commented 2026-12-01 12:48:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T12:48:38Z.


Test report on #3282 (and #3281 under it): with it, the alternate-frame black box over the window in the retail title's first interior scene is gone on an RTX 5090, in two runs of the same build; results below are from real runs on the hardware named.

What it fixes here. In the first interior scene, the window showed a black box on every other frame. Following one pixel of the window back through the frame: the window's draw (VS bee4089e8db26003, PS 1f158b6c62603705) passes through a 1280x720 R9G9B9E5 texture, the read side of an alias pair (written as R32_UINT, read as R9G9B9E5 at the same address). That texture is computed each frame by a few compute passes (42503c984c6e7870 ... bca2f01e3e561c7b) that read the TAA history, a ping-pong of two such 1280x720 pairs: the first at 0x135c980000, the second right after it at 0x135cd04000 (16 KiB- but not 64 KiB-aligned). Without #3282's top two commits, the second texture is not put on the pair pages, and its read side stays empty while its written side holds data; every other frame the TAA passes read that empty history, and the window was computed from zeros. With #3282 the second texture goes on the pair pages at boot, its read side holds the data, and the window no longer alternates.

Tree. Not main and not #3282's head as is: our local test tree = main d52ff48c + a local input helper for unattended runs + #3281's two commits (f232cc0f, 7c9915b2) + a port of #3094's alias copy (XCL_ALIAS_COPY=1) + a revert of one compact-form commit + #3056 + local diagnostics (pixel history, live switches, all off unless set) = 5a46b2c0; then #3282's two commits on #3281 cherry-picked: d88d30f2 (clean) and 12a5bb2d, with one conflict in vram.rs place_with, resolved by taking #3282's side: let known = console_bytes; before the size estimate, and place_on_pages(..., console_bytes, !unaligned_on_pages(va, desc, known, console_align, pair), false, pair && known.is_some(), ...) in place of our tree's place_on_pages(..., console_bytes, true, false, pair_pages(), ...) (pair is pair_pages(), passed down by place). Result 661f01f1. cargo test -p xcl --lib vram on it: 78 passed, 0 failed, 1 ignored.

Hardware and settings. RTX 5090 32 GB, driver 621.40, Windows 11; release build; XCL_PAIR_PAGES=1, XCL_ALIAS_COPY=1, XCL_UMA_WINDOWS=16, XCL_UMA_DRIVER=mixed:1536:1792, XCL_COHERENT_MB=4095, XCL_DRED=1, XCL_PREPARE=0, held-Enter input, warm translated cache; the measurements start 20 s after the world is reached. Values were read with a texel probe (a 1x1 copy before a draw or dispatch) and pixel history at the window pixel (1920, 720 of the 3840x2160 present; 640, 240 of the 1280x720 textures).

Before (5a46b2c0, without #3282's two commits). Boot: only the first texture is on the pair pages.

[    7.288] D3D12.X: pair pages: texture at 0x135c980000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000: a live texture is in the same memory (1 so far)

The second texture's read side, sampled by the TAA pass on its frames: always 0.

pixel history r1: f2788 ev 9183 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0xf31b4f90 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000)
pixel history r1: f2790 ev 20110 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0xf31b4f90 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000)
pixel history r1: f2792 ev 31217 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0xf31b4f90 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000)

The window draw's input: 0 on every other frame.

pixel history r1: f2787 ev 3974 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa2f1fa510 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000)
pixel history r1: f2788 ev 9364 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa2f1fa510 1280x720 fmt 67 state 0x0 p0 at (640, 240): (1.6211, 0.4258, 0.1367)
pixel history r1: f2789 ev 14873 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa2f1fa510 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000)
pixel history r1: f2790 ev 20272 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa2f1fa510 1280x720 fmt 67 state 0x0 p0 at (640, 240): (1.6367, 0.4297, 0.1367)

The final output at the window pixel: near black on every other frame.

pixel history r1: f2787 ev 4345 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.0157, 0.0039, 0.0039, 0.0000) -> (0.0196, 0.0039, 0.0039, 0.0000)
pixel history r1: f2788 ev 9683 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.8706, 0.6000, 0.3490, 0.6667) -> (0.8588, 0.5882, 0.3412, 0.6667)
pixel history r1: f2789 ev 15287 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.0196, 0.0039, 0.0039, 0.0000) -> (0.0157, 0.0000, 0.0000, 0.0000)
pixel history r1: f2790 ev 20684 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.8588, 0.5882, 0.3412, 0.6667) -> (0.8627, 0.5922, 0.3412, 0.6667)

After (661f01f1, with #3282's two commits). Boot: both textures on the pair pages.

[    7.713] D3D12.X: pair pages: texture at 0x135c980000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000: a live texture is in the same memory (1 so far)
[    7.716] D3D12.X: pair pages: texture at 0x135cd04000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000: a live texture is in the same memory (2 so far)

The second texture's read side holds the data.

pixel history r1: f2908 ev 9523 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0x108457400 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.5391, 0.5469, 0.1406)
pixel history r1: f2910 ev 20529 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0x108457400 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.6094, 0.5625, 0.1406)
pixel history r1: f2912 ev 31501 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0x108457400 1280x720 fmt 67 state 0x0 p0 at (640, 240): (4.9844, 0.8750, 0.1562)

The window draw's input: non-zero on every frame (8 of 8; f2911-2914: 4.9219, 4.4531, 2.3438, 0.1426).

pixel history r1: f2907 ev 4057 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa70cc41d0 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.5391, 0.5469, 0.1406)
pixel history r1: f2908 ev 9942 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa70cc41d0 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.6172, 0.5625, 0.1406)
pixel history r1: f2909 ev 15184 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa70cc41d0 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.6172, 0.5625, 0.1406)
pixel history r1: f2910 ev 20648 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa70cc41d0 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.7109, 0.5781, 0.1406)

The final output at the window pixel: steady.

pixel history r1: f2908 ev 10167 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.9176, 0.6588, 0.3843, 0.6667) -> (0.9216, 0.6627, 0.3882, 0.6667)
pixel history r1: f2909 ev 15862 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.9176, 0.6627, 0.3843, 0.6667) -> (0.9176, 0.6627, 0.3804, 0.6667)
pixel history r1: f2910 ev 20943 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.9216, 0.6627, 0.3882, 0.6667) -> (0.9176, 0.6627, 0.3843, 0.6667)
pixel history r1: f2911 ev 26650 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.9176, 0.6627, 0.3804, 0.6667) -> (0.9333, 0.6902, 0.3961, 0.6667)

At f2914 the window pixel dips to 0.49 / 0.28 / 0.14 (not 0): one frame, most likely the scripted camera moving; not claimed either way.

Confirming run (same build, same settings, two pixel-history rounds of 8 frames each, f2952-2959 and f2979-2986): the window draw's input is non-zero in all 16 frames (4.0625, 3.9688, 4.2031, 4.2344, 4.5312, 3.8203, 3.9141, 3.9531, 4.3125, 4.4375, 3.9141, 4.0156, 4.0625, 4.1719, 4.0781, 4.2188), and the final output at the window pixel stays between R 0.87-0.94, G 0.58-0.69, B 0.30-0.40 in every frame it was written (15; in f2980 the draw left the pixel unchanged). No dip in this run.

Ruled out on the way (same scene, unattended runs, before #3282): pinning each alternating descriptor slot and buffer of the window's draws to one frame's copy, a global UAV + aliasing barrier before every draw and dispatch, one frame in flight, discards turned into no-ops, the alias copy left out or made only at the write-to-read transition: none changed the alternation.

Also in the same runs: the TAA smear in that view. Frame dumps of the cell (960x540, frames 2600-2960) without and with #3282: without it, even on the frames where the window is drawn, the yard seen through it is smeared with streaky trails (the TAA accumulating from a history that is empty every other frame); with it, the yard is sharp. Measured as the share of pixels more than twice their 3x3 median: on the character's silhouette 1.18-1.25 % -> 0.23-0.40 %, on the window's border 3.1-3.9 % -> 1.2-1.5 %, a control area unchanged (0.017-0.021 relative high-frequency energy in both). No frames attached.

Addendum (a third run). #3282 alone does not end the flicker; with #3094's alias copy it does. A run of main b2b1f109 + #3281 + #3282 + #3516 (no #3094) on the same RTX 5090 still showed the window's black frames (graded on frame dumps: 1 of 8 black, 2 dim). The reason in the code: #3282 puts the second texture's written R32_UINT half on the pair pages (vram::place), but its R9G9B9E5 read half goes through vram::place_pages, which needs a 64 KiB-aligned address, so at 0x135cd04000 it becomes a texture of its own kept in step only by title-texture uploads, which follow CPU writes; the GPU's writes to the R32 half never reach it. #3094's alias copy fills it, and only once #3282 has placed the written half (our tree had the copy all along, and pair 2's read half stayed empty until #3282 was added).

Update: a side effect in the same scene. With #3282 the room's own light goes out. A matched pair on the same tree (8d737ed9 without #3282, f4231a68 with it; the only difference is #3282's four files), same seed, 8 frames each, at a point on the cell's left wall (2560x1440 lighting target):

  • the tile-lighting draw (VS b6395e96c2908eef, PS 3d12f1c5bbb190e7, blend off) writes (0.059-0.068, 0.048-0.056, 0.039-0.045) without #3282 and exactly 0 with it, every frame;
  • after tone mapping (PS 4adcdc125462510a) the wall is 0.21/0.21/0.16 without and 0.02/0.00/0.00 with #3282: grey vs black on screen;
  • the sunlit yard through the window maps the same in both (0.58-0.62 / 0.32-0.35 / 0.17 after tone mapping), so it is not the exposure.

So #3282 fixes the window but something the room's tile lighting reads changes with it; most likely one of its inputs now on the pair pages. We are finding which input next and will add it here. This does not change the window finding above.

Not tested

  • #3282's own head as is: our tree needed the vram.rs conflict resolved (above), on a tree that is not main.
  • The whole test suite on 661f01f1 (only vram's tests, 78/0/1).
  • AMD, other NVIDIA cards; other scenes.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen (diagnostics, the conflict resolution for this test, the runs on the hardware above, reading the logs, this report).

<!-- greyfinch-sync:ivall/xcl:comment:7311679501 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7311679501). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-01T12:48:38Z. --- Test report on #3282 (and #3281 under it): with it, the alternate-frame black box over the window in the retail title's first interior scene is gone on an RTX 5090, in two runs of the same build; results below are from real runs on the hardware named. **What it fixes here.** In the first interior scene, the window showed a black box on every other frame. Following one pixel of the window back through the frame: the window's draw (VS `bee4089e8db26003`, PS `1f158b6c62603705`) passes through a 1280x720 R9G9B9E5 texture, the read side of an alias pair (written as R32_UINT, read as R9G9B9E5 at the same address). That texture is computed each frame by a few compute passes (`42503c984c6e7870` ... `bca2f01e3e561c7b`) that read the TAA history, a ping-pong of two such 1280x720 pairs: the first at `0x135c980000`, the second right after it at `0x135cd04000` (16 KiB- but not 64 KiB-aligned). Without #3282's top two commits, the second texture is not put on the pair pages, and its read side stays empty while its written side holds data; every other frame the TAA passes read that empty history, and the window was computed from zeros. With #3282 the second texture goes on the pair pages at boot, its read side holds the data, and the window no longer alternates. **Tree.** Not `main` and not #3282's head as is: our local test tree = `main` `d52ff48c` + a local input helper for unattended runs + #3281's two commits (`f232cc0f`, `7c9915b2`) + a port of #3094's alias copy (`XCL_ALIAS_COPY=1`) + a revert of one compact-form commit + #3056 + local diagnostics (pixel history, live switches, all off unless set) = `5a46b2c0`; then #3282's two commits on #3281 cherry-picked: `d88d30f2` (clean) and `12a5bb2d`, with one conflict in `vram.rs` `place_with`, resolved by taking #3282's side: `let known = console_bytes;` before the size estimate, and `place_on_pages(..., console_bytes, !unaligned_on_pages(va, desc, known, console_align, pair), false, pair && known.is_some(), ...)` in place of our tree's `place_on_pages(..., console_bytes, true, false, pair_pages(), ...)` (`pair` is `pair_pages()`, passed down by `place`). Result `661f01f1`. `cargo test -p xcl --lib vram` on it: 78 passed, 0 failed, 1 ignored. **Hardware and settings.** RTX 5090 32 GB, driver 621.40, Windows 11; release build; `XCL_PAIR_PAGES=1`, `XCL_ALIAS_COPY=1`, `XCL_UMA_WINDOWS=16`, `XCL_UMA_DRIVER=mixed:1536:1792`, `XCL_COHERENT_MB=4095`, `XCL_DRED=1`, `XCL_PREPARE=0`, held-Enter input, warm translated cache; the measurements start 20 s after the world is reached. Values were read with a texel probe (a 1x1 copy before a draw or dispatch) and pixel history at the window pixel (1920, 720 of the 3840x2160 present; 640, 240 of the 1280x720 textures). **Before** (`5a46b2c0`, without #3282's two commits). Boot: only the first texture is on the pair pages. ``` [ 7.288] D3D12.X: pair pages: texture at 0x135c980000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000: a live texture is in the same memory (1 so far) ``` The second texture's read side, sampled by the TAA pass on its frames: always 0. ``` pixel history r1: f2788 ev 9183 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0xf31b4f90 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000) pixel history r1: f2790 ev 20110 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0xf31b4f90 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000) pixel history r1: f2792 ev 31217 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0xf31b4f90 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000) ``` The window draw's input: 0 on every other frame. ``` pixel history r1: f2787 ev 3974 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa2f1fa510 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000) pixel history r1: f2788 ev 9364 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa2f1fa510 1280x720 fmt 67 state 0x0 p0 at (640, 240): (1.6211, 0.4258, 0.1367) pixel history r1: f2789 ev 14873 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa2f1fa510 1280x720 fmt 67 state 0x0 p0 at (640, 240): (0.0000, 0.0000, 0.0000) pixel history r1: f2790 ev 20272 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa2f1fa510 1280x720 fmt 67 state 0x0 p0 at (640, 240): (1.6367, 0.4297, 0.1367) ``` The final output at the window pixel: near black on every other frame. ``` pixel history r1: f2787 ev 4345 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.0157, 0.0039, 0.0039, 0.0000) -> (0.0196, 0.0039, 0.0039, 0.0000) pixel history r1: f2788 ev 9683 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.8706, 0.6000, 0.3490, 0.6667) -> (0.8588, 0.5882, 0.3412, 0.6667) pixel history r1: f2789 ev 15287 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.0196, 0.0039, 0.0039, 0.0000) -> (0.0157, 0.0000, 0.0000, 0.0000) pixel history r1: f2790 ev 20684 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.8588, 0.5882, 0.3412, 0.6667) -> (0.8627, 0.5922, 0.3412, 0.6667) ``` **After** (`661f01f1`, with #3282's two commits). Boot: both textures on the pair pages. ``` [ 7.713] D3D12.X: pair pages: texture at 0x135c980000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000: a live texture is in the same memory (1 so far) [ 7.716] D3D12.X: pair pages: texture at 0x135cd04000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000: a live texture is in the same memory (2 so far) ``` The second texture's read side holds the data. ``` pixel history r1: f2908 ev 9523 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0x108457400 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.5391, 0.5469, 0.1406) pixel history r1: f2910 ev 20529 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0x108457400 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.6094, 0.5625, 0.1406) pixel history r1: f2912 ev 31501 probe vs 42503c984c6e7870 ps 0000000000000000 p1[3] pair 2 res 0x108457400 1280x720 fmt 67 state 0x0 p0 at (640, 240): (4.9844, 0.8750, 0.1562) ``` The window draw's input: non-zero on every frame (8 of 8; f2911-2914: 4.9219, 4.4531, 2.3438, 0.1426). ``` pixel history r1: f2907 ev 4057 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa70cc41d0 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.5391, 0.5469, 0.1406) pixel history r1: f2908 ev 9942 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa70cc41d0 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.6172, 0.5625, 0.1406) pixel history r1: f2909 ev 15184 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa70cc41d0 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.6172, 0.5625, 0.1406) pixel history r1: f2910 ev 20648 probe vs bee4089e8db26003 ps 1f158b6c62603705 p1[4] pair 59 res 0xa70cc41d0 1280x720 fmt 67 state 0x0 p0 at (640, 240): (2.7109, 0.5781, 0.1406) ``` The final output at the window pixel: steady. ``` pixel history r1: f2908 ev 10167 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.9176, 0.6588, 0.3843, 0.6667) -> (0.9216, 0.6627, 0.3882, 0.6667) pixel history r1: f2909 ev 15862 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.9176, 0.6627, 0.3843, 0.6667) -> (0.9176, 0.6627, 0.3804, 0.6667) pixel history r1: f2910 ev 20943 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.9216, 0.6627, 0.3882, 0.6667) -> (0.9176, 0.6627, 0.3843, 0.6667) pixel history r1: f2911 ev 26650 ... draw vs ffba8fa45ac5a329 ps 88fad02bd1195f9f p0 rt0 3840x2160 fmt 28 at (1920, 720): (0.9176, 0.6627, 0.3804, 0.6667) -> (0.9333, 0.6902, 0.3961, 0.6667) ``` At f2914 the window pixel dips to 0.49 / 0.28 / 0.14 (not 0): one frame, most likely the scripted camera moving; not claimed either way. **Confirming run** (same build, same settings, two pixel-history rounds of 8 frames each, f2952-2959 and f2979-2986): the window draw's input is non-zero in all 16 frames (4.0625, 3.9688, 4.2031, 4.2344, 4.5312, 3.8203, 3.9141, 3.9531, 4.3125, 4.4375, 3.9141, 4.0156, 4.0625, 4.1719, 4.0781, 4.2188), and the final output at the window pixel stays between R 0.87-0.94, G 0.58-0.69, B 0.30-0.40 in every frame it was written (15; in f2980 the draw left the pixel unchanged). No dip in this run. **Ruled out on the way** (same scene, unattended runs, before #3282): pinning each alternating descriptor slot and buffer of the window's draws to one frame's copy, a global UAV + aliasing barrier before every draw and dispatch, one frame in flight, discards turned into no-ops, the alias copy left out or made only at the write-to-read transition: none changed the alternation. **Also in the same runs: the TAA smear in that view.** Frame dumps of the cell (960x540, frames 2600-2960) without and with #3282: without it, even on the frames where the window is drawn, the yard seen through it is smeared with streaky trails (the TAA accumulating from a history that is empty every other frame); with it, the yard is sharp. Measured as the share of pixels more than twice their 3x3 median: on the character's silhouette 1.18-1.25 % -> 0.23-0.40 %, on the window's border 3.1-3.9 % -> 1.2-1.5 %, a control area unchanged (0.017-0.021 relative high-frequency energy in both). No frames attached. **Addendum (a third run).** #3282 alone does not end the flicker; with #3094's alias copy it does. A run of `main` `b2b1f109` + #3281 + #3282 + #3516 (no #3094) on the same RTX 5090 still showed the window's black frames (graded on frame dumps: 1 of 8 black, 2 dim). The reason in the code: #3282 puts the second texture's written R32_UINT half on the pair pages (`vram::place`), but its R9G9B9E5 read half goes through `vram::place_pages`, which needs a 64 KiB-aligned address, so at `0x135cd04000` it becomes a texture of its own kept in step only by title-texture uploads, which follow CPU writes; the GPU's writes to the R32 half never reach it. #3094's alias copy fills it, and only once #3282 has placed the written half (our tree had the copy all along, and pair 2's read half stayed empty until #3282 was added). **Update: a side effect in the same scene.** With #3282 the room's own light goes out. A matched pair on the same tree (`8d737ed9` without #3282, `f4231a68` with it; the only difference is #3282's four files), same seed, 8 frames each, at a point on the cell's left wall (2560x1440 lighting target): - the tile-lighting draw (VS `b6395e96c2908eef`, PS `3d12f1c5bbb190e7`, blend off) writes (0.059-0.068, 0.048-0.056, 0.039-0.045) without #3282 and exactly 0 with it, every frame; - after tone mapping (PS `4adcdc125462510a`) the wall is 0.21/0.21/0.16 without and 0.02/0.00/0.00 with #3282: grey vs black on screen; - the sunlit yard through the window maps the same in both (0.58-0.62 / 0.32-0.35 / 0.17 after tone mapping), so it is not the exposure. So #3282 fixes the window but something the room's tile lighting reads changes with it; most likely one of its inputs now on the pair pages. We are finding which input next and will add it here. This does not change the window finding above. **Not tested** - #3282's own head as is: our tree needed the `vram.rs` conflict resolved (above), on a tree that is not `main`. - The whole test suite on `661f01f1` (only `vram`'s tests, 78/0/1). - AMD, other NVIDIA cards; other scenes. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen (diagnostics, the conflict resolution for this test, the runs on the hardware above, reading the logs, this report).
KDenKC commented 2026-12-01 15:13:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T15:13:04Z.


@Pipodi a heads-up, since an edit doesn't notify: I added an update to the test report above. With #3282 the window's alternate-frame black box is gone, but in the same scene the room's tile lighting (PS 3d12f1c5bbb190e7) writes exactly 0 at a wall point where it writes ~0.06 without #3282 (matched pair, only #3282's four files differ), so the room goes from dim grey to black. Not exposure: the yard through the window tone-maps the same in both. We are tracing which input of that pass changes and will add it there.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.

<!-- greyfinch-sync:ivall/xcl:comment:7315541723 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7315541723). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-01T15:13:04Z. --- @Pipodi a heads-up, since an edit doesn't notify: I added an update to the test report above. With #3282 the window's alternate-frame black box is gone, but in the same scene the room's tile lighting (PS `3d12f1c5bbb190e7`) writes exactly 0 at a wall point where it writes ~0.06 without #3282 (matched pair, only #3282's four files differ), so the room goes from dim grey to black. Not exposure: the yard through the window tone-maps the same in both. We are tracing which input of that pass changes and will add it there. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
AAsobu commented 2026-12-01 16:12:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by AAsobu on 2026-12-01T16:12:07Z.


Test report on #3282 (with #3281 under it) together with #3094, on an RTX 3090: XCL_PAIR_PAGES=1 engages as described, but on this card it brings no visible change in what our runs reach, and it is slower in every run, in either order.

Tree. main b2b1f109d27e746a62ec95b04dd1f9924452e682 + #3094 8a28d31764071ad8cbfc7021d6d1d987e3745b11 + #3282 12a5bb2df9dab3c4ba45201fcfa0dd1ecf22d63e, merged cleanly with no conflicts and no local changes.

Tests. cargo build --workspace then cargo test --workspace --no-fail-fast -- --test-threads=4: 2921 passed, 0 failed, 51 ignored. SKIPPED: 28 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps, 3 no D3D12 debug layer). The new tests pass, including the four GPU ones in vram.

Runs. One release binary, retail title, 10 runs of 300 s with a warm cache: 6 in the order A, B, A, B, A, B, then 4 in the reversed order B, A, B, A, to rule out an order effect. A = XCL_ALIAS_COPY=1; B = XCL_ALIAS_COPY=1 XCL_PAIR_PAGES=1. Each window runs from 30 s to 140 s after the world is reached (first two-pass ExecuteIndirect), the same length for every run.

run (in order) arm presents / 2 s draws / 2 s 2 s windows with no present world reached at (s) peak commit (MB) peak video memory (MB)
1 A 0.83 3053 24 % 142 41810 16968
2 B 0.65 1376 44 % 156 41513 16794
3 A 1.04 3824 17 % 117 42402 17167
4 B 0.76 2386 35 % 149 41613 17010
5 A 1.00 3337 13 % 112 43688 17127
6 B 0.72 2492 37 % 154 44342 17196
7 B 0.74 2051 39 % 145 43523 16902
8 A 1.07 3355 13 % 114 43592 18120
9 B 0.69 2433 37 % 159 41420 16688
10 A 0.94 3091 26 % 122 43827 17911
  • Every B run (5) is below every A run (5) on presents (B 0.65-0.76, A 0.83-1.07), draws (B 1376-2492, A 3053-3824), stalled windows (B 35-44 %, A 13-26 %) and time to the world (B 145-159 s, A 112-142 s), in both orders. Peak commit is in the same range for both arms.
  • There were no device removals in any run. Run 6 (B) skipped 8 draws ("console code so far"); the other nine skipped none.
  • In every B run the log shows the pair pages at boot, including the TAA pair's second texture at a 16 KiB-aligned address:
    D3D12.X: pair pages: texture at 0x75c980000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000
    D3D12.X: pair pages: texture at 0x75cd04000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000
    
    Four more follow (30, 12, 60 and 1 tiles) within 16 s. No such line appears in the A runs.

Picture, as watched on screen in runs 1-6, with every screenshot taken saved.

  • A: the sky (from #3094's alias copy) in 3 of 3 runs.
  • B: the same as A in 3 of 3 runs, with no difference seen.
  • At about 0.5 presents a second, 300 s runs may not reach the first interior scene where the window's black box was reported on the RTX 5090. So this neither confirms nor contradicts that fix.

Not tested

  • The interior scene itself, and the room-lighting side effect reported above.
  • #3282 without #3094.
  • AMD and other NVIDIA cards.

Hardware: RTX 3090 24 GB (driver 621.24, NVIDIA shader-heap profile 2048 MB), i5-10600K, 32 GB, Windows 11 Home 26300; rustc 1.100.0, release build.
Tool and model: Claude Code (Claude Opus 5.5) ran the merge, the tests and the A/B runs and wrote this report; I watched the runs and checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7317204087 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7317204087). Originally posted by [AAsobu](https://github.com/AAsobu) on 2026-12-01T16:12:07Z. --- Test report on #3282 (with #3281 under it) together with #3094, on an RTX 3090: `XCL_PAIR_PAGES=1` engages as described, but on this card it brings no visible change in what our runs reach, and it is slower in every run, in either order. **Tree.** `main` `b2b1f109d27e746a62ec95b04dd1f9924452e682` + #3094 `8a28d31764071ad8cbfc7021d6d1d987e3745b11` + #3282 `12a5bb2df9dab3c4ba45201fcfa0dd1ecf22d63e`, merged cleanly with no conflicts and no local changes. **Tests.** `cargo build --workspace` then `cargo test --workspace --no-fail-fast -- --test-threads=4`: 2921 passed, 0 failed, 51 ignored. SKIPPED: 28 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps, 3 no D3D12 debug layer). The new tests pass, including the four GPU ones in `vram`. **Runs.** One release binary, retail title, 10 runs of 300 s with a warm cache: 6 in the order A, B, A, B, A, B, then 4 in the reversed order B, A, B, A, to rule out an order effect. A = `XCL_ALIAS_COPY=1`; B = `XCL_ALIAS_COPY=1 XCL_PAIR_PAGES=1`. Each window runs from 30 s to 140 s after the world is reached (first two-pass ExecuteIndirect), the same length for every run. | run (in order) | arm | presents / 2 s | draws / 2 s | 2 s windows with no present | world reached at (s) | peak commit (MB) | peak video memory (MB) | |---|---|---|---|---|---|---|---| | 1 | A | 0.83 | 3053 | 24 % | 142 | 41810 | 16968 | | 2 | B | 0.65 | 1376 | 44 % | 156 | 41513 | 16794 | | 3 | A | 1.04 | 3824 | 17 % | 117 | 42402 | 17167 | | 4 | B | 0.76 | 2386 | 35 % | 149 | 41613 | 17010 | | 5 | A | 1.00 | 3337 | 13 % | 112 | 43688 | 17127 | | 6 | B | 0.72 | 2492 | 37 % | 154 | 44342 | 17196 | | 7 | B | 0.74 | 2051 | 39 % | 145 | 43523 | 16902 | | 8 | A | 1.07 | 3355 | 13 % | 114 | 43592 | 18120 | | 9 | B | 0.69 | 2433 | 37 % | 159 | 41420 | 16688 | | 10 | A | 0.94 | 3091 | 26 % | 122 | 43827 | 17911 | - Every B run (5) is below every A run (5) on presents (B 0.65-0.76, A 0.83-1.07), draws (B 1376-2492, A 3053-3824), stalled windows (B 35-44 %, A 13-26 %) and time to the world (B 145-159 s, A 112-142 s), in both orders. Peak commit is in the same range for both arms. - There were no device removals in any run. Run 6 (B) skipped 8 draws ("console code so far"); the other nine skipped none. - In every B run the log shows the pair pages at boot, including the TAA pair's second texture at a 16 KiB-aligned address: ``` D3D12.X: pair pages: texture at 0x75c980000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000 D3D12.X: pair pages: texture at 0x75cd04000 (60 tiles) owns 0x384000 bytes of pages, not 0x3c0000 ``` Four more follow (30, 12, 60 and 1 tiles) within 16 s. No such line appears in the A runs. **Picture**, as watched on screen in runs 1-6, with every screenshot taken saved. - A: the sky (from #3094's alias copy) in 3 of 3 runs. - B: the same as A in 3 of 3 runs, with no difference seen. - At about 0.5 presents a second, 300 s runs may not reach the first interior scene where the window's black box was reported on the RTX 5090. So this neither confirms nor contradicts that fix. **Not tested** - The interior scene itself, and the room-lighting side effect reported above. - #3282 without #3094. - AMD and other NVIDIA cards. Hardware: RTX 3090 24 GB (driver 621.24, NVIDIA shader-heap profile 2048 MB), i5-10600K, 32 GB, Windows 11 Home 26300; rustc 1.100.0, release build. Tool and model: Claude Code (Claude Opus 5.5) ran the merge, the tests and the A/B runs and wrote this report; I watched the runs and checked it.
afpruivo commented 2026-12-01 16:48:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-01T16:48:54Z.


Test report on #3282 (with #3281 under it), with and without #3094, on an RTX 3090, in the first interior scene. This fills two gaps in the report above: these runs reach the interior scene, and they include #3282 without #3094. On this card XCL_PAIR_PAGES=1 alone ends the window's black area; XCL_ALIAS_COPY=1 alone does not.

Tree. main b2b1f109d27e746a62ec95b04dd1f9924452e682 + #3094 8a28d31764071ad8cbfc7021d6d1d987e3745b11 + #3282 12a5bb2df9dab3c4ba45201fcfa0dd1ecf22d63e, merged cleanly (179adb03), release. One binary for all four arms; only the switches differ. No suite run on this merge (the report above has one).

Runs. Retail title, warm cache, 420 s each, scripted A presses, in the order none, alias, pair, both. Common env: XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_PLACE_RETIRE=0 XCL_VIEW_REACH_MB=36 XCL_TWO_PASS_MB=2048 XCL_HUGE_PSO_CONCURRENCY=8 XCL_HUGE_PSO_WANTED_CONCURRENCY=8 XCL_PSO_WAIT_MS=5000 XCL_PREPARE=0. Frames dumped with XCL_FRAME_DUMP=7, an odd interval, so that consecutive dumps alternate between odd and even frames and an every-other-frame box would show in half of them. All four reached the interior scene and ended at 420 s with no device removal.

Picture. The last 16 dumps of each run were taken in the room, facing the window.

arm window dumps with the window's lower-right half black (luma < 0.06) window-region luma, mean
none lower-right half black (a triangle) in odd and even frames 5 of 16 0.11
XCL_ALIAS_COPY=1 the same triangle, a little lit along its edge 0 of 16 0.18
XCL_PAIR_PAGES=1 the yard, the watchtower and the sky through the whole window 0 of 16 0.42
both the same as pair pages 0 of 16 0.63
  • Here the black area is the same in odd and even frames; it is not the alternate-frame box seen on the 5090. That may come from the different tree or card.
  • The room around the window was not darker with XCL_PAIR_PAGES=1 in these dumps (luma of the right-hand wall area: none 0.09, pair 0.13, both 0.40). These are rough screen regions on a moving camera, not the pixel probe KDenKC used, so they do not rule out the tile-lighting change reported above.
  • A 900 s run with both switches showed the lit yard through the window at about 300 s, and the game was still running at 900 s with no device removal.

Memory. The peak private commit of xcl.exe, sampled every 5 s, was about the same in all four arms: none 49955 MB, alias 50744 MB, pair 47290 MB, both 49120 MB. The high level comes from the 16-window setup, not from either PR.

Speed. Not measured. Frames presented by 420 s: none 2967, alias 2610, pair 2666, both 2463 (one run each, with different world-entry times). That neither confirms nor contradicts the slowdown reported above.

Not tested

  • More than one run per arm. A pixel probe of the tile-lighting pass.
  • The default UMA layout. These runs all use 16 windows.
  • AMD and other NVIDIA cards.

Hardware: RTX 3090 24 GB (driver 621.40, NVIDIA shader-heap profile 2048 MB), i5-13600K, 32 GB, Windows 11 Pro 26300; release build.
Tool and model: Claude Code (Claude Opus 5.5) built the tree, ran the runs, measured the frames and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7318279735 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7318279735). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-12-01T16:48:54Z. --- Test report on #3282 (with #3281 under it), with and without #3094, on an RTX 3090, in the first interior scene. This fills two gaps in the report above: these runs reach the interior scene, and they include #3282 without #3094. On this card `XCL_PAIR_PAGES=1` alone ends the window's black area; `XCL_ALIAS_COPY=1` alone does not. **Tree.** `main` `b2b1f109d27e746a62ec95b04dd1f9924452e682` + #3094 `8a28d31764071ad8cbfc7021d6d1d987e3745b11` + #3282 `12a5bb2df9dab3c4ba45201fcfa0dd1ecf22d63e`, merged cleanly (`179adb03`), release. One binary for all four arms; only the switches differ. No suite run on this merge (the report above has one). **Runs.** Retail title, warm cache, 420 s each, scripted A presses, in the order none, alias, pair, both. Common env: `XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_PLACE_RETIRE=0 XCL_VIEW_REACH_MB=36 XCL_TWO_PASS_MB=2048 XCL_HUGE_PSO_CONCURRENCY=8 XCL_HUGE_PSO_WANTED_CONCURRENCY=8 XCL_PSO_WAIT_MS=5000 XCL_PREPARE=0`. Frames dumped with `XCL_FRAME_DUMP=7`, an odd interval, so that consecutive dumps alternate between odd and even frames and an every-other-frame box would show in half of them. All four reached the interior scene and ended at 420 s with no device removal. **Picture.** The last 16 dumps of each run were taken in the room, facing the window. | arm | window | dumps with the window's lower-right half black (luma < 0.06) | window-region luma, mean | |---|---|---|---| | none | lower-right half black (a triangle) in odd and even frames | 5 of 16 | 0.11 | | `XCL_ALIAS_COPY=1` | the same triangle, a little lit along its edge | 0 of 16 | 0.18 | | `XCL_PAIR_PAGES=1` | the yard, the watchtower and the sky through the whole window | 0 of 16 | 0.42 | | both | the same as pair pages | 0 of 16 | 0.63 | - Here the black area is the same in odd and even frames; it is not the alternate-frame box seen on the 5090. That may come from the different tree or card. - The room around the window was not darker with `XCL_PAIR_PAGES=1` in these dumps (luma of the right-hand wall area: none 0.09, pair 0.13, both 0.40). These are rough screen regions on a moving camera, not the pixel probe KDenKC used, so they do not rule out the tile-lighting change reported above. - A 900 s run with both switches showed the lit yard through the window at about 300 s, and the game was still running at 900 s with no device removal. **Memory.** The peak private commit of `xcl.exe`, sampled every 5 s, was about the same in all four arms: none 49955 MB, alias 50744 MB, pair 47290 MB, both 49120 MB. The high level comes from the 16-window setup, not from either PR. **Speed.** Not measured. Frames presented by 420 s: none 2967, alias 2610, pair 2666, both 2463 (one run each, with different world-entry times). That neither confirms nor contradicts the slowdown reported above. **Not tested** - More than one run per arm. A pixel probe of the tile-lighting pass. - The default UMA layout. These runs all use 16 windows. - AMD and other NVIDIA cards. Hardware: RTX 3090 24 GB (driver 621.40, NVIDIA shader-heap profile 2048 MB), i5-13600K, 32 GB, Windows 11 Pro 26300; release build. Tool and model: Claude Code (Claude Opus 5.5) built the tree, ran the runs, measured the frames and wrote this report.
Pipodi commented 2026-12-01 19:18:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-01T19:18:08Z.


@KDenKC (dark room with #3282)

Thank you for the matched pair. The cause is not found yet. What the code says:

  • It needs XCL_PAIR_PAGES=1, which is off by default. With the switch off unaligned_on_pages is false and every placement is main's.
  • Your conflict resolution in place_with is the same line as this head's, so the finding applies to this PR and not to the hand merge.
  • One correction: the sampled (R9G9B9E5) half does not need a 64 KiB-aligned address. place_pages calls place_on_pages with require_aligned = false, so a sampled texture of known size goes on the pages at any address. #3282 adds the same for the written half.
  • What changes for an unaligned UAV texture (single-sample, no depth, address on its XG alignment, 0x100 for layout 0x102) with the switch on:
    a. it is a reserved texture on the shared pages instead of a committed one;
    b. it is registered with register_gpu_owned, so the title's memory is never uploaded into it (before, register uploaded it once and again after CPU writes);
    c. it is a Target in placements and a placed entry in title_textures: a later placement over other pages of it, or a later entry over a different range of it, takes its tiles off the pages. placements gives them back on a barrier, a copy or a descriptor table; after Table::insert -> vram::unmap_superseded they come back only when the newer entry is removed.
  • So an input that reads 0 has three candidates: an unaligned UAV texture the CPU fills (b), one whose tiles were unmapped (c), or a view whose first upload from stale title memory lands on pages the GPU already wrote. The code does not single one out.

Two runs on your tree f4231a68 would narrow it: the same run with XCL_PLACE_RETIRE=0 (afpruivo's runs, which do not show the dark room, all had it), and one with XCL_PLACE_CHECK=1, which logs placements over live pages. We cannot reproduce that scene locally, so we are waiting for your trace of the input that reads zero (its address, format and flags) before changing anything; that would settle it. This stays open on the PR; the switch is off by default.

Written with Claude Code (Claude Opus 5.5; the code reading by a Claude Fable 5.2 subagent).


@Foniass (triage and merge check on 12a5bb2d)

New head c3145f90, restacked on #3281 c9d3abea.

  • gpu_owned_page_align(&x) ran with the switch off: fixed. create_placed_resource_x asks for it only when vram::pair_pages() is on. No behaviour change (with the switch off the value was ignored), so no new test.
  • require_aligned = false also gates the failure log, recycle_key and the texel accounting: checked. For the unaligned GPU-owned texture a refusal is not logged as "in an arena" (no arena takes that address either), recycle_key stays None because a UAV texture has flags, and the memory report counts its texels when the report is on. The only differences are diagnostic, so I wrote them into the comment at the call instead of adding a flag.
  • Finding 1 (the alignment rule filters little, 0x100): agreed. It keeps out addresses the layout cannot have, nothing more.
  • Finding 2 (CPU writes are no longer uploaded for an unaligned UAV texture): correct, and it is the rule main already applies to a 64 KiB-aligned one (register_gpu_owned). Switch-on only. It is one candidate for KDenKC's dark room; open.
  • Finding 3 (the glyph exclusion is not reached today): agreed; kept as a guard, with its unit test.
  • Finding 4 (capped views read zero with XCL_TEXTURE_LEVEL_PAGES=1): not looked at in this round.

Suite on c3145f90 (RTX 4090, driver 621.40, i9-13900K, Windows 11, debug): cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 2914 passed, 0 failed, 51 ignored, 25 SKIPPED (no wave64 and the usual adapter skips).

Written with Claude Code (Claude Opus 5.5; the code check and the fixes by a Claude Fable 5.2 subagent).


@AAsobu (5 + 5 runs, slower with the switch)

Thanks for the runs. The code has reasons for a cost with the switch on; none of them is measured here:

  • every unaligned UAV texture becomes a reserved texture with tile mappings instead of a committed one, and that creation is where XCL already notes the PC is slow (create_placed_resource_x);
  • it enters placements, so a newer placement over its pages takes its tiles off and the next use maps them back; submitted work waits for that mapping (vram::before_execute), which fits more stalled windows;
  • every placement of a capped view takes the pages lock and asks the registry about each partner.

The per-call environment read is gone on the new head; I do not expect that to account for it. No fix for now; the switch stays off by default.

Written with Claude Code (Claude Opus 5.5; the code reading by a Claude Fable 5.2 subagent).


@afpruivo (420 s runs, room not darker)

Thanks. One detail in your setup may matter: all four runs set XCL_PLACE_RETIRE=0, and KDenKC's do not. If the dark room comes from a superseded target's tiles leaving the pages, that would explain why your dumps do not show it (an inference, not checked). Could you run pair once more without XCL_PLACE_RETIRE=0?

Written with Claude Code (Claude Opus 5.5; the code reading by a Claude Fable 5.2 subagent).

<!-- greyfinch-sync:ivall/xcl:comment:7322572401 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7322572401). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-12-01T19:18:08Z. --- **@KDenKC** (dark room with #3282) Thank you for the matched pair. The cause is not found yet. What the code says: - It needs `XCL_PAIR_PAGES=1`, which is off by default. With the switch off `unaligned_on_pages` is false and every placement is main's. - Your conflict resolution in `place_with` is the same line as this head's, so the finding applies to this PR and not to the hand merge. - One correction: the sampled (R9G9B9E5) half does not need a 64 KiB-aligned address. `place_pages` calls `place_on_pages` with `require_aligned = false`, so a sampled texture of known size goes on the pages at any address. #3282 adds the same for the written half. - What changes for an unaligned UAV texture (single-sample, no depth, address on its XG alignment, 0x100 for layout 0x102) with the switch on: a. it is a reserved texture on the shared pages instead of a committed one; b. it is registered with `register_gpu_owned`, so the title's memory is never uploaded into it (before, `register` uploaded it once and again after CPU writes); c. it is a `Target` in `placements` and a placed entry in `title_textures`: a later placement over other pages of it, or a later entry over a different range of it, takes its tiles off the pages. `placements` gives them back on a barrier, a copy or a descriptor table; after `Table::insert` -> `vram::unmap_superseded` they come back only when the newer entry is removed. - So an input that reads 0 has three candidates: an unaligned UAV texture the CPU fills (b), one whose tiles were unmapped (c), or a view whose first upload from stale title memory lands on pages the GPU already wrote. The code does not single one out. Two runs on your tree `f4231a68` would narrow it: the same run with `XCL_PLACE_RETIRE=0` (afpruivo's runs, which do not show the dark room, all had it), and one with `XCL_PLACE_CHECK=1`, which logs placements over live pages. We cannot reproduce that scene locally, so we are waiting for your trace of the input that reads zero (its address, format and flags) before changing anything; that would settle it. This stays open on the PR; the switch is off by default. Written with Claude Code (Claude Opus 5.5; the code reading by a Claude Fable 5.2 subagent). --- **@Foniass** (triage and merge check on 12a5bb2d) New head `c3145f90`, restacked on #3281 `c9d3abea`. - **`gpu_owned_page_align(&x)` ran with the switch off**: fixed. `create_placed_resource_x` asks for it only when `vram::pair_pages()` is on. No behaviour change (with the switch off the value was ignored), so no new test. - **`require_aligned = false` also gates the failure log, `recycle_key` and the texel accounting**: checked. For the unaligned GPU-owned texture a refusal is not logged as "in an arena" (no arena takes that address either), `recycle_key` stays `None` because a UAV texture has flags, and the memory report counts its texels when the report is on. The only differences are diagnostic, so I wrote them into the comment at the call instead of adding a flag. - **Finding 1** (the alignment rule filters little, 0x100): agreed. It keeps out addresses the layout cannot have, nothing more. - **Finding 2** (CPU writes are no longer uploaded for an unaligned UAV texture): correct, and it is the rule main already applies to a 64 KiB-aligned one (`register_gpu_owned`). Switch-on only. It is one candidate for KDenKC's dark room; open. - **Finding 3** (the glyph exclusion is not reached today): agreed; kept as a guard, with its unit test. - **Finding 4** (capped views read zero with `XCL_TEXTURE_LEVEL_PAGES=1`): not looked at in this round. Suite on `c3145f90` (RTX 4090, driver 621.40, i9-13900K, Windows 11, debug): `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: 2914 passed, 0 failed, 51 ignored, 25 SKIPPED (no wave64 and the usual adapter skips). Written with Claude Code (Claude Opus 5.5; the code check and the fixes by a Claude Fable 5.2 subagent). --- **@AAsobu** (5 + 5 runs, slower with the switch) Thanks for the runs. The code has reasons for a cost with the switch on; none of them is measured here: - every unaligned UAV texture becomes a reserved texture with tile mappings instead of a committed one, and that creation is where XCL already notes the PC is slow (`create_placed_resource_x`); - it enters `placements`, so a newer placement over its pages takes its tiles off and the next use maps them back; submitted work waits for that mapping (`vram::before_execute`), which fits more stalled windows; - every placement of a capped view takes the pages lock and asks the registry about each partner. The per-call environment read is gone on the new head; I do not expect that to account for it. No fix for now; the switch stays off by default. Written with Claude Code (Claude Opus 5.5; the code reading by a Claude Fable 5.2 subagent). --- **@afpruivo** (420 s runs, room not darker) Thanks. One detail in your setup may matter: all four runs set `XCL_PLACE_RETIRE=0`, and KDenKC's do not. If the dark room comes from a superseded target's tiles leaving the pages, that would explain why your dumps do not show it (an inference, not checked). Could you run `pair` once more without `XCL_PLACE_RETIRE=0`? Written with Claude Code (Claude Opus 5.5; the code reading by a Claude Fable 5.2 subagent).
KDenKC commented 2026-12-01 19:20:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T19:20:07Z.


@Pipodi thanks, that narrows it well. Both runs are queued on f4231a68's lineage for when the rig is back (a few hours): one with XCL_PLACE_RETIRE=0, and one with XCL_PLACE_CHECK=1. The second also carries a new whole-frame trace that lists every input of the room's tile-lighting pass with its address, format, flags and whether its tiles are on the pages, so it should give you the zeroed input directly. Results will go here.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.

<!-- greyfinch-sync:ivall/xcl:comment:7322634575 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7322634575). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-01T19:20:07Z. --- @Pipodi thanks, that narrows it well. Both runs are queued on `f4231a68`'s lineage for when the rig is back (a few hours): one with `XCL_PLACE_RETIRE=0`, and one with `XCL_PLACE_CHECK=1`. The second also carries a new whole-frame trace that lists every input of the room's tile-lighting pass with its address, format, flags and whether its tiles are on the pages, so it should give you the zeroed input directly. Results will go here. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
bmjask commented 2026-12-01 20:46:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T20:46:49Z.

Review: COMMENTED


Review of c3145f90: 3 finding(s). 3 are inline.


These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.

<!-- greyfinch-sync:ivall/xcl:review:6139874400 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#pullrequestreview-6139874400). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-01T20:46:49Z. **Review:** COMMENTED --- Review of `c3145f90`: 3 finding(s). 3 are inline. --- _These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it._
bmjask commented 2026-12-01 20:46:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T20:46:50Z.

Code review location: crates/xcl/src/hle/d3d12x/vram.rs; line 3292

@@ -3186,11 +3278,32 @@ fn note_unknown_size(desc: &D3D12_RESOURCE_DESC, least: Option<u64>) {
     }
 }
 
+/// Whether a GPU-owned texture at `va` may go on the shared pages when `va` is not 64 KiB-aligned
+/// (`XCL_PAIR_PAGES=1`): its console size is known and `va` holds the alignment XG gives its layout
+/// (`console_align`). Measured with the GDK's XG library, `console_align` is `Texture::alignment()`
+/// (XCL's model of it, pinned by a test in `xg`): R32_UINT 1280x720 layout 0x102 0x100, R9G9B9E5
+/// 1280x720 layout 0 0x1000 and layout 2 0x10000. The title describes the same memory with a
+/// sampled view at that address: both then map tile k to the same page (`owned_pages`), which a
+/// committed resource of its own never shared with the view. Only a texture the GPU writes and the
+/// CPU does not fill: UAV flag, no depth or stencil, single-sample (the Defect B texture is an
+/// R32_UINT UAV); any other one at such an address keeps the committed resource and `register`.
+/// At a 64 KiB-aligned `va` this is false: that placement is what it was without the rule.
+fn unaligned_on_pages(va: usize, desc: &D3D12_RESOURCE_DESC, console_bytes: Option<u64>, console_align: Option<u64>, pair: bool) -> bool {
+    let gpu_written = desc.Flags.0 & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS.0 != 0 && desc.Flags.0 & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL.0 == 0 && desc.SampleDesc.Count == 1;

This treats any single-sample, non-depth texture with the UAV flag as one the CPU doesn't fill, but the UAV flag says nothing about CPU writes. These textures move from a committed resource kept in step by register (cpu_backed, uploaded after CPU writes) onto the pages via register_gpu_owned (cpu_backed false). With XCL_PAIR_PAGES=1, a single-plane UAV the CPU fills and a compute pass then updates (a LUT, an RGBA8 atlas) at a 16 KiB-aligned address never has its CPU writes uploaded, so the GPU reads zeros or stale data. The glyph exclusion only covers multi-plane small targets.

<!-- greyfinch-sync:ivall/xcl:review-comment:4760755821 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#discussion_r4760755821). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-01T20:46:50Z. **Code review location:** `crates/xcl/src/hle/d3d12x/vram.rs`; line 3292 ~~~~diff @@ -3186,11 +3278,32 @@ fn note_unknown_size(desc: &D3D12_RESOURCE_DESC, least: Option<u64>) { } } +/// Whether a GPU-owned texture at `va` may go on the shared pages when `va` is not 64 KiB-aligned +/// (`XCL_PAIR_PAGES=1`): its console size is known and `va` holds the alignment XG gives its layout +/// (`console_align`). Measured with the GDK's XG library, `console_align` is `Texture::alignment()` +/// (XCL's model of it, pinned by a test in `xg`): R32_UINT 1280x720 layout 0x102 0x100, R9G9B9E5 +/// 1280x720 layout 0 0x1000 and layout 2 0x10000. The title describes the same memory with a +/// sampled view at that address: both then map tile k to the same page (`owned_pages`), which a +/// committed resource of its own never shared with the view. Only a texture the GPU writes and the +/// CPU does not fill: UAV flag, no depth or stencil, single-sample (the Defect B texture is an +/// R32_UINT UAV); any other one at such an address keeps the committed resource and `register`. +/// At a 64 KiB-aligned `va` this is false: that placement is what it was without the rule. +fn unaligned_on_pages(va: usize, desc: &D3D12_RESOURCE_DESC, console_bytes: Option<u64>, console_align: Option<u64>, pair: bool) -> bool { + let gpu_written = desc.Flags.0 & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS.0 != 0 && desc.Flags.0 & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL.0 == 0 && desc.SampleDesc.Count == 1; ~~~~ --- This treats any single-sample, non-depth texture with the UAV flag as one the CPU doesn't fill, but the UAV flag says nothing about CPU writes. These textures move from a committed resource kept in step by `register` (cpu_backed, uploaded after CPU writes) onto the pages via `register_gpu_owned` (cpu_backed false). With XCL_PAIR_PAGES=1, a single-plane UAV the CPU fills and a compute pass then updates (a LUT, an RGBA8 atlas) at a 16 KiB-aligned address never has its CPU writes uploaded, so the GPU reads zeros or stale data. The glyph exclusion only covers multi-plane small targets.
bmjask commented 2026-12-01 20:46:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T20:46:50Z.

Code review location: crates/xcl/src/hle/d3d12x/device_x.rs; line 1294

@@ -1281,7 +1290,9 @@ pub(super) unsafe extern "system" fn create_placed_resource_x(this: *mut c_void,
         let pc = std::ptr::read_unaligned(d.as_ptr() as *const D3D12_RESOURCE_DESC);
         let console_bytes = console_bytes(&x);
         if super::vram::gpu_owned(flags) {
-            if let Some(hr) = super::vram::place(this, va as usize, &pc, state, clear, console_bytes, riid, ppv) {
+            // (the layout's alignment is only asked for with the switch that uses it)
+            let console_align = super::vram::pair_pages().then(|| gpu_owned_page_align(&x)).flatten();

gpu_owned_page_align / unaligned_on_pages don't check what register_gpu_owned (gpu_owned_layout) requires. A UAV in format 67 (-> 26), 88 (-> 87) or 85/86/115 (-> 28) at an unaligned, layout-aligned address goes on the pages, then register_gpu_owned returns Err ("a console format promoted on the PC"). The only fallback is retire_overlapping, so the texture gets neither readback nor upload. On main it was committed and kept in step by register.

<!-- greyfinch-sync:ivall/xcl:review-comment:4760755833 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#discussion_r4760755833). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-01T20:46:50Z. **Code review location:** `crates/xcl/src/hle/d3d12x/device_x.rs`; line 1294 ~~~~diff @@ -1281,7 +1290,9 @@ pub(super) unsafe extern "system" fn create_placed_resource_x(this: *mut c_void, let pc = std::ptr::read_unaligned(d.as_ptr() as *const D3D12_RESOURCE_DESC); let console_bytes = console_bytes(&x); if super::vram::gpu_owned(flags) { - if let Some(hr) = super::vram::place(this, va as usize, &pc, state, clear, console_bytes, riid, ppv) { + // (the layout's alignment is only asked for with the switch that uses it) + let console_align = super::vram::pair_pages().then(|| gpu_owned_page_align(&x)).flatten(); ~~~~ --- `gpu_owned_page_align` / `unaligned_on_pages` don't check what `register_gpu_owned` (`gpu_owned_layout`) requires. A UAV in format 67 (-> 26), 88 (-> 87) or 85/86/115 (-> 28) at an unaligned, layout-aligned address goes on the pages, then `register_gpu_owned` returns Err ("a console format promoted on the PC"). The only fallback is `retire_overlapping`, so the texture gets neither readback nor upload. On main it was committed and kept in step by `register`.
bmjask commented 2026-12-01 20:46:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T20:46:50Z.

Code review location: crates/xcl/src/hle/d3d12x/vram.rs; line 3327

@@ -3199,13 +3312,19 @@ pub unsafe fn place(this: *mut c_void, va: usize, desc: &D3D12_RESOURCE_DESC, st
     // (a 3D render target's size on the console is not modelled: without one, every PC tile of
     // it went on the title's pages from `va` on – more of them than the console's texture takes,
     // so the last ones were the first pages of the title's next texture)
+    let known = console_bytes;
     let console_bytes = console_bytes.or_else(|| {
         let least = least_texture_bytes(desc);
         note_unknown_size(desc, least);
         least
     });
     if std::env::var_os("XCL_VRAM_ARENAS").is_none() {
-        if let Some(hr) = place_on_pages(dev, this, va, desc, state, clear, console_bytes, true, false, riid, ppv) {
+        // (an unaligned one needs the size the console gives it, not `least_texture_bytes`.
+        // `require_aligned = false` for it is also what `place_on_pages` takes a sampled texture
+        // by: a refusal is not logged as "in an arena" (no arena takes that address either), and
+        // `memory_report`'s texel accounting counts it; the reserved pool still does not recycle
+        // it, a UAV texture has flags)
+        if let Some(hr) = place_on_pages(dev, this, va, desc, state, clear, console_bytes, !unaligned_on_pages(va, desc, known, console_align, pair), false, pair && known.is_some(), riid, ppv) {

An unaligned UAV on the pages now registers as placements::Kind::Target, so it takes part in supersession, which the committed resource it replaces never did. With XCL_PAIR_PAGES=1 this applies to every unaligned UAV, not just the two in the targeted pass. Such a UAV can unmap older live textures whose pages overlap its range (late_release::hold_unmap), or lose its own mapping to a newer overlapping placement, and those textures read zeros where main read correct data.

<!-- greyfinch-sync:ivall/xcl:review-comment:4760755844 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#discussion_r4760755844). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-01T20:46:50Z. **Code review location:** `crates/xcl/src/hle/d3d12x/vram.rs`; line 3327 ~~~~diff @@ -3199,13 +3312,19 @@ pub unsafe fn place(this: *mut c_void, va: usize, desc: &D3D12_RESOURCE_DESC, st // (a 3D render target's size on the console is not modelled: without one, every PC tile of // it went on the title's pages from `va` on – more of them than the console's texture takes, // so the last ones were the first pages of the title's next texture) + let known = console_bytes; let console_bytes = console_bytes.or_else(|| { let least = least_texture_bytes(desc); note_unknown_size(desc, least); least }); if std::env::var_os("XCL_VRAM_ARENAS").is_none() { - if let Some(hr) = place_on_pages(dev, this, va, desc, state, clear, console_bytes, true, false, riid, ppv) { + // (an unaligned one needs the size the console gives it, not `least_texture_bytes`. + // `require_aligned = false` for it is also what `place_on_pages` takes a sampled texture + // by: a refusal is not logged as "in an arena" (no arena takes that address either), and + // `memory_report`'s texel accounting counts it; the reserved pool still does not recycle + // it, a UAV texture has flags) + if let Some(hr) = place_on_pages(dev, this, va, desc, state, clear, console_bytes, !unaligned_on_pages(va, desc, known, console_align, pair), false, pair && known.is_some(), riid, ppv) { ~~~~ --- An unaligned UAV on the pages now registers as `placements::Kind::Target`, so it takes part in supersession, which the committed resource it replaces never did. With XCL_PAIR_PAGES=1 this applies to every unaligned UAV, not just the two in the targeted pass. Such a UAV can unmap older live textures whose pages overlap its range (`late_release::hold_unmap`), or lose its own mapping to a newer overlapping placement, and those textures read zeros where main read correct data.
Pipodi commented 2026-12-01 23:23:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-01T23:23:44Z.


Thank you for the review of c3145f90. Pushed 9cd6c839 (commits 82d9248c + 9cd6c839), restacked on #3281's f32c1894.
Suite: cargo test --workspace --no-fail-fast -- --test-threads=4 on 9cd6c839 (includes f32c1894) (gpuq log 20261201-231222-57a8): 2918 passed, 0 failed, 51 ignored, 25 SKIPPED (22 no wave64, 2 no heap windows, 1 driver cache needs Developer Mode).


1. vram.rs:3292: the UAV flag does not mean the CPU does not fill the texture

Partly right. With XCL_PAIR_PAGES=1, a single-plane UAV texture at an address that holds its layout's
alignment (0x100 for layout 0x102) moves from a committed resource kept in step by register
(cpu_backed) to the pages and register_gpu_owned, which never uploads the title's memory into it.
A UAV the CPU fills and a compute pass then updates would lose its CPU texels there.

That is what main already does with every such UAV at a 64 KiB-aligned address (place →
place_on_pages → register_gpu_owned), so the rule extends main's handling of GPU-owned textures to
more addresses rather than adding a new one. Off by default; with the switch off unaligned_on_pages
is false and the placement is main's.

Not changed yet. The options I see: restrict the unaligned case to a UAV that has a sampled alias at
its address (which the creation order does not always allow), or give a GPU-owned entry on the pages a
CPU upload path. Both are larger than this PR; tell me if you want one of them here.

2. device_x.rs:1294: formats register_gpu_owned refuses go on the pages with no fallback

Confirmed, thank you. Formats 67, 88, 85, 86 and 115 are promoted on the PC, gpu_owned_layout
refuses them, and the texture was left with only retire_overlapping. Only with the switch on: the
alignment is not asked for without it.

Fixed in 9cd6c839: gpu_owned_page_align now asks gpu_owned_layout with the PC description and
gives no alignment to a texture it refuses, so such a texture keeps the committed resource and
register, as on main. The test a_glyph_cache_gets_no_console_alignment_but_a_720p_target_does
covers 1280x720 UAVs in the five formats (None) and fails with the layout not asked.

3. vram.rs:3327: an unaligned UAV on the pages takes part in supersession

Right that it does now, and with layout 0x102 nearly every unaligned single-sample UAV of known size
qualifies, not only the two in the pass. It follows the rule every GPU-owned texture on the pages
follows on main at a 64 KiB-aligned address (Kind::Target), and sharing pages with its view is the
point of the change. Its range in placements is only the 64 KiB pages that start inside its own
console range (owned_pages), so it supersedes only what overlaps those. Off by default.

Not changed. Keeping these placements out of supersession would also change what the pairing in
#3281 sees, so I would measure that as its own change.


AI use: Claude Code with Claude Opus 5.5 (checked each point against the code, ran the tests, wrote
these replies).

<!-- greyfinch-sync:ivall/xcl:comment:7329292060 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7329292060). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-12-01T23:23:44Z. --- Thank you for the review of `c3145f90`. Pushed `9cd6c839` (commits `82d9248c` + `9cd6c839`), restacked on #3281's `f32c1894`. Suite: `cargo test --workspace --no-fail-fast -- --test-threads=4` on `9cd6c839` (includes `f32c1894`) (gpuq log 20261201-231222-57a8): 2918 passed, 0 failed, 51 ignored, 25 SKIPPED (22 no wave64, 2 no heap windows, 1 driver cache needs Developer Mode). --- ## 1. `vram.rs:3292`: the UAV flag does not mean the CPU does not fill the texture Partly right. With `XCL_PAIR_PAGES=1`, a single-plane UAV texture at an address that holds its layout's alignment (0x100 for layout 0x102) moves from a committed resource kept in step by `register` (`cpu_backed`) to the pages and `register_gpu_owned`, which never uploads the title's memory into it. A UAV the CPU fills and a compute pass then updates would lose its CPU texels there. That is what main already does with every such UAV at a 64 KiB-aligned address (`place` → `place_on_pages` → `register_gpu_owned`), so the rule extends main's handling of GPU-owned textures to more addresses rather than adding a new one. Off by default; with the switch off `unaligned_on_pages` is false and the placement is main's. Not changed yet. The options I see: restrict the unaligned case to a UAV that has a sampled alias at its address (which the creation order does not always allow), or give a GPU-owned entry on the pages a CPU upload path. Both are larger than this PR; tell me if you want one of them here. ## 2. `device_x.rs:1294`: formats `register_gpu_owned` refuses go on the pages with no fallback Confirmed, thank you. Formats 67, 88, 85, 86 and 115 are promoted on the PC, `gpu_owned_layout` refuses them, and the texture was left with only `retire_overlapping`. Only with the switch on: the alignment is not asked for without it. Fixed in `9cd6c839`: `gpu_owned_page_align` now asks `gpu_owned_layout` with the PC description and gives no alignment to a texture it refuses, so such a texture keeps the committed resource and `register`, as on main. The test `a_glyph_cache_gets_no_console_alignment_but_a_720p_target_does` covers 1280x720 UAVs in the five formats (None) and fails with the layout not asked. ## 3. `vram.rs:3327`: an unaligned UAV on the pages takes part in supersession Right that it does now, and with layout 0x102 nearly every unaligned single-sample UAV of known size qualifies, not only the two in the pass. It follows the rule every GPU-owned texture on the pages follows on main at a 64 KiB-aligned address (`Kind::Target`), and sharing pages with its view is the point of the change. Its range in `placements` is only the 64 KiB pages that start inside its own console range (`owned_pages`), so it supersedes only what overlaps those. Off by default. Not changed. Keeping these placements out of supersession would also change what the pairing in #3281 sees, so I would measure that as its own change. --- AI use: Claude Code with Claude Opus 5.5 (checked each point against the code, ran the tests, wrote these replies).
Foniass commented 2026-12-01 23:28:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T23:28:21Z.


Follow-up review (head 9cd6c839, since c3145f90, diff read, not a merge-check):

  • Stacked on #3281: still applies; 1a38d2c6 and f32c1894 are #3281's head, only 82d9248c and 9cd6c839 belong here.
  • Unaligned UAVs let through, description silent; conflict with main; require_aligned = false side effects; gpu_owned_page_align with the switch off: fixed. The description has a scope paragraph, the branch merges cleanly, the comment at vram.rs ~3339 names the failure log, recycle_key and texel accounting, and device_x.rs ~1298 calls gpu_owned_page_align only when pair_pages() is on.
  • CPU writes are no longer uploaded for an unaligned UAV texture: still open. The rule (vram.rs ~3303) and the commit message say it now, but nothing checks that the CPU never fills such a texture; the description lists it as a possible cause of the darker room reported with the switch on.
  • The glyph-cache exclusion is never reached: still open, kept on purpose. unaligned_on_pages (~3308) needs the UAV flag, which a glyph cache lacks, so cpu_filled_small_target in gpu_owned_page_align (device_x.rs ~1244) excludes nothing.
  • Capped views read zero with XCL_TEXTURE_LEVEL_PAGES=1 (reported on the PR): still open; the lazy-level path in place_on_pages (vram.rs ~2439) is unchanged.

New: none.

Fine: gpu_owned_page_align now uses gpu_owned_layout with the PC description, so a UAV in a format the PC promotes (67, 88, 85, 86, 115) keeps the committed resource and register as on main; register_gpu_owned runs the same check, and the test loops over those five formats.

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

<!-- greyfinch-sync:ivall/xcl:comment:7329386306 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7329386306). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T23:28:21Z. --- Follow-up review (head 9cd6c839, since c3145f90, diff read, not a merge-check): - **Stacked on #3281:** still applies; `1a38d2c6` and `f32c1894` are #3281's head, only `82d9248c` and `9cd6c839` belong here. - **Unaligned UAVs let through, description silent; conflict with `main`; `require_aligned = false` side effects; `gpu_owned_page_align` with the switch off:** fixed. The description has a scope paragraph, the branch merges cleanly, the comment at `vram.rs` ~3339 names the failure log, `recycle_key` and texel accounting, and `device_x.rs` ~1298 calls `gpu_owned_page_align` only when `pair_pages()` is on. - **CPU writes are no longer uploaded for an unaligned UAV texture:** still open. The rule (`vram.rs` ~3303) and the commit message say it now, but nothing checks that the CPU never fills such a texture; the description lists it as a possible cause of the darker room reported with the switch on. - **The glyph-cache exclusion is never reached:** still open, kept on purpose. `unaligned_on_pages` (~3308) needs the UAV flag, which a glyph cache lacks, so `cpu_filled_small_target` in `gpu_owned_page_align` (`device_x.rs` ~1244) excludes nothing. - **Capped views read zero with `XCL_TEXTURE_LEVEL_PAGES=1` (reported on the PR):** still open; the lazy-level path in `place_on_pages` (`vram.rs` ~2439) is unchanged. New: none. Fine: `gpu_owned_page_align` now uses `gpu_owned_layout` with the PC description, so a UAV in a format the PC promotes (67, 88, 85, 86, 115) keeps the committed resource and `register` as on `main`; `register_gpu_owned` runs the same check, and the test loops over those five formats. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
bmjask commented 2026-12-01 23:46:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T23:46:13Z.

Review: COMMENTED


Review of 9cd6c839: 1 finding(s).

Re-review of the new commits (f32c1894..9cd6c839). Still present from my earlier review: a UAV texture the CPU fills, placed at an unaligned address, still never gets its CPU texels (vram.rs ~3307; the doc comment now accepts this). Also, a texture whose register_gpu_owned fails after it's on the pages is still neither uploaded nor read back (device_x.rs ~1301), and gpu_owned_page_align's prediction can drift from what register_gpu_owned checks (resource.GetDesc(), address overflow). The finding below is new. These are on lines outside the diff:

crates/xcl/src/hle/d3d12x/title_textures.rs:381: At unaligned addresses, pairing still depends on creation order, and now it unmaps the view. If the sampled R9G9B9E5 view is placed before the R32_UINT texture it reads (e.g. view at 0x107cf04000, then the UAV at the same address), pair_partners finds no writer, so the view keeps its uncapped size (0x398000/0x3c0000). TEXTURES.insert for the writer (0x384000) then sees an overlap with a different end, sets old.unmapped and calls unmap_superseded(view), and the view reads zeros, which is the defect this PR fixes.


These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.

<!-- greyfinch-sync:ivall/xcl:review:6142260558 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#pullrequestreview-6142260558). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-01T23:46:13Z. **Review:** COMMENTED --- Review of `9cd6c839`: 1 finding(s). Re-review of the new commits (`f32c1894..9cd6c839`). Still present from my earlier review: a UAV texture the CPU fills, placed at an unaligned address, still never gets its CPU texels (`vram.rs` ~3307; the doc comment now accepts this). Also, a texture whose `register_gpu_owned` fails after it's on the pages is still neither uploaded nor read back (`device_x.rs` ~1301), and `gpu_owned_page_align`'s prediction can drift from what `register_gpu_owned` checks (`resource.GetDesc()`, address overflow). The finding below is new. These are on lines outside the diff: **`crates/xcl/src/hle/d3d12x/title_textures.rs:381`**: At unaligned addresses, pairing still depends on creation order, and now it unmaps the view. If the sampled R9G9B9E5 view is placed before the R32_UINT texture it reads (e.g. view at 0x107cf04000, then the UAV at the same address), `pair_partners` finds no writer, so the view keeps its uncapped size (0x398000/0x3c0000). `TEXTURES.insert` for the writer (0x384000) then sees an overlap with a different end, sets `old.unmapped` and calls `unmap_superseded(view)`, and the view reads zeros, which is the defect this PR fixes. --- _These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it._
Pipodi commented 2026-12-02 03:14:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-02T03:14:18Z.


Thank you. Pushed ea91c5f4 (commits 77303f3b + ea91c5f4), restacked on #3281's b02b2c34.
Suite on #3282 head ea91c5f4 (local GPU through gpuq, debug): cargo test --workspace -- --test-threads=4: 2920 passed, 0 failed, 51 ignored; 25 SKIPPED (no wave64 x22, no heap windows x2, driver cache needs Developer Mode).


title_textures.rs:381: at an unaligned address a view placed before its writer is unmapped

Right that it happens, but it is not new in this PR. The unmap is Table::insert
(title_textures.rs:371-384): any later entry overlapping a placed one with a different range
unmaps it. On main, the R32_UINT at an unaligned address is a committed resource kept in step by
title_textures::register, which inserts the same 0x384000 range at the same address, so a view
placed before it is unmapped the same way. This PR changes which path registers the writer
(register_gpu_owned on the pages), not the insert. A view placed first is not capped either way:
that is the creation-order dependence from the #3281 review (point 3 there), not changed here. In the
title run the writer was placed first.


AI use: Claude Code with Claude Opus 5.5 (main session, reviews, fixes), Claude Sonnet 5.5 (runs) and
Claude Fable 5.2 (earlier code).

<!-- greyfinch-sync:ivall/xcl:comment:7333679020 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7333679020). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-12-02T03:14:18Z. --- Thank you. Pushed `ea91c5f4` (commits `77303f3b` + `ea91c5f4`), restacked on #3281's `b02b2c34`. Suite on #3282 head `ea91c5f4` (local GPU through gpuq, debug): `cargo test --workspace -- --test-threads=4`: 2920 passed, 0 failed, 51 ignored; 25 SKIPPED (no wave64 x22, no heap windows x2, driver cache needs Developer Mode). --- ## `title_textures.rs:381`: at an unaligned address a view placed before its writer is unmapped Right that it happens, but it is not new in this PR. The unmap is `Table::insert` (`title_textures.rs:371-384`): any later entry overlapping a placed one with a different range unmaps it. On main, the R32_UINT at an unaligned address is a committed resource kept in step by `title_textures::register`, which inserts the same 0x384000 range at the same address, so a view placed before it is unmapped the same way. This PR changes which path registers the writer (`register_gpu_owned` on the pages), not the insert. A view placed first is not capped either way: that is the creation-order dependence from the #3281 review (point 3 there), not changed here. In the title run the writer was placed first. --- AI use: Claude Code with Claude Opus 5.5 (main session, reviews, fixes), Claude Sonnet 5.5 (runs) and Claude Fable 5.2 (earlier code).
Foniass commented 2026-12-02 03:16:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T03:16:44Z.


Follow-up review (head ea91c5f4, since 9cd6c839, diff read, not a merge-check):

  • Earlier points: unchanged. git range-diff shows this PR's own commits (77303f3b, ea91c5f4) identical to 82d9248c / 9cd6c839; the push only carries #3281's new b02b2c34. Still open from the last review: CPU writes are not uploaded for an unaligned UAV texture, the glyph-cache exclusion is never reached, and capped views reading zero with XCL_TEXTURE_LEVEL_PAGES=1.

New: none.

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

<!-- greyfinch-sync:ivall/xcl:comment:7333722118 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7333722118). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T03:16:44Z. --- Follow-up review (head ea91c5f4, since 9cd6c839, diff read, not a merge-check): - **Earlier points:** unchanged. `git range-diff` shows this PR's own commits (`77303f3b`, `ea91c5f4`) identical to `82d9248c` / `9cd6c839`; the push only carries #3281's new `b02b2c34`. Still open from the last review: CPU writes are not uploaded for an unaligned UAV texture, the glyph-cache exclusion is never reached, and capped views reading zero with `XCL_TEXTURE_LEVEL_PAGES=1`. New: none. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
BBareth commented 2026-12-03 08:05:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-12-03T08:05:18Z.


Test report: #3094 (8a28d317) and #3282 (ea91c5f4) together, in a retail title's gameplay.

  • Tree: main 395405e4 merged with #3094 (8a28d317), #3282 (ea91c5f4) and #3625 (e3dabe10), release.
  • Hardware: RTX 5070 Ti, driver 32.0.16.2124; i7-12700K; Windows 11 Pro 26200.
  • Settings in every run:
    • The 16-window layout: XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_VIEW_REACH_MB=36 XCL_MIRROR_FILL_MB=128. Without it, this title's world draws nothing and no comparison is possible.
    • XCL_TWO_PASS_MB=4096 XCL_TEXTURE_LEVEL_PAGES=1 XCL_WAVE64_SPIN=0.
  • Runs: 1300 s each with warm shader caches, A pressed once at 70 s. The last ~17 minutes are in the first gameplay scene. The binary is the same in every run; only XCL_ALIAS_COPY and XCL_PAIR_PAGES differ, and both are switched together, so this does not tell the two PRs apart.
  • Targets: dumped with XCL_DUMP_TARGETS=2000,1,16 after 900 or 1000 s. Sampled texels drawn are out of 230,400.
XCL_ALIAS_COPY + XCL_PAIR_PAGES HDR target (fmt 10) fmt 42 target presents per minute, 360–1200 s (median) video memory over budget at 240–300 s frames removals / crashes
off 89,421 (39 %) 43,600 88 3,390 MB 4874 0 / 0
on, run 1 230,400 (100 %) 119,263 85 2,372 MB 4665 0 / 0
on, run 2 230,400 (100 %) 136,786 92 2,535 MB 4800 0 / 0

What the images show:

  • Both switches off: the HDR target is mostly black. Only the window frame and parts of the room are lit, and the view through the window has no sky.
  • Both switches on, in both runs: the lit scene, with the sky, the buildings outside and the sunlit furniture.
  • Unchanged either way: the G-buffer targets (RGBA8) have the same number of drawn texels within 1 %. The difference is in the lighting and the targets built from it, not the geometry.
  • Same in all three runs: a speckled patch over one window and a few black blocks on a wall.

Frame rate is about the same either way, and video memory is a little lower with the switches on.

Not checked:

  • each switch on its own;
  • AMD;
  • the 4-window default layout;
  • runs longer than 1300 s.

AI use: Claude Code, Claude Opus 5.5 ran the runs and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7371805858 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7371805858). Originally posted by [BBareth](https://github.com/BBareth) on 2026-12-03T08:05:18Z. --- Test report: #3094 (8a28d317) and #3282 (ea91c5f4) together, in a retail title's gameplay. - **Tree:** main 395405e4 merged with #3094 (8a28d317), #3282 (ea91c5f4) and #3625 (e3dabe10), release. - **Hardware:** RTX 5070 Ti, driver 32.0.16.2124; i7-12700K; Windows 11 Pro 26200. - **Settings in every run:** - The 16-window layout: `XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_VIEW_REACH_MB=36 XCL_MIRROR_FILL_MB=128`. Without it, this title's world draws nothing and no comparison is possible. - `XCL_TWO_PASS_MB=4096 XCL_TEXTURE_LEVEL_PAGES=1 XCL_WAVE64_SPIN=0`. - **Runs:** 1300 s each with warm shader caches, A pressed once at 70 s. The last ~17 minutes are in the first gameplay scene. The binary is the same in every run; only `XCL_ALIAS_COPY` and `XCL_PAIR_PAGES` differ, and both are switched together, so this does not tell the two PRs apart. - **Targets:** dumped with `XCL_DUMP_TARGETS=2000,1,16` after 900 or 1000 s. Sampled texels drawn are out of 230,400. | `XCL_ALIAS_COPY` + `XCL_PAIR_PAGES` | HDR target (fmt 10) | fmt 42 target | presents per minute, 360–1200 s (median) | video memory over budget at 240–300 s | frames | removals / crashes | |---|---|---|---|---|---|---| | off | 89,421 (39 %) | 43,600 | 88 | 3,390 MB | 4874 | 0 / 0 | | on, run 1 | 230,400 (100 %) | 119,263 | 85 | 2,372 MB | 4665 | 0 / 0 | | on, run 2 | 230,400 (100 %) | 136,786 | 92 | 2,535 MB | 4800 | 0 / 0 | **What the images show:** - **Both switches off:** the HDR target is mostly black. Only the window frame and parts of the room are lit, and the view through the window has no sky. - **Both switches on, in both runs:** the lit scene, with the sky, the buildings outside and the sunlit furniture. - **Unchanged either way:** the G-buffer targets (RGBA8) have the same number of drawn texels within 1 %. The difference is in the lighting and the targets built from it, not the geometry. - **Same in all three runs:** a speckled patch over one window and a few black blocks on a wall. Frame rate is about the same either way, and video memory is a little lower with the switches on. **Not checked:** - each switch on its own; - AMD; - the 4-window default layout; - runs longer than 1300 s. AI use: Claude Code, Claude Opus 5.5 ran the runs and wrote this report.
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/3282:upstream-pr/3282'
git switch 'upstream-pr/3282'

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