  We construct projective varieties in mixed characteristic whose singularities
model, in generic cases, those of tamely potentially crystalline Galois
deformation rings for unramified extensions of $\mathbb{Q}_p$ with small
regular Hodge-Tate weights. We establish several significant facts about their
geometry including a unibranch property at special points and a representation
theoretic description of the irreducible components of their special fibers. We
derive from these geometric results a number of local and global consequences:
the Breuil-M\'ezard conjecture in arbitrary dimension for tamely potentially
crystalline deformation rings with small Hodge-Tate weights (with appropriate
genericity conditions), the weight part of Serre's conjecture for $U(n)$ as
formulated by Herzig (for global Galois representations which satisfy the
Taylor-Wiles hypotheses and are sufficiently generic at $p$), and an
unconditional formulation of the weight part of Serre's conjecture for wildly
ramified representations.
