Encode templates and occurrences into IFNS bytes that decodeInstancedShard reads back.
decodeInstancedShard
Encode templates and occurrences into IFNS bytes that
decodeInstancedShardreads back.