jaideeppyne opened a new issue, #773:
URL: https://github.com/apache/datasketches-java/issues/773

   ### Problem
   
   `theta.PreambleUtil.preambleToString()` derives `CurrentCount` for 
one-preamble-long images from `SINGLEITEM_FLAG_MASK`.
   
   Historical C++ single-item images may omit that flag. Java accepts those 
images because the theta parser deliberately does not depend on the flag, but 
the diagnostic output reports `CurrentCount: 0` even though the image contains 
one retained item.
   
   This was identified while resolving the cross-language differences tracked 
in apache/datasketches-cpp#460. Current C++ now writes the flag, but older 
valid images still expose the diagnostic mismatch.
   
   ### Expected behavior
   
   For a one-preamble-long theta image, derive the diagnostic count from the 
empty flag:
   
   - empty image: `CurrentCount: 0`
   - non-empty image: `CurrentCount: 1`
   
   The printed `SINGLE_ITEM` field should continue to reflect the serialized 
flag itself.
   
   ### Proposed test
   
   Serialize a single-item compact sketch, clear only the single-item flag to 
model a historical C++ image, and verify that `preambleToString()` reports 
`CurrentCount: 1` while preserving `SINGLE_ITEM: false`.
   


-- 
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