Skip to content

fix: classify CPC image errors and clarify intersection naming - #195

Merged
tisonkun merged 2 commits into
mainfrom
codex/cpc-invalid-data-to-sketch
Aug 11, 2026
Merged

fix: classify CPC image errors and clarify intersection naming#195
tisonkun merged 2 commits into
mainfrom
codex/cpc-invalid-data-to-sketch

Conversation

@tisonkun

Copy link
Copy Markdown
Member

Summary

  • classify out-of-range lg_k and first_interesting_column values read from CPC images as InvalidData in both CpcSketch and CpcWrapper
  • cover both valid lg_k boundaries and the first-interesting-column boundary with regression tests
  • keep all public sketch-materialization APIs named to_sketch, while renaming the internal IntersectionState::result helper to to_compact_parts because it returns intermediate CompactSketchParts rather than a sketch
  • record the observable CPC error-kind correction in the changelog

Rationale

InvalidArgument describes a bad direct API argument. These values come from a serialized image, so an out-of-range value means the image is malformed and should use InvalidData consistently with the other deserialization checks.

The public result-extraction audit found no remaining result method: CPC, HLL, Theta, and Tuple operators already use to_sketch. The only result helper was crate-internal and did not produce a sketch, so to_compact_parts states its behavior more accurately.

Validation

  • cargo x check
  • cargo x test
  • cargo x lint

@tisonkun
tisonkun merged commit d695039 into main Aug 11, 2026
10 checks passed
@tisonkun
tisonkun deleted the codex/cpc-invalid-data-to-sketch branch August 11, 2026 01:46
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