Skip to content

D3D12.X: a 3-D texture XG cannot size is taken at its texels' bytes - #2753

Merged
Prime1997 merged 1 commit into
xcl-dev:mainfrom
MacieGx:d3d12x/volume-texture-size
Nov 30, 2026
Merged

Prime1997 merged 1 commit into
xcl-dev:mainfrom
MacieGx:d3d12x/volume-texture-size

Conversation

@MacieGx

@MacieGx MacieGx commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

A 3-D texture XG does not lay out (a 3-D render target: xg::Texture::volume refuses flags 1 / 2 with E_NOTIMPL) got no console size in CreatePlacedResourceX, so vram gave it every tile of the PC texture as a 64 KiB page at its address. The newer retail title of #505 places thirteen 33x33x33 RGBA16F colour LUTs (render target + UAV, flags 0x5) 512 KiB apart; the PC texture has 18 tiles of 64 KiB, so each LUT shared 10 pages with the next one. A LUT's bake overwrote rows of its neighbour, the tone map sampled another LUT's rows (LUT[black] = cyan) and the whole picture came out teal. Such a texture is now taken at the bytes of its texels (287,496 here: 5 pages of its own), which no console layout of it is smaller than.

Part of #505.

Why not the console's layout: what the console's library does with a 3-D render target is not known here. The xg_oracle volume test covers flags 0 and 4 only, and no console library was at hand to ask. The 2-D rule for render targets (64KB_R_X, thin for 3-D in our tiling model) would give 33 x 64 KiB = 2.06 MiB, which cannot be right for textures the title packs 512 KiB apart, and it would keep the overlap. 4KB_S thick (500 KiB) fits, but that is a guess. Teaching XG this would also change what XGCreateTextureComputer and GetResourceAllocationInfo tell titles. The texels' bytes are a lower bound of any layout, so the pages taken are always the texture's own.

What is in it

  • D3D12.X: a 3-D texture XG cannot size is taken at its texels' bytes (crates/xcl/src/hle/d3d12x/device_x.rs: console_bytes / volume_texel_bytes, used by create_placed_resource_x; vram::owned_pages made pub(super) for the test), with the unit test volume_targets_xg_does_not_lay_out_keep_to_their_texels: two such LUTs 512 KiB apart do not share a page, a full mip chain is summed, and a sampled 3-D texture keeps XG's size.

Tested

  • Without the fix (the fallback disabled, so console_bytes is XG's size only) the new test fails: assertion left == right failed, left: None, right: Some(287496); with it, it passes
  • cargo test --release -p xcl --lib -- volume_targets owned_pages hle::xg on e07d03b: 80 passed, 0 failed, 0 ignored, 1257 filtered out (CPU tests; the filter also matches hle::xgameruntime)
  • NVIDIA GeForce RTX 5080 (driver 621.24 = 32.0.16.2124), AMD Ryzen 7 5800X3D, 32 GB, Windows 11 Pro 10.0.26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, release. On e07d03b (this PR, on main b49be18).
  • cargo build --release --workspace && cargo test --release --workspace --no-fail-fast -- --test-threads=4 on e07d03b: 1432 passed, 4 failed, 47 ignored. The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (CreateComputePipelineState: out of memory (0x8007000E)), which fail on main as well.
  • SKIPPED (the same as on main): 21 "no wave64", 3 refused by the per-lane form, heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows), pso_measurement_compiles_an_exact_synthetic_record (needs Developer Mode).
  • Lab (the same change behind a switch, on our lab branch, NVIDIA): the Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505 title went from a teal picture to the game's colours (cell wall in grey, the yard and sunset light in the window, a photo in colour; run W1, 470 s, no device removal). The title places thirteen such 33x33x33 RGBA16F render-target / UAV textures 512 KiB apart; before the change each took 18 tiles of 64 KiB, so neighbours shared 10.

Regression run
main:

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1383 (PresentX 1383)
presents per 2 s (last 3): 35 52 56
device removals: 0
crashes: 0
peak commit: 19703 MB

this PR:

xcl-smoke v1
commit: e07d03bf0fc1bcbfac3d369d2f7eeed5eba6afd7
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1615 (PresentX 1615)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15692 MB

Not tested

  • The console's own size for 3-D render targets: no console xg_xs.dll (XCL_SAMPLE_XG) was at hand.
  • AMD GPUs. The lab run was on NVIDIA.
  • Other textures XG cannot size (MSAA, unknown formats) still get the PC's tile count. This PR covers 3-D textures only.

AI use

  • Claude Code. Claude Opus 5.5 coordinated the work. A Claude Fable 5.2 lab subagent found the bug and wrote the lab fix. A Claude Opus 5.5 subagent wrote this port, its test and this description.

