moving the dag sort operation into evaluator