Repository navigation
Conversation
Note: since this run the PR conflicts with main (3b6a91e). 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 |
ab6adf3 to
fb4478d
Compare
|
I routed the existing unaligned pair fixture through
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. |
|
Ran the paired-page alignment tests at System
Results
What this adds Not tested 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. |
fb4478d to
475a532
Compare
|
Source check on the current stacked heads: #3282 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 AI use: OpenAI Codex (GPT-6.2 Sol) compared the exact PR-head source and drafted this note. |
475a532 to
c2452da
Compare
|
Thanks, you were right:
AI use: Claude Code. Claude Sonnet 5.5 did the restack and the runs; Claude Opus 5.5 reviewed it and wrote this reply. |
c2452da to
12a5bb2
Compare
|
Rebased again, with #3281, onto main Whole suite on 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. |
|
Stacked on #3281: the 307 shared added lines are #3281's two commits. Only AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
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 Tree. Not Hardware and settings. RTX 5090 32 GB, driver 621.40, Windows 11; release build; Before ( 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 ( 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 Update: a side effect in the same scene. With #3282 the room's own light goes out. A matched pair on the same tree (
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
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). |
|
@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 AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
|
Test report on #3282 (with #3281 under it) together with #3094, on an RTX 3090: Tree. Tests. 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 =
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. |
|
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 Tree. Runs. Retail title, warm cache, 420 s each, scripted A presses, in the order none, alias, pair, both. Common env: Picture. The last 16 dumps of each run were taken in the room, facing the window.
Memory. The peak private commit of 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. |
12a5bb2 to
c3145f9
Compare
|
@KDenKC (dark room with #3282) Thank you for the matched pair. The cause is not found yet. What the code says:
Two runs on your tree Written with Claude Code (Claude Opus 5.5; the code reading by a Claude Fable 5.2 subagent). @Foniass (triage and merge check on 12a5bb2) New head
Suite on 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:
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 Written with Claude Code (Claude Opus 5.5; the code reading by a Claude Fable 5.2 subagent). |
|
@Pipodi thanks, that narrows it well. Both runs are queued on AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
…g in its record, --inputs <ps> in the report, not for a PR For the xcl-dev#3282 room question (which input of the tile lighting is zeroed): every census texture record names its title address, its PC resource flags, whether its title pages are mapped (vram) and how the title-texture table has it (active / shadowed / unmapped: title_textures' own placements unmap superseded entries whatever XCL_PLACE_RETIRE says). An unmapped input is flagged and grouped under memory / aliasing. census_report.py --inputs <pixel shader> lists every input and output of that shader's passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g in its record, --inputs <ps> in the report, not for a PR For the xcl-dev#3282 room question (which input of the tile lighting is zeroed): every census texture record names its title address, its PC resource flags, whether its title pages are mapped (vram) and how the title-texture table has it (active / shadowed / unmapped: title_textures' own placements unmap superseded entries whatever XCL_PLACE_RETIRE says). An unmapped input is flagged and grouped under memory / aliasing. census_report.py --inputs <pixel shader> lists every input and output of that shader's passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g in its record, --inputs <ps> in the report, not for a PR For the xcl-dev#3282 room question (which input of the tile lighting is zeroed): every census texture record names its title address, its PC resource flags, whether its title pages are mapped (vram) and how the title-texture table has it (active / shadowed / unmapped: title_textures' own placements unmap superseded entries whatever XCL_PLACE_RETIRE says). An unmapped input is flagged and grouped under memory / aliasing. census_report.py --inputs <pixel shader> lists every input and output of that shader's passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g in its record, --inputs <ps> in the report, not for a PR For the xcl-dev#3282 room question (which input of the tile lighting is zeroed): every census texture record names its title address, its PC resource flags, whether its title pages are mapped (vram) and how the title-texture table has it (active / shadowed / unmapped: title_textures' own placements unmap superseded entries whatever XCL_PLACE_RETIRE says). An unmapped input is flagged and grouped under memory / aliasing. census_report.py --inputs <pixel shader> lists every input and output of that shader's passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bmjask
left a comment
There was a problem hiding this comment.
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.
| /// 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; |
There was a problem hiding this comment.
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.
| 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(); |
There was a problem hiding this comment.
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.
| // 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) { |
There was a problem hiding this comment.
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.
…s pages A title can place two descriptions at one address: a 1280x720 R32_UINT UAV and a 1280x720 R9G9B9E5 SRV. XG sizes them 0x384000 (57 pages) and 0x3c0000 (60 pages), so the one placed second owns 3 pages more than the first, and those are the shared pages of the texture the title put 0x390000 after them. The sampled alias then reads that neighbour's memory (a step in the captured frame), and placements sees it Around the target and supersedes it. With XCL_PAIR_PAGES=1 (off by default) place_on_pages caps a sampled texture placed at the address and tile count of a live mapped texture the GPU writes, and that it is a view of, to the smaller of the two (pair_bytes) and keeps the capped size in its Target, so the later texture shares exactly the written partner's pages and its other tiles are private (va, i) tiles. Placed first, the larger texture is not changed (its tiles are bound already). The cap is made before the range is handed to placements, so a capped pair is Same, not Around. The log line is printed for the first two and powers of two. Only a written texture is a partner (pair_partners), and only while it is the current placement: mapped, held by the title and not superseded in placements (placements::current_view; a superseded target stays mapped in vram until its deferred unmap, late_release::hold_unmap), to a sampled texture with the same size and levels and a texel of the same size (Desc::same_texels, the rule placements keeps the two on one memory by; a texture of another shape with as many tiles is something else the title put in that memory, and keeps its size), with the size CreatePlacedResourceX passes (console_bytes: XG's, or for a 3-D texture XG cannot lay out the bytes of its texels; not the least_texture_bytes lower bound). A sampled texture caps nothing, capped or not. A texture the GPU writes is never capped: on the console it has all of its own size, and its readback into the title's memory (title_textures::publish_download) goes by its whole layout. The registry is asked with PAGES released: its lock is the outer one of the two (placements::unmap_if_superseded). The cap is not the byte layout of the console. Measured with the GDK's XG library: the two layouts (0x102 and 2) put texel (x, y) at different offsets (first difference at (8,0); 920896 of 921600 texels differ), and the SRV's 3-page overrun is real on the console (36864 texels past the UAV's end). The cap is what the PC alias shows. Tests: pair_bytes on targets (a written partner; a sampled one or one of unknown size caps nothing and a written texture is not capped; a superseded partner before and after its unmap), placements::current and current_view on a registry (another shape, other levels and another texel size are not a view), a placements test that the capped pair is Same, and GPU tests with the real descriptions: a neighbour at +0x390000 (80 of 128 neighbour rows are overwritten without the cap, with pair_bytes returning its own size), and a written texture made after a smaller sampled one and then superseded (with every mapped texture a partner it is capped to 0x384000; with the registry not asked, the sampled texture made after it is capped to the superseded one; a sampled 720x1280 texture at the address of a written 1280x720 one has as many tiles and keeps its size). Assisted-by: Claude Code (Claude Sonnet 5.5) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The title places an R9G9B9E5 view by address over a live R32_UINT texture (1280x720, 0x384000 bytes). XG sizes the view 0x3c0000 and the title's next resource starts at the view's address + 0x384000. Table::insert saw that resource inside the view's range, called the view superseded by a different range, and vram::unmap_superseded mapped all 60 of its tiles to NULL: the compute pass that read the view got zeros and wrote zeros over the R32_UINT. XCL_PAIR_PAGES=1 capped only the vram extent (pair_bytes), not the table's. The entry of a sampled texture now keeps the capped extent (vram::pair_capped_bytes reads it from the placed Target, so pair_bytes stays the one place that computes it) and insert, retire_range, remove, the source links and the hot range use it. So do the test for written pages (Entry::written_in), the pages a partial upload compares (dirty_on) and the fingerprint of a view whose memory is not watched: a write to the neighbour's first bytes is in a 1 MiB source piece of the view, and with the view's whole size it sent the view up again. Every upload of a capped view, its first whole one too, now stops at its cap (texture_upload::Item::own_tiles from vram::pair_capped_tiles, the tiles owned_pages gives it; texture_upload::owned_parts clips each piece to them). The view's tiles past the cap are the extra pages keyed (va, 57..59) it shares with the R32_UINT, whose last texels they hold: a whole upload of the view wrote the neighbour's bytes over them, and the view's first upload after register is always a whole one (pending; gpu_written is only set on the writer's entry). A level in the packed mips or a 3D level goes up whole when the view owns all of its tiles, else not at all. Each array slice has its own packed mips, D3D12_PACKED_MIP_INFO's start (slice 0's) plus the slice times the tiles of a slice, and a level from NumStandardMips on is packed: WARP gives the packed subresources of slice 1 slice 0's start and no tiles, not D3D12_PACKED_TILE (256x256, 2 slices, 9 mips: start 5, 0x0). The hashes of its pages are still those of the whole layout. The entry of a texture the GPU writes (register_gpu_owned) has no cap: vram never caps one, and publish_download writes its whole layout back into the title's memory, so its range in the table is its whole size. Only under XCL_PAIR_PAGES=1. Tests: gpu_register_takes_the_cap_from_the_pair (register's range stops at the capped extent, the written texture keeps its own size; skip_test without reserved textures); capped_placed_view_is_not_superseded_by_its_neighbour fails with the cap ignored (the insert at address + 0x384000 returns the view to unmap), and with the whole size in written_in (a written page at address + 0x384000 selects the view); a_capped_views_fingerprint_ends_at_its_cap fails with the whole size fingerprinted, in the baseline (seed_stream_recheck) or in the recheck (a write past the cap, in the end slice of a whole-size fingerprint, queues the view); gpu_a_capped_views_first_upload_leaves_the_tiles_past_its_cap places the pair on pages, registers the view, sends its first upload through upload_all and fails with the clip off or with no own_tiles from upload_all (the view writes 30720 texels of tiles 57..59 of the R32_UINT); gpu_a_capped_arrays_first_upload_stops_at_its_cap_in_a_later_slice caps a 2-slice array with packed mips one tile into slice 1 and fails with slice 0's packed start for every slice, with the packed levels taken from D3D12_PACKED_TILE alone, or with no own_tiles from upload_all (slice 1's packed mips get the view's bytes). Assisted-by: Claude Code (Claude Sonnet 5.5) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…memory register decides inline whether a render target is a small single-sample colour target with texels and more than one plane (a glyph cache the CPU fills), and so is uploaded like a texture. The next commit needs the same answer before a placement, so the rule is a function, cpu_filled_small_target. No behaviour change. Assisted-by: Claude Code (Claude Sonnet 5.5)
…ress its layout allows A title places a written R32_UINT 1280x720 texture at an address that is 16 KiB- but not 64 KiB-aligned, and a sampled R9G9B9E5 view over it. place_on_pages refused the texture (require_aligned), so it became a committed resource: the view found no partner to be capped to, kept XG's 0x398000, was superseded by the texture the title put 0x384000 after it and read zero. The two descriptions also did not share memory. In a run of a retail title 23 of the 48 views placed by address were in this class. Measured with the GDK's XG library: R32_UINT 1280x720 layout 0x102 has size 0x384000 and alignment 0x100; R9G9B9E5 1280x720 layout 0 has 0x398000 / 0x1000 and layout 2 has 0x3c0000 / 0x10000. So the address is valid on the console. Under XCL_PAIR_PAGES=1 (off by default) a GPU-owned texture whose console size is known (before the least_texture_bytes stand-in) goes on the pages when its address holds the alignment XG gives its layout (Texture::alignment, passed from CreatePlacedResourceX). The view then pairs with it: same tile, same page, and the cap and the title_textures extent of the previous commits apply. Only a texture the GPU may write takes this path: UAV flag, no depth or stencil, single-sample (the texture above is an R32_UINT, flags 0x300004). The flag does not say the CPU does not fill it: one the CPU fills loses those texels on the pages, as register_gpu_owned never uploads (main does the same at a 64 KiB-aligned address). Anything else at an unaligned address keeps the committed resource and title_textures::register, as on main, and an unaligned depth or MSAA texture stays out of the retire_overlapping fallback of register_gpu_owned. At a 64 KiB-aligned address nothing changes: the rule is false there (va % PAGE != 0), so the sampled-only recycle key, the texel stats and the "not reserved" log are as before. A small CPU-filled render target keeps its old path. XG gives an R8 256x256 render target (layout 0x102, two planes) the alignment 0x2000 (layout 0: 0x10000), so the addresses of a glyph cache pass the rule; on the pages it would return from CreatePlacedResourceX before title_textures::register and its CPU texels would never go up. Such a target gets no console alignment (gpu_owned_page_align). The 1280x720 R32_UINT is small by the size rule too, which is why the rule needs the second plane. So does a texture register_gpu_owned refuses (gpu_owned_layout: a console format promoted on the PC, such as an R9G9B9E5, B8G8R8X8, B5G6R5, B5G5R5A1 or B4G4R4A4 UAV, or subresources that differ). On the pages it would be left with the retire_overlapping fallback, neither read back nor uploaded; as a committed resource title_textures::register keeps it in step, as on main. gpu_owned_page_align asks gpu_owned_layout with the PC description and gives such a texture no alignment. Tests: the alignment rule (false at 64 KiB-aligned addresses; false without the UAV flag, with depth, multisampled; mutation-checked); XCL's XG model against the measured sizes and alignments; gpu_owned_page_align for the glyph cache (None) and the 1280x720 texture (0x100), failing when the rule is the size alone or is dropped, and for 1280x720 UAVs in formats 67, 88, 85, 86 and 115 (None; 0x100 with the layout not asked); a GPU test with a texture at a 16 KiB-aligned address on the pages, its view capped to 0x384000 and sharing its pages, a neighbour at +0x384000 leaving the view's data intact, and two textures 16 KiB apart in one 64 KiB page keeping their own data (fails with the rule reverted), and a no-UAV, a depth and a multisampled texture at an unaligned address not placed; skip_test when reserved textures are unavailable. Assisted-by: Claude Code (Claude Sonnet 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c3145f9 to
9cd6c83
Compare
|
Thank you for the review of 1.
|
|
Follow-up review (head 9cd6c83, since c3145f9, diff read, not a merge-check):
New: none. Fine: AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
bmjask
left a comment
There was a problem hiding this comment.
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.
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.9cd6c839D3D12.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.9cd6c839: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=4on9cd6c839(on D3D12.X: XCL_PAIR_PAGES=1 caps a texture in a live one's memory to its pages #3281's headf32c1894, main493dbd3d): 2918 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 D3D12.X: XCL_PAIR_PAGES=1 caps a texture in a live one's memory to its pages #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 D3D12.X: XCL_PAIR_PAGES=1 caps a texture in a live one's memory to its pages #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 (
9cd6c839, on #3281's headf32c1894):The PR's run got 105.7 % of
main's frames and 102.5 % 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 D3D12.X: XCL_PAIR_PAGES=1 caps a texture in a live one's memory to its pages #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.9cd6c839(and the restack onto D3D12.X: XCL_PAIR_PAGES=1 caps a texture in a live one's memory to its pages #3281'sf32c1894): 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.