GPU diagnostics: texture census does not account for all live HostTexture allocations #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?
Imported from Marvisak/VIctory. Originally posted by FunWithFlagsDev on 2026-11-26T18:50:46Z.
<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
Imported from Marvisak/VIctory. Originally posted by Ingenioeren on 2026-11-26T21:42:15Z.
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.