GPU diagnostics: texture census does not account for all live HostTexture allocations #3334
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#3334
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@FunWithFlagsDev on GitHub · 2026-11-26 18:50 UTC · original
<html>Summary
On main at
63bcca43c6a00a758510398fa43096ce7e4f7df0, the global host texture counters and the detailed texture census cover different populations of live objects.This may make memory retention analysis difficult, particularly on memory-constrained adapters.
Source-level findings
HostTexture::new()incrementsTEXTURESandTEXTURE_BYTES, whileDropdecrements them.texture_census()enumerates weak references stored inMEMORY.shared_texture()can replace an existing entry inMEMORYwhile the previous host texture remains alive through other references.Auxiliary depth twin textures are constructed through
HostTexture::new()without being inserted intoMEMORY.Consequently, summing the detailed census categories does not necessarily reproduce the global live texture byte count.
Relevant source locations
resource.rs:831–859resource.rs:936–969resource.rs:1246–1263twin.rs:140–143host.rs:3084–3119Synthetic reproduction
An independent weak-reference model demonstrates the accounting difference:
State | Global live MiB | Indexed MiB -- | -- | -- Initial resource | 8 | 8 Replacement while old resource remains referenced | 24 | 16 Additional unindexed auxiliary resource | 28 | 16 Old resource released | 20 | 16 Auxiliary resource released | 16 | 16 All resources released | 0 | 0Six automated model tests and six deterministic assertions passed.
These are synthetic allocation sizes, not measured GPU residency.
Suggested improvement
Could the diagnostics explicitly distinguish indexed texture bytes from total live HostTexture bytes?
A separate category for unclassified or unindexed live allocations would make the scope of the census clearer. If this limited coverage is intentional, documenting it in the diagnostic output would also address the ambiguity.
Concurrent updates and the cost of diagnostic collection should be considered.
Scope and limitations
This report identifies a diagnostic coverage discrepancy, not a confirmed GPU memory leak.
No native D3D12 execution or Rust workspace validation was performed. No proprietary assets or game files were used.
</html>
cache_census_model.py
@Ingenioeren on GitHub · 2026-11-26 21:42 UTC · original
Confirmed the diagnostic gap on Windows WARP at public main
63bcca4using real D3D12 resources and the production constructors. Both tests used synthetic 64×64 textures and readtexture_counts()andtexture_census()directly.Releasing the old allocation brought the first case's indexed and live totals back into agreement. The counters returned to baseline after releasing the test textures. These values are VIctory's allocation accounting from D3D12, separate from adapter residency measurements. Labeling the detailed row as the title-memory index census would make that scope visible without adding a registry or subtracting two counters that can change independently. Replacement path · Census · Twin constructor
AI-assisted synthetic verification with OpenAI Codex.