  The abundance of dark matter haloes is one of the key probes of the growth of
structure and expansion history of the Universe. Theoretical predictions for
this quantity usually assume that, when expressed in a certain form, it depends
only on the mass variance of the linear density field. However, cosmological
simulations have revealed that this assumption breaks, leading to 10-20%
systematic effects. In this paper we employ a specially-designed suite of
simulations to further investigate this problem. Specifically, we carry out
cosmological N-body simulations where we systematically vary growth history at
a fixed linear density field, or vary the power spectrum shape at a fixed
growth history. We show that the halo mass function generically depends on
these quantities, thus showing a clear signal of non-universality. Most of this
effect can be traced back to the way in which the same linear fluctuation grows
differently into the nonlinear regime depending on details of its assembly
history. With these results, we propose a parameterization with explicit
dependence on the linear growth rate and power spectrum shape. Using an
independent suite of simulations, we show that this fitting function accurately
captures the mass function of haloes over cosmologies spanning a vast parameter
space, including massive neutrinos and dynamical dark energy. Finally, we
employ this tool to improve the accuracy of so-called cosmology-rescaling
methods and show they can deliver 2% accurate predictions for the halo mass
function over the whole range of currently viable cosmologies.
