D3D12.X: discard newly backed placed and reserved targets (#940) #1342

Open
github-bot wants to merge 1 commit from github-bot/gh-1342 into main AGit
Owner

@⁠eizispark on GitHub · 2026-11-24 15:00 UTC · original
eizispark:fix/940-discard-fresh-targets → main · +217 −24 · 1 files · 1 commits · open

D3D12 resources created with CreatePlacedResource or CreateReservedResource and ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL start uninitialized; transitioning or using them before a DiscardResource, Clear*View, or Copy* triggers debug-layer error 1422 (RENDER_TARGET_OR_DEPTH_STENCIL_RESOURCENOTINITIALIZED, #940) and leaves target compression metadata uninitialized. Placements that alias existing live or < 2 s idle memory at the same title address (vram::Arenas reusing an arena or vram::Pages sharing any existing 64 KiB page) must keep earlier GPU writes intact and must not be discarded.

Part of #940 (handles message 1422 on newly backed placed and reserved render targets and depth-stencil buffers; messages 538 and 824 remain separate).

What is in it

  • crates/xcl/src/hle/d3d12x/vram.rs: return a fresh flag from Arenas::take (true only when a new arena heap is created) and Pages::bind (true only when none of the target's tiles reused an existing pages or extra_pages entry). When a freshly backed placement carries ALLOW_DEPTH_STENCIL or ALLOW_RENDER_TARGET, synchronously submit DiscardResource on a per-device internal direct queue inside title_textures::own_work (after waiting on the Pages tile-mapping fence for reserved placements), transitioning to DEPTH_WRITE or RENDER_TARGET and restoring the initial state before place returns.
  • crates/xcl/src/hle/d3d12x/vram.rs (tests): add fresh_targets_need_discard_once_and_aliased_arenas_do_not (unit test for Arenas::take freshness across live, < 2 s idle, and swept arenas plus discard_target_state) and fresh_placed_and_reserved_targets_discard_without_wiping_aliases (GPU test verifying fresh arena D32S8 and fresh reserved R8G8B8A8_UNORM targets discard once, preserve non-target initial states across the discard, and do not discard or overwrite pixels when aliased at the same title address).

Tested

  • Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (driver 32.0.32015.16001), rustc 1.100.0 (0ef1bc386 2026-11-09), debug and release.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on the head, rebased onto main 426a5a7: 1242 passed, 3 failed – gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_3 and gpu::recomp::tests::gpu_image_get_resinfo_past_last_level, which fail the same way on a clean main 426a5a7 on this adapter; 46 ignored.
  • cargo test -p xcl --lib hle::d3d12x::vram -- --test-threads=4, 3 consecutive runs: 17 passed, 0 failed, 1 ignored on each run.
  • fresh_placed_and_reserved_targets_discard_without_wiping_aliases failed before discard_fresh was wired in: discards() stayed 0.

Regression run

main:

xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1680 (PresentX 1680)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14599 MB

PR head:

xcl-smoke v1
commit: 457314409b46999cdc7294fb44fb464b6e67c806
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14608 MB

Not tested

  • A debug-layer count on a retail run on this host (Windows Graphics Tools is not installed here; @⁠jessenic's RTX 5070 Ti run covers it).
  • Intel GPUs, Windows 10, wave32-only adapters, and XCL_SAMPLE_* sample-data tests.

AI use

  • Antigravity (Google DeepMind, Gemini 4 Carbon) – investigated #940 message 1422, wrote the fix and tests, and ran the test suite and smoke check. Antigravity (Claude Opus 5.5) – rebased it onto main 426a5a7 (kept canonical_va next to the discard helpers and updated the new arena tests to the 4-field Arenas::take result), and reran the suite and the smoke pair.
**@⁠eizispark** on GitHub · 2026-11-24 15:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342) `eizispark:fix/940-discard-fresh-targets` → `main` · +217 −24 · 1 files · 1 commits · open D3D12 resources created with `CreatePlacedResource` or `CreateReservedResource` and `ALLOW_RENDER_TARGET` or `ALLOW_DEPTH_STENCIL` start uninitialized; transitioning or using them before a `DiscardResource`, `Clear*View`, or `Copy*` triggers debug-layer error 1422 (`RENDER_TARGET_OR_DEPTH_STENCIL_RESOURCENOTINITIALIZED`, #940) and leaves target compression metadata uninitialized. Placements that alias existing live or `< 2 s` idle memory at the same title address (`vram::Arenas` reusing an arena or `vram::Pages` sharing any existing 64 KiB page) must keep earlier GPU writes intact and must not be discarded. Part of #940 (handles message 1422 on newly backed placed and reserved render targets and depth-stencil buffers; messages 538 and 824 remain separate). **What is in it** - `crates/xcl/src/hle/d3d12x/vram.rs`: return a `fresh` flag from `Arenas::take` (true only when a new arena heap is created) and `Pages::bind` (true only when none of the target's tiles reused an existing `pages` or `extra_pages` entry). When a freshly backed placement carries `ALLOW_DEPTH_STENCIL` or `ALLOW_RENDER_TARGET`, synchronously submit `DiscardResource` on a per-device internal direct queue inside `title_textures::own_work` (after waiting on the `Pages` tile-mapping fence for reserved placements), transitioning to `DEPTH_WRITE` or `RENDER_TARGET` and restoring the initial state before `place` returns. - `crates/xcl/src/hle/d3d12x/vram.rs` (`tests`): add `fresh_targets_need_discard_once_and_aliased_arenas_do_not` (unit test for `Arenas::take` freshness across live, `< 2 s` idle, and swept arenas plus `discard_target_state`) and `fresh_placed_and_reserved_targets_discard_without_wiping_aliases` (GPU test verifying fresh arena `D32S8` and fresh reserved `R8G8B8A8_UNORM` targets discard once, preserve non-target initial states across the discard, and do not discard or overwrite pixels when aliased at the same title address). **Tested** - Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (driver `32.0.32015.16001`), `rustc 1.100.0 (0ef1bc386 2026-11-09)`, debug and release. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on the head, rebased onto `main` `426a5a7`: 1242 passed, 3 failed – `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`, `fuzz_validate_and_gpu_3` and `gpu::recomp::tests::gpu_image_get_resinfo_past_last_level`, which fail the same way on a clean `main` `426a5a7` on this adapter; 46 ignored. - `cargo test -p xcl --lib hle::d3d12x::vram -- --test-threads=4`, 3 consecutive runs: 17 passed, 0 failed, 1 ignored on each run. - `fresh_placed_and_reserved_targets_discard_without_wiping_aliases` failed before `discard_fresh` was wired in: `discards()` stayed 0. **Regression run** `main`: ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1680 (PresentX 1680) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14599 MB ``` PR head: ``` xcl-smoke v1 commit: 457314409b46999cdc7294fb44fb464b6e67c806 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1677 (PresentX 1677) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14608 MB ``` **Not tested** - A debug-layer count on a retail run on this host (Windows Graphics Tools is not installed here; @⁠jessenic's RTX 5070 Ti run covers it). - Intel GPUs, Windows 10, wave32-only adapters, and `XCL_SAMPLE_*` sample-data tests. **AI use** - Antigravity (Google DeepMind, Gemini 4 Carbon) – investigated #940 message 1422, wrote the fix and tests, and ran the test suite and smoke check. Antigravity (Claude Opus 5.5) – rebased it onto `main` `426a5a7` (kept `canonical_va` next to the discard helpers and updated the new arena tests to the 4-field `Arenas::take` result), and reran the suite and the smoke pair.
D3D12 placed and reserved resources created with ALLOW_RENDER_TARGET or
ALLOW_DEPTH_STENCIL start uninitialized; using or transitioning them
before a DiscardResource, Clear*View, or Copy* triggers debug-layer
error 1422 (RENDER_TARGET_OR_DEPTH_STENCIL_RESOURCENOTINITIALIZED) and
leaves target compression metadata uninitialized.

Track whether a placement in vram::Pages::bind or vram::Arenas::take
allocated exclusively fresh backing rather than sharing existing live or
idle pages or an existing arena. When a render-target or depth-stencil
placement is freshly backed, synchronously submit DiscardResource on an
internal direct queue (after waiting on the tile-mapping fence for
reserved placements) while preserving the resource's initial state and
leaving aliased placements untouched.

Part of #940.

Assisted-by: Antigravity (Google DeepMind, Gemini 4 Carbon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:51:20 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 15:08 UTC · original

Full-suite run, since this PR has no test report yet: the new test fails on both GPUs here, on its expected clear colour. Tested exact head 39c1824 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 708 passed, 1 failed, 21 ignored in the xcl lib, so cargo stops before the other test binaries. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • Failed: fresh_placed_and_reserved_targets_discard_without_wiping_aliases (vram.rs:1222), 3 of 3 runs on its own too: left: [64, 127, 191, 255], right: [64, 128, 191, 255]. The other checks in that test (discard counts, the aliased depth/stencil keeping 0.375 / 0x3C) passed before it.
  • The render target is cleared to [0.25, 0.5, 0.75, 1.0] as R8G8B8A8_UNORM, and 0.5 × 255 = 127.5 is exactly halfway between two bytes. Both drivers here give 127, and D3D's float-to-UNORM conversion has a tolerance, so 128 isn't guaranteed. Clearing to a value off the halfway point (or allowing ±1 per channel) would make the check portable.
  • The new tests ran and passed: fresh_targets_need_discard_once_and_aliased_arenas_do_not.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: the same single failure with the same bytes ([64, 127, 191, 255]), 708 passed.

Not tested

  • The test binaries after the xcl lib, a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 15:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342#issuecomment-7135519960) Full-suite run, since this PR has no test report yet: **the new test fails on both GPUs here**, on its expected clear colour. Tested exact head `39c1824` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **708 passed, 1 failed, 21 ignored** in the xcl lib, so cargo stops before the other test binaries. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - Failed: `fresh_placed_and_reserved_targets_discard_without_wiping_aliases` (`vram.rs:1222`), 3 of 3 runs on its own too: `left: [64, 127, 191, 255]`, `right: [64, 128, 191, 255]`. The other checks in that test (discard counts, the aliased depth/stencil keeping 0.375 / 0x3C) passed before it. - The render target is cleared to `[0.25, 0.5, 0.75, 1.0]` as `R8G8B8A8_UNORM`, and 0.5 × 255 = 127.5 is exactly halfway between two bytes. Both drivers here give 127, and D3D's float-to-UNORM conversion has a tolerance, so 128 isn't guaranteed. Clearing to a value off the halfway point (or allowing ±1 per channel) would make the check portable. - The new tests ran and passed: `fresh_targets_need_discard_once_and_aliased_arenas_do_not`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: the same single failure with the same bytes (`[64, 127, 191, 255]`), 708 passed. **Not tested** - The test binaries after the xcl lib, a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 15:28 UTC · original

A regression run under Wine on Linux, on a retail title.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 39c1824 as it is and main 930e8b4, no uncommitted changes. Retail title 1.0.2.1, scripts/linux/smoke.sh (#257) for 60 s, no input. Nine runs in a row, main first and last, other PRs in between.
  • A regression check: I did not check whether GTA VI reaches the changed code in these 60 s.

Regression run

main (first run):

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1371 (PresentX 1371)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

this PR:

xcl-smoke v1
commit: 39c18245a55e5f3e550c7b9efe4d97d9b4755c88
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1359 (PresentX 1359)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

The last main run: 1338 frames, exit: 0x0, no device removal, no crash. Under Wine, peak commit reads 0 MB, so these blocks do not check memory.

Not tested

  • the test suite on this head; native Windows; AMD.

AI use

  • Claude Code (Claude Opus 5.5) built both commits, ran the runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
**@⁠JoaoPauluu** on GitHub · 2026-11-24 15:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342#issuecomment-7136077539) A regression run under Wine on Linux, on a retail title. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `39c1824` as it is and `main` `930e8b4`, no uncommitted changes. Retail title 1.0.2.1, `scripts/linux/smoke.sh` (#257) for 60 s, no input. Nine runs in a row, `main` first and last, other PRs in between. - A regression check: I did not check whether GTA VI reaches the changed code in these 60 s. **Regression run** main (first run): ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1371 (PresentX 1371) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` this PR: ``` xcl-smoke v1 commit: 39c18245a55e5f3e550c7b9efe4d97d9b4755c88 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1359 (PresentX 1359) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` The last `main` run: 1338 frames, `exit: 0x0`, no device removal, no crash. Under Wine, `peak commit` reads 0 MB, so these blocks do not check memory. **Not tested** - the test suite on this head; native Windows; AMD. **AI use** - Claude Code (Claude Opus 5.5) built both commits, ran the runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
Author
Owner

@⁠Mischief8713 on GitHub · 2026-11-24 15:55 UTC · original

GPU run of 39c1824 on Windows (NVIDIA GTX 1660 Ti, Turing): fresh_placed_and_reserved_targets_discard_without_wiping_aliases fails with 127 where 128 is expected

Tested

  • NVIDIA GeForce GTX 1660 Ti 6 GB (Turing, driver 32.0.16.2114), Ryzen 5 2600X, Windows 11 (10.0.26300), rustc 1.100.0, debug build
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64)
  • main at 930e8b4 on the same machine: lib 707 passed, 0 failed, 21 ignored; e2e 3 passed
  • The head contains current main (930e8b4).
  • lib: 708 passed, 1 failed, 21 ignored. The failure is hle::d3d12x::vram::tests::fresh_placed_and_reserved_targets_discard_without_wiping_aliases at vram.rs:1222: left [64, 127, 191, 255], right [64, 128, 191, 255].
  • The failing check is the tiled render target cleared to [0.25, 0.5, 0.75, 1.0]. 0.5 times 255 is 127.5, an exact tie, and this driver converts it to 127. The other three channels match.

What this adds: the same 127 versus 128 is already reported on an RTX 5070 Ti and a Radeon iGPU. A third driver family on a different architecture shows it, which points at the test comparing an exact tie, not at a driver bug. A clear value that is not a tie (for example 0.502) or a tolerance of one would make the test independent of the driver's tie-breaking. I have not run that change.

Not tested

  • No retail title and no scripts/smoke.ps1 run, so no regression run
  • AMD GPUs; only Turing was run here
  • No change was tried to see whether the test passes with a non-tie clear value

AI use

  • Claude Code with Claude Sonnet 5.5 ran the commands and wrote this report. I checked the output.
**@⁠Mischief8713** on GitHub · 2026-11-24 15:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342#issuecomment-7136829081) **GPU run of `39c1824` on Windows (NVIDIA GTX 1660 Ti, Turing): `fresh_placed_and_reserved_targets_discard_without_wiping_aliases` fails with 127 where 128 is expected** **Tested** - NVIDIA GeForce GTX 1660 Ti 6 GB (Turing, driver 32.0.16.2114), Ryzen 5 2600X, Windows 11 (10.0.26300), rustc 1.100.0, debug build - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64) - `main` at `930e8b4` on the same machine: lib 707 passed, 0 failed, 21 ignored; `e2e` 3 passed - The head contains current `main` (`930e8b4`). - lib: 708 passed, 1 failed, 21 ignored. The failure is `hle::d3d12x::vram::tests::fresh_placed_and_reserved_targets_discard_without_wiping_aliases` at `vram.rs:1222`: left `[64, 127, 191, 255]`, right `[64, 128, 191, 255]`. - The failing check is the tiled render target cleared to `[0.25, 0.5, 0.75, 1.0]`. 0.5 times 255 is 127.5, an exact tie, and this driver converts it to 127. The other three channels match. **What this adds:** the same 127 versus 128 is already reported on an RTX 5070 Ti and a Radeon iGPU. A third driver family on a different architecture shows it, which points at the test comparing an exact tie, not at a driver bug. A clear value that is not a tie (for example 0.502) or a tolerance of one would make the test independent of the driver's tie-breaking. I have not run that change. **Not tested** - No retail title and no `scripts/smoke.ps1` run, so no regression run - AMD GPUs; only Turing was run here - No change was tried to see whether the test passes with a non-tie clear value **AI use** - Claude Code with Claude Sonnet 5.5 ran the commands and wrote this report. I checked the output.
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 15:57 UTC · original

Thanks @⁠futurepro62 for running with the D3D12 debug layer enabled and catching the 0.5 * 255 = 127.5 halfway tie on RTX 5070 Ti and the 9800X3D RDNA2 iGPU, and thanks @⁠JoaoPauluu for the Linux/Wine NVIDIA regression run.

Updated fresh_placed_and_reserved_targets_discard_without_wiping_aliases to clear the R8G8B8A8_UNORM target to [0.2, 0.4, 0.6, 1.0] ([51, 102, 153, 255], exact integers on every adapter), rebased onto main as ebdbae3, and refreshed the PR description with new workspace test and 60 s xcl-smoke results on ebdbae3.

AI use: Antigravity (Gemini 4 Carbon)

**@⁠eizispark** on GitHub · 2026-11-24 15:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342#issuecomment-7136900616) Thanks @⁠futurepro62 for running with the D3D12 debug layer enabled and catching the `0.5 * 255 = 127.5` halfway tie on RTX 5070 Ti and the 9800X3D RDNA2 iGPU, and thanks @⁠JoaoPauluu for the Linux/Wine NVIDIA regression run. Updated `fresh_placed_and_reserved_targets_discard_without_wiping_aliases` to clear the `R8G8B8A8_UNORM` target to `[0.2, 0.4, 0.6, 1.0]` (`[51, 102, 153, 255]`, exact integers on every adapter), rebased onto `main` as `ebdbae3`, and refreshed the PR description with new workspace test and 60 s `xcl-smoke` results on `ebdbae3`. AI use: Antigravity (Gemini 4 Carbon)
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 16:11 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 16:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342#issuecomment-7137257348) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. Thanks!
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 16:51 UTC · original

Retest of the new head ebdbae3: passes on both GPUs. The new clear colour [0.2, 0.4, 0.6, 1.0] maps to exact bytes (51, 102, 153), so no channel lands on a rounding tie any more.

  • RTX 5070 Ti (driver 616.64), XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored.
  • AMD Radeon iGPU of the 9800X3D (RDNA2), XCL_ADAPTER=radeon, same command: 753 passed, 0 failed, 41 ignored, nothing skipped.
  • fresh_placed_and_reserved_targets_discard_without_wiping_aliases is ok on both. Last time it failed on both with [64, 127, 191, 255].

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this comment. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 16:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342#issuecomment-7138323770) Retest of the new head `ebdbae3`: **passes on both GPUs.** The new clear colour `[0.2, 0.4, 0.6, 1.0]` maps to exact bytes (51, 102, 153), so no channel lands on a rounding tie any more. - RTX 5070 Ti (driver 616.64), `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **753 passed, 0 failed, 41 ignored**. - AMD Radeon iGPU of the 9800X3D (RDNA2), `XCL_ADAPTER=radeon`, same command: **753 passed, 0 failed, 41 ignored**, nothing skipped. - `fresh_placed_and_reserved_targets_discard_without_wiping_aliases` is `ok` on both. Last time it failed on both with `[64, 127, 191, 255]`. **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this comment. I checked it before posting.
Author
Owner

@⁠jessenic on GitHub · 2026-11-25 09:05 UTC · original

Test report: on a retail title with the D3D12 debug layer, this PR removes the id 1422 errors (render and depth targets used before they are initialised). The title still ends at the same later device removal, which is not this PR's.

Setup: RTX 5070 Ti 16 GB (driver 610.88), Ryzen 7 9700X, 32 GB, Windows 11 Pro 26300, rustc 1.97.0, release. Retail title, Series S profile (device_type = "lockhart"), story load with scripted A presses, XCL_D3D12_DEBUG=1.

Tree: a local integration branch on main 8f5fca5 with #1323, #1143, #1221, #765, #1405, #1464, #751, #684, #1110, #615, #1315/#1316, #495, #1993, #2009, #929, #1291 and a local port of #640. This PR's bb12dd7 was cherry-picked on top as 70e76ee. The only conflict was with the #640 port in place_on_pages (vram.rs): #640's two new Target fields were kept, and so were this PR's fresh / after_map and its return value.

debug-layer runs id 1422 messages how they end
without this PR 2 8 in each (the log's per-id cap), from the first frames of the world 0x887a0005 after the intro's title card
with this PR 2 0 0x887a0005 at the same point (#101 + 7–9 s)
  • The user watching the runs without this PR saw a block of static in the top-left of the window before the removal. They did not see it in a later run, so I can't tie it to this PR from one run.
  • cargo test -p xcl --lib -- vram on this tree: 18 passed, 1 failed, 1 ignored with --test-threads=1. The failure is #640's page_budget_one_placement_at_the_cap_evicts_one_batch (33 evictions instead of 32). It fails only when this PR's fresh_placed_and_reserved_targets_discard_without_wiping_aliases runs before it on the same device. It passes alone (3 of 3), and with this PR's GPU test skipped the rest pass 16/0/1. So the two PRs' tests share state on the device; it matters only if both are merged.

Not tested: main alone; AMD; Series X; more than two runs with the PR; not a scripts/smoke.ps1 regression run.

AI use: Claude Code (Claude Opus 5.5) resolved the cherry-pick, ran the runs and tests on the machine above and wrote this report.

**@⁠jessenic** on GitHub · 2026-11-25 09:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342#issuecomment-7157853969) **Test report: on a retail title with the D3D12 debug layer, this PR removes the id 1422 errors (render and depth targets used before they are initialised). The title still ends at the same later device removal, which is not this PR's.** **Setup:** RTX 5070 Ti 16 GB (driver 610.88), Ryzen 7 9700X, 32 GB, Windows 11 Pro 26300, rustc 1.97.0, release. Retail title, Series S profile (`device_type = "lockhart"`), story load with scripted A presses, `XCL_D3D12_DEBUG=1`. **Tree:** a local integration branch on `main` `8f5fca5` with #1323, #1143, #1221, #765, #1405, #1464, #751, #684, #1110, #615, #1315/#1316, #495, #1993, #2009, #929, #1291 and a local port of #640. This PR's `bb12dd7` was cherry-picked on top as `70e76ee`. The only conflict was with the #640 port in `place_on_pages` (`vram.rs`): #640's two new `Target` fields were kept, and so were this PR's `fresh` / `after_map` and its return value. | | debug-layer runs | id 1422 messages | how they end | |---|---|---|---| | without this PR | 2 | 8 in each (the log's per-id cap), from the first frames of the world | `0x887a0005` after the intro's title card | | with this PR | 2 | 0 | `0x887a0005` at the same point (`#101` + 7–9 s) | - The user watching the runs without this PR saw a block of static in the top-left of the window before the removal. They did not see it in a later run, so I can't tie it to this PR from one run. - `cargo test -p xcl --lib -- vram` on this tree: 18 passed, 1 failed, 1 ignored with `--test-threads=1`. The failure is #640's `page_budget_one_placement_at_the_cap_evicts_one_batch` (33 evictions instead of 32). It fails only when this PR's `fresh_placed_and_reserved_targets_discard_without_wiping_aliases` runs before it on the same device. It passes alone (3 of 3), and with this PR's GPU test skipped the rest pass 16/0/1. So the two PRs' tests share state on the device; it matters only if both are merged. **Not tested:** `main` alone; AMD; Series X; more than two runs with the PR; not a `scripts/smoke.ps1` regression run. **AI use:** Claude Code (Claude Opus 5.5) resolved the cherry-pick, ran the runs and tests on the machine above and wrote this report.
Author
Owner

@⁠eizispark on GitHub · 2026-11-25 11:45 UTC · original

Rebased onto main 426a5a7 as 4573144. Thanks @⁠jessenic for the debug-layer run; that covers the retail check I couldn't do on this host.

main had added canonical_va (mirror aliasing) in the same spot as discard_fresh, and both are kept. canonical_va runs before Arenas::take / Pages::bind, so a GPU mirror view that lands on an existing arena or page counts as an alias, not as a fresh placement, and is not discarded. The new arena tests from #1990 / 5a515f0 were updated to the 4-field take() result.

On the RX 9070 XT: vram, 3 runs × 17 passed. Full workspace: 1242 passed; the 3 failures also fail on a clean main 426a5a7 here. New smoke pair in the description: 1680 frames on main, 1677 on the PR, no removals or crashes.

**@⁠eizispark** on GitHub · 2026-11-25 11:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342#issuecomment-7161458184) Rebased onto `main` `426a5a7` as `4573144`. Thanks @⁠jessenic for the debug-layer run; that covers the retail check I couldn't do on this host. `main` had added `canonical_va` (mirror aliasing) in the same spot as `discard_fresh`, and both are kept. `canonical_va` runs before `Arenas::take` / `Pages::bind`, so a GPU mirror view that lands on an existing arena or page counts as an alias, not as a fresh placement, and is not discarded. The new arena tests from #1990 / `5a515f0` were updated to the 4-field `take()` result. On the RX 9070 XT: `vram`, 3 runs × 17 passed. Full workspace: 1242 passed; the 3 failures also fail on a clean `main` `426a5a7` here. New smoke pair in the description: 1680 frames on main, 1677 on the PR, no removals or crashes.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 04:53 UTC · original

Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-26 04:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1342#issuecomment-7182990384) Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/hle/d3d12x/vram.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1342/head:github-bot/gh-1342'
git switch 'github-bot/gh-1342'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1342'
git switch 'github-bot/gh-1342'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1342'
git switch 'github-bot/gh-1342'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1342'
git switch 'main'
git merge --squash 'github-bot/gh-1342'
git switch 'main'
git merge --ff-only 'github-bot/gh-1342'
git switch 'main'
git merge 'github-bot/gh-1342'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.