In this video, Destin — the creator of YouTube channel Smarter Every Day — rides in an F-16 with a USAF Thunderbirds pilot. If you start watching the video at the 11:06 mark, you will see what happens when the aircraft passes through Mach 1, namely, that the altimeter reading suddenly jumps.
Destin explains that this jump in the altimeter reading is because the air pressure downstream of the normal shock wave that is impinging on the pitot-static tube of the aircraft is lower than the air pressure upstream, but by the laws of compressible airflow, this would be total air pressure, not static air pressure.
As static air pressure, which is sensed by the altimeter, is always higher downstream of a normal shock wave, why is it that the altimeter reading registers a sudden jump and not drop instead?