🤖 Generated with Claude Code

xg::Texture::volume refuses 3-D render targets (flags 1 / 2: E_NOTIMPL),
so CreatePlacedResourceX had no console size for them and vram gave such a
texture every tile of the PC texture as a 64 KiB page at its address. The
newer retail title of xcl-dev#505 places thirteen 33x33x33 RGBA16F colour LUTs
(flags 0x5) 512 KiB apart. The PC texture has 18 tiles, so each LUT shared
10 pages with the next one. A LUT's bake overwrote its neighbour's rows and
the tone map sampled the wrong LUT (black -> cyan): the picture was teal. On
our lab branch the same change turned the picture into the game's colours.

The fallback is the bytes of the texels of every level (287,496 bytes, 5
pages of its own, for that LUT) and not a console layout. What the console's
library does with a 3-D render target is not known: the xg oracle covers 3-D
flags 0 and 4 only, and no console library was at hand. The 2-D render
target rule (64KB_R_X, thin for 3-D) gives 2.06 MiB, which cannot be right
for textures packed 512 KiB apart and keeps the overlap. 4KB_S thick (500 KiB)
fits but is a guess. Teaching XG would also change what XGCreateTextureComputer
and GetResourceAllocationInfo tell titles. No layout is smaller than its
texels, so the pages taken are always the texture's own.

Part of xcl-dev#505.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GodlyBDS

Copy link
Copy Markdown

Independent Ampere validation of the NVIDIA-branch precursor b59d263

RTX 3090 Ti 24 GiB, driver 621.40, Windows 10, 32 GiB RAM. Both release builds use e877812e390cad68f9082445c43a397ebf8a00bf and the same local Agility path scope and #662 XG startup adapter. The treatment adds only b59d2638. The relevant settings are XCL_TEXTURE_LEVEL_PAGES=1 XCL_DIRECT_DXIL=1 XCL_PREPARE=0 XCL_PSO_PRELOAD=0 XCL_DRED=1 XCL_COHERENT_MB=4095 XCL_UMA_WINDOWS=4 XCL_HEAP_WINDOWS=1 XCL_TWO_PASS_MB=4096, with the verified app-only 1 GiB NVIDIA shader heap. Both arms cloned the same 11,721 native PSOs and matching shader cache, used the same starting profile and scripted inputs, and had no fixed runtime timeout. Cache manifest hashes and environment settings matched.

  • Without the tile-placement fix: a cyan-white image with scene details at 207.754 s. Device removal at 252.834 s.
  • With the tile-placement fix: the city-light horizon was predominantly dark with gold highlights at 323.222 s. Device removal at 323.288 s.
  • The exact NVIDIA-branch overlap regression a_3d_texture_of_unknown_console_size_keeps_off_the_next_textures_pages passed (1 pass, 0 failures, no skips).
  • Both removals were 0x887a0005. DRED returned VA zero with no matched allocation and no breadcrumbs. Neither removal had a corresponding Display 4101/nvlddmkm 153 in the event window.

The direction of the color change is consistent with correcting cyan sampled from the wrong LUT. The frames are from different points in the opening and this is one run per arm. The control also recorded 153 two-pass mesh allocation refusals at the same 4 GiB cap, while the treatment recorded zero. No claim about a matched-frame color error, correct geometry, sustained rendering or device-removal prevention. The exact #2753 head has not been run here. Memory details are in the existing #2688 report.

AI use: Codex (GPT-6) built and ran the pair, reviewed the backbuffer samples and wrote this report.

@emirduran707

Copy link
Copy Markdown
Contributor

Independent AMD RDNA4 (native wave64) verification of exact PR head e07d03bf0fc1bcbfac3d369d2f7eeed5eba6afd7 on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver 32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC 1.9.2602.17).

Tested

  • cargo build --workspace (debug): passed (0 errors).
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1434 passed, 2 failed, 47 ignored (8 SKIPPED: 6 per-lane DXIL forms refused by host adapter/driver, 1 heap_window_out_of_memory_falls_back_to_the_switch_form no heap windows, 1 pso_measurement_compiles_an_exact_synthetic_record Windows Developer Mode off).
    • The new test hle::d3d12x::device_x::tests::volume_targets_xg_does_not_lay_out_keep_to_their_texels passed.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 and fuzz_validate_and_gpu_3) are pre-existing on unmodified main on this RX 9060 XT / driver 32.0.31044.16.
  • cargo build --release -p xcl + 60 s retail-title smoke test (scripts/smoke.ps1, offline):
xcl-smoke v1
commit: e07d03bf0fc1bcbfac3d369d2f7eeed5eba6afd7
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1591 (PresentX 1591)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 18654 MB

