Title textures: detile and hash the title's memory in place, not a copy #602
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!602
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/602/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@dns54 on GitHub · 2026-11-24 02:19 UTC · original
dns54:perf/title-bytes-in-place→main· +37 −3 · 1 files · 1 commits · merged 2026-11-24 02:41 UTCBefore a title texture is hashed (
unchanged_skip, #486) and detiled for an upload,title_texturescopied its memory into a new zeroed buffer of its size (read_committed): a fresh allocation, its page faults and the copy, for every texture each time. The retail title's intro video re-uploads its 3840×2160 and 1920×1080 R8 planes several times a presented frame, and with #451 the copy was still the larger part of the time the render thread spends there.title_bytesnow hands out the title's memory where it is when the whole range is readable (gpu::shader::readable), and the page-by-page copy as before when it is not.What is in it
Title textures: detile and hash the title's memory in place, not a copy–crates/xcl/src/hle/d3d12x/title_textures.rs:title_bytes, used by the unchanged-content hash, the 2D slices and 3D textures insubresources; testtitle_bytes_are_used_in_place_when_all_are_readable(a committed page is used in place; a range with a reserved page is read, with the same bytes asread_committed).Tested
cargo test --workspace --no-fail-fast -- --test-threads=4at3984bf1: 681 passed, 4 failed, 41 ignored. Onmain9ce2070on this card: 680 passed, the same 4 failed, 41 ignored:gpu_nonfused_mad_and_mac_prevent_fma_contraction,placed_title_textures_share_vram_and_preserve_pixels,transitions_apply_when_their_list_is_submitted,d32s8_targets_take_their_own_size_of_video_memorySKIPPED:gpu_geometry_mode_es_gs_strip,gpu_mesh_mode_two_passes(no mesh shaders)main9ce2070→ this PR: 39–41 → 60 presents per 2 s; hash + read + detile ~1.25 s for ~850 MB → ~0.6 s for ~1430 MB of every 2 s (1.47 → 0.42 ms per MB)Regression run
The last window of the PR's run (38) is the title loading its world after the video, which the
mainrun reaches later.Not tested
AI use
🤖 Generated with Claude Code
@ryosen0 on GitHub · 2026-11-24 02:37 UTC · original
Tested
3984bf1(on9ce2070) on NVIDIA: RTX 3060 Ti 8 GB (wave32), Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11, release build.cargo test -p xcl --lib -- --test-threads=1 title_textures: 10 passed, 0 failed — includingtitle_bytes_are_used_in_place...and the GPU mirror/placement tests (serial; under--test-threads=4that set hits the poisoned-lock contention documented on main in #516's report).XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=120): clean exit, 3262 frames, steady 60 presents / 2 s at every 30 s sample through t=118 s — the intro's 4K/1080p R8 re-upload path this PR targets ran the whole window with no dip, no device removal.The
readablewhole-range check before handing out the title's memory reads right: the page-by-page fallback keeps the old behaviour for a range with an unreadable page, so the fast path can't fault where the copy wouldn't.Not tested: a range that straddles an unreadable page in a retail run (fallback exercised by the unit test only); no timing comparison against the copy path on this machine.
AI use: GPT-6.2 Astra (API model selector) in DSH ran the tests and the run and wrote this comment; the human contributor reviewed it.
@grahamster2 on GitHub · 2026-11-24 03:08 UTC · original
Benchmark of
3984bf1merged ontomain3db536e(clean merge). Result: no measurable difference on this machine, neither better nor worse.Setup: RTX 3080 10 GB (driver 32.0.16.1088), Ryzen 5 7600X, 32 GB, Windows 11 26200, release builds. Retail title,
XCL_NETWORK=0, A at 14/17/21/25/31 s, 180 s runs. Both caches were warmed with one run per build first (not counted); then 2 measured runs per build.main=3db536e(#451 and #435 in).+0x23cf683) at 100.4 / 97.4 sThe intro already runs at ~22.5 fps on main here, so on this CPU the copy this PR removes is not what limits it. The end-of-run crash is the #232 / #505 stop, the same on both builds.
Regression run (no presses, 60 s; the title folder is a neutrally named junction)
main:
PR merged onto main:
Test report written with Claude Code (Claude Opus 5.5) from my own runs.
@MonkeyPython on GitHub · 2026-11-24 03:01 UTC · original · edited 2026-11-24 03:17 UTC
@odd/tasks/draft-pr602-comment.md