  An irreducible integrable connection $(E,\nabla)$ on a smooth projective
complex variety $X$ is called rigid if it gives rise to an isolated point of
the corresponding moduli space $\mathcal{M}_{dR}(X)$. According to Simpson's
motivicity conjecture, irreducible rigid flat connections are of geometric
origin, that is, arise as subquotients of a Gau\ss-Manin connection of a family
of smooth projective varieties defined on an open dense subvariety of $X$. In
this article we study mod $p$ reductions of irreducible rigid connections and
establish results which confirm Simpson's prediction. In particular, for large
$p$, we prove that $p$-curvatures of mod $p$ reductions of irreducible rigid
flat connections are nilpotent, and building on this result, we construct an
$F$-isocrystalline realization for {irreducible} rigid flat connections. More
precisely, we prove that there exist smooth models $X_R$ and $(E_R,\nabla_R)$
of $X$ and $(E,\nabla)$, over a finite type ring $R$, such that for every Witt
ring $W(k)$ of a finite field $k$ and every homomorphism $R \to W(k)$, the
$p$-adic completion of the base change
$(\widehat{E}_{W(k)},\widehat{\nabla}_{W(k)})$ on $\widehat{X}_{W(k)}$
represents an $F$-isocrystal. Subsequently we show that {irreducible} rigid
flat connections with vanishing $p$-curvatures are unitary. This allows us to
prove new cases of the Grothendieck--Katz $p$-curvature conjecture. We also
prove the existence of a complete companion correspondence for $F$-isocrystals
stemming from irreducible cohomologically rigid connections.
