D3D12.X: fix title texture skip hash on remap, one read, no poison (#504) #503

Closed
Grimkaaah wants to merge 1 commit from upstream-pr/508 into main
Grimkaaah commented 2026-11-24 01:06:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Grimkaaah on 2026-11-24T01:06:53Z.


Summary

  • Clear LAST_CONTENT for every texture in to_unmap / to_remap so a remapped texture is re-uploaded even when its CPU bytes are unchanged (#504.1).
  • Read title memory once per upload: hash + subresources_from share the same snapshot (no double-read / TOCTOU) (#504.2).
  • Remember content hashes only after upload_batch succeeds for that item — a failed upload no longer poisons the skip cache (#504.3).

Fixes #504

Test plan

  • cargo test -p xcl --lib hle::d3d12x::title_textures::tests::last_content
  • cargo test -p xcl --lib hle::d3d12x::title_textures::tests::a_texture_with_unchanged_memory
<!-- greyfinch-sync:ivall/xcl:issue:5464112452 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/508). Originally posted by [Grimkaaah](https://github.com/Grimkaaah) on 2026-11-24T01:06:53Z. --- ## Summary - Clear `LAST_CONTENT` for every texture in `to_unmap` / `to_remap` so a remapped texture is re-uploaded even when its CPU bytes are unchanged (#504.1). - Read title memory **once** per upload: hash + `subresources_from` share the same snapshot (no double-read / TOCTOU) (#504.2). - Remember content hashes only after `upload_batch` succeeds for that item — a failed upload no longer poisons the skip cache (#504.3). Fixes #504 ## Test plan - [x] `cargo test -p xcl --lib hle::d3d12x::title_textures::tests::last_content` - [x] `cargo test -p xcl --lib hle::d3d12x::title_textures::tests::a_texture_with_unchanged_memory`
thehollowedone commented 2026-11-24 07:05:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-24T01:10:03Z.


The upload path now reads title memory once. There’s one more full copy of the detiled bytes on each cache miss: subs.clone() duplicates every subresource’s owned Vec<u8> while the original batch is still live. Could upload_all push (r, subs, states) directly into the upload list and append (res_key, h) to a parallel list at the same point? That keeps the failure indices aligned and moves the bytes into the batch once. Batch construction at 61ee2a2 · Subresource definition

Tested

On the same commit, cargo test --offline --locked -p xcl --lib hle::d3d12x::title_textures::tests -- --test-threads=1 --nocapture passed 9 tests, with 0 failures, 0 ignored and no reported skips. XCL selected the RTX 3080 Ti (621.35). Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, debug.

Not tested

Full workspace, retail titles, and the performance impact of removing the copy.

AI use

Codex with GPT-6.2 Astra reviewed the upload path, ran the tests and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7118824466 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/508#issuecomment-7118824466). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-24T01:10:03Z. --- The upload path now reads title memory once. There’s one more full copy of the detiled bytes on each cache miss: `subs.clone()` duplicates every subresource’s owned `Vec<u8>` while the original batch is still live. Could `upload_all` push `(r, subs, states)` directly into the upload list and append `(res_key, h)` to a parallel list at the same point? That keeps the failure indices aligned and moves the bytes into the batch once. [Batch construction at 61ee2a2](https://github.com/ivall/xcl/blob/61ee2a280184ba22995ef306609dc18aa975e981/crates/xcl/src/hle/d3d12x/title_textures.rs#L864-L888) · [Subresource definition](https://github.com/ivall/xcl/blob/61ee2a280184ba22995ef306609dc18aa975e981/crates/xcl/src/gpu/texture.rs#L34-L42) **Tested** On the same commit, `cargo test --offline --locked -p xcl --lib hle::d3d12x::title_textures::tests -- --test-threads=1 --nocapture` passed 9 tests, with 0 failures, 0 ignored and no reported skips. XCL selected the RTX 3080 Ti (621.35). Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, debug. **Not tested** Full workspace, retail titles, and the performance impact of removing the copy. **AI use** Codex with GPT-6.2 Astra reviewed the upload path, ran the tests and drafted this report.
Abdellah-Khanani commented 2026-11-24 07:05:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Abdellah-Khanani on 2026-11-24T01:24:47Z.


Tested on AMD RDNA1: no new failures.

  • AMD Radeon RX 5700 XT (RDNA1), driver 32.0.21045.29003; Ryzen 5 2600; Windows 11 Pro 22631; Rust 1.100.0 MSVC, debug.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on this PR's head 61ee2a2 (on top of current main 7ebf1b8): 677 passed, 1 failed, 41 ignored. On main 7ebf1b8 alone: 676 passed, 1 failed, 41 ignored.
  • The one failure is gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction. It fails on main on this adapter too and is unrelated (#472).
  • last_content_is_not_poisoned_by_a_hash_check_alone, a_texture_with_unchanged_memory_is_left_out_until_it_is_forgotten and the other 7 title_textures tests pass. On this adapter placed_title_textures_share_vram_and_preserve_pixels is SKIPPED on main (the driver refuses the reserved cube; see #470), so it does not cover this change here.
  • SKIPPED: gpu_geometry_mode_es_gs_strip, gpu_mesh_mode_two_passes (no mesh shaders).
  • Diff read in full before building. Upload failures are reported by batch index (upload_batch pushes (k, e)), so the failed_idx mapping to keys is right.
  • No retail title run.

Tested with Claude Code (Claude Opus 5.5); the run was on my machine.

<!-- greyfinch-sync:ivall/xcl:comment:7119074480 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/508#issuecomment-7119074480). Originally posted by [Abdellah-Khanani](https://github.com/Abdellah-Khanani) on 2026-11-24T01:24:47Z. --- Tested on AMD RDNA1: no new failures. - AMD Radeon RX 5700 XT (RDNA1), driver 32.0.21045.29003; Ryzen 5 2600; Windows 11 Pro 22631; Rust 1.100.0 MSVC, debug. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on this PR's head 61ee2a2 (on top of current `main` 7ebf1b8): **677 passed, 1 failed, 41 ignored**. On `main` 7ebf1b8 alone: 676 passed, 1 failed, 41 ignored. - The one failure is `gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction`. It fails on `main` on this adapter too and is unrelated (#472). - `last_content_is_not_poisoned_by_a_hash_check_alone`, `a_texture_with_unchanged_memory_is_left_out_until_it_is_forgotten` and the other 7 `title_textures` tests pass. On this adapter `placed_title_textures_share_vram_and_preserve_pixels` is SKIPPED on `main` (the driver refuses the reserved cube; see #470), so it does not cover this change here. - SKIPPED: `gpu_geometry_mode_es_gs_strip`, `gpu_mesh_mode_two_passes` (no mesh shaders). - Diff read in full before building. Upload failures are reported by batch index (`upload_batch` pushes `(k, e)`), so the `failed_idx` mapping to `keys` is right. - No retail title run. Tested with Claude Code (Claude Opus 5.5); the run was on my machine.
gta5all commented 2026-11-24 07:05:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gta5all on 2026-11-24T01:27:04Z.


Review of 8d09824's diff against main (69f0635). The three fixes match #504, and reading the memory once and slicing it gives the same bytes as the old per-slice read_committed calls (size() covers array × slice_bytes, and bytes past the end read as 0 in detile_level / detile_volume). Two things I'd change before it is merged:

1. Every batch's detiled data is copied once more. upload_items clones each item's Vec<Subresource> (up to BATCH_BYTES, 256 MiB, per batch) only to drop the two extra tuple fields. That gives back much of what reading once saves. Keeping batch as the tuple upload_batch takes, with the keys in a separate vec, avoids the copy:

-            batch.push((r, subs, states, res_key, h));
+            batch.push((r, subs, states));
+            keys.push((res_key, h));
-        let upload_items: Vec<_> = batch.iter().map(|(r, subs, states, _, _)| (r.clone(), subs.clone(), states.clone())).collect();
-        let keys: Vec<_> = batch.iter().map(|(_, _, _, res, h)| (*res, *h)).collect();
         match own_work(|| {
             super::vram::before_execute(&queue);
-            texture::upload_batch(dev, &queue, &upload_items)
+            texture::upload_batch(dev, &queue, &batch)
         }) {

(with let mut keys = Vec::new(); next to let mut batch = Vec::new();). Smaller point: with XCL_TEXTURE_SKIP_UNCHANGED=0 the hash is still computed for every upload. let h = if unchanged_skip() { content_hash(&mem) } else { 0 }; only remembers a dummy hash that is never compared.

2. No test fails without the fix for #504.1. last_content_is_not_poisoned_by_a_hash_check_alone checks the helpers only. The placement test misses the remap case because it writes a new pattern (0xD4) before the refresh that follows drop(new_res). Restoring the old texture's memory to what it held at its last upload shows the bug: B's 0x55 write lies inside old_res, so rewriting 0xAA gives the bytes of old_res's last upload while its remapped tiles hold B's data. Without the LAST_CONTENT removal in forget, this upload is skipped and the assert fails:

             drop(new_res);
+            write_tiled(base, &old_desc, 0xAA); // the bytes of old_res's last upload, before B
+            refresh(queue.as_raw());
+            assert_eq!(read_sub(&old_res, 0), subresources(base, &xg::Texture::new(&old_desc).unwrap())[0].data, "#504.1: remapped texture with unchanged memory is uploaded again");
             write_tiled(base, &old_desc, 0xD4);

Also: the multi-line reformatting of the two Subresource { .. } expressions in subresources_from is churn CONTRIBUTING asks to leave out. And the PR description check fails because the description has no Tested (full GPU suite counts), Regression run (the two xcl-smoke blocks), Not tested or AI use sections.

Static review only: I did not build or run this (no Windows machine here). The diffs above are suggestions to check, not tested code.

Written with Claude Code (Claude Opus 5.5), under human review.

<!-- greyfinch-sync:ivall/xcl:comment:7119111725 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/508#issuecomment-7119111725). Originally posted by [gta5all](https://github.com/gta5all) on 2026-11-24T01:27:04Z. --- Review of `8d09824`'s diff against `main` (`69f0635`). The three fixes match #504, and reading the memory once and slicing it gives the same bytes as the old per-slice `read_committed` calls (`size()` covers `array × slice_bytes`, and bytes past the end read as 0 in `detile_level` / `detile_volume`). Two things I'd change before it is merged: **1. Every batch's detiled data is copied once more.** `upload_items` clones each item's `Vec<Subresource>` (up to `BATCH_BYTES`, 256 MiB, per batch) only to drop the two extra tuple fields. That gives back much of what reading once saves. Keeping `batch` as the tuple `upload_batch` takes, with the keys in a separate vec, avoids the copy: ```diff - batch.push((r, subs, states, res_key, h)); + batch.push((r, subs, states)); + keys.push((res_key, h)); ``` ```diff - let upload_items: Vec<_> = batch.iter().map(|(r, subs, states, _, _)| (r.clone(), subs.clone(), states.clone())).collect(); - let keys: Vec<_> = batch.iter().map(|(_, _, _, res, h)| (*res, *h)).collect(); match own_work(|| { super::vram::before_execute(&queue); - texture::upload_batch(dev, &queue, &upload_items) + texture::upload_batch(dev, &queue, &batch) }) { ``` (with `let mut keys = Vec::new();` next to `let mut batch = Vec::new();`). Smaller point: with `XCL_TEXTURE_SKIP_UNCHANGED=0` the hash is still computed for every upload. `let h = if unchanged_skip() { content_hash(&mem) } else { 0 };` only remembers a dummy hash that is never compared. **2. No test fails without the fix for #504.1.** `last_content_is_not_poisoned_by_a_hash_check_alone` checks the helpers only. The placement test misses the remap case because it writes a new pattern (`0xD4`) before the refresh that follows `drop(new_res)`. Restoring the old texture's memory to what it held at its last upload shows the bug: B's `0x55` write lies inside `old_res`, so rewriting `0xAA` gives the bytes of `old_res`'s last upload while its remapped tiles hold B's data. Without the `LAST_CONTENT` removal in `forget`, this upload is skipped and the assert fails: ```diff drop(new_res); + write_tiled(base, &old_desc, 0xAA); // the bytes of old_res's last upload, before B + refresh(queue.as_raw()); + assert_eq!(read_sub(&old_res, 0), subresources(base, &xg::Texture::new(&old_desc).unwrap())[0].data, "#504.1: remapped texture with unchanged memory is uploaded again"); write_tiled(base, &old_desc, 0xD4); ``` Also: the multi-line reformatting of the two `Subresource { .. }` expressions in `subresources_from` is churn CONTRIBUTING asks to leave out. And the `PR description` check fails because the description has no **Tested** (full GPU suite counts), **Regression run** (the two `xcl-smoke` blocks), **Not tested** or **AI use** sections. Static review only: I did not build or run this (no Windows machine here). The diffs above are suggestions to check, not tested code. Written with Claude Code (Claude Opus 5.5), under human review.
Alpha325 commented 2026-11-24 07:05:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Alpha325 on 2026-11-24T01:36:38Z.


I ran the unchanged-source remap regression suggested in review. I applied the same local test-only edits to base 7ebf1b8 and PR head 61ee2a2.

The fixture uploads a 512×512 RGBA8 texture, then places and uploads a smaller texture over part of its address range. While the old texture is still shadowed, the fixture restores the exact CPU bytes from its first upload. It then releases the overlapping texture, calls refresh, and compares the old texture’s GPU readback byte for byte.

Build Uploads after remap Hash skips Wrong readback bytes
Base, cache enabled 0 1 1,045,504 / 1,048,576
Base, cache disabled 1 0 0 / 1,048,576
PR, cache enabled 1 0 0 / 1,048,576

The cache-disabled control isolates the cause: identical CPU bytes do not mean the remapped GPU tiles still contain the old texture. The PR forces the upload and restores the full readback. I’d add this case to placed_title_textures_share_vram_and_preserve_pixels, since the existing fixture writes a different pattern after remapping.

Tested: Radeon RX 9060 XT, driver 32.0.32029.2010, Windows 11, Rust 1.100.0 MSVC x64, release. The PR’s texture test module passed 9/9 with the fixture and no skips. This check covers remap invalidation, not upload-failure handling or snapshot performance.

AI use: OpenAI Codex (GPT-6.2 Sol) wrote the local fixture, ran the tests, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7119271703 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/508#issuecomment-7119271703). Originally posted by [Alpha325](https://github.com/Alpha325) on 2026-11-24T01:36:38Z. --- I ran the unchanged-source remap regression suggested in review. I applied the same local test-only edits to base `7ebf1b8` and PR head `61ee2a2`. The fixture uploads a 512×512 RGBA8 texture, then places and uploads a smaller texture over part of its address range. While the old texture is still shadowed, the fixture restores the exact CPU bytes from its first upload. It then releases the overlapping texture, calls `refresh`, and compares the old texture’s GPU readback byte for byte. | Build | Uploads after remap | Hash skips | Wrong readback bytes | |---|---:|---:|---:| | Base, cache enabled | 0 | 1 | 1,045,504 / 1,048,576 | | Base, cache disabled | 1 | 0 | 0 / 1,048,576 | | PR, cache enabled | 1 | 0 | 0 / 1,048,576 | The cache-disabled control isolates the cause: identical CPU bytes do not mean the remapped GPU tiles still contain the old texture. The PR forces the upload and restores the full readback. I’d add this case to `placed_title_textures_share_vram_and_preserve_pixels`, since the existing fixture writes a different pattern after remapping. **Tested:** Radeon RX 9060 XT, driver `32.0.32029.2010`, Windows 11, Rust 1.100.0 MSVC x64, release. The PR’s texture test module passed 9/9 with the fixture and no skips. This check covers remap invalidation, not upload-failure handling or snapshot performance. **AI use:** OpenAI Codex (GPT-6.2 Sol) wrote the local fixture, ran the tests, and drafted this report.
ryosen0 commented 2026-11-24 07:05:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ryosen0 on 2026-11-24T01:57:22Z.


Test report on NVIDIA (the review thread so far has RDNA1 and code audits): PR head 61ee2a2 merged onto main 508a0c7 (clean merge), release build, RTX 3060 Ti 8 GB (wave32), Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11.

Tested

  • cargo test -p xcl --lib -- --test-threads=1 title_textures xaudio2 acphal on the merge with #468 and #456 also applied (all three touch adjacent paths): 27 passed, 0 failed - including the three new LAST_CONTENT tests (last_content_is_not_poisoned_by_a_hash_check_alone, the unchanged-remap regression, the one-read snapshot).
  • The title_textures GPU tests (gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes, placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted) pass serially on this adapter. Under --test-threads=4 the same set fails on a poisoned lock on unmodified main too (documented in #516's report) - worth running GPU tests serially when reporting counts.
  • Retail run (GTA VI 1.0.2.1, XCL_NETWORK=0 XCL_ACTIVITY=1): the game exited cleanly on its own at t≈34 s during shader warm-up (exit 0x0, no crash, no device removal) - the early-exit behaviour varies run to run on this title; nothing in the log points at the skip path. Not counted as a regression signal either way.

Not tested

  • A long retail run on this PR alone; no visual comparison of remapped textures.

AI use: GPT-6.2 Astra (API model selector) in DSH ran the builds/tests and wrote this comment; the human contributor reviewed it.

<!-- greyfinch-sync:ivall/xcl:comment:7119613936 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/508#issuecomment-7119613936). Originally posted by [ryosen0](https://github.com/ryosen0) on 2026-11-24T01:57:22Z. --- Test report on NVIDIA (the review thread so far has RDNA1 and code audits): PR head `61ee2a2` merged onto `main` `508a0c7` (clean merge), release build, RTX 3060 Ti 8 GB (wave32), Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11. **Tested** - `cargo test -p xcl --lib -- --test-threads=1 title_textures xaudio2 acphal` on the merge with #468 and #456 also applied (all three touch adjacent paths): **27 passed, 0 failed** - including the three new `LAST_CONTENT` tests (`last_content_is_not_poisoned_by_a_hash_check_alone`, the unchanged-remap regression, the one-read snapshot). - The `title_textures` GPU tests (`gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes`, `placed_title_textures_share_vram_and_preserve_pixels`, `transitions_apply_when_their_list_is_submitted`) pass serially on this adapter. Under `--test-threads=4` the same set fails on a poisoned lock on unmodified main too (documented in #516's report) - worth running GPU tests serially when reporting counts. - Retail run (GTA VI 1.0.2.1, `XCL_NETWORK=0 XCL_ACTIVITY=1`): the game exited cleanly on its own at t≈34 s during shader warm-up (exit 0x0, no crash, no device removal) - the early-exit behaviour varies run to run on this title; nothing in the log points at the skip path. Not counted as a regression signal either way. **Not tested** - A long retail run on this PR alone; no visual comparison of remapped textures. AI use: GPT-6.2 Astra (API model selector) in DSH ran the builds/tests and wrote this comment; the human contributor reviewed it.
jacksonslab commented 2026-11-24 07:05:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jacksonslab on 2026-11-24T03:23:55Z.


Tested on a retail title (Windows 11, RTX 4070 SUPER 12 GB, i7-14700K). We hit #504.3 independently: with #486's skip-unchanged on, a failed upload_queue/upload_batch left the content hash recorded, so the texture was never uploaded again. We had a local fix that only forgot the hash on failure; this PR's version is strictly better (also covers remaps with unchanged bytes and the double read). We've replaced our fix with this PR in our test build; title_textures tests pass.

<!-- greyfinch-sync:ivall/xcl:comment:7121050635 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/508#issuecomment-7121050635). Originally posted by [jacksonslab](https://github.com/jacksonslab) on 2026-11-24T03:23:55Z. --- Tested on a retail title (Windows 11, RTX 4070 SUPER 12 GB, i7-14700K). We hit #504.3 independently: with #486's skip-unchanged on, a failed `upload_queue`/`upload_batch` left the content hash recorded, so the texture was never uploaded again. We had a local fix that only forgot the hash on failure; this PR's version is strictly better (also covers remaps with unchanged bytes and the double read). We've replaced our fix with this PR in our test build; `title_textures` tests pass.
Toons29 commented 2026-11-25 03:05:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T02:56:27Z.


Regression run of 61ee2a28 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 61ee2a280184ba22995ef306609dc18aa975e981
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1488 (PresentX 1488)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14799 MB

Against the limits in CONTRIBUTING.md: 92 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7151389122 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/508#issuecomment-7151389122). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T02:56:27Z. --- Regression run of `61ee2a28` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 61ee2a280184ba22995ef306609dc18aa975e981 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1488 (PresentX 1488) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14799 MB ``` Against the limits in CONTRIBUTING.md: 92 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
DavidM1911 commented 2026-11-25 14:10:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T13:53:47Z.


Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7164447276 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/508#issuecomment-7164447276). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T13:53:47Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
andrewDoing commented 2026-11-27 03:46:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T03:46:00Z.


I verified the single-snapshot change on a native RTX 5070 by running the same GPU readback assertion against 61ee2a280184ba22995ef306609dc18aa975e981 and its immediate parent 7ebf1b8044bef8f0ef296eb36e85010cceb4633a.

The fixture uses a 64 × 64 R8 texture backed by ordinary memory. On the first call to upload_all, a one-shot test hook changes the source from A (0x17) to B (0x81) after the hash comparison and before detiling. I then restore A and call upload_all again. A third call changes the source to C (0x56) as a fresh-upload control. All three calls exercise the production upload path. Each readback follows a fence on the upload queue.

Revision First readback After restoring A Fresh C control
Parent 7ebf1b80 4,096 B One skip, 4,096 B 4,096 C
PR 61ee2a28 4,096 A One skip, 4,096 A 4,096 C

The parent failed the expected-A assertion. The PR passed it. Neither test skipped. On the PR, the hash and uploaded pixels describe the same snapshot, so skipping the second upload preserves the correct texture. This checks #504’s double-read case with a controlled source change. Remapping, failed uploads and retail frame time were outside this test.

AI use: OpenAI Codex with GPT-6.2 Astra adapted the fixture and ran the paired native checks; Codex coordinated and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7209254216 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/508#issuecomment-7209254216). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-27T03:46:00Z. --- I verified the single-snapshot change on a native RTX 5070 by running the same GPU readback assertion against `61ee2a280184ba22995ef306609dc18aa975e981` and its immediate parent `7ebf1b8044bef8f0ef296eb36e85010cceb4633a`. The fixture uses a 64 × 64 R8 texture backed by ordinary memory. On the first call to `upload_all`, a one-shot test hook changes the source from A (`0x17`) to B (`0x81`) after the hash comparison and before detiling. I then restore A and call `upload_all` again. A third call changes the source to C (`0x56`) as a fresh-upload control. All three calls exercise the production upload path. Each readback follows a fence on the upload queue. | Revision | First readback | After restoring A | Fresh C control | | --- | --- | --- | --- | | Parent `7ebf1b80` | 4,096 B | One skip, 4,096 B | 4,096 C | | PR `61ee2a28` | 4,096 A | One skip, 4,096 A | 4,096 C | The parent failed the expected-A assertion. The PR passed it. Neither test skipped. On the PR, the hash and uploaded pixels describe the same snapshot, so skipping the second upload preserves the correct texture. This checks #504’s double-read case with a controlled source change. Remapping, failed uploads and retail frame time were outside this test. AI use: OpenAI Codex with GPT-6.2 Astra adapted the fixture and ran the paired native checks; Codex coordinated and prepared this report.
andrewDoing commented 2026-11-27 04:27:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T04:27:34Z.


Follow-up to my snapshot readback on head 61ee2a280184ba22995ef306609dc18aa975e981: a previous successful hash can remain after a later submitted upload returns an outer error. If those submitted bytes reached the texture, restoring the previous source can then incorrectly hit the unchanged-content skip.

In a synthetic 64×64 R8 fixture, A uploaded successfully; B was submitted and a real fence completed; a test-only hook then returned an error at the outer wait boundary. After restoring A, the unmodified head recorded one skip and all 4,096 read-back texels remained B. A local candidate cleared hashes for the attempted resources on the outer batch error: the next A refresh recorded zero skips and all 4,096 texels returned to A. Initial A, B, and a fresh C control each matched in both runs.

The injected error occurred after a successful wait on a healthy device to make the landed-copy case deterministic. This is not a reproduced native driver timeout, device loss, or GTA VI symptom. On a real timeout, staging lifetime and device recovery are separate concerns; hash invalidation alone does not establish either. Retail frequency and performance remain unmeasured.

AI use: OpenAI Codex with GPT-6.2 Astra constructed, ran and independently reviewed the synthetic test and candidate; Codex coordinated and prepared this follow-up.

<!-- greyfinch-sync:ivall/xcl:comment:7209814716 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/508#issuecomment-7209814716). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-27T04:27:34Z. --- Follow-up to my snapshot readback on head `61ee2a280184ba22995ef306609dc18aa975e981`: a previous successful hash can remain after a later submitted upload returns an outer error. If those submitted bytes reached the texture, restoring the previous source can then incorrectly hit the unchanged-content skip. In a synthetic 64×64 R8 fixture, A uploaded successfully; B was submitted and a real fence completed; a test-only hook then returned an error at the outer wait boundary. After restoring A, the unmodified head recorded one skip and all 4,096 read-back texels remained B. A local candidate cleared hashes for the attempted resources on the outer batch error: the next A refresh recorded zero skips and all 4,096 texels returned to A. Initial A, B, and a fresh C control each matched in both runs. The injected error occurred after a successful wait on a healthy device to make the landed-copy case deterministic. This is not a reproduced native driver timeout, device loss, or GTA VI symptom. On a real timeout, staging lifetime and device recovery are separate concerns; hash invalidation alone does not establish either. Retail frequency and performance remain unmeasured. AI use: OpenAI Codex with GPT-6.2 Astra constructed, ran and independently reviewed the synthetic test and candidate; Codex coordinated and prepared this follow-up.
andrewDoing commented 2026-11-27 04:28:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T04:28:34Z.


Related prior work: #2109 discusses clearing LAST_CONTENT after failed batches and preserving retry state, alongside mitigation for repeated waits. That overlaps the hash-invalidation candidate in my previous comment. Its newer uploader also retains timed-out staging resources, so my staging-lifetime caveat applies to the historical #508 head tested here, not automatically to that newer path.

The deterministic A→B→A fixture establishes the cache consequence after an injected completion-report error; it does not identify the queue dependency behind a real title timeout. AI use: OpenAI Codex with GPT-6.2 Astra checked the related discussion; Codex coordinated and prepared this correction.

<!-- greyfinch-sync:ivall/xcl:comment:7209827876 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/508#issuecomment-7209827876). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-27T04:28:34Z. --- Related prior work: #2109 discusses clearing `LAST_CONTENT` after failed batches and preserving retry state, alongside mitigation for repeated waits. That overlaps the hash-invalidation candidate in my previous comment. Its newer uploader also retains timed-out staging resources, so my staging-lifetime caveat applies to the historical #508 head tested here, not automatically to that newer path. The deterministic A→B→A fixture establishes the cache consequence after an injected completion-report error; it does not identify the queue dependency behind a real title timeout. AI use: OpenAI Codex with GPT-6.2 Astra checked the related discussion; Codex coordinated and prepared this correction.
Foniass commented 2026-12-01 03:37:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:37:22Z.


Triage (#1607) – head 61ee2a2

The code this PR changes is no longer on main. Main commit e44c9ff clears LAST_CONTENT on placed-texture unmap and remap (item 1 of #504). Commit 73fc616 then replaced the whole-texture skip with a page-by-page comparison of written pages. That commit also uploads a texture whole again when its upload failed or when it becomes active again. LAST_CONTENT, same_as_last_upload and the double read in upload_all are gone from title_textures.rs. Failed batches are retried through retry_failed. The PR conflicts with main, and a rebase would mean writing it again against the new upload path.
Recommendation: close (superseded by main commits e44c9ff and 73fc616).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7299896328 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/508#issuecomment-7299896328). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:37:22Z. --- **Triage (#1607)** – head 61ee2a2 The code this PR changes is no longer on main. Main commit e44c9ff clears `LAST_CONTENT` on placed-texture unmap and remap (item 1 of #504). Commit 73fc616 then replaced the whole-texture skip with a page-by-page comparison of written pages. That commit also uploads a texture whole again when its upload failed or when it becomes active again. `LAST_CONTENT`, `same_as_last_upload` and the double read in `upload_all` are gone from `title_textures.rs`. Failed batches are retried through `retry_failed`. The PR conflicts with main, and a rebase would mean writing it again against the new upload path. Recommendation: close (superseded by main commits e44c9ff and 73fc616). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:38:08 +00:00 (Migrated from github.com)

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


Closing as superseded: this change is already on main (73fc616f). e44c9ff clears LAST_CONTENT on unmap/remap (#2460); 73fc616f replaced LAST_CONTENT with per-page Known/changed in texture_upload.rs (LAST_CONTENT no longer exists on main); a failed upload is retried via stale()/retry_failed, so the PR's remember-only-after-success goal is met

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311423462 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/508#issuecomment-7311423462). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:38:08Z. --- Closing as superseded: this change is already on `main` (73fc616f). e44c9ff clears LAST_CONTENT on unmap/remap (#2460); 73fc616f replaced LAST_CONTENT with per-page Known/changed in texture_upload.rs (LAST_CONTENT no longer exists on main); a failed upload is retried via stale()/retry_failed, so the PR's remember-only-after-success goal is met Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!503
No description provided.