I think a large part of the reason the schema-variables patch has gone sideways for so many years is that it's an ambitious overdesign.
Last two weeks this patch is shorter and shorter. I removed a large part related to check of type consistency, because I can do this check more easily - and other work is done by dependencies.
Big thanks to Julien - it does a lot of work and he shows me a lot of issues and possibilities on how to fix it. With Julien work this patch moved forward. Years before it was just a prototype.
This patch is not too complex - important part is session_variable.c with 1500 lines , and it is almost simple code - store value to hashtab, and cleaning hash tab on sinval or on transaction end or abort + debug routine.