[dynamic] compute hstate (vertical or flat)