GPU: distinguish live texture allocations from the title-memory index #3400

Open
github-bot wants to merge 1 commit from github-bot/gh-3400 into main AGit
Owner

@⁠AlanQiang0418 on GitHub · 2026-11-26 22:22 UTC · original
AlanQiang0418:codex/texture-census-scope → main · +8 −5 · 2 files · 1 commits · open

Closes #3334. Coordination claim.

A depth twin contributes to the live host texture total. So does an old allocation that a command list still holds after another texture replaces it at the same address. The detailed report visits only current entries in the title-memory index.

The frame report now labels both populations and prints the indexed subtotal alongside the six existing categories. It sums their byte counts before rounding to MB, using the same traversal that supplies the breakdown.

Validation

  • cargo test --locked -p victory-gpu --features diagnostics --lib resource::tests -- --test-threads=1 passed all 18 tests.
  • cargo clippy --locked -p victory-gpu --all-targets --all-features -- -D warnings passed.
  • A synthetic WARP run with two 1024×1024 indexed textures, a replaced texture retained by a command list, and a writable depth twin measured 16,777,216 live bytes and 8,388,608 indexed bytes. Each of the two allocations outside the index accounted for 4,194,304 bytes. The updated frame log printed live host textures: 4 (17 MB, 4 MB of them used by lists) and host textures in the title-memory index: 8 MB. Releasing the command list reduced only the live total. After releasing every texture, both totals reached zero.
  • The repository asset check passed for both changed files.

AI-assisted with OpenAI Codex.

**@⁠AlanQiang0418** on GitHub · 2026-11-26 22:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/3400) `AlanQiang0418:codex/texture-census-scope` → `main` · +8 −5 · 2 files · 1 commits · open Closes #3334. [Coordination claim](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633). A depth twin contributes to the live host texture total. So does an old allocation that a command list still holds after another texture replaces it at the same address. The detailed report visits only current entries in the title-memory index. The frame report now labels both populations and prints the indexed subtotal alongside the six existing categories. It sums their byte counts before rounding to MB, using the same traversal that supplies the breakdown. **Validation** - `cargo test --locked -p victory-gpu --features diagnostics --lib resource::tests -- --test-threads=1` passed all 18 tests. - `cargo clippy --locked -p victory-gpu --all-targets --all-features -- -D warnings` passed. - A synthetic WARP run with two 1024×1024 indexed textures, a replaced texture retained by a command list, and a writable depth twin measured 16,777,216 live bytes and 8,388,608 indexed bytes. Each of the two allocations outside the index accounted for 4,194,304 bytes. The updated frame log printed `live host textures: 4 (17 MB, 4 MB of them used by lists)` and `host textures in the title-memory index: 8 MB`. Releasing the command list reduced only the live total. After releasing every texture, both totals reached zero. - The repository asset check passed for both changed files. AI-assisted with OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:06:41 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 22:28 UTC · original · approved these changes

LGTM — verified on RTX 5090 (Windows / D3D12) against origin/main (63bcca4).

  • Clearly distinguishing live texture allocations from the title-memory index is clean and minimal.
  • cargo test -p victory-gpu --lib resource:: -- --test-threads=1: 18 passed, 0 failed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 22:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/3400#pullrequestreview-6081125957) · **approved these changes** LGTM — verified on RTX 5090 (Windows / D3D12) against `origin/main` (`63bcca4`). - Clearly distinguishing live texture allocations from the title-memory index is clean and minimal. - `cargo test -p victory-gpu --lib resource:: -- --test-threads=1`: 18 passed, 0 failed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠Jackster on GitHub · 2026-11-26 23:02 UTC · original

Windows 11, 63bcca4 + this PR, Radeon RX 7900 XTX:

  • cargo test -p victory-gpu --lib: 231 passed / 0 failed / 1 ignored — same count as unpatched 63bcca4.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.

No test is added; this is compile/regression coverage for the memory-report split between live texture allocations and the title-memory index. Synthetic only. AI-assisted.

**@⁠Jackster** on GitHub · 2026-11-26 23:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/3400#issuecomment-7205200474) Windows 11, `63bcca4` + this PR, Radeon RX 7900 XTX: - `cargo test -p victory-gpu --lib`: 231 passed / 0 failed / 1 ignored — same count as unpatched `63bcca4`. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. No test is added; this is compile/regression coverage for the memory-report split between live texture allocations and the title-memory index. Synthetic only. AI-assisted.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 23:02 UTC · original · approved these changes

Reviewed 4f077f2a merged onto main (63bcca43) — clear and accurate diagnostic distinction between live HostTexture allocations (texture_counts) and the MEMORY title-memory index (texture_census).

