D3D12.X: title textures keep per-page hashes and hash only written pages #2395

Open
opened 2026-11-26 05:29:49 +00:00 by github-bot · 0 comments
Owner

@⁠KOLESNiii on GitHub · 2026-11-25 17:43 UTC · original

Part of #2390.

When any page of a kept-in-step title texture comes back from the write watch, upload_all reads and hashes the whole texture to see if it changed (content_hash(&title_bytes(va, size)), crates/xcl/src/hle/d3d12x/title_textures.rs:1099-1107 on main 3f4495a). A 16 MiB texture with one written 4 KiB page is hashed in full. Most of the time the result is "unchanged". In my title's menus (RTX 2070 SUPER, main 3f4495a), the "uploads left out" count reached 1,024 at 39 s, 2,048 at 43 s and 4,096 at 52 s. Each of those was a full-texture hash that changed nothing.

Proposal: keep a hash per page for each texture (or per 64 KiB, to match the tiles), as sparse.rs already does for its chunks. Hash only the pages the write watch reported, compare them with the stored hashes, and record which pages really changed. #2396 uses that list.

Test: writing a page with the same bytes does not upload; writing a different byte in one page uploads and updates only that page's hash. Remapping (#504) still forces an upload.

Found by code reading with Claude Code (Claude Opus 5.5).

**@⁠KOLESNiii** on GitHub · 2026-11-25 17:43 UTC · [original](https://github.com/xcl-dev/xcl/issues/2395) Part of #2390. When any page of a kept-in-step title texture comes back from the write watch, `upload_all` reads and hashes the **whole** texture to see if it changed (`content_hash(&title_bytes(va, size))`, `crates/xcl/src/hle/d3d12x/title_textures.rs:1099-1107` on `main` 3f4495a). A 16 MiB texture with one written 4 KiB page is hashed in full. Most of the time the result is "unchanged". In my title's menus (RTX 2070 SUPER, `main` 3f4495a), the "uploads left out" count reached 1,024 at 39 s, 2,048 at 43 s and 4,096 at 52 s. Each of those was a full-texture hash that changed nothing. **Proposal:** keep a hash per page for each texture (or per 64 KiB, to match the tiles), as `sparse.rs` already does for its chunks. Hash only the pages the write watch reported, compare them with the stored hashes, and record which pages really changed. #2396 uses that list. **Test:** writing a page with the same bytes does not upload; writing a different byte in one page uploads and updates only that page's hash. Remapping (#504) still forces an upload. *Found by code reading with Claude Code (Claude Opus 5.5).*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:29:49 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.