Is there a typo in the code block for the `Process` function near the end of the post? Lines 13-15 have the following loop:
while (remapVec[remapStartIndex] >= index) { // Follow the 'cycle'
index = remapVec[remapStartIndex];
}
I'm not sure what that loop is supposed to be doing, but as its written it looks like it would either be skipped entirely or never terminate; after single iteration, the the two values would be equal and never change again.