SavicStefan opened a new pull request, #514: URL: https://github.com/apache/datasketches-cpp/pull/514
The C++ theta implementation used a single constant, theta_constants::MIN_LG_K = 5, for two distinct roles: the floor on the user-requested nominal size (K) and the floor on the internal hash table (cache) size. Java keeps these separate -- ThetaUtil.MIN_LG_NOM_LONGS = 4 and MIN_LG_ARR_LONGS = 5 -- so Java accepts lg_k = 4 (nominal 16) while C++ rejected it in theta_base_builder:: set_lg_k. This blocked cross-language use of the smallest theta/tuple sketches and unions. Split the constant: MIN_LG_K becomes 4 (the nominal floor validated by set_lg_k, shared by update/union/tuple builders), and a new MIN_LG_ARR = 5 keeps the hash table floored at 32 slots via starting_sub_multiple(). A lg_k = 4 sketch therefore starts with lg_cur_size (5) > lg_nom_size (4) and only ever rebuilds down to the nominal 16, which the existing update/rebuild path already handles. Add tests: building at the minimum lg_k (and rejecting below it), estimation + trim + serialization round trip for an update sketch, and a union built at the minimum lg_k. Co-authored-by: Isaac -- 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]
