MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / build_conflict_tree

Function build_conflict_tree

atomic-core/src/output/alive/order.rs:524–545  ·  view source on GitHub ↗

Build the conflict tree from SCCs. This creates a simple linear conflict tree. More sophisticated conflict detection (order conflicts) would enhance this.

(graph: &AliveGraph, result: &mut OrderResult)

Source from the content-addressed store, hash-verified

522/// This creates a simple linear conflict tree. More sophisticated
523/// conflict detection (order conflicts) would enhance this.
524fn build_conflict_tree(graph: &AliveGraph, result: &mut OrderResult) {
525 let mut path = ConflictPath::new();
526
527 // Add SCCs in reverse order (they come out in reverse topological order)
528 for (i, scc) in result.sccs.iter().enumerate().rev() {
529 let scc_id = SccId::new(i);
530
531 // For multi-span SCCs, we could create nested conflict structures
532 // For now, just add them as SCCs
533 path.push(PathElement::scc(scc_id));
534
535 // Track if any span in this SCC is a zombie
536 let _has_zombie = scc.iter().any(|&vid| {
537 graph
538 .try_get_vertex(vid)
539 .map(|v| v.is_zombie())
540 .unwrap_or(false)
541 });
542 }
543
544 result.conflict_tree = ConflictTree::from_path(path);
545}
546
547// TESTS
548

Callers 1

compute_orderFunction · 0.85

Calls 4

try_get_vertexMethod · 0.80
iterMethod · 0.45
pushMethod · 0.45
is_zombieMethod · 0.45

Tested by

no test coverage detected