feat(stats): widen BLAKE3 fingerprint to cover all streaming stats#3824
Merged
Conversation
Bump `FINGERPRINT_HASH_COLUMNS` from 26 to 29 so the dataset fingerprint hash now incorporates `n_positive`, `max_precision`, and `sparsity` — i.e. every streaming column emitted by `stats_headers()`. Previously the last three streaming columns were silently excluded, leaving fingerprints that could collide on datasets that differ only in those fields. Also rewrite the constant's comment to enumerate the streaming columns and note the invariant: when a streaming column is added or removed in `stats_headers()`, the constant must be updated. STATS_DEFINITIONS.md updated to match. Existing stats caches built with prior qsv versions will produce a different `blake3` value after this change; that's harmless because the cache invalidates on `qsv_version` mismatch already. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the stats command’s dataset fingerprinting so the BLAKE3 hash covers all default (“streaming”) stats columns emitted in the main stats output, preventing false fingerprint matches when datasets differ only in the previously-excluded trailing fields.
Changes:
- Increased
FINGERPRINT_HASH_COLUMNSfrom 26 to 29 to includen_positive,max_precision, andsparsityin the fingerprinted portion of each stats record. - Updated the in-code comment to enumerate the streaming columns and document the invariant with
stats_headers(). - Updated
docs/STATS_DEFINITIONS.mdto reflect the new fingerprint behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/cmd/stats.rs | Expands the fingerprint window to include all streaming columns and documents the expected column set. |
| docs/STATS_DEFINITIONS.md | Updates the hash.blake3 definition to match the widened fingerprint behavior. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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
FINGERPRINT_HASH_COLUMNSfrom26to29insrc/cmd/stats.rsso the dataset BLAKE3 fingerprint now hashes every streaming column emitted bystats_headers(). The previously-excluded trailing three (n_positive,max_precision,sparsity) are now part of the fingerprint, eliminating false matches on datasets that differ only in those fields.stats_headers()must be mirrored here.docs/STATS_DEFINITIONS.mdso thehash.blake3row reflects the new behavior.Compatibility
Stats caches generated by earlier qsv versions will produce a different
blake3value after this change. That's harmless — caches already invalidate onqsv_versionmismatch (CARGO_PKG_VERSIONincurrent_stats_args), so existing caches will be regenerated on the next run with the wider fingerprint.Test plan
cargo build --locked --bin qsv -F all_features— clean.cargo clippy --locked --bin qsv -F all_features— clean.cargo t stats -F all_features— 728 passed, 0 failed, 3 ignored (all pre-existing).blake3value in a.stats.csv.jsonis stable across reruns of the same input.n_positive/max_precision/sparsitynow produces a different fingerprint than before this PR.🤖 Generated with Claude Code