Mask inspection and repair form a closed loop that a photomask must pass through before it can ship to production. Inspection — using optical, electron-beam, or for EUV masks actinic light — compares the patterned mask against its reference layout database to flag any defect large enough to affect printing, using either a die-to-die or die-to-database comparison depending on how many copies of the pattern exist on the mask. Any flagged defect then goes through repair (focused ion beam, laser, or e-beam deposition depending on defect type), followed by re-inspection to confirm the fix meets specification; the mask only qualifies for release once this inspect-repair-reinspect loop converges with zero print-relevant defects remaining.