[repacker] Move already-isolated overflow roots

Initialize every selected root's incoming-edge count before traversing
their combined subgraph.  This prevents later root initialization from
overwriting counts collected through an earlier root.

An overflow root still needs a new packing space when no duplication is
needed, so move already-isolated roots instead of treating that case as
an unsuccessful resolution attempt.

Assisted-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Behdad Esfahbod committed 2026-10-02 02:36:20 -06:00
1 parent 5b104f8afe
commit 22248564c1
2 files changed
+4 -3

No files matched your search

+3
View File
@@ -1008,6 +1008,9 @@ public:
if (unlikely (root_idx >= vertices_.length))
return Err(OUT_OF_BOUNDS);
subgraph.set (root_idx, wide_parents (root_idx, parents));
}
for (unsigned root_idx : roots)
{
TRY (find_subgraph (root_idx, subgraph));
}
TRY (graph_result_t<void>::from (subgraph, ALLOCATION_FAILURE));