From 451876c02f7baf20bcef7775ca409e48eb6a2c8f Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Sun, 20 Sep 2026 22:20:30 -0400 Subject: [PATCH] fix(engine): stop PairFiller toggling the global fill-strategy registry PairFiller.EvaluateCandidates wrapped its candidate loop in FillStrategyRegistry.SetEnabled(...) and reset it with SetEnabled(null) afterwards. Nothing inside that window re-enters the strategy pipeline (EvaluateCandidate and FillRemnantBox only use FillLinear), so the restriction had no effect on the running solve. It did mutate process-global state: concurrent solves (e.g. benchmark --parallel) could observe the narrowed strategy list, and the reset cleared any filter set elsewhere. Co-Authored-By: Claude Sonnet 5 --- OpenNest.Engine/Fill/PairFiller.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/OpenNest.Engine/Fill/PairFiller.cs b/OpenNest.Engine/Fill/PairFiller.cs index 89c563a..8181e3b 100644 --- a/OpenNest.Engine/Fill/PairFiller.cs +++ b/OpenNest.Engine/Fill/PairFiller.cs @@ -97,7 +97,6 @@ namespace OpenNest.Engine.Fill var partBox = drawing.Program.BoundingBox(); var partArea = System.Math.Max(partBox.Width * partBox.Length, 1); - FillStrategyRegistry.SetEnabled("Pairs", "RectBestFit", "Extents", "Linear"); try { for (var batchStart = 0; batchStart < candidates.Count; batchStart += batchSize) @@ -165,10 +164,6 @@ namespace OpenNest.Engine.Fill { Debug.WriteLine("[PairFiller] Cancelled mid-phase, using results so far"); } - finally - { - FillStrategyRegistry.SetEnabled(null); - } Debug.WriteLine($"[PairFiller] Best pair result: {best?.Count ?? 0} parts"); return best ?? new List();