Zulip Chat Archive
Stream: lean4
Topic: sieve of Eratosthenes benchmark
Wrenna Robson (Feb 19 2026 at 09:55):
I must be missing something - but I cannot see what the benchmark in lean4#12345 has to do with the sieve of Eratosthenes. divisorsList, as defined there, seems to output exactly those numbers less than n which divide n. But this is not what the sieve does - indeed it is the exact opposite of what the sieve does. It is notoriously easy to mis-implement the sieve, especially in a functional context, but this doesn't even seem to do that. What am I missing?
Jovan Gerbscheid (Feb 23 2026 at 14:21):
Let's tag the relevant person: @Bhavik Mehta
Wojciech Różowski (Feb 23 2026 at 14:24):
Actually that was me who added the benchmark for the upcoming cbv tactic and did mistakenly attribute the name "sieve of Eratosthenes" to the benchmark proposed by @Bhavik Mehta . I am happy to rename this to avoid further confusion.
Bhavik Mehta (Feb 23 2026 at 14:25):
I don't think this is meant to be a sieve of Eratosthenes benchmark, it's just a prime filter benchmark. That is, I think the PR description misnames it, but the benchmark is still valuable
Bhavik Mehta (Feb 23 2026 at 14:26):
(I think it's possible that this example was minimised from a true sieve benchmark, but I'm not certain, and you're correct that now it definitely doesn't do that)
Wrenna Robson (Feb 23 2026 at 14:26):
It looks like a pretty sensible benchmark aye, I just think the description is confusing. I think just tests/bench/speedcenter.exec.velcom.yaml needs changing (that's the only bit that mentions the sieve I think).
Last updated: Feb 28 2026 at 14:05 UTC