D3D12.X: coordinate view texture creation by cache key #2812

Open
github-bot wants to merge 2 commits from github-bot/gh-2812 into main AGit
Owner

@⁠CryingLaughing on GitHub · 2026-11-26 14:07 UTC · original
CryingLaughing:fix/coordinate-view-resource-creation → main · +159 −17 · 2 files · 2 commits · open

Stacked on #2762. Part of #2743.

The view-resource cache now shares one pending placement per normalized address and description. Concurrent callers for that key receive the completed resource. Lookups for other keys can proceed during creation.

What is in it

  • Adds a pending entry for creation. Once the resource is published, the entry holds only the completed result. Zero remains a cached result, and the completed entry count still includes failures.
  • Checks shared pending creation, independent keys, cached zero and publication with a bounded CPU fixture.

Tested

  • Head ab169f5396bda3df5a48497e668f49a99192e892, based on #2762 head 496ef5780a4549fc3f15bc65340deb1db4794d6b. RTX 4080 driver 621.01, i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC, DXC 1.8.2502.11.
  • The focused cache test passed 1/0/0. The separate native sequential resource identity check passed 1/0/0 with zero capability skips and reused the exact and padding-only requests.
  • cargo build --workspace --locked -j 4 and cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output passed 1,437 passed, 0 failed, 47 ignored across 37 harnesses, including 29 capability skips.

Regression run

Matched retail smoke runs are pending.

Not tested

  • Concurrent native allocations, retail smoke, or the effect on title memory use.
**@⁠CryingLaughing** on GitHub · 2026-11-26 14:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/2812) `CryingLaughing:fix/coordinate-view-resource-creation` → `main` · +159 −17 · 2 files · 2 commits · open Stacked on #2762. Part of #2743. The view-resource cache now shares one pending placement per normalized address and description. Concurrent callers for that key receive the completed resource. Lookups for other keys can proceed during creation. **What is in it** - Adds a pending entry for creation. Once the resource is published, the entry holds only the completed result. Zero remains a cached result, and the completed entry count still includes failures. - Checks shared pending creation, independent keys, cached zero and publication with a bounded CPU fixture. **Tested** - Head `ab169f5396bda3df5a48497e668f49a99192e892`, based on #2762 head `496ef5780a4549fc3f15bc65340deb1db4794d6b`. RTX 4080 driver 621.01, i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC, DXC 1.8.2502.11. - The focused cache test passed **1/0/0**. The separate native sequential resource identity check passed **1/0/0** with zero capability skips and reused the exact and padding-only requests. - `cargo build --workspace --locked -j 4` and `cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output` passed **1,437 passed, 0 failed, 47 ignored** across 37 harnesses, including 29 capability skips. **Regression run** Matched retail smoke runs are pending. **Not tested** - Concurrent native allocations, retail smoke, or the effect on title memory use.
resource_at makes a placed texture for each new (address, description)
of a view the title writes without a resource object (device #70/#71)
and keeps it. Its key cleared the padding after the flags but not the
padding after Dimension (bytes 4..8). A retail title leaves that set,
so the same view made another texture whenever it differed: 24,844 of
80,953 textures in a 200 s run were such twins (GreemSC, #2743).

The key now leaves out both. The activity line counts the textures
kept.

Part of #2743, #2688.

Assisted-by: Claude Code (Claude Opus 5.5)
Publish one completed placed texture for each normalized view key. Keep allocation and waits outside the map lock so distinct keys can progress. Preserve completed failed entries and ownership of successful resources.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:11:18 +00:00
Author
Owner

@⁠Anon64 on GitHub · 2026-11-26 14:44 UTC · original

Regression run of ab169f5 on a newer retail title: no device removal, no crash, frames and commit within the limits.

Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main b49be18 (this PR's base) and of this PR's exact head, scripts/smoke.ps1 -Game <title> for 60 s with XCL_NETWORK=0 and A pressed every 4 s from 20 s. Main ran before and after a batch of 11 PRs and peaked at 23,855 and 23,844 MB, so the baseline held steady over the batch.

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1461 (PresentX 1462)
presents per 2 s (last 3): 10 1 1
device removals: 0
crashes: 0
peak commit: 23855 MB

this PR:

xcl-smoke v1
commit: ab169f5396bda3df5a48497e668f49a99192e892
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1505 (PresentX 1506)
presents per 2 s (last 3): 8 20 12
device removals: 0
crashes: 0
peak commit: 24952 MB

103 % of main's frames, 104 % of its peak commit. One run each.

Not tested: the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD.

AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.

**@⁠Anon64** on GitHub · 2026-11-26 14:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2812#issuecomment-7195250182) **Regression run of `ab169f5` on a newer retail title: no device removal, no crash, frames and commit within the limits.** **Setup:** RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main `b49be18` (this PR's base) and of this PR's exact head, `scripts/smoke.ps1 -Game <title>` for 60 s with `XCL_NETWORK=0` and A pressed every 4 s from 20 s. Main ran before and after a batch of 11 PRs and peaked at 23,855 and 23,844 MB, so the baseline held steady over the batch. main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1461 (PresentX 1462) presents per 2 s (last 3): 10 1 1 device removals: 0 crashes: 0 peak commit: 23855 MB ``` this PR: ``` xcl-smoke v1 commit: ab169f5396bda3df5a48497e668f49a99192e892 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1505 (PresentX 1506) presents per 2 s (last 3): 8 20 12 device removals: 0 crashes: 0 peak commit: 24952 MB ``` 103 % of main's frames, 104 % of its peak commit. One run each. **Not tested:** the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD. AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.
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/2812/head:github-bot/gh-2812'
git switch 'github-bot/gh-2812'

Merge

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