Title textures: one upload batch moves its textures in two barrier calls #881
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!881
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-881"
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?
@mastrr9 on GitHub · 2026-11-24 07:24 UTC · original
mastrr9:perf/d3d12x-batch-texture-upload-barriers→main· +160 −14 · 2 files · 1 commits · openBatches
ResourceBarriertransitions in title texture upload batches (gpu/texture.rs+hle/d3d12x/title_textures.rs) so a streaming batch ofNdistinct textures issues 2ResourceBarriercalls instead of2N(e.g., 64 textures: 128 → 2 barrier drains), allowing copies of different textures to overlap on NVIDIA GPUs:record_batchtransitions each run of distinct textures toCOPY_DESTin one barrier call before their copies and back in one call after.barrier_groupssplits a new run whenever the same texture appears again in a batch so no singleResourceBarriermoves a resource twice and the later upload wins.upload_alldefers any texture whose memory range overlaps one already in the batch to the next batch (preserving ordering for aliased placed title textures).upload_barriers_are_batched_per_run_of_distinct_textures,a_batch_takes_no_two_textures_over_the_same_memory, and GPU testgpu_upload_batch_with_a_texture_twice_keeps_the_later_contents.Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974),rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC debug, DXC Windows SDK10.0.26100.0,d3d12SDKLayers.dllinstalledafbba2079d8dbcda73f7e9746497722f90a32475cargo build --workspace: clean (no new warnings; only pre-existingfetch_updatedeprecation warning)cargo test --workspace -- --test-threads=4: 716 passed, 0 failed, 41 ignored (gpu_upload_batch_with_a_texture_twice_keeps_the_later_contentsok,upload_barriers_are_batched_per_run_of_distinct_texturesok,a_batch_takes_no_two_textures_over_the_same_memoryok)SKIPPEDGPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64Not tested
scripts/smoke.ps1) not yet run (no retail title available in this clean-room environment); opened as Draft pending a smoke run.AI use
@ryosen0 on GitHub · 2026-11-24 07:40 UTC · original
Retail smoke for the pending Regression run, on RTX 3060 Ti 8 GB (Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11, release) — the title whose texture streaming this batches:
Plus a 150 s run with scripted presses that reaches the loading screens and the heavy upload phase (thousands of title-texture uploads, ≈1.75 GB of CPU writes through the sparse windows): clean, 4203 frames, steady 60 presents / 2 s, 0 removals / 0 crashes. The batching survives the phase it targets on a second NVIDIA host.
The matched main-side block still needs to come from current main (
a1672ef) for the checks — the head block above is yours to paste.One observation, not a request: this title's load phase has an intermittent device removal on 8 GB cards (~1 in 6 runs on the #541 branch,
0x887a0006during upload churn). Since this change reorders barrier drains around copies, it would be worth one longer run on an 8 GB card before merge to see the tally doesn't move — I can run that shape here if you rebase onto current main.AI use: GPT-6.2 Astra (API model selector) in DSH built the head, ran the smoke and the 150 s run, and drafted this comment; the human contributor reviewed the numbers before posting.
@mastrr9 on GitHub · 2026-11-24 08:39 UTC · original
@ryosen0 Thank you so much for running both the 90 s smoke and the 150 s loading-phase run on your RTX 3060 Ti — really helpful data!
I've rebased this branch cleanly onto current
main(09940bb, PR head is now2d2997bb8e72164134fad06d10e1e60e144f888a) and re-verified on Windows 11 / RTX 5080 (cargo test --workspace -- --test-threads=4: 719 passed / 0 failed / 41 ignored). Ready whenever you have time for that longer 8 GB stress run!@SlopTart on GitHub · 2026-11-24 09:34 UTC · original
Linux / AMD RDNA3 datapoint.
Merged state: head
2d2997bonto main077ce40, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 709 passed, 10 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). upload-batch barrier tests green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@Toons29 on GitHub · 2026-11-25 03:05 UTC · original
Regression run of
2d2997bbon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % 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.@JJAutoCompare on GitHub · 2026-11-25 05:45 UTC · original
Empirical test report (2d2997bb)
Hardware / environment
2d2997bb8e72164134fad06d10e1e60e144f888a, Windows x64 build 26200, AMD64 Family 23 Model 113 with 12 logical processors. A separate probe of the default D3D12 device identified Intel Arc A770 Graphics (PCI 8086:56A0). The GPU fixture requests the default D3D12 adapter.1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5 (01b62ad47), unoptimized test profile.Commands and results
cargo test --workspace --no-runcompleted outsideInvoke-ArcTest.ps1with exit code 0.xcllibrary test executable with--exactforgpu::texture::tests::upload_barriers_are_batched_per_run_of_distinct_texturesandhle::d3d12x::title_textures::tests::a_batch_takes_no_two_textures_over_the_same_memory. WithXCL_ADAPTER=NONE_CPU_ONLY, the CPU run had 2 passed, 0 failed, 0 ignored, 0 skipped.Invoke-ArcTest.ps1 -Test { ... }with--exact gpu::texture::tests::gpu_upload_batch_with_a_texture_twice_keeps_the_later_contentsandXCL_ADAPTER=A770. The wrapper acquired and released the Arc test lock. The GPU run had 1 passed, 0 failed, 0 ignored, 0 skipped.RUST_TEST_NOCAPTURE=1. Totals from the focused log were 3 passed, 0 failed, 0 ignored, 0 skipped.Observed behavior
The CPU fixtures verified that repeated textures start a new run without changing upload order and that overlapping memory spans end a batch while adjacent spans can share it. The D3D12 fixture uploaded A, B, then A again in one batch. Readback matched A's second payload and B's own payload byte for byte.
Not tested
The full GPU workspace suite and game smoke runs on main and the PR head were omitted. The barrier call count and upload timing were not measured.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr881-focused.logand published.@DavidM1911 on GitHub · 2026-11-25 09:52 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@DavidM1911 on GitHub · 2026-11-26 03:11 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.