Skip to content

perf(gpu): hash tracked texture subresources with a 128-bit digest - #476

Open
romainhedouin wants to merge 1 commit into
pragyaangaur:mainfrom
romainhedouin:perf/texture-digest-128
Open

romainhedouin wants to merge 1 commit into
pragyaangaur:mainfrom
romainhedouin:perf/texture-digest-128

Conversation

@romainhedouin

@romainhedouin romainhedouin commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Tracked texture subresources (VICTORY_FAULT_TRACKING=1 only) are now compared by a 128-bit digest instead of blake3::hash; untracked memory (the Rosetta default) is still compared byte for byte. The digest is not cryptographic (a change confined to one 16-byte lane must repeat that lane's 64-bit state, so the effective bound there is about 2^-64, not 2^-128): a collision would leave one subresource stale until its next change. blake3 stays a dependency (used elsewhere).

Hashing 1 MiB of texture bytes blake3 digest
native timing, Apple M4, standalone model (not Rosetta/Wine) 0.45 ms 0.034 ms (about 13x)
model, 1M+ structured edits (bit pairs, swaps, XOR-cancelling pairs, zero padding, lane-confined flips) n/a 0 collisions in 128 bits; 32-bit slices match chance; avalanche 64.0 of 128 bits

Tested: Windows clippy (both configs) clean and the two new unit tests pass in a standalone copy; not run under CrossOver, and the share of a frame spent hashing is unmeasured. Will conflict textually with #415, #416 and #417, which edit the same lines.

🤖 Generated with Claude Code

blake3 took 0.45 ms a MiB on the arm64 NEON path; the digest takes 0.034
ms (native model, M4, same code, about 13x). Only tracked textures hash
(VICTORY_FAULT_TRACKING=1): with fault tracking off, the Rosetta default,
they are compared byte for byte. The digest is not cryptographic; a
collision leaves one subresource stale until its next change.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@romainhedouin
romainhedouin force-pushed the perf/texture-digest-128 branch from 6fea78e to 8c2e7e4 Compare November 27, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant