trace_edges: return data is now pre-allocated and returned via struct.