Verification

  • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (both default and --features diagnostics): 0 warnings.
  • resource::tests:: passed on both a discrete NVIDIA RTX 5090 and WARP with --features diagnostics and VICTORY_D3D12_DEBUG=1.
  • Ran a live invariant probe on RTX 5090 and WARP (VICTORY_D3D12_DEBUG=1) confirming the exact behavior documented in crates/victory-gpu/src/resource.rs:942 and logged in crates/victory-gpu/src/host.rs:3087, 3118:
    • Replacing a MEMORY-indexed texture while a caller still holds the previous Arc<HostTexture> reports live_delta = 131072 vs indexed_delta = 65536.
    • Creating a depth twin via HostTexture::new adds 65536 to live bytes while leaving texture_census() unchanged.
    • Dropping handles and releasing resources returns both live and indexed counters cleanly to baseline with 0 leaks and 0 Debug Layer errors.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 23:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/3400#pullrequestreview-6081324665) · **approved these changes** Reviewed `4f077f2a` merged onto `main` (`63bcca43`) — clear and accurate diagnostic distinction between live `HostTexture` allocations (`texture_counts`) and the `MEMORY` title-memory index (`texture_census`). ### Verification - `cargo xtask policy`: 191 files ok; `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (both default and `--features diagnostics`): 0 warnings. - `resource::tests::` passed on both a discrete NVIDIA RTX 5090 and WARP with `--features diagnostics` and `VICTORY_D3D12_DEBUG=1`. - Ran a live invariant probe on RTX 5090 and WARP (`VICTORY_D3D12_DEBUG=1`) confirming the exact behavior documented in `crates/victory-gpu/src/resource.rs:942` and logged in `crates/victory-gpu/src/host.rs:3087, 3118`: - Replacing a `MEMORY`-indexed texture while a caller still holds the previous `Arc<HostTexture>` reports `live_delta = 131072` vs `indexed_delta = 65536`. - Creating a depth twin via `HostTexture::new` adds `65536` to live bytes while leaving `texture_census()` unchanged. - Dropping handles and releasing resources returns both live and indexed counters cleanly to baseline with 0 leaks and 0 Debug Layer errors. LGTM.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 11:24 UTC · original

I checked the actual frame log on 4f077f2 and on main 63bcca4 with the same synthetic test on Windows/WARP 1.0.22. Four live textures accounted for 1,835,008 bytes, with two indexed textures accounting for 524,288 bytes. Main printed the old labels and no indexed subtotal. This PR printed live host textures: 4 (2 MB, …) and host textures in the title-memory index: 1 MB. The two indexed buckets each round to 0 MB individually, so the test also checks that the subtotal is rounded after the bytes are summed. All counts returned to baseline after release.

The optional test-only commit is directly on 4f077f2. It fails on main at the frame-log assertion and passes with this PR. Run texture_frame_report_distinguishes_live_and_indexed_bytes with --features diagnostics and -- --ignored --test-threads=1; it runs alone because the counters are process-wide. The 18 existing resource tests passed on both revisions. Strict all-features/all-targets GPU Clippy and the asset policy passed on the test branch.

If you take the commit, please retain the Git author. If folding it in, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted with Codex. Synthetic textures only.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 11:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/3400#issuecomment-7217032291) I checked the actual frame log on `4f077f2` and on main `63bcca4` with the same synthetic test on Windows/WARP 1.0.22. Four live textures accounted for 1,835,008 bytes, with two indexed textures accounting for 524,288 bytes. Main printed the old labels and no indexed subtotal. This PR printed `live host textures: 4 (2 MB, …)` and `host textures in the title-memory index: 1 MB`. The two indexed buckets each round to 0 MB individually, so the test also checks that the subtotal is rounded after the bytes are summed. All counts returned to baseline after release. The optional [test-only commit](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/be774666d6960be8528cc60f1968a084125894a9) is directly on `4f077f2`. It fails on main at the frame-log assertion and passes with this PR. Run `texture_frame_report_distinguishes_live_and_indexed_bytes` with `--features diagnostics` and `-- --ignored --test-threads=1`; it runs alone because the counters are process-wide. The 18 existing resource tests passed on both revisions. Strict all-features/all-targets GPU Clippy and the asset policy passed on the test branch. If you take the commit, please retain the Git author. If folding it in, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with Codex. Synthetic textures only.
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/3400/head:github-bot/gh-3400'
git switch 'github-bot/gh-3400'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3400'
git switch 'github-bot/gh-3400'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3400'
git switch 'github-bot/gh-3400'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3400'
git switch 'main'
git merge --squash 'github-bot/gh-3400'
git switch 'main'
git merge --ff-only 'github-bot/gh-3400'
git switch 'main'
git merge 'github-bot/gh-3400'
git push origin 'main'
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/Marvisak--VIctory!3400
No description provided.