Skip to content

D3D12.X: re-fingerprint unwatched streamed textures at spaced frame milestones - #2029

Merged
ivall merged 1 commit into
xcl-dev:mainfrom
raylitebull:feat/title-textures-streamed-recheck-v2
Nov 25, 2026
Merged

ivall merged 1 commit into
xcl-dev:mainfrom
raylitebull:feat/title-textures-streamed-recheck-v2

Conversation

@raylitebull

@raylitebull raylitebull commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Adds spaced frame-milestone re-fingerprinting (frames [4, 12, 40, 120, 400], gated by XCL_TEXTURE_STREAM_RECHECK, default on) for active non-gpu_written textures backed by unwatched or mapped physical pages, ensuring textures initially uploaded zeroed are re-queued once streaming writes fill their pages and subsequent higher-resolution mip streams.

Part of #1833.

What is in it

  • crates/xcl/src/hle/d3d12x/title_textures.rs (+350 / -5): record a bounded (<= 48 KiB start/mid/end, ReadProcessMemory-safe) fingerprint for active non-gpu_written textures not fully covered by GetWriteWatch spans, re-check at spaced frame milestones 4, 12, 40, 120, and 400, reset the schedule when content changes, and add title_textures unit tests.

Tested

  • Toolchain: Windows 11 x64, rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly onto aaa0936 (dea3552).
  • dea3552 was rebased cleanly onto aaa0936 (preserving #1986 / #2024's BATCH_BYTES / BATCH_ITEMS constants via pure git during a local test hold) and is queued for GitHub Actions Build and test + reviewer verification.
  • Earlier pre-rebase head 216ef4c (onto 279d3ea) passed cargo check --workspace --tests, title_textures (5/5), and Build and test (Windows, no GPU).
  • Exact-head 60 s scripts/smoke.ps1 regression pair on NVIDIA GeForce RTX 3060 (@Anon64): passed (0 device removals, 0 crashes).

Regression run
60 s scripts/smoke.ps1 pair on exact head dea3552 vs main (NVIDIA GeForce RTX 3060 12 GB, driver 581.80, Windows 11 26200, release, XCL_NETWORK=0, A pressed every 4 s from 20 s on a retail title), contributed by @Anon64:

main:

xcl-smoke v1
commit: aaa093657bd96a146c05c0c1a9b61149fe761453
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1443 (PresentX 1443)
presents per 2 s (last 3): 42 9 0
device removals: 0
crashes: 0
peak commit: 24704 MB

this PR:

xcl-smoke v1
commit: dea3552119bf4403f42704166fbed400ddca1705
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1469 (PresentX 1469)
presents per 2 s (last 3): 15 1 0
device removals: 0
crashes: 0
peak commit: 21470 MB

Not tested

  • cargo check / title_textures tests and 60 s scripts/smoke.ps1 pair on rebased head dea3552, full cargo test --workspace suite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.

AI use

  • Antigravity assisted with implementation, rebase onto aaa0936, and unit tests; the author reviewed the diff.

…ilestones

Textures backed by unwatched or mapped physical pages cannot be tracked by GetWriteWatch, so a texture first uploaded while still zeroed before streaming fills its pages remained zeroed unless its mirror source remapped. Record a bounded (<= 48 KiB start/mid/end, ReadProcessMemory-safe) fingerprint for active non-gpu_written textures not fully covered by write-watched spans and re-check them at frames 4, 12, 40, 120, and 400 after upload, re-queuing changed textures and resetting their schedule so subsequent higher-resolution mip streams are also uploaded. Controlled by XCL_TEXTURE_STREAM_RECHECK (default on).
@raylitebull
raylitebull force-pushed the feat/title-textures-streamed-recheck-v2 branch from 216ef4c to dea3552 Compare November 25, 2026 02:13
@raylitebull

Copy link
Copy Markdown
Member Author

Rebased #2029 cleanly onto aaa0936 in commit dea3552, resolving the adjacency conflict in crates/xcl/src/hle/d3d12x/title_textures.rs alongside #1986 / #2024 (BATCH_BYTES / BATCH_ITEMS).

Pushed dea3552 for GitHub Actions Build and test and fresh verification.

@Anon64

Anon64 commented Nov 25, 2026

Copy link
Copy Markdown

Regression run for this PR: head dea3552, based on main aaa0936. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, XCL_NETWORK=0, A pressed every 4 s from 20 s, scripts/smoke.ps1 on a retail title for 60 s, back to back with the main run.

main aaa0936:

xcl-smoke v1
commit: aaa093657bd96a146c05c0c1a9b61149fe761453
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1443 (PresentX 1443)
presents per 2 s (last 3): 42 9 0
device removals: 0
crashes: 0
peak commit: 24704 MB

this PR:

xcl-smoke v1
commit: dea3552119bf4403f42704166fbed400ddca1705
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1469 (PresentX 1469)
presents per 2 s (last 3): 15 1 0
device removals: 0
crashes: 0
peak commit: 21470 MB

No device removals or crashes; 101 % of main's frames, 86 % of its peak commit.

Not tested: the whole suite; world loading; whether the title reaches the changed code in these 60 s.

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

@JoaoPauluu

Copy link
Copy Markdown

A regression run under Wine on Linux on the retail title: no device removal, no crash, frames level with main (1386 here, 1357 and 1365 on the two main runs). The PR's streamed unwatched re-uploads triggered line does not appear in the log within 60 s, so the re-fingerprinting is not seen to fire here; this is a regression run only.

Tested

Regression run

main (first run):

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

this PR:

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

The second main run: 1365 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, a longer run that reaches the later frame milestones, gameplay with streaming, native Windows.

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.

@JJAutoCompare

Copy link
Copy Markdown

Empirical verification — PR #2029 (dea3552119bf4403f42704166fbed400ddca1705)

Tested clean detached PR head dea3552119bf4403f42704166fbed400ddca1705 on STOR-WINLAB.

Environment

  • Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, wave range 8–32, DoublePrecisionFloatShaderOps=0, d3d12SDKLayers.dll absent).
  • rustc 1.100.0 (0ef1bc386 2026-11-09) (CARGO_INCREMENTAL=0, debug info 0). Standalone DXC/DXIL 1.9.2609.5 was prepended to PATH; XCL logged loading Windows SDK DXC/DXIL 1.9.2602.17 (21d28f72).

