Here's the problem, if bottlneck is installed then its nanvar is used, rather than this one (and you have disable that, so that's an issue). 2nd since sem doesn't have a bottleneck impl. then it will always be called; you can control how things are one. If a change in count is a problem (I can't imagine how it would be changed...but).....then simply have a test that has an exact answer for sem that would break if the count changes then this won't be an issue.