sim: use STATE_MAGIC helper