Some time ago I had to fix some issues around live reg tracking in DAG scheduling. The logic there is quite hard to follow.
After that I tried to extract the logic from the scheduler itself. I'm not sure it is anything better what it was.
If the change is worth anything let me know. I can work a bit more on that.
I'm also considering replacing the array with a map. It contains mostly nulls.