Understanding how a single laser pulse can toggle magnetization in a compensated 3d ferrimagnet is a critical problem in ultrafast magnetism. To resolve it, we test single-shot all-optical switching of magnetization in Mn 2 Ru x Ga at different temperatures using femto-to picosecond pulses in the visible to far-infrared spectral ranges. The switching process is found to be independent of photon energy, but strongly dependent on both the pulse duration and sample temperature. Switching is disabled whenever the starting temperature T 0 is above the compensation point of Mn 2 Ru x Ga, but as T 0 is lowered below compensation, increasingly longer pulses become capable of toggling the magnetization. We explain the observations in terms of a switching process driven by exchange relaxation of the angular momenta of the manganese sublattices, and propose a common framework to account for the similarities and differences of all-optical switching in Mn 2 Ru x Ga and GdFeCo alloys.