Tested

  • cargo build --workspace and cargo test --workspace --no-run exited 0 outside the GPU lock.
  • Focused PR tests (cargo test -p xcl --lib hle::d3d12x::title_textures::tests::<name> -- --exact --nocapture): 3 passed, 0 failed, 0 ignored, 0 skipped:
    • range_is_fully_watched_handles_gaps_and_adjacent_spans
    • sample_fingerprint_detects_start_mid_and_end_changes_in_large_textures
    • stream_recheck_schedule_catches_late_writes_and_resets_milestones (verified +4 requeue, reset after mutation, GPU-written exclusion, retirement after +400 in the 4/12/40/120/400 schedule).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 (under Invoke-ArcTest.ps1, exited 101): 1,126 passed, 28 failed, 46 ignored across 20 test binaries, with 24 SKIPPED lines across 14 tests (excluded from coverage; libtest pass counts include early returns).
    • Failures (28): 27 standalone GPU DXIL/recompiler tests in xcl --lib (pipeline creation 0x80070057 and shader output assertions) plus e2e::test_title_runs_and_game_folder_is_untouched (dynamic depth bias RSSetDepthBiasX Split wave64: masks read only lane by lane stay in their half #94 blue vs green). Unrelated to the title-texture milestone path (no same-run main baseline).
    • Skips (24 visible lines): 19 wave64 unavailable, 3 refused wave32 f16 lowerings, 1 driver-cache toggle unavailable, 1 heap-window fallback unavailable; debug-layer e2e early return is captured outside the 24 lines.

Not tested

  • Retail Xbox title streaming, scripts/smoke.ps1 main-vs-PR run, XCL_SAMPLE_* (unset), D3D12 debug layer, and non-Arc adapters.

AI use

  • T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr2029-suite.log and published this report.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

IvyNotFound added a commit to IvyNotFound/xcl that referenced this pull request Nov 25, 2026
# Conflicts:
#	crates/xcl/src/hle/d3d12x/title_textures.rs
@raylitebull

Copy link
Copy Markdown
Member Author

Thanks @Anon64 for running and sharing the exact-head 60 s scripts/smoke.ps1 pair on dea3552 (0 device removals, 0 crashes) — added to the PR description!

@ivall
ivall merged commit f45409c into xcl-dev:main Nov 25, 2026
2 of 4 checks passed
@ivall

ivall commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Merged as f45409c, thank you. This is the AMD run it was waiting for.

Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug: ea088a5 + #2029 + #1782, cargo test --workspace --no-fail-fast -- --test-threads=4: 1248 passed, 2 failed, 46 ignored, 7 SKIPPED. The two failures are fuzz_validate_and_gpu_1 and _3 (#2115), on main too.

In the title (426a5a7 + #2180 + #2029 + #1782 + the #2080 stack with a fix, XCL_DIRECT_DXIL=1 XCL_PSO_PRELOAD=0, release): one run of 421 s, 30 fps in the menus, then the world load with no present from about 70 s on (pipelines being built, as before). No device removal and no crash; closed by hand.

Not measured: the effect of this change on its own, and what the rechecks cost per submit.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this on the maintainer's behalf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants