Every data region needs at least one dedupe or copy edge, since a copy
run never crosses the hole between regions, and every hole is already
one op. When that floor exceeds rewrite.total-max no covering exists,
but the search only found out after walking the whole extent, which is
O(V^2) in its boundary count.
With total-max = 10, a reference run on a disk-image corpus counted
582,604 searches ending with no covering under the limit (270 at
total-max = 100). Check the floor up front and count the rejection the
same way.
Assisted-by: Claude-Code:claude-opus-5-5
return nullopt;
}
+ // Op floor: every data region needs at least one dedupe or copy edge (a
+ // copy run never crosses the hole between regions), and every hole is
+ // already one op. If that floor exceeds total-max no covering exists,
+ // so say so now instead of discovering it after an O(V^2) walk.
+ if (in.m_data_regions.size() + in.m_hole_ops > policy.m_total_max) {
+ BEESCOUNT(plan_cover_none_limit);
+ return nullopt;
+ }
+
// V-budget: the exact DP below is O(V^2) in the boundary count and holds
// the dst Exclusion for its whole duration, so a high-V extent can wedge a
// worker (and everything queued behind that extent). Above the budget,