D3D12.X: XCL_PAIR_PAGES=1 puts a GPU-owned texture on pages at an address its layout allows #3282
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3282"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.dllof 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, somaingives that texture a committed resource and the cap never applies. WithXCL_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 onmain.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 inxg.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
82d9248cD3D12.X: name the rule that keeps a small render target in step with memory:cpu_filled_small_targetincrates/xcl/src/hle/d3d12x/title_textures.rs. This commit changes no behaviour.ea91c5f4D3D12.X: XCL_PAIR_PAGES=1 puts a GPU-owned texture on pages at an address its layout allows: the alignment rule andplace_with(vram.rs), the console alignment passed fromCreatePlacedResourceX(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.ea91c5f4:create_placed_resource_xasks forgpu_owned_page_alignonly withXCL_PAIR_PAGES=1on, and only for a formatgpu_owned_layoutlays out (others stay committed, as onmain); the comment at therequire_aligned = falsecall names its other effects (failure log,recycle_key, texel accounting).Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), debug build for the suite, release builds for the smoke runs.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4onea91c5f4(on #3281's headb02b2c34, main493dbd3d): 2920 passed, 0 failed, 51 ignored, 25 SKIPPED. Each commit alone:cargo check -p xcl --testspasses.pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache: Developer Mode is required) (1).27abece7(same patches as12a5bb2d; only #3281's comment and commit message changed since): with the alignment rule reverted (unaligned_on_pagesfalse at an unaligned address),a_gpu_owned_texture_at_an_unaligned_address_needs_its_console_alignmentandgpu_an_unaligned_gpu_owned_texture_shares_pages_with_its_viewfail (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_doesfails (leftSome(8192), rightNone). Unmutated, all four pass.XCL_PAIR_PAGES=1: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.ps1on clean trees, release builds,XCL_PREPARE=0andXCL_PRESS_AT=16:Aon both sides, RTX 4090 (driver 621.40).main (
6bfb5c51):This PR's head (
ea91c5f4, on #3281's headb02b2c34):The PR's run got 105.7 % of
main's frames and 100.1 % of its peak commit.Not tested
main-based tree: in most runs the title's frame loop stopped during start-up, with the switch on, with it off, and on plainmaintoo.XCL_PAIR_PAGES=1in the 60 s smoke run.475a5325, whose parent still had #3281's old partner rule.register_gpu_owned.STATUS_ACCESS_VIOLATIONof the lib test binary duringgpu::dxil::compact_testswas seen in this PR's first suite run (an earlier head), not in the run on12a5bb2d; it was not seen onmainin 3 runs, and is pre-existing as far as we can tell (this PR does not touch that code).AI use
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.ea91c5f4(and the restack onto #3281'sb02b2c34): 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.Imported from ivall/xcl. Originally posted by Foniass on 2026-11-29T14:58:06Z.
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.ps1run of a retail title against main on the same machine. The 4fuzz_validate_and_gpu_*failures happen on main on this machine too.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T18:03:47Z.
I routed the existing unaligned pair fixture through
CreatePlacedResourceXon current headfb4478d7, 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=0throughout.XCL_PAIR_PAGES=1andXCL_TEXTURE_LEVEL_PAGES=0, the entry point placed the writer and view on the same pages and capped the view from0x398000to0x384000. Native GPU readback matched all 720 alias rows and all 64 adjacent rows after writing separate patterns.XCL_PAIR_PAGES=0, all three resource creations succeeded and the unaligned writer stayed off the shared pages. This control checked placement.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.map_levelscall 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.
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-29T18:39:49Z.
Ran the paired-page alignment tests at
fb4478d7on an NVIDIA Blackwell desktop part.System
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.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T00:54:14Z.
Source check on the current stacked heads: #3282
475a5325still has the olderpair_bytes(targets, va, total, ...)rule: it takes the smallest known size among any mapped same-address, same-tile-count target. The current parent #3281ddd5c6cainstead 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
CLEANstatus is againstmain; 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.
Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-01T07:35:44Z.
Thanks, you were right:
475a5325still sat on #3281's old commits. Restacked onto #3281's current headddd5c6ca; the new head isc2452da5, and only the top two commits belong here (2e20260a,c2452da5).pair_bytes; the one call that changed isplace_on_pagesinplace_with(vram.rs), which now passespair && known.is_some(), the parent'spair_pages() && known.c2452da5(RTX 4090, driver 621.40): 2766 passed, 0 failed, 49 ignored, 28 SKIPPED.2e20260aalone passescargo check -p xcl --tests.c2452da5, and a new smoke pair (main0fe06eb0againstc2452da5: 1586 against 1614 frames, 20653 against 20413 MB peak, no removal or crash). The description is updated with both.XCL_PAIR_PAGES=1(now labelled as475a5325'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.
Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-01T08:15:03Z.
Rebased again, with #3281, onto main
493dbd3d:c2452da5conflicted with #2753 indevice_x.rs(itsconsole_bytes/volume_texel_bytessit where this PR addsgpu_owned_page_align; both are kept). New head12a5bb2don #3281'sb0192a85; 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 main493dbd3d: 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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:48:05Z.
Triage (#1607) – head
c3145f9Stacked on #3281: the 307 shared added lines are #3281's two commits. Only
7307ba5dandc3145f90belong 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 passesrequire_aligned = falsetoplace_on_pages. That flag also gates the failure log, the reserved-poolrecycle_keyand memory-reporttexels. 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).c3145f90now 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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:09:25Z.
merge-check
base:
493dbd3dd0head:
12a5bb2df9merge: 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
d88d30f2and12a5bb2dread (+266/-15). WithXCL_PAIR_PAGESunset behaviour is unchanged (!unaligned_on_pages(..)is true, and d88d30f2's condition is equivalent), butgpu_owned_page_align(&x)(device_x.rs~1293) runs on every GPU-ownedCreatePlacedResourceXregardless. That builds the XG layout a second time (console_bytesalready did) and runs the glyph check, and the result is thrown away when the switch is off. Computing it only whenpair_pages()is on avoids that. The run below has a second smoke withXCL_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 atfirst + i*64Kand 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 throughregister; here it goes throughregister_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_pagesrequires the UAV flag and the glyph descriptor has none, as the description says. (4) andrewDoing's report (capped views read zero withXCL_TEXTURE_LEVEL_PAGES=1too) has no answer yet. Fine:checked_next_multiple_ofandsaturating_addkeep 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 useplace_with(.., pair=true)rather than the environment, holdVRAM_TEST_LOCK, and skip without hardware.performance: 60 s smoke of a retail title, main
493dbd3dvs 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 withXCL_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_alignonpair_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.
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, PS1f158b6c62603705) 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 at0x135c980000, the second right after it at0x135cd04000(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
mainand not #3282's head as is: our local test tree =maind52ff48c+ 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) and12a5bb2d, with one conflict invram.rsplace_with, resolved by taking #3282's side:let known = console_bytes;before the size estimate, andplace_on_pages(..., console_bytes, !unaligned_on_pages(va, desc, known, console_align, pair), false, pair && known.is_some(), ...)in place of our tree'splace_on_pages(..., console_bytes, true, false, pair_pages(), ...)(pairispair_pages(), passed down byplace). Result661f01f1.cargo test -p xcl --lib vramon 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.The second texture's read side, sampled by the TAA pass on its frames: always 0.
The window draw's input: 0 on every other frame.
The final output at the window pixel: near black on every other frame.
After (
661f01f1, with #3282's two commits). Boot: both textures on the pair pages.The second texture's read side holds the data.
The window draw's input: non-zero on every frame (8 of 8; f2911-2914: 4.9219, 4.4531, 2.3438, 0.1426).
The final output at the window pixel: steady.
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
mainb2b1f109+ #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 throughvram::place_pages, which needs a 64 KiB-aligned address, so at0x135cd04000it 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 (
8d737ed9without #3282,f4231a68with 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):b6395e96c2908eef, PS3d12f1c5bbb190e7, blend off) writes (0.059-0.068, 0.048-0.056, 0.039-0.045) without #3282 and exactly 0 with it, every frame;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;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
vram.rsconflict resolved (above), on a tree that is notmain.661f01f1(onlyvram's tests, 78/0/1).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).
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.
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=1engages 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.
mainb2b1f109d27e746a62ec95b04dd1f9924452e682+ #30948a28d31764071ad8cbfc7021d6d1d987e3745b11+ #328212a5bb2df9dab3c4ba45201fcfa0dd1ecf22d63e, merged cleanly with no conflicts and no local changes.Tests.
cargo build --workspacethencargo 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 invram.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.Picture, as watched on screen in runs 1-6, with every screenshot taken saved.
Not tested
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.
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=1alone ends the window's black area;XCL_ALIAS_COPY=1alone does not.Tree.
mainb2b1f109d27e746a62ec95b04dd1f9924452e682+ #30948a28d31764071ad8cbfc7021d6d1d987e3745b11+ #328212a5bb2df9dab3c4ba45201fcfa0dd1ecf22d63e, 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 withXCL_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.
XCL_ALIAS_COPY=1XCL_PAIR_PAGES=1XCL_PAIR_PAGES=1in 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.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
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.
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:
XCL_PAIR_PAGES=1, which is off by default. With the switch offunaligned_on_pagesis false and every placement is main's.place_withis the same line as this head's, so the finding applies to this PR and not to the hand merge.place_pagescallsplace_on_pageswithrequire_aligned = false, so a sampled texture of known size goes on the pages at any address. #3282 adds the same for the written half.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,registeruploaded it once and again after CPU writes);c. it is a
Targetinplacementsand a placed entry intitle_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.placementsgives them back on a barrier, a copy or a descriptor table; afterTable::insert->vram::unmap_supersededthey come back only when the newer entry is removed.Two runs on your tree
f4231a68would narrow it: the same run withXCL_PLACE_RETIRE=0(afpruivo's runs, which do not show the dark room, all had it), and one withXCL_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 #3281c9d3abea.gpu_owned_page_align(&x)ran with the switch off: fixed.create_placed_resource_xasks for it only whenvram::pair_pages()is on. No behaviour change (with the switch off the value was ignored), so no new test.require_aligned = falsealso gates the failure log,recycle_keyand 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_keystaysNonebecause 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.register_gpu_owned). Switch-on only. It is one candidate for KDenKC's dark room; open.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:
create_placed_resource_x);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;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 runpaironce more withoutXCL_PLACE_RETIRE=0?Written with Claude Code (Claude Opus 5.5; the code reading by a Claude Fable 5.2 subagent).
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 withXCL_PLACE_RETIRE=0, and one withXCL_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.
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.
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 3292This 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 viaregister_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.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 1294gpu_owned_page_align/unaligned_on_pagesdon't check whatregister_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, thenregister_gpu_ownedreturns Err ("a console format promoted on the PC"). The only fallback isretire_overlapping, so the texture gets neither readback nor upload. On main it was committed and kept in step byregister.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 3327An 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.Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-01T23:23:44Z.
Thank you for the review of
c3145f90. Pushed9cd6c839(commits82d9248c+9cd6c839), restacked on #3281'sf32c1894.Suite:
cargo test --workspace --no-fail-fast -- --test-threads=4on9cd6c839(includesf32c1894) (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 texturePartly right. With
XCL_PAIR_PAGES=1, a single-plane UAV texture at an address that holds its layout'salignment (0x100 for layout 0x102) moves from a committed resource kept in step by
register(
cpu_backed) to the pages andregister_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 tomore addresses rather than adding a new one. Off by default; with the switch off
unaligned_on_pagesis 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: formatsregister_gpu_ownedrefuses go on the pages with no fallbackConfirmed, thank you. Formats 67, 88, 85, 86 and 115 are promoted on the PC,
gpu_owned_layoutrefuses them, and the texture was left with only
retire_overlapping. Only with the switch on: thealignment is not asked for without it.
Fixed in
9cd6c839:gpu_owned_page_alignnow asksgpu_owned_layoutwith the PC description andgives no alignment to a texture it refuses, so such a texture keeps the committed resource and
register, as on main. The testa_glyph_cache_gets_no_console_alignment_but_a_720p_target_doescovers 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 supersessionRight 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 thepoint of the change. Its range in
placementsis only the 64 KiB pages that start inside its ownconsole 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).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T23:28:21Z.
Follow-up review (head
9cd6c839, sincec3145f90, diff read, not a merge-check):1a38d2c6andf32c1894are #3281's head, only82d9248cand9cd6c839belong here.main;require_aligned = falseside effects;gpu_owned_page_alignwith the switch off: fixed. The description has a scope paragraph, the branch merges cleanly, the comment atvram.rs~3339 names the failure log,recycle_keyand texel accounting, anddevice_x.rs~1298 callsgpu_owned_page_alignonly whenpair_pages()is on.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.unaligned_on_pages(~3308) needs the UAV flag, which a glyph cache lacks, socpu_filled_small_targetingpu_owned_page_align(device_x.rs~1244) excludes nothing.XCL_TEXTURE_LEVEL_PAGES=1(reported on the PR): still open; the lazy-level path inplace_on_pages(vram.rs~2439) is unchanged.New: none.
Fine:
gpu_owned_page_alignnow usesgpu_owned_layoutwith the PC description, so a UAV in a format the PC promotes (67, 88, 85, 86, 115) keeps the committed resource andregisteras onmain;register_gpu_ownedruns 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.
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 whoseregister_gpu_ownedfails after it's on the pages is still neither uploaded nor read back (device_x.rs~1301), andgpu_owned_page_align's prediction can drift from whatregister_gpu_ownedchecks (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_partnersfinds no writer, so the view keeps its uncapped size (0x398000/0x3c0000).TEXTURES.insertfor the writer (0x384000) then sees an overlap with a different end, setsold.unmappedand callsunmap_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.
Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-02T03:14:18Z.
Thank you. Pushed
ea91c5f4(commits77303f3b+ea91c5f4), restacked on #3281'sb02b2c34.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 unmappedRight 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 rangeunmaps 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 viewplaced before it is unmapped the same way. This PR changes which path registers the writer
(
register_gpu_ownedon 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).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T03:16:44Z.
Follow-up review (head
ea91c5f4, since9cd6c839, diff read, not a merge-check):git range-diffshows this PR's own commits (77303f3b,ea91c5f4) identical to82d9248c/9cd6c839; the push only carries #3281's newb02b2c34. 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 withXCL_TEXTURE_LEVEL_PAGES=1.New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
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.395405e4merged with #3094 (8a28d317), #3282 (ea91c5f4) and #3625 (e3dabe10), release.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.XCL_ALIAS_COPYandXCL_PAIR_PAGESdiffer, and both are switched together, so this does not tell the two PRs apart.XCL_DUMP_TARGETS=2000,1,16after 900 or 1000 s. Sampled texels drawn are out of 230,400.XCL_ALIAS_COPY+XCL_PAIR_PAGESWhat the images show:
Frame rate is about the same either way, and video memory is a little lower with the switches on.
Not checked:
AI use: Claude Code, Claude Opus 5.5 ran the runs and wrote this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.