A Fast x86 Implementation of Select (2017) [pdf]
arxiv.org
arxiv.org
https://github.com/facebook/folly/commit/b28186247104f8b90cf...
That said, we worry too much about who the first person to have an idea was. Any idea worth having is come upon independently by many people, and putting the idea to work and communicating it to others are more valuable contributions anyway.
It's worth noting Jukka Suomela had this PDEP idea late 2014, and I've used the trick a few times from that source.
https://scholar.google.com/scholar?q=guy+jacobson
But, there's been a lot of development on succinct data structures since, and this post on the fast select algorithm was in-part a continuation of a conversation from a post yesterday on succinct data structures in general and the open-source lib SDSL 2.0. So if anyone wants to learn more about SDSs in general, there's a bunch of links to videos and reference material in the comments of yesterday's thread...
SDSL – Succinct Data Structure Library 2.0 https://news.ycombinator.com/item?id=18204432
But then I found <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50168>.
Using tzcnt in principle is faster than bsf in many cases since bsf always has a dependency on the output register (due to the zero input case), but tzcnt doesn't. In practice tzcnt had a false dependency anyways, at least until Skylake where that was fixed (again IIRC, I recall that one of these bit manipulation didn't have their false report fixed, but the rest did).
One thing they don't mention is that the low MLP isn't inherent in the other algorithms! With the default/obvious implementation of a benchmark loop using each method you hit this issue, but in principle I think you could re-write almost any algorithm which is "instruction count MLP limited" like this into another one that isn't. A simple sketch is to simply do a batch of N loads up front, storing them into a temporary buffer, then do the computation part.
The loading part will have maximum MLP (after all, it's pure loads) and then the computation part will get all L1 hits unless you picked N wrong.
It loses a bit because the loads aren't as effectively overlapped with computation, but if the loads time "dominates" as presented here, it would work well.
A more sophisticated approach would still try to overlap computation and loads, at max MLP. You could do this by inserting additional prefetches or actual loads into the computation stream, enough to get the required MLP. This is actually kind of complicated and more dependent on the actual hardware parameters which is why I mentioned the other way first.
Eventually I worked it out. I think they are planning to submit this as a conference paper, but at the time of creating the preprint weren't sure which conference. So "Conference on Very Important Topics" is just a placeholder for where the actual conference/proceedings info would go on the article first page.