Do we know that the rule in 4/4 is correct? Could it be, instead, that variables are sorted in descending order of bind count? IIRC the latter has some form of precedent; I think that's how numeric variables are sorted for sm1.
After even more testing I see you are right. I will update the series.
This works, but I think it might be slightly clearer to build a local list, append to its tail, and then list_move_head() to ctx->extern_vars.
Okay.