Skip to content

Commit 13cc7fd

Browse files
bod09claude
andcommitted
Fix false fan-out: count unique consumers, not edge count
gem_to_bar had 2 edges to alloy_furnace (one enhancement, one main from dedup) which triggered false fan-out detection, preventing supply propagation. Alloy showed qty=8 (demand) instead of qty=6 (supply-constrained: 12 bars / 2 per alloy = 6). Fix: count unique consumer NODE IDs, not raw edge count. gem_to_bar → alloy (2 edges, 1 consumer) = NOT fan-out → propagate. alloy → bolt/plate/frame/super/coiler (5 consumers) = fan-out → stop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f5b8985 commit 13cc7fd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

js/graph-builder.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ class FlowGraphBuilder {
483483
if (!curNode) continue;
484484
// Find non-byproduct edges FROM this node
485485
const outEdges = edges.filter(e => e.from === curId && e.kind !== "byproduct");
486-
const isFanOut = outEdges.length > 1;
486+
const uniqueConsumers = new Set(outEdges.map(e => e.to)).size;
487+
const isFanOut = uniqueConsumers > 1;
487488

488489
for (const edge of outEdges) {
489490
if (supplyVisited.has(edge.to)) continue;

0 commit comments

Comments
 (0)