  The photonic platform holds great promise for quantum computing.
Nevertheless, the intrinsic probabilistic characteristics of its native fusion
operations introduces substantial randomness into the computing process, posing
significant challenges to achieving scalability and efficiency in program
execution. In this paper, we introduce a randomness-aware compilation framework
designed to concurrently achieve scalability and efficiency. Our approach
leverages an innovative combination of offline and online optimization passes,
with a novel intermediate representation serving as a crucial bridge between
them. Through a comprehensive evaluation, we demonstrate that this framework
significantly outperforms the most efficient baseline compiler in a scalable
manner, opening up new possibilities for realizing scalable photonic quantum
computing.
