perf(texture): bypass intermediate buffer for compatible committed twin copies #657

Open
github-bot wants to merge 8 commits from github-bot/gh-657 into main AGit
Owner

@⁠tommiehansen on GitHub · 2026-12-06 01:25 UTC · original
tommiehansen:perf/phase13-direct-twin-copy-20261206 → main · +333 −18 · 3 files · 8 commits · open

Why

Avoid the intermediate buffer and associated barriers on eligible texture twin copies.

What changes

Opt-in VICTORY_DIRECT_TWIN_COPY admits independently committed host backing, distinct resources and matching typed single-plane 2D format/dimensions/subresources. Depth/MSAA/placed/reserved and incompatible cases retain the existing route. Existing state transitions and write tracking are preserved. Cached plans now include requested mip-level coverage as well as both resource serials, preventing reuse of a stale plan for a different number of levels.

Benchmark results

Final head 8a87edd, WARP, eight alternating ABBA/BAAB blocks per shape. Median block medians, paired interval reductions:

Format / width Before (µs) After (µs) Paired time change Winning blocks
RGBA8 / 256 365.55 331.38 −11.16% 7/8
RGBA8 / 1024 1423.28 850.20 −40.05% 8/8
RGBA8 / 2048 5669.95 2979.83 −48.02% 8/8
BC1 / 256 264.63 254.83 −6.08% 5/8
BC1 / 1024 379.78 312.30 −18.82% 8/8
BC1 / 2048 704.00 444.18 −35.47% 8/8

Intermediate bytes eliminated on admitted path. Small BC1 is noisy; no general small-copy speedup claim.

Why this should be merged

Removes unnecessary intermediate allocation/copies on eligible resources, preserves exact outputs and improves larger measured copy intervals. Ready for review as scoped opt-in; default behavior remains unchanged.

Validation

Final-head CI 47594765725 passed: 192 exact paired readback arms, 12 actual production planning/recording passes and four retirement controls. Real committed resources, three mips and two array layers, selected repeated writes, HostList state transitions, row-level oracles, admission rejection controls and serial/level cache invalidation; intermediate buffer present only in baseline. Prior CI 47592026839 independently measured the original route.

Compatibility and dependencies

Independent opt-in. The production plan/cache/record path is exercised, not full title twin_copy entry or actual placed/reserved allocations. Physical AMD timing, distinct guest physical alias stress and title activation remain open. No gameplay FPS claim.

Physical AMD capture

Test-only head c32f9c8 adds a strict actual DXGI AMD adapter identity gate, without changing production logic. Use the shared runner with PRC_AMD_GATES=direct_twin and eight internal paired blocks. Physical execution remains pending. Earlier tables retain their measured revision; negative paired time change means improvement. #662 uses the same allocation-provenance concept; preserve a single definition when integrating.

**@⁠tommiehansen** on GitHub · 2026-12-06 01:25 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/657) `tommiehansen:perf/phase13-direct-twin-copy-20261206` → `main` · +333 −18 · 3 files · 8 commits · open ## Why Avoid the intermediate buffer and associated barriers on eligible texture twin copies. ## What changes Opt-in VICTORY_DIRECT_TWIN_COPY admits independently committed host backing, distinct resources and matching typed single-plane 2D format/dimensions/subresources. Depth/MSAA/placed/reserved and incompatible cases retain the existing route. Existing state transitions and write tracking are preserved. Cached plans now include requested mip-level coverage as well as both resource serials, preventing reuse of a stale plan for a different number of levels. ## Benchmark results Final head 8a87edd, WARP, eight alternating ABBA/BAAB blocks per shape. Median block medians, paired interval reductions: | Format / width | Before (µs) | After (µs) | Paired time change | Winning blocks | |---|---:|---:|---:|---:| | RGBA8 / 256 | 365.55 | 331.38 | −11.16% | 7/8 | | RGBA8 / 1024 | 1423.28 | 850.20 | −40.05% | 8/8 | | RGBA8 / 2048 | 5669.95 | 2979.83 | −48.02% | 8/8 | | BC1 / 256 | 264.63 | 254.83 | −6.08% | 5/8 | | BC1 / 1024 | 379.78 | 312.30 | −18.82% | 8/8 | | BC1 / 2048 | 704.00 | 444.18 | −35.47% | 8/8 | Intermediate bytes eliminated on admitted path. Small BC1 is noisy; no general small-copy speedup claim. ## Why this should be merged Removes unnecessary intermediate allocation/copies on eligible resources, preserves exact outputs and improves larger measured copy intervals. Ready for review as scoped opt-in; default behavior remains unchanged. ## Validation [Final-head CI 47594765725](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47594765725) passed: 192 exact paired readback arms, 12 actual production planning/recording passes and four retirement controls. Real committed resources, three mips and two array layers, selected repeated writes, HostList state transitions, row-level oracles, admission rejection controls and serial/level cache invalidation; intermediate buffer present only in baseline. [Prior CI 47592026839](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47592026839) independently measured the original route. ## Compatibility and dependencies Independent opt-in. The production plan/cache/record path is exercised, not full title twin_copy entry or actual placed/reserved allocations. Physical AMD timing, distinct guest physical alias stress and title activation remain open. No gameplay FPS claim. ### Physical AMD capture Test-only head `c32f9c8` adds a strict actual DXGI AMD adapter identity gate, without changing production logic. Use the [shared runner](https://github.com/tommiehansen/VIctory-xmem/blob/tracking/phases-8-10/validation/amd-production-gates.sh) with `PRC_AMD_GATES=direct_twin` and eight internal paired blocks. Physical execution remains pending. Earlier tables retain their measured revision; negative paired time change means improvement. #662 uses the same allocation-provenance concept; preserve a single definition when integrating.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 01:32:44 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/657/head:github-bot/gh-657'
git switch 'github-bot/gh-657'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-657'
git switch 'github-bot/gh-657'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-657'
git switch 'github-bot/gh-657'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-657'
git switch 'main'
git merge --squash 'github-bot/gh-657'
git switch 'main'
git merge --ff-only 'github-bot/gh-657'
git switch 'main'
git merge 'github-bot/gh-657'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.