A flexible photonics processor enabling on-chip optimization of light-speed information processing without requiring complex fabrication.