You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@datasketches.apache.org by "jaideeppyne (via GitHub)" <gi...@apache.org> on 2026/08/05 17:01:12 UTC
[PR] refactor: centralize seed hash validation (datasketches-rust)
jaideeppyne opened a new pull request, #183:
URL: https://github.com/apache/datasketches-rust/pull/183
Closes #182.
## What changed
- add one internal `check_seed_hash` helper that computes the expected hash once and preserves the existing invalid-data error
- use it in the Count-Min, CPC, compact Theta (v1/v2/v3), and compact Tuple deserialization paths
- remove 41 lines of repeated validation while keeping the helper crate-private
## Validation
- `cargo x prepare-testdata` — passed (645 cross-language snapshots prepared)
- `cargo x test` — passed
- nightly Clippy with `-D warnings` — passed
- nightly rustfmt check — passed
- rustdoc with warnings denied — passed
- Taplo format check and typos — passed
`cargo x lint` reached and passed all repository/code checks above, but its final local-tool bootstrap could not install `hawkeye 6.5.1` with the repository's Rust 1.86 toolchain because current transitive crates require Rust 1.88+; no source/license finding was reported before that environment-only bootstrap failure.
## Risk and rollback
This is an internal refactor with no public API or serialized-format change. The main risk is an accidentally changed error kind/message; the helper retains `ErrorKind::InvalidData` through `Error::deserial` and the prior message text. Reverting commit `0d6570b` fully rolls it back.
## AI assistance
OpenAI Codex assisted with implementation and validation. I reviewed the diff and test results.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org
Re: [PR] refactor: centralize seed hash validation (datasketches-rust)
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun merged PR #183:
URL: https://github.com/apache/datasketches-rust/pull/183
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org
Re: [PR] refactor: centralize seed hash validation (datasketches-rust)
Posted by "jaideeppyne (via GitHub)" <gi...@apache.org>.
jaideeppyne commented on PR #183:
URL: https://github.com/apache/datasketches-rust/pull/183#issuecomment-5198341578
Thanks — updated in 6b193ad. `check_seed_hash` now accepts an error-producing closure over `(expected, actual)`, so each caller retains control of its error contract. In particular, the CPC path still uses its prior explicit `Error::new(ErrorKind::InvalidData, ...)` form, while the deserialization paths retain `Error::deserial(...)`; the helper only owns the equality check. This also keeps the mismatch path to one seed-hash computation.
Validation after the change:
- `cargo x test` — passed
- `cargo +nightly clippy --tests --all-features --all-targets --workspace -- -D warnings` — passed
- `cargo +nightly fmt --all --check` — passed
- `RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo +nightly doc --package datasketches --all-features --no-deps` — passed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org