  We prove a version of the Bhargava-Kane-Lenstra-Poonen-Rains heuristics for
Selmer groups of quadratic twist families of abelian varieties over global
function fields. As a consequence, we derive a result towards the "minimalist
conjecture" on Selmer ranks of abelian varieties in such families. More
precisely, we show that the probabilities predicted in these two conjectures
are correct to within an error term in the size of the constant field, $q$,
which goes to $0$ as $q$ grows. Two key inputs are a new homological stability
theorem for a generalized version of Hurwitz spaces parameterizing covers of
punctured Riemann surfaces of arbitrary genus, and an expression of average
sizes of Selmer groups in terms of the number of rational points on these
Hurwitz spaces over finite fields.
