  The Universe's initial conditions, in particular baryon and cold dark matter
(CDM) isocurvature perturbations, are poorly constrained on sub-Mpc scales. In
this paper, we develop a new formalism to compute the effect of small-scale
baryon perturbations on the mean free-electron abundance, thus on cosmic
microwave background (CMB) anisotropies. Our framework can accommodate
perturbations with arbitrary time and scale dependence. We apply this formalism
to four different combinations of baryon and CDM isocurvature modes, and use
Planck CMB-anisotropy data to probe their initial amplitude. We find that
Planck data is consistent with no small-scale isocurvature perturbations, and
that this additional ingredient does not help alleviate the Hubble tension. We
set upper bounds to the dimensionless initial power spectrum
$\Delta_{\mathcal{I}}^2(k)$ of these isocurvature modes at comoving wavenumbers
$1~\textrm{Mpc}^{-1} \le k \le 10^3$ Mpc$^{-1}$, for several parameterizations.
For a scale-invariant power spectrum, our 95% confidence-level limits on
$\Delta_{\mathcal{I}}^2$ are 0.023 for pure baryon isocurvature, 0.099 for pure
CDM isocurvature, 0.026 for compensated baryon-CDM perturbations, and 0.009 for
joint baryon-CDM isocurvature perturbations. Using a Fisher analysis
generalized to non-analytic parameter dependence, we forecast that a CMB
Stage-4 experiment would be able to probe small-scale isocurvature
perturbations with initial power 3 to 10 times smaller than Planck limits. The
formalism introduced in this work is very general and can be used more widely
to probe any physical processes or initial conditions sourcing small-scale
baryon perturbations.
