-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mastic: Implement the heavy hitters sketch from ia.cr/2024/666 #1208
base: main
Are you sure you want to change the base?
Conversation
// Make sure all heavy hitters are accounted for. | ||
let num_heavy_hitters = count | ||
.iter() | ||
.filter(|(_weight, count)| **count >= mastic.szk.typ.threshold) | ||
.count(); | ||
assert_eq!(heavy_hitters.len(), num_heavy_hitters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test may flake, since bucket collisions can garble heavy hitters.
71cd831
to
0c7b791
Compare
// Check that each input is either a `1` or a `-1`. | ||
input | ||
.iter() | ||
.copied() | ||
.map(|x| gadgets[0].call(&[x])) | ||
.collect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A typical input length will probably be something like num_bits == 256
. I wonder if we'd be better off (in terms of proof size and computation) with ParallelSum
here.
That would mean we would need joint randomness and thus a larger field (Field128
). I'm not sure if a larger field would pay off.
da8f205
to
c279d4f
Compare
This commit adds an initial implementation of the sketching technique from ia.cr/2024/666 for approximate heavy hitters. This main advantage is that the computation requires just one round of aggregation rather than many.
c279d4f
to
a38929d
Compare
This commit adds an initial implementation of the sketching technique from ia.cr/2024/666 for approximate heavy hitters. This main advantage is that the computation requires just one round of aggregation rather than many.