tisonkun opened a new pull request, #382:
URL: https://github.com/apache/datasketches-rust/pull/382
Closes #176.
## Summary
`datasketches-rust` previously consumed cross-language serialization
fixtures from C++, Go, and Java via `apache/datasketches-tck`, while lacking a
generator to produce Rust serialization snapshots for TCK publication,
peer-language compatibility suites, and end-to-end self-verification. In
addition, `HllSketch::serialize` and `HllUnion::serialize` omitted
`COMPACT_FLAG_MASK` (`0x08`) in serialized `HllType::Hll6` and `HllType::Hll8`
HLL-mode preambles, causing compact-format checks in cross-language readers
such as `datasketches-java` (`HllSketchCrossLanguageTest.checkUnionRust`) to
reject serialized Rust HLL6 and HLL8 union images.
This pull request adds the Rust serialization snapshot generator, wires it
into `xtask` and `tests-integration`, and aligns HLL6 and HLL8 preamble flags
with the compact wire format:
* Set `COMPACT_FLAG_MASK` across `Hll4`, `Hll6`, and `Hll8` in
`write_hll_preamble` (`datasketches/src/hll/serialization.rs`), matching `List`
and `HashSet` coupon modes and peer DataSketches implementations while keeping
deserialization permissive for images with or without the flag, and record the
fix in `CHANGELOG.md`.
* Add an unpublished `snapshots` workspace binary crate (`--output-dir`,
repeatable `--sketch`) that generates 176 `.sk` fixtures across all 12 sketch
families, and document snapshot generation in `CONTRIBUTING.md`.
* Extend `cargo x prepare-testdata` with a `rust` target, included in the
default language set for CI coverage while running offline without downloading
remote TCK archives when `rust` is selected alone.
* Add 1-to-1 self-verification tests in
`tests-integration/tests/serde_tests` covering all 176 `*_rust.sk` fixtures
alongside existing C++, Go, and Java compatibility tests, and ignore
`rust_generated_files` in `tests-integration/tests/serde_tests/.gitignore`.
| Sketch family | Count | Generated fixtures
|
| ------------- | ----: |
---------------------------------------------------------------------------------------------------------------------
|
| `bloom` | 8 | `bf_n{0,10000,2000000,30000000}_h{3,5}_rust.sk`
|
| `countmin` | 7 | `count_min_v2_n{0,1,10,100,1000,10000}_rust.sk`,
`count_min_v2_seed42_n1000_rust.sk` |
| `cpc` | 6 | `cpc_n{0,100,200,2000,20000}_rust.sk`,
`cpc_negative_one_rust.sk` |
| `density` | 12 |
`density_{float,double}_n{0,1,10,100,1000,10000}_rust.sk`
|
| `frequencies` | 20 | `frequent_{long,string}_n*_rust.sk`,
`frequent_{long,string}_purged_rust.sk`, `frequent_string_{ascii,utf8}_rust.sk`
|
| `hll` | 27 | `hll{4,6,8}_n*_rust.sk`,
`hll{4,6,8}_union_rust.sk`
|
| `kll` | 32 | `kll_{float,double,long,string}_n*_rust.sk`
|
| `req` | 12 | `req_float_n*_rust.sk`,
`req_float_{negative,mixed}_n{1,10}_rust.sk`
|
| `tdigest` | 8 | `tdigest_double_n*_rust.sk`
|
| `theta` | 15 | `theta_n*_rust.sk`,
`theta_compressed_n{10..1000000}_rust.sk`, `theta_non_empty_no_entries_rust.sk`
|
| `tuple` | 8 | `tuple_int_n*_rust.sk`
|
| `xor` | 21 |
`xor{8,16,32}_n{0,1,10,100,1000,10000,100000}_rust.sk`
|
## Validation
* `cargo x prepare-testdata rust` (offline generation of all 176 fixtures)
and `--sketch` family filtering.
* `cargo x lint`, `cargo x check`, `cargo x test`, and MSRV (`1.86.0`)
workspace test runs.
* `apache/datasketches-tck` `snapshots update rust` and repeated `snapshots
check rust` runs verifying deterministic stability across all 149 deterministic
fixtures and expected randomized compaction variance across the 27
estimation-mode KLL, REQ, and Density fixtures.
* Cross-language deserialization against `apache/datasketches-java` (`mvn
test -P check_rust_files`, including
`HllSketchCrossLanguageTest.checkUnionRust`) and `apache/datasketches-cpp`
across all shared sketch families.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]