FastFilter / fastfilter_java

Fast Approximate Membership Filters (Java)
Apache License 2.0
238 stars 27 forks source link

XorSimple ArrayIndexOutOfBoundsException (qi becomes negative) #18

Open richardstartin opened 4 years ago

richardstartin commented 4 years ago

Not reproducible because of nondeterministic implementation. Triggered with: seed = -7786367340918479677 keys = [-5825935719248731811, -1720202582300215804, 6605723083954138092]

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 33
    at org.fastfilter.xor.XorSimple.map(XorSimple.java:55)
    at org.fastfilter.xor.XorSimple.<init>(XorSimple.java:28)
    at org.fastfilter.xor.XorSimple.construct(XorSimple.java:19)
    at org.fastfilter.FilterType$8.construct(FilterType.java:68)
    at org.fastfilter.SimpleFuzzer.main(SimpleFuzzer.java:28)
lemire commented 2 years ago

Looks like an overflow.

I would recommend you checkout the new XorBinaryFuse8.java. Faster and smaller.