Repository navigation
registry/storage: avoid duplicate SHA-256 in canonical full-fallback validation - #4921
Merged
milosgajdos merged 1 commit intoOct 14, 2026
Merged
Conversation
…validation Signed-off-by: Perfloop Agent <[email protected]>
milosgajdos
approved these changes
Oct 12, 2026
justincormack
approved these changes
Oct 14, 2026
This was referenced Nov 8, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Avoid a redundant canonical SHA-256 pass when blob validation reaches canonical full-hash fallback. The fallback now re-derives the canonical digest from the bytes freshly read from storage and compares it with the requested canonical descriptor. The tested SHA-512/noncanonical fallback scenarios retain their existing verification behavior.
Performance
For the primary 128 MiB in-memory canonical SHA-256 full-fallback validation benchmark, median time improved from 778,789,861.5 ns/op to 416,956,704 ns/op (46.46% lower; p=0.0000108).
Additional
Commitfull-fallback measurements observed the following medians:The SHA-512 fallback measurement was 659,583,574 to 665,301,413.5 ns/op (+0.87%; p=0.247), and resumed SHA-512 was 667,379,567 to 660,202,668 ns/op (-1.08%; p=0.123). Neither difference was statistically significant.
Validation
Focused fallback and resumed-digest tests,
go vetforregistry/storage, upstream lint, vendor validation, and the binaries/API-document validation passed.Scope
This change is limited to the full-hash fallback validation branch. The common size-based fast-path branch is not modified and was not benchmarked. The primary performance claim is limited to canonical SHA-256 full-fallback validation.
Full measured evidence: https://app.perfloop.ai/t/oss/case_6nr6g3vmet