Separate texture rewrite dimension counts #4965

Closed
github-bot wants to merge 1 commit from github-bot/gh-4964 into main AGit
Owner

@⁠kyle7908 on GitHub · 2026-12-01 15:42 UTC · original
kyle7908:diagnose-texture-slot-rewrites → main · +111 −22 · 1 files · 1 commits · closed without merging

Refs #4860

What it changes

Texture-slot rewrite diagnostics now count confirmed texture SRV dimension mismatches separately from unavailable or unsupported dimensions. An SRV using its default descriptor can have no dimension available to the classifier. Previously that case incremented the same counter as an explicit 2D-to-array mismatch.

The two new counts sum to the old bucket. Aggregate rewrite and retention counts, log cadence, descriptor selection and retention rules stay the same. These counters measure rewrites and cannot establish that a draw sampled a null view.

How it was tested

  • GPU and profile: Windows 11 with Rust 1.98.1. The regression fixtures use synthetic descriptors and require no device or title data. No title run.
  • Before: on upstream 5fabb46e with only the new regression test added, cargo test -p victory-gpu --lib --locked texture_rewrites_distinguish_known_and_unknown_dimensions failed because the explicit mismatch and the implicit SRV both returned Kin::None.
  • After: the identical regression passed on the tree now in c84db15. cargo test -p victory-gpu --lib --locked descriptor::host::tests passed 87 tests with 1 ignored. cargo test -p victory-gpu --lib --features diagnostics --locked texture_rewrites passed both new tests. Coverage includes explicit and implicit SRVs, unknown and unsupported dimensions, placed buffers, retention modes and aggregate counts.
  • For shader changes, the wave sizes tested: no shader changes.
  • cargo test passed for the crates it touches: yes. The patched victory-gpu suite passed 1,097 tests with 66 ignored. cargo test --workspace --locked -- --test-threads=1 passed with host loopback access. The three socket tests that failed in the restricted run also failed on the clean baseline under the same restriction.
  • The first parallel cargo test --workspace --locked run hit the existing UAV-pool assertion reported in #2420. The isolated UAV-pool test passed on the patch.
  • cargo clippy --workspace --all-targets --locked -- -D warnings and the same command with --all-features produced the same five errors on clean 5fabb46e and on the patch. They are in the existing font, menu and panel code tracked by #4708.
  • cargo xtask policy passed for all 464 tracked files. cargo xtask policy --staged passed for the one changed file.

Checked for overlap

  • I searched the open and closed issues and PRs for the same problem and checked open PRs touching the descriptor host file. Related: #4883 (fallback descriptor shape), #4864 (stand-in allocation retry), #4719 (retention default), and #3128 (sampled eviction). I found no PR that separates the rewrite counters.
**@⁠kyle7908** on GitHub · 2026-12-01 15:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4964) `kyle7908:diagnose-texture-slot-rewrites` → `main` · +111 −22 · 1 files · 1 commits · closed without merging Refs #4860 ## What it changes Texture-slot rewrite diagnostics now count confirmed texture SRV dimension mismatches separately from unavailable or unsupported dimensions. An SRV using its default descriptor can have no dimension available to the classifier. Previously that case incremented the same counter as an explicit 2D-to-array mismatch. The two new counts sum to the old bucket. Aggregate rewrite and retention counts, log cadence, descriptor selection and retention rules stay the same. These counters measure rewrites and cannot establish that a draw sampled a null view. ## How it was tested - GPU and profile: Windows 11 with Rust 1.98.1. The regression fixtures use synthetic descriptors and require no device or title data. No title run. - Before: on upstream `5fabb46e` with only the new regression test added, `cargo test -p victory-gpu --lib --locked texture_rewrites_distinguish_known_and_unknown_dimensions` failed because the explicit mismatch and the implicit SRV both returned `Kin::None`. - After: the identical regression passed on the tree now in `c84db15`. `cargo test -p victory-gpu --lib --locked descriptor::host::tests` passed 87 tests with 1 ignored. `cargo test -p victory-gpu --lib --features diagnostics --locked texture_rewrites` passed both new tests. Coverage includes explicit and implicit SRVs, unknown and unsupported dimensions, placed buffers, retention modes and aggregate counts. - For shader changes, the wave sizes tested: no shader changes. - `cargo test` passed for the crates it touches: yes. The patched `victory-gpu` suite passed 1,097 tests with 66 ignored. `cargo test --workspace --locked -- --test-threads=1` passed with host loopback access. The three socket tests that failed in the restricted run also failed on the clean baseline under the same restriction. - The first parallel `cargo test --workspace --locked` run hit the existing UAV-pool assertion reported in #2420. The isolated UAV-pool test passed on the patch. - `cargo clippy --workspace --all-targets --locked -- -D warnings` and the same command with `--all-features` produced the same five errors on clean `5fabb46e` and on the patch. They are in the existing font, menu and panel code tracked by #4708. - `cargo xtask policy` passed for all 464 tracked files. `cargo xtask policy --staged` passed for the one changed file. ## Checked for overlap - [x] I searched the open and closed issues and PRs for the same problem and checked open PRs touching the descriptor host file. Related: #4883 (fallback descriptor shape), #4864 (stand-in allocation retry), #4719 (retention default), and #3128 (sampled eviction). I found no PR that separates the rewrite counters.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 15:44:38 +00:00
github-bot closed this pull request 2026-12-01 18:30:26 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:27 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4964#issuecomment-7320984731) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-12-01 18:33 UTC · original

Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree.

Base 5fabb46eaf6ed8771321787f8871051abde69b9b, head c84db151c213d05e133112807d5ce2b01359866d. git diff --numstat → crates/victory-gpu/src/descriptor/host.rs 111/22.

Both tests are new on the base:

git grep -F texture_rewrites_distinguish_known_and_unknown_dimensions 5fabb46e -- .
git grep -F texture_rewrites_keep_the_total_and_retention_counts 5fabb46e -- .

→ no match, exit 1 for each.

git diff --check "5fabb46e..c84db151" → no output, exit 0.

$env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4964'
cargo test --locked -p victory-gpu --lib -- descriptor::host::tests::texture_rewrites_distinguish_known_and_unknown_dimensions --exact --test-threads=1 --quiet
cargo test --locked -p victory-gpu --lib -- descriptor::host::tests::texture_rewrites_keep_the_total_and_retention_counts --exact --test-threads=1 --quiet

Result, each: running 1 test, test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1162 filtered out.

This is the counter split the report on #4860 asked for, so worth saying what is actually covered: the first test drives kin with hand-built descriptors and asserts a placed TEXTURE2D resource whose SRV dimension goes flat → array reports the same class as an explicit shader view carrying that dimension with a null resource handle, while the same old view against a buffer resource reports UnknownDimension rather than a confirmed mismatch. The second feeds all six kinds three writes each with fixed kept flags (Same all kept, Moved/Sized only later ones, Other only the last, the two dimension kinds never) and reads the per-class buckets back, plus the kept count and total_rewrites as the sum of the five class buckets.

The caveat: these are the counters and the classifier, not the call site. rewritten() still decides kept from Kin::kept before counting, so what the log will report for a given run depends on that table rather than on anything asserted here.

No title data, no device; GPU/driver N/A. No game data.

**@⁠cloph-dsp** on GitHub · 2026-12-01 18:33 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4964#issuecomment-7321124823) Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree. Base `5fabb46eaf6ed8771321787f8871051abde69b9b`, head `c84db151c213d05e133112807d5ce2b01359866d`. `git diff --numstat` → crates/victory-gpu/src/descriptor/host.rs 111/22. Both tests are new on the base: ``` git grep -F texture_rewrites_distinguish_known_and_unknown_dimensions 5fabb46e -- . git grep -F texture_rewrites_keep_the_total_and_retention_counts 5fabb46e -- . ``` → no match, exit 1 for each. `git diff --check "5fabb46e..c84db151"` → no output, exit 0. ``` $env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4964' cargo test --locked -p victory-gpu --lib -- descriptor::host::tests::texture_rewrites_distinguish_known_and_unknown_dimensions --exact --test-threads=1 --quiet cargo test --locked -p victory-gpu --lib -- descriptor::host::tests::texture_rewrites_keep_the_total_and_retention_counts --exact --test-threads=1 --quiet ``` Result, each: `running 1 test`, `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1162 filtered out`. This is the counter split the report on #4860 asked for, so worth saying what is actually covered: the first test drives `kin` with hand-built descriptors and asserts a placed TEXTURE2D resource whose SRV dimension goes flat → array reports the same class as an explicit shader view carrying that dimension with a null resource handle, while the same old view against a buffer resource reports `UnknownDimension` rather than a confirmed mismatch. The second feeds all six kinds three writes each with fixed `kept` flags (`Same` all kept, `Moved`/`Sized` only later ones, `Other` only the last, the two dimension kinds never) and reads the per-class buckets back, plus the kept count and `total_rewrites` as the sum of the five class buckets. The caveat: these are the counters and the classifier, not the call site. `rewritten()` still decides `kept` from `Kin::kept` before counting, so what the log will report for a given run depends on that table rather than on anything asserted here. No title data, no device; GPU/driver N/A. No game data.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4965
No description provided.