leerho opened a new pull request, #813:
URL: https://github.com/apache/datasketches-java/pull/813

   The `CompactTupleSketch` reader now checks the first 8 bytes of an empty 
serial version 3 image, as the theta reader does since #776. Before this 
change, any image with the empty flag set was accepted, whatever its other 
preamble bytes held.
   
   An empty image must have:
   - PreLongs = 1, SerVer = 3, Family = TUPLE (9), SketchType = 
CompactTupleSketch (1), and a zero unused byte 4;
   - the read-only, empty and compact flags set, with reserved flag bits 0, 5, 
6 and 7 clear.
   
   Ignored, as in theta:
   - **the ordered flag:** older Java writers leave it clear; C++, Go and Java 
after #812 set it;
   - **the seed hash:** it is 0 or the seed hash, depending on the writer. The 
Go CL file `tuple_int_n0_go.sk` carries the default seed hash.
   
   Every empty-image writer checked writes this form: Java from 3.1.0 on (when 
serial version 3 began), C++ from 3.0.0 on, and Go. Legacy images (serial 
versions 1 and 2) are not changed.
   
   **Tests:** the new `TupleEmptyImageTest` accepts the Java, older Java, C++ 
and Go empty forms, ignores the seed hash under a custom seed, and accepts 
trailing bytes. It rejects PreLongs 2 or 3, a nonzero unused byte, a missing 
read-only or compact flag, and each reserved flag bit. The four rejection tests 
fail on main.
   
   - Full suite: 2,456 tests pass.
   - `check_cpp_files`, `check_go_files`, `check_rust_files` and 
`check_cpp_historical_files` pass.
   - Merged with #812, the tuple tests pass (278); the two branches don't 
conflict.
   
   The array-of-doubles compact reader is not changed here.
   
   🤖 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]

Reply via email to