leerho opened a new pull request, #790:
URL: https://github.com/apache/datasketches-java/pull/790
Adds union-result fixtures to the HLL cross-language test. Test-only; no
library code changes.
## Why
The existing HLL fixtures are update sketches only, serialized compact, at a
single lgK. That misses two classes of bugs, and both turned up in September
2026:
- The deferred KxQ rebuild can only be reached through a union, and the
generator creates no unions.
- Flags bit 32 collided between implementations (`REBUILD_CURMIN_NUM_KXQ` in
Java, `FULL_SIZE` in C++). It lives in the flags byte, which nothing inspected,
and only the compact form was ever written.
## What it adds
- `generateUnionBinariesForCompatibilityTesting` writes six files,
`hll{4,6,8}_union_java.sk` (compact) and `hll{4,6,8}_unionupd_java.sk`
(updatable). They come from a union whose inputs span all three curModes, so
coupon updates into a gadget with a pending KxQ rebuild are exercised. One lgK
is enough, because neither defect class depends on lgK. The files go to the
gitignored generated-files directory, so the repository doesn't grow.
- `checkUnionJava`, `checkUnionCpp`, `checkUnionGo` and `checkUnionRust`
share one check body. For each file it asserts that:
- flags bit 32 is never set;
- the compact flag matches the form that was written (HLL_6 and HLL_8 used
to omit it);
- the estimate matches the true count, and is the same for every target
type, since an incorrect KxQ rebuild shifts it.
No C++, Go or Rust generator writes these files yet. Until one does, those
checks warn about the missing files and skip them. Matching generators in the
other repos would be follow-ups.
## Testing
- `-Pcheck_java_files`: generates the files and reads them back, 4/4
`HllSketchCrossLanguageTest` tests pass.
- When it was written, the check was verified by corrupting a fixture:
setting bit 32, or clearing the compact flag, each fails with the intended
message.
- `mvn verify -DskipTests` passes. The default test run is unaffected,
because these groups are excluded by default.
Supersedes the never-opened branch `hll-xlang-fixtures`. This is the same
commit, rebased onto main after #771.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]