This collection has to be empty by the time writeIdx comes around.  If its not the pack is corrupt and unusable, because the caller asked for something we don't actually have.

You need to process the baseById collection before fixThinPack gets called.

And I think I just found a bug in IndexPack.  We are iterating baseById and mutating it at the same time during fixThinPack.  Which isn't exactly safe.  We must be getting lucky here.