Skip to content

Use an array of zero bytes instead of nil to represent "no fingerprint"#447

Open
aqk wants to merge 1 commit intomainfrom
use-zero-byte-vector-instead-of-nil
Open

Use an array of zero bytes instead of nil to represent "no fingerprint"#447
aqk wants to merge 1 commit intomainfrom
use-zero-byte-vector-instead-of-nil

Conversation

@aqk
Copy link
Copy Markdown
Contributor

@aqk aqk commented Apr 16, 2026

Doing this allows concatenation of an ordered set of signatures to uniquely represent that set.


Note

Medium Risk
Touches dependency fingerprinting and cache-key generation, so mistakes could cause incorrect cache hits/misses or reduced cache effectiveness despite the change being mechanically straightforward.

Overview
Standardizes include fingerprints to a fixed 32-byte SHA-256 digest. IncludeDesc.fingerprint changes from Vec<u8> (with “no fingerprint” as empty) to [u8; 32] (with “no fingerprint” as all-zero bytes), and all include/namespace/embed paths now populate this field accordingly.

This updates cache key construction in diskcache to concatenate fixed-size fingerprints deterministically, and adds explicit try_into() conversions where SHA-256 results are produced (e.g., add_main_fingerprint, module/import hashing).

Reviewed by Cursor Bugbot for commit 9c4af97. Bugbot is set up for automated code reviews on this repo. Configure here.

Doing this allows concatenation of an ordered set of signatures to uniquely represent that set.
Base automatically changed from 20260216-freeze-early-cache to main April 21, 2026 02:34
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