pat-validate from current master (11dfb8b)