traceToGraphProgram

Converts a list of OpTrace records (captured during a tracing forward pass) into a GraphProgram DAG suitable for optimization passes.

Each TensorRef becomes a GraphValue and each OpTrace becomes a GraphNodeDefinition. Tensor references that appear as outputs of no trace are treated as external inputs (model parameters or activations fed from outside).