Non-deterministic result when merging an empty KllFloatsSketch with two others
还没有人认领这个 Issue。
评估
调研方向
首先复现围绕 KllFloatsSketch.newHeapInstance()、heapify()、merge() 和 toByteArray() 提供的测试。比较合并包含 1 个和 200 个项目的 sketch 时重复序列化的结果,然后跟踪合并和序列化行为。重复测试产生一个确定性的 digest 并且持续通过,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Merging an empty KllFloatsSketch with two KllFloatsSketch, with 1 and 200 "items" respectively, does not always produce the same result
I would have expected the following test scenario to pass:
@Test
public void test() throws NoSuchAlgorithmException {
KllFloatsSketch t1 = KllFloatsSketch.newHeapInstance();
t1.update(1f);
byte[] tb1 = t1.toByteArray();
KllFloatsSketch t2 = KllFloatsSketch.newHeapInstance();
for(int i=0; i<200; i++) {
t2.update(1f*i);
}
byte[] tb2 = t2.toByteArray();
HashSet<BigInteger> digests = new HashSet<>();
for(int i=0; i<30; i++) {
KllFloatsSketch start = KllFloatsSketch.newHeapInstance();
byte[] h1 = Arrays.copyOf(tb1, tb1.length);
byte[] h2 = Arrays.copyOf(tb2, tb2.length);
KllFloatsSketch kll1 = KllFloatsSketch.heapify(MemorySegment.ofArray(h1));
start.merge(kll1);
KllFloatsSketch kll2 = KllFloatsSketch.heapify(MemorySegment.ofArray(h2));
start.merge(kll2);
MessageDigest md5 = MessageDigest.getInstance("MD5");
BigInteger digest = new BigInteger(md5.digest(start.toByteArray()));
digests.add(digest);
System.out.println(digest);
}
assertEquals(1, digests.size());
}
The digests are:
115710133967357289505160160937439690295
-100233422360292323003164315945381734567
-100233422360292323003164315945381734567
-100233422360292323003164315945381734567
115710133967357289505160160937439690295
115710133967357289505160160937439690295
...
And therefore the test throws:
java.lang.AssertionError:
Expected :2
Actual :1
- 主要语言
- Java
- 星标
- 958
- 派生
- 226
- 平均合并
- 3 天 40 分钟
- 30 天内合并 PR
- 13
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datasketches-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
apache/datasketches-java#731 · 16 条评论 ·
-
难度 3/5 1-2 天 新手友好度 58/100
apache/datasketches-java#739 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
apache/datasketches-java#720 · 3 条评论 ·
-
难度 5/5 一周以上 新手友好度 30/100
apache/datasketches-java#647 · 5 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
apache/datasketches-java#569 ·
查看 apache/datasketches-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
infinispan/infinispan#18150 ·
-
area/frontend
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
untriaged
难度 2/5 1-3 小时 新手友好度 82/100
opensearch-project/k-NN#3597 ·
-
bug
难度 2/5 1-3 小时 新手友好度 88/100