Repository navigation
D3D12.X: hash only written pages of title textures (#2395) - #2484
ChalanaGimhanaX wants to merge 1 commit into
Conversation
bmjask
left a comment
There was a problem hiding this comment.
Nonblocking validation gap: GetWriteWatch(RESET) captures/reset dirty pages at title_textures.rs:751-767, and the new fast path hashes only those captured pages at :905-946. A CPU write to another texture page after reset but before upload_all can miss this submission and be caught only on the next refresh, adding a frame/submission of staleness. Please either document the synchronization guarantee that excludes this or add an interleaving regression test.
Track per-page content hashes in LAST_CONTENT (PageHashes) and pass overlapping write-watched dirty pages from refresh_once into upload_all via Upload. When dirty pages are known for a previously uploaded texture at the same (src, size, page_size), changed_pages_with reads and hashes only those deduplicated clamped pages outside the LAST_CONTENT lock instead of re-hashing the full texture. First uploads, pending uploads, size/page_size changes, and xcl-dev#504 GPU-view remaps still perform the full per-page baseline pass, and recheck_gpu_view_sources invalidates LAST_CONTENT after dropping TEXTURES. Verified with cargo test -p xcl --lib hle::d3d12x::title_textures::tests -- --test-threads=1 (24 passed, 0 failed).
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
b6b5b9c to
1c9e839
Compare
|
Thanks for the review, @bmjask — addressed in
Re-ran the full release suite ( AI use: Antigravity (Gemini 4 Neon) added the doc comment and interleaving test, ran the tests and smoke check, and drafted this reply. |
Port per-page content hashing (#2484 by ChAlanA) onto the indexed dirty_and_pending + parallel hash_and_detile_all upload pipeline: - Track per-page hashes (PageHashes) in LAST_CONTENT and propagate overlapping dirty pages from refresh_once into Upload. - For previously uploaded textures with known dirty pages, upload_all checks changed_pages_since_last_upload first (reading and hashing only those deduplicated clamped 4 KiB pages outside LAST_CONTENT) and skips unchanged textures without reading or detiling the full resource. - For first/pending uploads, hash_and_detile_all populates PageHashes directly from the single already-read title_bytes buffer, preserving #2470 lazy-mip retry and #2460 invalidations plus invalidating LAST_CONTENT in recheck_gpu_view_sources. Includes all 5 per-page dirty/unaligned/remap/dedup unit tests. Assisted-by: Antigravity (Gemini 4 Neon High)
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
…textures) Reconciles per-page content hashing with xcl-dev#751 safe ReadProcessMemory copy and xcl-dev#871 Wine coherent-window round-robin hashing (now without holding TEXTURES/LAST_CONTENT locks during hashing). Assisted-by: Antigravity (Gemini 4 Neon)
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
Found while building on this PR, one case where the skip leaves out an upload it needs (no benchmarks): a placed texture superseded by a placement over a different range is unmapped ( Steps that show it on this PR's head with an RTX 5070 Ti (test Suggested fix: drop the hashes where the tiles go, one line AI use: Claude Code (Claude Opus 5.5) found this, wrote and ran the test, and drafted this comment. |
…validation (port upstream xcl-dev#2484 + xcl-dev#2578) (cherry picked from commit 77ff481152b0573c2df9d11a6dde8012ab13c482)
Track per-page content hashes for write-watched title textures instead of hashing the entire texture on every dirty hit. When
refresh_oncecollects overlapping dirty pages for a previously uploaded texture with matching(src, size, page_size),upload_allreads and hashes only those deduplicated dirty pages (outsideLAST_CONTENT), returns the changed page indices (ready for #2396), and still forces a full baseline upload on first upload, pending uploads, or #504 GPU-view remaps.Fixes #2395. Part of #2390, #582, and #1833.
What is in it
crates/xcl/src/hle/d3d12x/title_textures.rs: replacedLAST_CONTENT's whole-texture hash with per-pagePageHashes, passed dirty pages fromrefresh_oncethroughUpload, invalidatedLAST_CONTENToutsideTEXTURESonrecheck_gpu_view_sourcesremaps, implementedchanged_pages_with/changed_pages_since_last_upload(documenting theExecuteCommandLists/GetWriteWatch(WRITE_WATCH_FLAG_RESET)synchronization contract), and added 6 unit tests (including aGetWriteWatch(RESET)post-reset interleaving test) alongside updating the existing unchanged-upload test.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release build.cargo test --release -p xcl --lib hle::d3d12x::title_textures::tests -- --test-threads=1(1c9e839): 25 passed, 0 failed.cargo build --release --workspace+cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture(1c9e839): 1423 passed, 0 failed, 46 ignored.SKIPPEDGPU/adapter tests (26): 21 no wave64, 3 refused f16 forms (#1426), 1no heap windows, 1pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode required for driver cache disable).cargo test --release -p xcl --test e2e -- --test-threads=1(1c9e839): 4 passed, 0 failed.Regression run
main (
6d051da):this PR (
1c9e839):Not tested
AI use