Consider porting the algorithm for min/max mask in window queries from phtree-cpp. The algorithm is more vectorization friendly.