  A recent approach to the Beck-Fiala conjecture, a fundamental problem in
combinatorics, has been to understand when random integer matrices have
constant discrepancy. We give a complete answer to this question for two
natural models: matrices with Bernoulli or Poisson entries. For Poisson
matrices, we further characterize the discrepancy for any rectangular aspect
ratio. These results give sharp answers to questions of Hoberg and Rothvoss
(SODA 2019) and Franks and Saks (Random Structures Algorithms 2020). Our main
tool is a conditional second moment method combined with Stein's method of
exchangeable pairs. While previous approaches are limited to dense matrices,
our techniques allow us to work with matrices of all densities. This may be of
independent interest for other sparse random constraint satisfaction problems.
