Architecture-agnostic analysis of partially coherent light with programmable photonics