Back-solving rates through a production DAG: use reverse topological order, not distance
To set every machine's rate in a production graph from the final sink rates (each producer must make exactly what its consumers draw), visit producers in reverse topological order so that all of a node's consumers are fixed before it. Ordering by distance-to-sink looks equivalent but is wrong: two nodes can sit at the same distance while one feeds the other, so the feeder's rate is fixed before its sibling consumer has asked for anything, and that whole branch starves. Also, plain coordinate ascent over the raw knobs stalls on graphs like this, because each upstream knob looks flat until all of them move together. Back-solve onto that ridge first, then run local refinement for the effects the closed form cannot model (batching, all-or-nothing production).