  In the random geometric graph model $\mathsf{Geo}_d(n,p)$, we identify each
of our $n$ vertices with an independently and uniformly sampled vector from the
$d$-dimensional unit sphere, and we connect pairs of vertices whose vectors are
``sufficiently close'', such that the marginal probability of an edge is $p$.
  We investigate the problem of testing for this latent geometry, or in other
words, distinguishing an Erd\H{o}s-R\'enyi graph $\mathsf{G}(n, p)$ from a
random geometric graph $\mathsf{Geo}_d(n, p)$. It is not too difficult to show
that if $d\to \infty$ while $n$ is held fixed, the two distributions become
indistinguishable; we wish to understand how fast $d$ must grow as a function
of $n$ for indistinguishability to occur.
  When $p = \frac{\alpha}{n}$ for constant $\alpha$, we prove that if $d \ge
\mathrm{polylog} n$, the total variation distance between the two distributions
is close to $0$; this improves upon the best previous bound of Brennan,
Bresler, and Nagaraj (2020), which required $d \gg n^{3/2}$, and further our
result is nearly tight, resolving a conjecture of Bubeck, Ding, Eldan, \&
R\'{a}cz (2016) up to logarithmic factors. We also obtain improved upper bounds
on the statistical indistinguishability thresholds in $d$ for the full range of
$p$ satisfying $\frac{1}{n}\le p\le \frac{1}{2}$, improving upon the previous
bounds by polynomial factors.
  Our analysis uses the Belief Propagation algorithm to characterize the
distributions of (subsets of) the random vectors {\em conditioned on producing
a particular graph}. In this sense, our analysis is connected to the ``cavity
method'' from statistical physics. To analyze this process, we rely on novel
sharp estimates for the area of the intersection of a random sphere cap with an
arbitrary subset of the sphere, which we prove using optimal transport maps and
entropy-transport inequalities on the unit sphere.
