Files
6gbvram---16gb-ram/crates
Local TestandClaude Sonnet 5 5b36758982 perf(resource): gate filler-twins statistics behind diagnostics
texture_at's filler-twins tracking (PLACED_RAW, PLACED_TWINS, and the
per-call block in texture_at that takes PLACED_RAW's own mutex and scans
previously-seen raw descriptions at the same address) exists solely to
feed placed_filler_twins(), whose only caller is copystat::log_memory --
itself compiled only with feature = "diagnostics". A build without that
feature paid for the second mutex, the BTreeSet, and an O(seen-so-far)
scan on every placed-texture lookup (hit or miss) with no consumer for
the result.

Gates PLACED_RAW, PLACED_TWINS, placed_filler_twins(), the `raw` binding,
and the tracking block itself behind feature = "diagnostics". The
functional cache (PLACED_TEXTURES) and its key (`key`, built from
VICTORY_PLACED_FILLER the same way as before) are untouched -- this
candidate never reads or writes PLACED_TEXTURES.

Independently reviewed before implementing (see
research/reviews/OPTIMIZATION_CANDIDATE_B_REVIEW.md): re-ran the
existing experiments/optimization-validation/filler.rs equivalence
tests myself (6/6 pass, both configs), confirmed the eliminated block
has no path into the functional cache, confirmed no equivalent change
exists upstream (checked ZJOU 477c395a directly -- it gates only the
getter, not the producer -- and did a fresh PR search).

Verified after implementing: cargo test --workspace --locked (27 result
lines) and cargo test -p victory-gpu --features diagnostics --lib (381
tests) are byte-for-byte identical in pass/fail/ignored counts between
this branch and an unpatched origin/main worktree. cargo clippy, both
CI invocations (with and without --all-features), produce an identical
error set to the same unpatched worktree (a pre-existing, unrelated
victory-formats issue blocks the workspace-wide command in both).

Does not implement candidate A (incremental VIEWS census) or the shapes
segmentation candidate, per instruction. No game files used, no push,
no PR.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-11-27 01:18:17 +01:00
..