Hi Vincent,
Thanks for bringing this to our attention. It does seem like there is a potential here for errors if the array is reallocated during insertion, and passing by value would resolve that issue.
I haven’t been able to get a repro case myself unfortunately. I tried a level sequence with 40+ sub-sequences in it, all with transform origin overrides to see if this was related to growing the sparse array, but that didn’t trip anything with -stompmalloc, so I’m curious what your repro is, and if it’s something I could easily replicate for a test case around this.
Either way, the fix seems valid, so I’ll try to integrate it soon into main.
Thanks!
Austin