We use a relativistic ionization front to provide various initial transverse wakefield amplitudes for the self-modulation of a long proton bunch in plasma. We show experimentally that, with sufficient initial amplitude [≥(4.1±0.4) MV/m], the phase of the modulation along the bunch is reproducible from event to event, with 3%-7% (of 2π) rms variations all along the bunch. The phase is not reproducible for lower initial amplitudes. We observe the transition between these two regimes. Phase reproducibility is essential for deterministic external injection of particles to be accelerated.