(Compare against main b49be183 on this machine: 1603 frames, 18576 MB peak, 0 device removals, 0 crashes.)

Not tested

  • NVIDIA / Intel GPUs, Linux / Wine.

AI use

  • Verification run and report prepared with Antigravity (Gemini 4 Neon); all build, test, and smoke results are from live runs on this machine.

@Decodere

Copy link
Copy Markdown
Contributor

Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2753 at e07d03bf0fc1bcbfac3d369d2f7eeed5eba6afd7 (exact parent origin/main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements and targeted test results only; not a full source review.

Setup

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200
  • Toolchain / caches: rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)
  • Workload: Retail workload title: 29640639 via scripts/smoke.ps1 -Seconds 60 (XCL_NETWORK=0 XCL_ACTIVITY=1, default flags, no input)

Targeted RTX 4060 release unit tests (e07d03bf)

  • cargo test --release -p xcl --lib volume_targets_xg_does_not_lay_out_keep_to_their_texels -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit 0).
  • cargo test --release -p xcl --lib hle::d3d12x::vram:: -- --test-threads=4: 19 passed, 0 failed, 1 ignored (2.55 s, churn_update_tile_mappings_timing ignored, 0 skipped, exit 0).
  • cargo test --release -p xcl --lib hle::d3d12x::device_x:: -- --test-threads=4: 15 passed, 0 failed, 0 ignored (0.19 s, 0 skipped, exit 0).

Observations

  • The new 3-D volume-texture sizing fallback (volume_texel_bytes / console_bytes) passes volume_targets_xg_does_not_lay_out_keep_to_their_texels and all 34 targeted hle::d3d12x::vram:: and hle::d3d12x::device_x:: tests cleanly in --release on this RTX 4060 (8 GB) host with 0 skips.
  • Quiet 60 s retail smoke ran cleanly (exit: 0x0, 1556 frames shown, 60 60 60 steady-state presents per 2 s, 0 device removals, 0 crashes, 14009 MB peak commit vs parent b49be183's 14018 MB / 1518 frames).

Paired 60 s RTX 4060 smoke (b49be183 vs e07d03bf)

Parent origin/main (b49be183):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB

PR #2753 head (e07d03bf):

xcl-smoke v1
commit: e07d03bf0fc1bcbfac3d369d2f7eeed5eba6afd7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1556 (PresentX 1556)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14009 MB

Limits of coverage

  • Full workspace test suite was not re-run on e07d03bf (only targeted hle::d3d12x::vram:: and hle::d3d12x::device_x:: release tests plus paired quiet 60 s smoke).
  • The quiet 60 s no-input menu/intro smoke verifies no runtime regression on the baseline path rather than extended world-load 3-D volume-target VRAM savings (the XG fallback sizing path itself is covered by volume_targets_xg_does_not_lay_out_keep_to_their_texels).
  • Single discrete NVIDIA 8 GB GPU (RTX 4060) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host.

AI use

Ran the targeted release unit tests and paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts and smoke blocks were taken directly from cargo test and scripts/smoke.ps1 outputs.

@Gevroska

Gevroska commented Nov 26, 2026 •

Copy link
Copy Markdown

I compared stock b49be183 with PR head e07d03bf using two 33 × 33 × 33 RGBA16F textures, first on WARP and then on a physical RTX 3080.

On stock, adjacent placements shared 10 backing pages. I stopped that case before issuing texture commands, so I have no readback result for the overlapping pair. With the placements farther apart, stock shared zero pages and both textures read back correctly.

On the PR head, both placement cases shared zero pages. After waiting for GPU completion, I read back every component of every texel: 0.25 throughout the first texture and 0.75 throughout the second. An independent repeat of the adjacent pair on the RTX 3080 reproduced the stock overlap and the successful PR readback, with zero skips. These were synthetic tests; whether the retail game uses this placement pattern remains open.

I used Codex GPT-6 Sol Daybreak for the WARP fixture and GPT-6.2 Sol for physical GPU verification and independent review. Codex GPT-6.2 Astra wrote this comment.

I reviewed and approved this comment before posting.

@jennydeth

Copy link
Copy Markdown

Windows / NVIDIA results for e07d03b with the retail title (1.0.2.1) on an RTX 3060 12 GB. This is a regression check only: my title (9cc6a39e) is not the one in the PR's runs (16b5e5d4).

Regression run (default settings, 600 s)

main b49be18:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060
title: 9cc6a39e
seconds: 600
exit: 0x0
frames shown: 2047 (PresentX 2047)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 35859 MB

This PR, e07d03b:

xcl-smoke v1
commit: e07d03bf0fc1bcbfac3d369d2f7eeed5eba6afd7
gpu: NVIDIA GeForce RTX 3060
title: 9cc6a39e
seconds: 600
exit: 0x0
frames shown: 1978 (PresentX 1978)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 35177 MB
  • This PR has 1,978 frames against main's 2,047 (97 %) and peak commit of 35,177 MB against 35,859 MB (98 %), with no removal and no crash in either. Neither run reaches the world: presents stop at 100.3 s on main and at 94.2 s with this PR, while big compute programs are still compiling.
  • I can't tell from the logs whether this title creates a 3-D texture XG refuses: not every CreatePlacedResourceX is logged, and the new path logs nothing. The frames dumped in the pair are start-up and loading screens, so they don't show colour grading.
  • Direct DXIL (XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1, warm caches, 900 s): the device was lost (0x887a0005, NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403) at 194.3 s, last present at 124.7 s, with the same DRED line as on main (page fault at GPU VA 0x0; allocations there: []; recently freed: []). Three b49be18 runs today with the same switches lost it at 110.6, 211.2 and 216.0 s, so one run can't tell this PR apart from main there.

Tested

  • NVIDIA GeForce RTX 3060 12 GB, driver 32.0.16.2101 (32-lane waves only); Ryzen 5 5600X; 32 GB RAM; Windows 11 Pro 10.0.26300.9974; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); release; DXC 1.9.2609.5.
  • cargo test --workspace --release --no-fail-fast -- --test-threads=4 on e07d03b: 1436 passed, 0 failed, 47 ignored. SKIPPED (29): 21 × no wave64; 3 × per-lane form refused; 3 × no D3D12 debug layer / d3d12SDKLayers.dll; 1 × no heap windows; 1 × pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache).
  • Retail title 1.0.2.1, scripts/smoke.ps1 -Game <folder> (XCL_NETWORK=0), the same scripted pad presses into the story load in every run; XCL_FRAME_DUMP=300 in the pair, 100 in the direct DXIL runs. Every run was of a copy named xcl-noprofile.exe: this machine has xcl run: xcl nvprofile puts xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590's 1 GiB shader-heap profile on xcl.exe, and a copy under another name does not match it.

