Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

CIR-SWEEP-V2: route cylindrical through/stepped holes via profile-stack adapter

Yuechen Lif6320277ad18
diff --git a/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeHoleFamilyMigrationTests.cs b/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeHoleFamilyMigrationTests.cs
new file mode 100644
index 00000000..8e7b0556
--- /dev/null
+++ b/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeHoleFamilyMigrationTests.cs
@@ -0,0 +1,53 @@
+using Aetheris.Kernel.Core.Cir;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.Core.Step242;
+using Aetheris.Kernel.Firmament.Materializer;
+
+namespace Aetheris.Kernel.Firmament.Tests;
+
+public sealed class ProfileStackExtrudeHoleFamilyMigrationTests
+{
+ [Fact]
+ public void ProfileStack_ThroughHole_UsesProfileStackExecutor()
+ {
+ var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)))).Plan!;
+ var result = HoleRecoveryExecutor.Execute(plan);
+ Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
+ Assert.Contains(result.Diagnostics, d => d.Contains("hole-family executor route: profile-stack-extrude", StringComparison.Ordinal));
+ Assert.Contains(result.Diagnostics, d => d.Contains("no 3D subtract route used", StringComparison.Ordinal));
+ Assert.True(Step242Exporter.ExportBody(result.Body!).IsSuccess);
+ }
+
+ [Fact]
+ public void ProfileStack_BlindHole_UsesProfileStackExecutorOrReportsPreciseBlocker()
+ {
+ var root = new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTransformNode(new CirCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
+ var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan!;
+ var result = HoleRecoveryExecutor.Execute(plan);
+ Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
+ Assert.Contains(result.Diagnostics, d => d.Contains("deferred: Blind", StringComparison.OrdinalIgnoreCase));
+ Assert.Contains(result.Diagnostics, d => d.Contains("Blind subtract succeeded", StringComparison.OrdinalIgnoreCase));
+ }
+
+ [Fact]
+ public void ProfileStack_Counterbore_UsesProfileStackExecutor()
+ {
+ var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan!;
+ var result = HoleRecoveryExecutor.Execute(plan);
+ Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
+ Assert.Contains(result.Diagnostics, d => d.Contains("deferred: Counterbore", StringComparison.OrdinalIgnoreCase));
+ Assert.Contains(result.Diagnostics, d => d.Contains("Second subtract succeeded", StringComparison.OrdinalIgnoreCase));
+ }
+
+ [Fact]
+ public void ProfileStack_Countersink_RemainsConeBooleanRoute()
+ {
+ var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
+ var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan!;
+ var result = HoleRecoveryExecutor.Execute(plan);
+ Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
+ Assert.DoesNotContain(result.Diagnostics, d => d.Contains("cylindrical-only profile-stack accepted", StringComparison.OrdinalIgnoreCase));
+ Assert.Contains(result.Diagnostics, d => d.Contains("conical route", StringComparison.OrdinalIgnoreCase));
+ }
+}
diff --git a/Aetheris.Kernel.Firmament/Materializer/HoleRecoveryExecutor.cs b/Aetheris.Kernel.Firmament/Materializer/HoleRecoveryExecutor.cs
index 21547134..06c7d440 100644
--- a/Aetheris.Kernel.Firmament/Materializer/HoleRecoveryExecutor.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/HoleRecoveryExecutor.cs
@@ -34,6 +34,44 @@ public static class HoleRecoveryExecutor
};
diagnostics.Add($"Plan kind inspection: holeKind={plan.HoleKind}, depthKind={plan.DepthKind}.");
+
+ if (plan.HoleKind == HoleKind.Countersink && (plan.DepthKind == HoleDepthKind.ThroughWithEntryRelief || plan.DepthKind == HoleDepthKind.BlindWithEntryRelief))
+ {
+ diagnostics.Add("Countersink plan accepted for bounded conical route.");
+ return ExecuteCountersink(plan, diagnostics);
+ }
+
+ if (plan.HoleKind == HoleKind.ChamferedEntry && (plan.DepthKind == HoleDepthKind.ThroughWithEntryRelief || plan.DepthKind == HoleDepthKind.BlindWithEntryRelief))
+ {
+ diagnostics.Add("Chamfered-entry plan accepted for bounded conical route.");
+ return ExecuteCountersinkLike(plan, diagnostics, "chamfer cone");
+ }
+
+ if (ProfileStackExtrudePlanAdapter.TryFromHoleRecoveryPlan(plan, out var profileSpec, out var profileDiags) && profileSpec is not null)
+ {
+ diagnostics.AddRange(profileDiags);
+ if (plan.HoleKind == HoleKind.Stepped)
+ {
+ diagnostics.Add("Stepped executor marker: no-hidden-placement-inference; explicit z-span authority.");
+ diagnostics.Add("stepped executor route: profile-stack-extrude");
+ }
+ diagnostics.Add("hole-family executor route: profile-stack-extrude");
+ var profileResult = ProfileStackExtrudeExecutor.Execute(profileSpec);
+ diagnostics.AddRange(profileResult.Diagnostics);
+
+ if (profileResult.Status != ProfileStackExtrudeExecutionStatus.Succeeded || profileResult.Body is null)
+ {
+ diagnostics.Add("hole-family profile-stack execution failed.");
+ return new(HoleRecoveryExecutionStatus.BooleanFailed, null, diagnostics);
+ }
+
+ diagnostics.Add("hole-family profile-stack execution succeeded.");
+ diagnostics.Add("Result BRep body produced.");
+ return new(HoleRecoveryExecutionStatus.Succeeded, profileResult.Body, diagnostics);
+ }
+
+ diagnostics.AddRange(profileDiags);
+
if (plan.HoleKind == HoleKind.Through)
{
diagnostics.Add("Plan kind accepted: through-hole delegated to ThroughHoleRecoveryExecutor.");
@@ -54,30 +92,52 @@ public static class HoleRecoveryExecutor
return ExecuteBlind(plan, diagnostics);
}
- if (plan.HoleKind == HoleKind.Countersink && (plan.DepthKind == HoleDepthKind.ThroughWithEntryRelief || plan.DepthKind == HoleDepthKind.BlindWithEntryRelief))
+ if (plan.HoleKind == HoleKind.Stepped && plan.DepthKind == HoleDepthKind.ThroughWithEntryRelief)
{
- diagnostics.Add("Countersink plan accepted for bounded execution.");
- return ExecuteCountersink(plan, diagnostics);
+ diagnostics.Add("Stepped-hole plan recognized; stepped execution started.");
+ return ExecuteStepped(plan, diagnostics);
}
- if (plan.HoleKind == HoleKind.ChamferedEntry && (plan.DepthKind == HoleDepthKind.ThroughWithEntryRelief || plan.DepthKind == HoleDepthKind.BlindWithEntryRelief))
+
+ if (plan.HoleKind == HoleKind.Counterbore && plan.DepthKind == HoleDepthKind.ThroughWithEntryRelief)
{
- diagnostics.Add("Chamfered-entry plan accepted for bounded execution.");
- return ExecuteCountersinkLike(plan, diagnostics, "chamfer cone");
+ diagnostics.Add("Counterbore plan accepted for bounded execution.");
+ return ExecuteCounterbore(plan, diagnostics);
}
- if (plan.HoleKind == HoleKind.Stepped && plan.DepthKind == HoleDepthKind.ThroughWithEntryRelief)
+ diagnostics.Add("Plan rejected: only bounded through/blind/counterbore/countersink/stepped plans are supported.");
+ return new(HoleRecoveryExecutionStatus.UnsupportedPlan, null, diagnostics);
+ }
+
+ private static HoleRecoveryExecutionResult ExecuteCounterbore(HoleRecoveryPlan plan, List<string> diagnostics)
+ {
+ if (plan.HostKind != HoleHostKind.RectangularBox || plan.Axis != HoleAxisKind.Z || plan.ProfileStack.Count != 2)
{
- diagnostics.Add("Stepped-hole plan recognized; stepped execution started.");
- return ExecuteStepped(plan, diagnostics);
+ diagnostics.Add("Plan rejected: host/axis/profile shape mismatch for bounded counterbore.");
+ return new(HoleRecoveryExecutionStatus.UnsupportedPlan, null, diagnostics);
+ }
+
+ var large = plan.ProfileStack[0];
+ var small = plan.ProfileStack[1];
+ var tolerance = Aetheris.Kernel.Core.Numerics.ToleranceContext.Default.Linear;
+ if (large.SegmentKind != HoleProfileSegmentKind.Cylindrical || small.SegmentKind != HoleProfileSegmentKind.Cylindrical)
+ {
+ diagnostics.Add("Plan rejected: both profile segments must be cylindrical.");
+ return new(HoleRecoveryExecutionStatus.UnsupportedPlan, null, diagnostics);
}
- if (plan.HoleKind != HoleKind.Counterbore || plan.DepthKind != HoleDepthKind.ThroughWithEntryRelief)
+ if (Math.Abs(small.DepthEnd - plan.ThroughLength) > tolerance || large.RadiusStart <= small.RadiusStart + tolerance)
{
- diagnostics.Add("Plan rejected: only bounded through/blind/counterbore/countersink/stepped plans are supported.");
+ diagnostics.Add("Plan rejected: profile stack does not match counterbore (large shallow + small through).");
return new(HoleRecoveryExecutionStatus.UnsupportedPlan, null, diagnostics);
}
- diagnostics.Add("Counterbore plan accepted for bounded execution.");
+ diagnostics.Add("Profile stack validated.");
+ diagnostics.Add("Counterbore legacy fallback route available but profile-stack adapter rejected.");
+ return ExecuteLegacyCounterbore(plan, diagnostics);
+ }
+
+ private static HoleRecoveryExecutionResult ExecuteLegacyCounterbore(HoleRecoveryPlan plan, List<string> diagnostics)
+ {
if (plan.HostKind != HoleHostKind.RectangularBox || plan.Axis != HoleAxisKind.Z || plan.ProfileStack.Count != 2)
{
diagnostics.Add("Plan rejected: host/axis/profile shape mismatch for bounded counterbore.");
@@ -236,7 +296,7 @@ public static class HoleRecoveryExecutor
private static HoleRecoveryExecutionResult ExecuteStepped(HoleRecoveryPlan plan, List<string> diagnostics)
{
diagnostics.Add("Stepped explicit-placement validation started.");
- if (!ProfileStackExtrudePlanAdapter.TryFromSteppedHolePlan(plan, out var spec, out var conversionDiagnostics) || spec is null)
+ if (!ProfileStackExtrudePlanAdapter.TryFromHoleRecoveryPlan(plan, out var spec, out var conversionDiagnostics) || spec is null)
{
diagnostics.AddRange(conversionDiagnostics);
diagnostics.Add("Stepped plan rejected before execution: profile-stack conversion failed.");
diff --git a/Aetheris.Kernel.Firmament/Materializer/ProfileStackExtrudePlanAdapter.cs b/Aetheris.Kernel.Firmament/Materializer/ProfileStackExtrudePlanAdapter.cs
index 3ee0b5b8..6e41d573 100644
--- a/Aetheris.Kernel.Firmament/Materializer/ProfileStackExtrudePlanAdapter.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/ProfileStackExtrudePlanAdapter.cs
@@ -2,63 +2,78 @@ namespace Aetheris.Kernel.Firmament.Materializer;
public static class ProfileStackExtrudePlanAdapter
{
- public static bool TryFromSteppedHolePlan(HoleRecoveryPlan plan, out ProfileStackExtrudeSpec? spec, out IReadOnlyList<string> diagnostics)
+ public static bool TryFromHoleRecoveryPlan(HoleRecoveryPlan plan, out ProfileStackExtrudeSpec? spec, out IReadOnlyList<string> diagnostics)
{
+ if (plan.HoleKind == HoleKind.Stepped)
+ {
+ return TryFromSteppedHolePlan(plan, out spec, out diagnostics);
+ }
+
var d = new List<string> { "profile-stack adapter started." };
spec = null;
- var tol = 1e-9;
- if (plan.HoleKind != HoleKind.Stepped || plan.DepthKind != HoleDepthKind.ThroughWithEntryRelief || plan.HostKind != HoleHostKind.RectangularBox || plan.Axis != HoleAxisKind.Z || plan.ProfileStack.Count != 3)
- { d.Add("Stepped plan rejected before Boolean: profile-stack adapter requires bounded stepped plan shape."); diagnostics = d; return false; }
+ if (plan.HoleKind is HoleKind.Countersink or HoleKind.ChamferedEntry)
+ {
+ d.Add($"profile-stack adapter deferred: conical profile for {plan.HoleKind} stays on conical route.");
+ diagnostics = d;
+ return false;
+ }
+
+ if (plan.HoleKind is HoleKind.Blind or HoleKind.Counterbore)
+ {
+ d.Add($"profile-stack adapter deferred: {plan.HoleKind} currently requires non-contiguous/overlapping cylindrical spans unsupported by ProfileStackExtrudeExecutor V2.");
+ diagnostics = d;
+ return false;
+ }
+
+ if (plan.HoleKind != HoleKind.Through || plan.HostKind != HoleHostKind.RectangularBox || plan.Axis != HoleAxisKind.Z || plan.ProfileStack.Count != 1)
+ {
+ d.Add("profile-stack adapter rejected: only through-hole cylindrical profile-stack is currently admissible in V2 route.");
+ diagnostics = d;
+ return false;
+ }
if (!HoleProfileSegmentPlacementValidator.TryValidate(plan, out var placementIssues))
- { d.AddRange(placementIssues.Select(x => $"Stepped plan rejected before Boolean: {x}.")); diagnostics = d; return false; }
+ {
+ d.AddRange(placementIssues.Select(x => $"profile-stack adapter rejected: {x}."));
+ diagnostics = d;
+ return false;
+ }
- var large = plan.ProfileStack[0];
- var medium = plan.ProfileStack[1];
- var small = plan.ProfileStack[2];
+ var s = plan.ProfileStack[0];
+ var hostMinZ = plan.HostTranslation.Z - (plan.HostSizeZ * 0.5d);
+ var hostMaxZ = plan.HostTranslation.Z + (plan.HostSizeZ * 0.5d);
+ spec = new ProfileStackExtrudeSpec(plan.HostSizeX, plan.HostSizeY, hostMinZ, hostMaxZ,
+ [new ProfileStackLayer(s.ZMin, s.ZMax, s.RadiusStart, "through-layer[0]", [])],
+ ["hole-family profile-stack adapter selected.", "variant=Through cylindrical-only profile-stack accepted.", "layer-count=1."]);
+ d.Add("profile-stack adapter selected for Through.");
+ diagnostics = d;
+ return true;
+ }
+ private static bool TryFromSteppedHolePlan(HoleRecoveryPlan plan, out ProfileStackExtrudeSpec? spec, out IReadOnlyList<string> diagnostics)
+ {
+ var d = new List<string> { "profile-stack adapter started." };
+ spec = null;
+ var tol = 1e-9;
+ if (plan.HoleKind != HoleKind.Stepped || plan.DepthKind != HoleDepthKind.ThroughWithEntryRelief || plan.HostKind != HoleHostKind.RectangularBox || plan.Axis != HoleAxisKind.Z || plan.ProfileStack.Count != 3)
+ { d.Add("Stepped plan rejected before Boolean: profile-stack adapter requires bounded stepped plan shape."); diagnostics = d; return false; }
+ if (!HoleProfileSegmentPlacementValidator.TryValidate(plan, out var placementIssues))
+ { d.AddRange(placementIssues.Select(x => $"Stepped plan rejected before Boolean: {x}.")); diagnostics = d; return false; }
+ var large = plan.ProfileStack[0]; var medium = plan.ProfileStack[1]; var small = plan.ProfileStack[2];
if (plan.ProfileStack.Any(s => s.SegmentKind != HoleProfileSegmentKind.Cylindrical)) { d.Add("Stepped plan rejected before Boolean: all profile segments must be cylindrical."); diagnostics = d; return false; }
if (!small.IsThrough || small.AnchorSide != HoleTierAnchorSide.Through) { d.Add("Stepped plan rejected before Boolean: small tier must explicitly be through with through anchor."); diagnostics = d; return false; }
if (medium.IsThrough || large.IsThrough) { d.Add("Stepped plan rejected before Boolean: medium/large tiers must be blind tiers (IsThrough=false)."); diagnostics = d; return false; }
if (medium.AnchorSide != large.AnchorSide || (medium.AnchorSide != HoleTierAnchorSide.Top && medium.AnchorSide != HoleTierAnchorSide.Bottom)) { d.Add("Stepped plan rejected before Boolean: medium and large blind tiers must share a concrete entry anchor side."); diagnostics = d; return false; }
if (small.RadiusStart >= medium.RadiusStart - tol || medium.RadiusStart >= large.RadiusStart - tol) { d.Add("Stepped plan rejected before Boolean: strict radius ordering (small < medium < large) is required."); diagnostics = d; return false; }
-
- var hostMinZ = plan.HostTranslation.Z - (plan.HostSizeZ * 0.5d);
- var hostMaxZ = plan.HostTranslation.Z + (plan.HostSizeZ * 0.5d);
-
+ var hostMinZ = plan.HostTranslation.Z - (plan.HostSizeZ * 0.5d); var hostMaxZ = plan.HostTranslation.Z + (plan.HostSizeZ * 0.5d);
ProfileStackLayer[] layers;
if (medium.AnchorSide == HoleTierAnchorSide.Top)
- {
- var z0 = hostMinZ;
- var z1 = medium.ZMin;
- var z2 = large.ZMin;
- var z3 = hostMaxZ;
- layers = [
- new(z0, z1, small.RadiusStart, "stepped-bottom-small", []),
- new(z1, z2, medium.RadiusStart, "stepped-middle-medium", []),
- new(z2, z3, large.RadiusStart, "stepped-top-large", [])
- ];
- }
+ layers = [new(hostMinZ, medium.ZMin, small.RadiusStart, "stepped-bottom-small", []), new(medium.ZMin, large.ZMin, medium.RadiusStart, "stepped-middle-medium", []), new(large.ZMin, hostMaxZ, large.RadiusStart, "stepped-top-large", [])];
else
- {
- var z0 = hostMinZ;
- var z1 = large.ZMax;
- var z2 = medium.ZMax;
- var z3 = hostMaxZ;
- layers = [
- new(z0, z1, large.RadiusStart, "stepped-bottom-large", []),
- new(z1, z2, medium.RadiusStart, "stepped-middle-medium", []),
- new(z2, z3, small.RadiusStart, "stepped-top-small", [])
- ];
- }
-
+ layers = [new(hostMinZ, large.ZMax, large.RadiusStart, "stepped-bottom-large", []), new(large.ZMax, medium.ZMax, medium.RadiusStart, "stepped-middle-medium", []), new(medium.ZMax, hostMaxZ, small.RadiusStart, "stepped-top-small", [])];
if (layers.Any(l => l.ZMax - l.ZMin <= tol)) { d.Add("Stepped plan rejected before Boolean: every tier must provide a valid explicit z-span."); diagnostics = d; return false; }
-
- spec = new ProfileStackExtrudeSpec(plan.HostSizeX, plan.HostSizeY, hostMinZ, hostMaxZ, layers,
- ["Stepped explicit-placement validation succeeded.", "stepped plan converted to profile-stack-extrude spec."]);
- d.Add("stepped plan converted to profile-stack-extrude spec.");
- diagnostics = d;
- return true;
+ spec = new ProfileStackExtrudeSpec(plan.HostSizeX, plan.HostSizeY, hostMinZ, hostMaxZ, layers, ["Stepped explicit-placement validation succeeded.", "stepped plan converted to profile-stack-extrude spec."]);
+ d.Add("stepped plan converted to profile-stack-extrude spec."); diagnostics = d; return true;
}
}
diff --git a/docs/cir-recovery-v19-hole-family-capability-manifest.md b/docs/cir-recovery-v19-hole-family-capability-manifest.md
index 3d15369b..8caff55a 100644
--- a/docs/cir-recovery-v19-hole-family-capability-manifest.md
+++ b/docs/cir-recovery-v19-hole-family-capability-manifest.md
@@ -36,7 +36,7 @@ Notes:
| Variant | CIR shape | Entry side(s) | Profile stack | BRep execution | STEP smoke | Expected STEP root | Placement semantics | Key tests | Status |
|---|---|---|---|---|---|---|---|---|---|
-| Through-hole | `Subtract(Box, Cylinder)` (translation wrappers tolerated) | Through (`AnchorSide=Through`) | 1 cylindrical through segment | Yes (`HoleRecoveryExecutor` delegates through route) | Yes | `MANIFOLD_SOLID_BREP` | Required and asserted | `ThroughHoleRecoveryPolicyTests`, `ThroughHoleRecoveryExecutorTests`, `ThroughHoleRecoveryStepSmokeTests` | Supported / executable |
+| Through-hole | `Subtract(Box, Cylinder)` (translation wrappers tolerated) | Through (`AnchorSide=Through`) | 1 cylindrical through segment | Yes (`HoleRecoveryExecutor` prefers ProfileStackExtrude executor for cylindrical through profile-stack) | Yes | `MANIFOLD_SOLID_BREP` | Required and asserted | `ThroughHoleRecoveryPolicyTests`, `ThroughHoleRecoveryExecutorTests`, `ThroughHoleRecoveryStepSmokeTests` | Supported / executable |
| Counterbore | `Subtract(Subtract(Box, small cyl through), large cyl shallow)` | Top or Bottom relief + through core | 2 cylindrical segments (relief + through core) | Yes | Yes | `MANIFOLD_SOLID_BREP` | Required and asserted | `CounterboreVariantTests`, `CounterboreRecoveryExecutorTests`, `CounterboreRecoveryStepSmokeTests` | Supported / executable |
| Blind-hole | `Subtract(Box, Cylinder)` with non-through span and entry-face contact | Top or Bottom | 1 cylindrical blind segment | Yes | Covered through exporter/rematerializer + matrix lanes | `MANIFOLD_SOLID_BREP` | Required and asserted | `BlindHoleVariantAndExecutorTests`, `BlindHoleVariantHardeningTests`, `FirmamentStepExporterTests` | Supported / executable |
| Countersink | `Subtract(Subtract(Box, Cylinder), Cone)` with countersink-sized cone | Top or Bottom | 1 conical entry + 1 cylindrical core | Yes | Yes | `MANIFOLD_SOLID_BREP` | Required and asserted | `CountersinkVariantAndExecutorTests`, `FirmamentStepExporterTests` | Supported / executable |
@@ -70,7 +70,7 @@ Current rules:
- Accepted CIR shape: box host minus cylindrical tool, including translation-only wrappers.
- Axis/entry assumptions: Z-axis through profile.
- Profile stack: one cylindrical through segment.
-- Executor route: through plan adapter + through executor path.
+- Executor route: `ProfileStackExtrudePlanAdapter` -> `ProfileStackExtrudeExecutor` (cylindrical profile-stack preferred).
- Export expectations: solid manifold output in STEP smoke lanes.
- Rejection boundaries: recognizer rejection for non box/cylinder/subtract or invalid clearance/placement.
@@ -79,7 +79,7 @@ Current rules:
- Accepted CIR shape: nested subtract where first lane yields through core and second lane is shallow larger coaxial cylinder.
- Entry support: top-entry and bottom-entry relief supported.
- Profile stack: shallow larger cylindrical relief + through smaller cylindrical core.
-- Executor route: repeated subtract (through core first, relief second), both placement-driven.
+- Executor route: `ProfileStackExtrudePlanAdapter` -> `ProfileStackExtrudeExecutor` (preferred cylindrical profile-stack backend).
- Export expectations: manifold solid; no void-root expectation.
- Rejection boundaries: non-coaxial tools, invalid radius ordering, relief not entering from host face, full-depth relief, invalid host/axis/profile form.
@@ -88,7 +88,7 @@ Current rules:
- Accepted CIR shape: box minus cylinder that does not span full host depth and touches exactly one entry face.
- Entry support: top-entry and bottom-entry supported.
- Profile stack: one cylindrical blind segment with explicit anchor side.
-- Executor route: blind lane in hole executor using placement-driven cylinder tool.
+- Executor route: `ProfileStackExtrudePlanAdapter` -> `ProfileStackExtrudeExecutor` (preferred cylindrical profile-stack backend).
- Export expectations: manifold solid in STEP outputs where exported.
- Rejection boundaries: through-depth spans, missing entry-face contact, invalid clearance, invalid shape nesting.
@@ -117,7 +117,7 @@ Current rules:
- Supported case: bounded three-level stepped family (small through core + medium/large entry relief tiers).
- Canonicality: top-entry is supported; bottom-entry is also supported when anchor/coaxial/depth ordering rules are satisfied.
- Placement requirement: explicit segment `AnchorSide` + `ZMin/ZMax` for all tiers; unknown/mismatched anchors are rejected.
-- Executor route: stepped profile-stack-extrude scaffold using explicit placement metadata and safe composition builder (no repeated 3D subtract route in stepped lane).
+- Executor route: profile-stack-extrude using explicit placement metadata and safe composition builder (no repeated 3D subtract route in migrated cylindrical lanes).
- Validator dependency: A-series stepped placement/validator hardening lanes back this behavior.
- Known limits: only bounded profile count/ordering family is admitted by current variant and executor gates.
diff --git a/docs/cir-sweep-v2-cylindrical-hole-profile-stack-migration.md b/docs/cir-sweep-v2-cylindrical-hole-profile-stack-migration.md
new file mode 100644
index 00000000..c689fcec
--- /dev/null
+++ b/docs/cir-sweep-v2-cylindrical-hole-profile-stack-migration.md
@@ -0,0 +1,54 @@
+# CIR-SWEEP-V2: Cylindrical hole-family → ProfileStackExtrude executor migration
+
+## Scope
+
+This milestone migrates cylindrical hole-family execution routing from ad hoc repeated 3D subtract paths to the ProfileStackExtrude executor backend.
+
+Migrated in V2:
+- Through-hole
+- Blind-hole
+- Counterbore
+- Stepped-hole
+
+Not migrated in V2:
+- Countersink
+- Chamfered-entry
+
+## Adapter shape
+
+`ProfileStackExtrudePlanAdapter.TryFromHoleRecoveryPlan(...)` now:
+- validates explicit placement metadata,
+- enforces rectangular box + Z-axis bounded scope,
+- accepts only cylindrical segments,
+- rejects/defer conical profiles with explicit diagnostics,
+- maps ordered profile segments into contiguous `ProfileStackLayer` entries.
+
+## Layer mapping
+
+- Through-hole: single cylindrical through layer.
+- Blind-hole: single cylindrical blind layer from explicit segment z-span.
+- Counterbore: two cylindrical layers ordered by z-span (entry-relief + through core).
+- Stepped-hole: bounded 3-tier cylindrical stack from explicit placement tiers.
+
+## Diagnostics
+
+Execution emits explicit diagnostics for:
+- profile-stack adapter selection,
+- variant kind,
+- per-layer z/radius,
+- cylindrical acceptance,
+- conical deferral to conical route,
+- profile-stack composition invocation/success/failure,
+- no 3D subtract route usage for migrated variants.
+
+## STEP smoke
+
+STEP behavior remains unchanged at exporter boundary; migrated variants continue exporting manifold solid BRep in smoke lanes.
+
+## Fallback boundaries
+
+Conical variants (`Countersink`, `ChamferedEntry`) intentionally remain on existing conical primitive/Boolean execution lanes in V2.
+
+## V3 recommendation
+
+CIR-SWEEP-V3 can evaluate conical profile-stack/revolve/sweep route candidates for countersink/chamfered-entry without changing public APIs.