9. (16 points) Let $a \geqslant 0$, for any $m, x (0 \leqslant m \leqslant a, 0 \leqslant x \leqslant \pi)$, we have
$$
|\sin x - \sin (x+m)| \leqslant 1 \text{.}
$$

Find the maximum value of $a$.
II. 9. Let $f(x)=\sin x-\sin (x+m)$. By the sum-to-product formula, we have
$$
f(x)=-2 \sin \frac{m}{2} \cdot \cos \left(x+\frac{m}{2}\right) .
$$

Thus, there must exist an $x_{0} \in[0, \pi]$, such that
$$
x_{0}+\frac{m}{2}=k \pi(k \in \mathbf{Z}) \text {. }
$$

Then $\left|f\left(x_{0}\right)\right|=\left|-2 \sin \frac{m}{2} \cdot \cos k \pi\right|=\left|2 \sin \frac{m}{2}\right|$.
By the problem statement, for any $m(0 \leqslant m \leqslant a)$, we always have
$$
\left|2 \sin \frac{m}{2}\right| \leqslant 1 \text {. }
$$

When $a>\frac{\pi}{3}$, take $m$ such that $\frac{\pi}{3}1$, which is a contradiction.

When $a=\frac{\pi}{3}$, for any $m, x(0 \leqslant m \leqslant a, 0 \leqslant x \leqslant \pi)$, we have
$$
\begin{array}{l}
|f(x)|=\left|-2 \sin \frac{m}{2} \cdot \cos \left(x+\frac{m}{2}\right)\right| \\
\leqslant\left|2 \sin \frac{m}{2}\right| \leqslant 2 \sin \frac{\pi}{6}=1 .
\end{array}
$$

In summary, the maximum value of $a$ is $\frac{\pi}{3}$.