fix(hll): update silently dropped after deserializing a compact List sketch (#117)

When an `HllSketch` in **List mode** is serialized it uses compact format:
only the live coupons are written to disk, with no trailing `COUPON_EMPTY`
sentinels. On deserialization, the container was allocated with exactly
`coupon_count` slots, leaving the array fully packed.

`list::update()` scans linearly for a `COUPON_EMPTY` (`0`) sentinel to find
an insertion slot. Finding none, it fell through silently — discarding every
value added after the round-trip.

Always allocate `1 << lg_arr` slots (initialized to `COUPON_EMPTY`) in
`List::deserialize()`, reading only `coupon_count` elements from the byte
stream in compact mode. The trailing empty slots are then available as
sentinels for subsequent `update()` calls.

Fixes #115.
2 files changed
tree: cba8168ebac80989a9d15b3a052dbf590606b010
  1. .cargo/
  2. .github/
  3. datasketches/
  4. tools/
  5. xtask/
  6. .asf.yaml
  7. .editorconfig
  8. .gitattributes
  9. .gitignore
  10. Cargo.lock
  11. Cargo.toml
  12. CHANGELOG.md
  13. CONTRIBUTING.md
  14. LICENSE
  15. licenserc.toml
  16. NOTICE
  17. README.md
  18. RELEASE.md
  19. rust-toolchain.toml
  20. rustfmt.toml
  21. taplo.toml
  22. typos.toml
README.md

Apache® DataSketches™ Core Rust Library Component

Crates.io Documentation MSRV 1.85.0 Apache 2.0 licensed Build Status

This is the core Rust component of the DataSketches library. It contains a subset of the sketching algorithms and can be accessed directly from user applications.

Note that we have parallel core library components for Java, C++, Python, and Go implementations of many of the same sketch algorithms:

Please visit the main DataSketches website for more information.

If you are interested in making contributions to this site, please see our Community page for how to contact us.