  Multiport interferometers based on integrated beamsplitter meshes are widely
used in photonic technologies. While the rectangular mesh is favored for its
compactness and uniformity, its geometry resists conventional
self-configuration approaches, which are essential to programming large meshes
in the presence of fabrication error. Here, we present a new configuration
algorithm, related to the $2\times 2$ block decomposition of a unitary matrix,
that overcomes this limitation. Our proposed algorithm is robust to errors,
requires no prior knowledge of the process variations, and relies only on
external sources and detectors. We show that self-configuration using this
technique reduces the effect of fabrication errors by the same quadratic factor
observed in triangular meshes. This relaxes a significant limit to the size of
multiport interferometers, removing a major roadblock to the scaling of optical
quantum and machine-learning hardware.