Not tested: #505's title; a frame of the world (no run gets that far); AMD / wave64.

AI use: Claude Code (Claude Opus 5.5) built the commit, ran the suite and the runs on my machine, read the logs and wrote this.

@Royalflamejlh

Royalflamejlh commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

On Linux + NVIDIA (RTX 4060 Ti 16 GB), this PR took away the large white shapes over the title's opening scenes that we reported on #505 (7199770263): with it, 0 of 25 frames dumped after the world load were over 20 % near-white (2 of 2 runs); without it, 43 of 48 were (5 of 5 runs).

Setup: NVIDIA 615.71.09, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175, a local dxil-spirv patch, and its allocator Reset releasing the command pool's memory (#2404, 7189698499); main b49be18 + #684, #751, #1599, #1860, #2082, #2404 5b9d4ff, #2633 db34184, #2707 dff6edc, #1803 cb007514, #2229 d2dee320, #1975 72960386 and a log line of ours (the tree of that report), ± this PR e07d03bf; two of the four runs without it also had #2513, or #2513 + #768; XCL_DIRECT_DXIL=1 XCL_HUGE_PSO_WANTED_CONCURRENCY=6; 300 s; a frame dumped every 10th present (every 30th in 035941-a). Near-white: all three channels > 230, every 4th pixel.

