-
My function for finding the median node among a node's sources/ancestors assumed they were sorted, which they often weren't. That was used to set the node's position to the source nodes' median's position.
On top of that, the function that scaled the positions up for actual display were doing what I can sum up as "full justify", so the positions set weren't respected, and nodes appeared well away from their sources' median x-position.
All this took a while to figure out.