From 22248564c1eb107ba51dced50cc4d8b904e02808 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 2 Oct 2026 02:36:20 -0600 Subject: [PATCH] [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 --- src/graph/graph.hh | 3 +++ src/hb-repacker.hh | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/graph/graph.hh b/src/graph/graph.hh index 839474a41..9ec9f22c7 100644 --- a/src/graph/graph.hh +++ b/src/graph/graph.hh @@ -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::from (subgraph, ALLOCATION_FAILURE)); diff --git a/src/hb-repacker.hh b/src/hb-repacker.hh index 3ddc188d4..d7903a897 100644 --- a/src/hb-repacker.hh +++ b/src/hb-repacker.hh @@ -236,9 +236,7 @@ graph_result_t _try_isolating_subgraphs (const hb_vector_t