Very cool, dig the additions.
You can also add in a step that pre-sorts the components, so they don’t end up in a random order.
In the patch I posted here one of the steps takes the centroid for each channel of the bases and rewrites them to a new buffer based on that order, and I’ve found it to be quite effective. At minimum, it’s always consistent.