Comparison-Based Diagnosis of VLSI Wafers