PETSc example (heat-TS-2d-PETSc.edp) incorrectly imlpemented?

You may prefer a handmade time loop like this
heat-PETSc.edp (1.7 KB)
Then you have to do second-order, Newton, timestep adaptation by hand. But it is much more understandable than with TSSolve.