Unify pieces check generation with generate_piece_checks()