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 <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,6 @@ namespace OpenNest.Engine.Fill
|
|||||||
var partBox = drawing.Program.BoundingBox();
|
var partBox = drawing.Program.BoundingBox();
|
||||||
var partArea = System.Math.Max(partBox.Width * partBox.Length, 1);
|
var partArea = System.Math.Max(partBox.Width * partBox.Length, 1);
|
||||||
|
|
||||||
FillStrategyRegistry.SetEnabled("Pairs", "RectBestFit", "Extents", "Linear");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
for (var batchStart = 0; batchStart < candidates.Count; batchStart += batchSize)
|
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");
|
Debug.WriteLine("[PairFiller] Cancelled mid-phase, using results so far");
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
FillStrategyRegistry.SetEnabled(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug.WriteLine($"[PairFiller] Best pair result: {best?.Count ?? 0} parts");
|
Debug.WriteLine($"[PairFiller] Best pair result: {best?.Count ?? 0} parts");
|
||||||
return best ?? new List<Part>();
|
return best ?? new List<Part>();
|
||||||
|
|||||||
Reference in New Issue
Block a user