Drinfeld’s relative compactification plays a basic role in the theory of automorphic sheaves, and its singularities encode representation-theoretic information in the form of intersection cohomology. We introduce a resolution of singularities consisting of stable maps from nodal deformations of the curve into twisted flag varieties. As an application, we prove that the twisted intersection coho...