WIP: make criteria nogil ready