Evolution of gas forms shrinkage cavity as solidifying metal drives out gas