this PR run the skyline over the sea: near-white dumped frames after the world load over 20 % near-white
without 035941-a 31.4 % (162.0 s) 4 of 4
without 102821-a 38.9 % (156.0 s) 11 of 13
without 101117-a not among its kept frames (only the last 10 kept) 9 of 10
without (+ #2513) 115242-a 38.7 % (178.6 s) 9 of 9
without (+ #2513 + #768) 121152-a 30.5 % (131.5 s) 10 of 12
with 122418-a 0.1 % (163.2 s) 0 of 12
with 123029-a not among its dumped frames 0 of 13 (at most 0.9 %: the title card's letters)
  • The white was faintly cyan: its pixels average (239, 250, 255) in all four skyline frames without the PR.
  • No device removal in any of the seven runs.
  • Read: only a 3-D texture that XG gives no size for gets one now, the bytes of its texels (device_x.rs:1089, console_bytes falling back to volume_texel_bytes); every other texture is placed as before. The path logs nothing, so these runs show the frames, not the placements.

Not tested: Windows; AMD; this PR on main alone.

AI use: Claude Code (Claude Opus 5.5) merged the trees, made and read the runs, and wrote this.

Posted without review by a person: the account owner was away and reads replies later.

Edited: "six runs" corrected to "seven runs" (the table has seven).

@razormontana

Copy link
Copy Markdown
Contributor

Independent native Windows validation of #2753 for #505

Tested

  • Clean PR head e07d03bf0fc1bcbfac3d369d2f7eeed5eba6afd7, parent b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. Windows 11 Pro 22631, Core i7-10700K, NVIDIA GeForce RTX 3070 8 GB, driver 617.42 (32.0.16.1742), Rust 1.100.0 MSVC, debug.

  • cargo test --offline --locked -j 1 -p xcl --lib --no-run succeeded with two existing Rust deprecation warnings. Each filter below ran with cargo test --offline --locked -j 1 -p xcl --lib <filter> -- --exact --test-threads=1 --nocapture. The five runs reported 5 passed, 0 failed, 0 ignored, 0 skips in total.

  • hle::d3d12x::device_x::tests::volume_targets_xg_does_not_lay_out_keep_to_their_texels (CPU)

  • hle::d3d12x::vram::tests::owned_pages_never_alias_disjoint_ranges (CPU)

  • hle::d3d12x::vram::tests::packed_console_3d_mip_tails_use_the_detile_upload_path (CPU)

  • gpu::texture::tests::gpu_console_textures_upload_every_mip_and_slice (GPU)

  • hle::d3d12x::device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed (GPU)

  • A standalone native D3D12 probe selected the RTX 3070 by name and queried a reserved 33×33×33 one-mip RGBA16F render target with UAV access. It reported tiled-resource tier 3 and 18 tiles with 32×16×16 texels per tile and a 2×3×3 grid. Build and run from the probe directory with cl.exe /nologo /W4 /EHsc /std:c++17 volume-footprint.cpp /Fe:volume-footprint.exe /link d3d12.lib dxgi.lib and .\volume-footprint.exe.

  • The focused CPU test checks XG's size fallback and ownership of two targets 512 KiB apart. The 287,496-byte fallback covers five guest-address pages per target, so their owned ranges are disjoint. Using the driver’s 18-tile count as the guest span on the parent would overlap ten pages. The GPU readback test covers tiled volume uploads separately. The two Rust GPU fixtures use the default D3D12 adapter.

Not tested

The exact adjacent 3D render-target pair in a GPU readback, retail world rendering, whole-workspace or parent runs, and net VRAM usage. The footprint query measures tile count. The fallback changes which addresses own those tiles.

AI use

Codex GPT-6.2 reviewed the diff, wrote the standalone footprint probe, ran the checks and drafted this report.

@JJAutoCompare

Copy link
Copy Markdown

Tested: Clean e07d03bf0fc1bcbfac3d369d2f7eeed5eba6afd7, Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC, debug, Intel Arc A770 driver 32.0.101.9175. cargo test --offline --locked -j 2 -p xcl --lib --no-run, then five focused exact CPU tests covering volume size, mip tails and placement ranges: 5 passed, 0 failed, 0 ignored, 0 skips. The fallback fixture assigns a 33×33×33 RGBA16F target 287,496 bytes (five guest pages), keeping volumes 512 KiB apart disjoint. cargo test --offline --locked -j 2 -p xcl --test d3d12_create_reserved_resource --no-run, then pc_reserved_resources_match_host_driver --exact --nocapture --test-threads=1 on Arc: 1 passed, 0 failed, 0 ignored, 0 skips. This fixture checks PC reserved-resource parity, including a sampled 3D texture.

Not tested: The adjacent XG-rejected render-target pair on Arc, console-native layout, full workspace suite and retail smoke.

AI use: T3 Code / Codex (gpt-6.2-sol) ran and independently reran the checks and drafted this report.

@afpruivo

Copy link
Copy Markdown

RTX 3090 24 GB, Windows: with this PR the retail title crawls after its story load and then ends in the +0x23cf683 null write (#675), in 3 of 3 runs. Without it (the base, and the base + #2229), 2 of 2 runs went the full 900 s with the same inputs. The opening scenes and the story load are the same with and without it; the difference starts when the world's frames begin (~780 draws per frame).

Setup

tree runs after the story load queue.Wait 5 s timeouts end
base 1 7–8.8 fps to the end 2 900 s, exit 0
base + #2229 1 4.4–8.5 fps to the end 0 900 s, exit 0
base + this PR 1 6.6 fps, then 0.4 → 0.1 fps from ~180 s 248 +0x23cf683 at 315 s
base + #2229 + this PR 2 2.9 fps, then 0.2–0.3 fps 247, 219 +0x23cf683 at ~420 s and 272 s
  • All five runs go through the same story load: DirectStorage bursts of 55k–90k requests per 30 s between ~60 and ~180 s into the title, then ~750–1,000 draws per present. With this PR the same draw count per present takes ever longer, the queue.Waits time out (5,000 ms; the producing queue is one value behind what was submitted, XCL's own queue waits mostly met), presents stop, and the title's watchdog ends it with the null write and stack of Retail title 1.0.2.1: GPU hang / crash at +0x23cf683 when the story loads (RTX 3070 Ti) #675.
  • Cold driver builds: 0–2 in the runs with this PR (18 in the first run with Recompiler: loads through s_getpc_b64 read the constant data after the program #2229, all before the slowdown), so not compile stalls.
  • I did not find the mechanism. One thing that changes for these textures: with a console size, bind_range gives the LUT 5 owned pages and its other 13 PC tiles as extra_pages at (va, i) instead of 18 pages at its address. Video memory (~15.5 of 24 GB local) and the target-page pools looked alike with and without the PR at the point it slows. That is a reading of the code, not a measurement.
  • I could not check the picture: on this tree the window showed almost nothing in any run.

Not tested: this PR on its own base (b49be18); default switches; other cards. One run of the base without #2229 and one with #2229 only.

AI use: Claude Code (Claude Opus 5.5) built the trees, ran the runs and drafted this; checked by me before posting.

@afpruivo

Copy link
Copy Markdown

Correction to my comment above: a rerun with frame dumps does not reproduce the split, so I no longer think this PR is the cause. With XCL_FRAME_DUMP=10 added and everything else as before, this PR's tree ran the full 900 s (0 queue.Wait timeouts, 8,561 frames), and the base without it stopped at 143 s into the title with a different failfast, 0x80000003 at +0x4da6315 (the one in #2140), during the load.

tree runs without dumps run with XCL_FRAME_DUMP=10
base (#2938 0567c713 + #609) 900 s +0x4da6315 at 143 s
base + #2229 900 s —
base + this PR +0x23cf683 at 315 s 900 s, 8–9 fps
base + #2229 + this PR +0x23cf683 ×2 —
  • So across seven runs the end at this point is not decided by this PR. The frame dump's readbacks change the timing, but a timing change that flips both arms points at an intermittent failure on the way into play, not at this change. Sorry for the noise.
  • What the dumps show: the slowdown and the +0x23cf683 ends in the earlier runs all start ~180 s into the title, which is where play starts. In the dumped run, frames from ~180 s to the end are the game's grey picture with the on-screen movement hints of the first playable section (the flat grey Recompiler: loads through s_getpc_b64 read the constant data after the program #2229 explains), so the title reached play and stayed there for 12 minutes at 8–9 fps on this card.
  • Setup as in my comment above (RTX 3090, driver 621.40, same switches, A held 3.5 s every 4 s), plus XCL_FRAME_DUMP=10.

AI use: Claude Code (Claude Opus 5.5) ran the runs, read the logs and dumps and drafted this; checked by me before posting.

Royalflamejlh added a commit to Royalflamejlh/xcl that referenced this pull request Nov 29, 2026
main has merged nvidia-dev (xcl-dev#3203): its two-pass mesh, sparse and upload
paths now submit through real::native_queue_execute / _signal / _wait.
Those already carry xcl-dev#867's UnadoptGuard and unwrap_fence; the conflicts
and the main-only submit paths were resolved as follows.

Taken from main, the stack's version dropped (main does the same):
- recomp/dxc.rs (3): xcl-dev#688's private DXC heaps; main's form (3842807)
  falls back on any failure and never destroys a heap.
- device_x.rs (10): xcl-dev#3091 (cherry-pick 511a297); main's 7e24237 keeps
  interned shader copies for base pipelines. xcl-dev#3091's tests and its
  real.rs test counter (GRAPHICS_FALLBACK_ATTEMPTS) and README line go;
  xcl-dev#2753's console_bytes is re-applied on main's file.
- bind.rs (16): the stack's only change there was xcl-dev#1803, merged in main.
  main's file, plus the xcl-dev#2816 feedback-copy UnadoptGuard in
  poll_two_pass_feedback (ed887d2, from linux/stack-nvidia-dev).
- pso.rs: main has daae033 (multidimensional groups take direct DXIL,
  xcl-dev#3189's change), so the stack-only commit is in main; translate calls
  take main's translate_compute_rodata / translate_entry_rodata_rt32.
- list_x.rs tests: xcl-dev#3090's barrier tests were in twice (cherry-pick and
  main's merge); the cherry-picked copy goes.
- runner.rs device(), xbox.rs Fssm::rodata: added on both sides; one copy.
- README.md: the precompile-wrapper paragraph was added on both sides;
  one copy.

Both kept:
- build.rs (2): TRANSLATION_GLUE_REVISION "pso-glue-v5-linux-multidimensional-
  direct" (main's v5 + the stack suffix); translator sources keep xcl-dev#2229's
  cfg.rs and code_loads.rs, drop dxc.rs as main does.
- dxil/kernel.rs (6): TRANSLATOR_VERSION 13 (main 12; the stack's xcl-dev#2229
  head output differs, as on linux/stack-nvidia-dev); main's rt32 entry
  points with xcl-dev#2229's code_loads.
- dxil/lower.rs (4), lower_mem.rs (3), lower_window.rs (1), recomp/emit.rs
  (11), recomp/mod.rs (3), recomp/tests.rs (1), core_tests.rs: main has
  an earlier copy of xcl-dev#2229 (41f1a85); xcl-dev#2229's head (code_loads, xcl_cload
  / xcl_gload(hi, a)) is kept over it, as on linux/stack-nvidia-dev;
  main's loop_ids, IO slots, ps_mask_live_scc and rt32 mask kept beside
  it, and main's duplicate core_tests copy of the rodata test goes.
  lower_mem.rs keeps the stack's scratch_ptr insert-before-terminator line.
- real.rs (6): the class scan keeps `own` with main's
  release_through_its_own_vtable; xcl-dev#2477's in-place patch after main's
  two-pass defer hooks; q_signal_pc / q_wait_pc beside main's page
  mappings; the title ExecuteCommandLists keeps xcl-dev#867's list guards inside
  main's watch::in_driver scope; test modules of both.
- list_x.rs (1): xcl-dev#867's allocator / PSO guards with main's `on = pc_alloc`.
- sparse.rs (1): main's new_state, with xcl-dev#867's raw fences for the sparse
  and readback fences and the async readback fence pairs (as on
  linux/stack-nvidia-dev); pc_execute (main's texture_upload submit path)
  unadopts its list for the submit.
- title_textures.rs (1): main's early fence creation, as a raw fence.
- dstorage.rs (4): xcl-dev#2864's unpack cache on main's Cow source and stage
  buffers.
- xg.rs (2): main's copy_args (adccb7d) covers xcl-dev#684's argument fix;
  xcl-dev#684's destination guard kept.
- present.rs (1), gpu_compute_e2e.rs (1), README.md (2): tests and text
  of both.

linux/README.md: main line updated; xcl-dev#1599, xcl-dev#2082, xcl-dev#1803, xcl-dev#3090, xcl-dev#688,
xcl-dev#3091 and the stack-only multidimensional row leave the table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brainhay5

Copy link
Copy Markdown

merge-check claim
head: e07d03b

@brainhay5

Copy link
Copy Markdown

merge-check
base: 9335bc0
head: e07d03b
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2800 passed, 2 failed, 50 ignored; 32 SKIPPED lines
failing: hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline
failing: test_title_runs_and_game_folder_is_untouched
both also fail on the base alone (the same two, run on 9335bc0 with this base) -> neither is this PR's
note: the first run of the suite aborted early — a background xcl-pso-ahead-2 panic ended the lib test binary before its result line (the flake #3041 documents; counts were 138 passed, not usable). Rerun of the same tree gave the totals above.
review: two files, +65/-2. create_placed_resource_x now sizes a texture through a new console_bytes, which keeps XG's size where XG has one and, for a 3-D texture XG does not lay out (render targets, e.g. 33x33x33 RGBA16F colour LUTs 512 KiB apart), falls back to the texels' bytes across levels (volume_texel_bytes, format via xg::element). Before this, such a texture was given every tile of its PC counterpart as a page at its address, so neighbouring LUTs shared pages and overwrote each other's rows — the bug described in the title. Returns None for non-3-D and unknown formats, so nothing else changes. The test builds a 33³ RGBA16F volume target and asserts its pages do not overlap its neighbour's, plus that a sampled 3-D texture keeps XG's size, so it fails without the change. Scope is contained; no unrelated edits.
performance: negligible — the size is computed once per placed-resource creation, no per-frame work, no new allocation in a hot path.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Nov 30, 2026
@johnbf8x

Copy link
Copy Markdown

merge-check claim
head: e07d03b

@johnbf8x

Copy link
Copy Markdown

merge-check
base: cb80246
head: e07d03b
merge: clean (git merge --no-commit --no-ff onto origin/main in a detached worktree; the merged tree was tested uncommitted)
build: cargo build --workspace -> ok (the PR merged and main alike, each in its own target dir)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> main and PR the same: 137 passed, 2 failed, 20 ignored outside the lib; the lib binary ends abnormally on both (0x80004005), so no lib total. SKIPPED: 28 on both (22 no wave64, 3 f16/f32 per-lane forms refused, 2 no heap windows, 1 no D3D12 debug layer). Failing: e2e test_title_draws_with_a_root_signature_under_the_debug_layer and test_title_runs_under_the_debug_layer_with_dred (no D3D12 debug layer on this PC), both fail on main too. The lib in parts: hle::d3d12x::list_x alone on 1 thread 113 passed on both; the rest on 4 threads, 0 failed before the process ends on both (PR 1744 ok, main 1743 ok). Next to the change, on 1 thread: hle::d3d12x::device_x::tests:: and hle::d3d12x::vram::tests:: PR 90 passed, main 89 passed, 0 failed, 1 ignored on both; the new volume_targets_xg_does_not_lay_out_keep_to_their_texels passes
review: none blocking, after reading the whole diff (device_x.rs, vram.rs). console_bytes keeps XG's size wherever XG gives one, so only textures XG refuses change, and volume_texel_bytes returns None for anything but a 3-D texture with a format xg::element knows, so those keep the old path. The arithmetic is checked (checked_mul / checked_add, mips capped at 16, a full chain when the desc says 0 mips). The texels' bytes are a lower bound of any console layout, as the description says; if the console lays such a texture out larger, the pages past its texels are not given to it, and what that does in a title is not tested here. owned_pages only becomes pub(super) for the test. The new test cannot run against main (it calls the new function), so "fails without the change" is by reading: on main this desc gets None and every PC tile as a page. Not run with the title of #505
performance: none expected: one desc parse per CreatePlacedResourceX of a texture, and only for 3-D textures XG refuses (reasoned, not measured)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3070 Ti 8 GB (driver 621.40), Intel Core i7-12700K, Windows 10 Pro 19045, rustc 1.100.0 / Claude Code, Claude Opus 5.5

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Nov 30, 2026
@Prime1997
Prime1997 merged commit a798017 into xcl-dev:main Nov 30, 2026
2 checks passed
dudenudem pushed a commit to dudenudem/xcl that referenced this pull request Nov 30, 2026
Keeps upstream's DXIL IR cuts (xcl-dev#3500-xcl-dev#3503/xcl-dev#3495-xcl-dev#3499: sampler waterfall,
descriptor windows, split-wave64 mask exchange, per-lane exec, direct PS
masks, quad shuffles, packed/normalized buffer decode, commit-aware
compiles), xcl-dev#3269 fixed-point optimizer, xcl-dev#3154 compact compute prologue,
xcl-dev#2123 split atomic add, xcl-dev#2070 offline 64 MB stacks, xcl-dev#3442 split-whole,
xcl-dev#1319 root-constant bounds, xcl-dev#3356 late Reset releases, xcl-dev#1322 empty-BVH/NaN
rays, xcl-dev#2753 3-D texture sizing, XMA/VFS/TLS/loader fixes.

Resolutions:
- real.rs: union of T-156 res_release pinning with upstream's InListReset
  and abi_rs_for_stages; dropped upstream's warm_graphics (T-095 removed
  that path); kept ComputeBuild::IndirectChain for our split-chain variant.
- dispatch_chain.rs: kept our IndirectBuild split-chain architecture (the
  T-095 port removed the preload/whole-worker machinery upstream builds
  on); ported upstream's huge-PSO refusal log.
- pso_async.rs: took upstream's commit-aware build_pieces/build_scoped and
  WORKER_STACK, removed the preload/backlog subsystem our port does not
  have (and its tests), kept our profile_is_series_s.
- late_release.rs: took upstream's Dead enum, Busy/InListReset and
  hold_pipeline/hold_heap/hold_unmap, with our vram release path (no
  recycle pool).
- emit.rs: upstream's additions moved into emit/memory.rs (ADD_TID_ENABLE),
  emit/exp.rs (misc-vector layer/viewport), emit/mimg.rs (SampleCmp with
  bias gradients), emit/valu.rs (abs/neg on shift/align), emit.rs out_struct.
- bind.rs: root-constant bounds clamp + its test; kept our bool
  execute_indirect API.
- bvh.rs: our grow/tri_ret/watertight model plus upstream's empty-root
  bounds and NaN-ray refusal.
- kernel.rs: upstream's mask/waterfall/rodata cuts plus our lanes_upper.
- shaders.rs: upstream's worker stack helpers and mesh/GS precompile paths,
  with our PipelineJob record identity.
- eh.rs: upstream's CLWB TF guard + test, our termination test.
- lower.rs test: 574bda4 makes wave32 SALU words compute S_WQM without
  quad lanes; assert that and keep the wave64 refusal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) ready-to-merge Has 2 independent safe merge-checks on current head (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.