Skip to content

feat(stats): widen BLAKE3 fingerprint to cover all streaming stats#3824

Merged
jqnatividad merged 3 commits into
masterfrom
fingerprint-all-streaming-stats
May 6, 2026
Merged

feat(stats): widen BLAKE3 fingerprint to cover all streaming stats#3824
jqnatividad merged 3 commits into
masterfrom
fingerprint-all-streaming-stats

Conversation

@jqnatividad
Copy link
Copy Markdown
Collaborator

Summary

  • Bumps FINGERPRINT_HASH_COLUMNS from 26 to 29 in src/cmd/stats.rs so the dataset BLAKE3 fingerprint now hashes every streaming column emitted by stats_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.
  • Rewrites the constant's comment to enumerate the streaming columns and pin the invariant: any change to the streaming-column set in stats_headers() must be mirrored here.
  • Updates docs/STATS_DEFINITIONS.md so the hash.blake3 row reflects the new behavior.

Compatibility

Stats caches generated by earlier qsv versions will produce a different blake3 value after this change. That's harmless — caches already invalidate on qsv_version mismatch (CARGO_PKG_VERSION in current_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).
  • Verify the new blake3 value in a .stats.csv.json is stable across reruns of the same input.
  • Verify a dataset whose stats differ ONLY in n_positive/max_precision/sparsity now produces a different fingerprint than before this PR.

🤖 Generated with Claude Code

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>
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 6, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_COLUMNS from 26 to 29 to include n_positive, max_precision, and sparsity in 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.md to 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.

Comment thread src/cmd/stats.rs Outdated
Comment thread docs/STATS_DEFINITIONS.md Outdated
jqnatividad and others added 2 commits May 6, 2026 13:32
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>
@jqnatividad jqnatividad merged commit a9062fa into master May 6, 2026
8 of 9 checks passed
@jqnatividad jqnatividad deleted the fingerprint-all-streaming-stats branch May 6, 2026 17:33
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.

2 participants