prepare_update_index() below will happily overwrite index_tag, if the state->obj_tag is set. As far as I can tell, state->write_tag and state->obj_tag are not the same. So it's not obvious that simply setting index_tag here provides the equality guarantee we're looking for.
If it does provide that guarantee, how does it do so?