Distinguishing $X$ and $Z$ errors is easy. $X$ errors anti-commute with the $Z$-type stabilizers, and so when you perform a measurement of *those* parity checks, you get and answer '1'. Similarly, $Z$ errors give you a '1' answer only on the $X$-type parity checks.

Also, note that, in the bulk (i.e. not on the edges), you *never* get a '1' on only one weight-4 parity check syndrome. They always come in pairs. You can never identify exactly what error happened (although you might make a good guess) but that doesn't prevent you from correcting the error. That's the whole point of a topological system. If a single $X$ error occurred somewhere, you don't have to apply the same $X$ to correct for it. Any sequence of $X$ operations that creates a closed loop on the lattice (without going off the edge) will also correct the error (and could equally have been an error sequence that gave the same syndrome).

That's how it's supposed to work for a infinite surface code, but surface-17 is just a 3x3 grid of data qubits with 4 weight-4 syndromes and 4 weight-2 syndroms – Ilya Besedin – 2020-01-09T11:50:34.940

The surface code is never infinite. The whole point is that it has a finite boundary. And the same understanding is supposed to work. – DaftWullie – 2020-01-09T11:52:45.780