Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Gate volume assertions only on authoritative measurements
Yuechen Li080042a3f3b8
diff --git a/Aetheris.Kernel.Core.Tests/Brep/BrepMassPropertiesTests.cs b/Aetheris.Kernel.Core.Tests/Brep/BrepMassPropertiesTests.csindex ee87e200..78980797 100644--- a/Aetheris.Kernel.Core.Tests/Brep/BrepMassPropertiesTests.cs+++ b/Aetheris.Kernel.Core.Tests/Brep/BrepMassPropertiesTests.cs@@ -30,6 +30,8 @@ public sealed class BrepMassPropertiesTestsAssert.True(result.Status != BrepMassPropertiesStatus.Unavailable, string.Join(" | ", result.Diagnostics));Assert.True(result.AbsoluteVolume > 0d);Assert.Contains(result.FaceContributions, item => item.SurfaceKind is not null);+ Assert.False(result.IsAuthoritativeForVolumeAssertion);+ Assert.True(result.IsTessellatedSanityEstimate);}[Fact]diff --git a/Aetheris.Kernel.Core/Brep/Verification/BrepMassProperties.cs b/Aetheris.Kernel.Core/Brep/Verification/BrepMassProperties.csindex a2c9bb63..9271b699 100644--- a/Aetheris.Kernel.Core/Brep/Verification/BrepMassProperties.cs+++ b/Aetheris.Kernel.Core/Brep/Verification/BrepMassProperties.cs@@ -60,14 +60,24 @@ public sealed record BrepMassPropertiesResult(double? ErrorBound,BrepMassPropertiesOptions Tolerance,BrepMassPropertiesTopologyDiagnostics Topology,- IReadOnlyList<string> Diagnostics);+ IReadOnlyList<string> Diagnostics)+{+ /// <summary>+ /// True only for bounded analytic recognizers. The generic trimmed-face+ /// route consumes display tessellation and is a diagnostic estimate, never+ /// an authoritative occupied-volume measurement.+ /// </summary>+ public bool IsAuthoritativeForVolumeAssertion => EvaluationMethod.StartsWith("Exact", StringComparison.Ordinal);++ public bool IsTessellatedSanityEstimate => !IsAuthoritativeForVolumeAssertion;+}/// <summary>-/// Independent B-rep mass-property evaluator. It only consumes materialized-/// topology, bindings, and analytic surfaces. Every supported face is-/// deterministically tessellated at two resolutions; oriented triangles are-/// integrated as tetrahedra against the origin (divergence theorem). The-/// difference between the two resolutions is reported as a numerical bound.+/// B-rep mass-property diagnostic. Bounded analytic recognizers provide exact+/// cross-checks for a few admitted families. The generic route deterministically+/// tessellates faces at two resolutions and integrates oriented triangles as+/// tetrahedra; that result is a display-derived sanity estimate and must not be+/// used as authoritative occupied-volume evidence./// </summary>public static class BrepMassProperties{@@ -415,22 +425,11 @@ public static class BrepMassProperties}case CurveGeometryKind.Circle3 when curve.Circle3 is { } circle && System.Math.Abs(circle.Normal.ToVector().Z) > 1d - 1e-8d:{- areaTwice = IntegrateConicAreaTwice(- circle.Center,- circle.XAxis.ToVector() * circle.Radius,- circle.YAxis.ToVector() * circle.Radius,- start,- end);- return true;- }- case CurveGeometryKind.Ellipse3 when curve.Ellipse3 is { } ellipse && System.Math.Abs(ellipse.Normal.ToVector().Z) > 1d - 1e-8d:- {- areaTwice = IntegrateConicAreaTwice(- ellipse.Center,- ellipse.XAxis.ToVector() * ellipse.MajorRadius,- ellipse.YAxis.ToVector() * ellipse.MinorRadius,- start,- end);+ var sign = circle.Normal.ToVector().Z >= 0d ? 1d : -1d;+ var a = start * sign; var b = end * sign;+ areaTwice = (circle.Center.X * circle.Radius * (System.Math.Sin(b) - System.Math.Sin(a)))+ - (circle.Center.Y * circle.Radius * (System.Math.Cos(b) - System.Math.Cos(a)))+ + (circle.Radius * circle.Radius * (b - a));return true;}default:@@ -438,16 +437,6 @@ public static class BrepMassProperties}}- private static double IntegrateConicAreaTwice(Point3D center, Vector3D cosineAxis, Vector3D sineAxis, double start, double end)- {- static double Primitive(Point3D c, Vector3D a, Vector3D b, double t)- => (c.X * ((a.Y * System.Math.Sin(t)) - (b.Y * System.Math.Cos(t))))- - (c.Y * ((a.X * System.Math.Sin(t)) - (b.X * System.Math.Cos(t))))- + (((a.X * b.Y) - (a.Y * b.X)) * t);-- return Primitive(center, cosineAxis, sineAxis, end) - Primitive(center, cosineAxis, sineAxis, start);- }-private static bool TryEvaluateExactAxisAlignedBoxQuarterCylinderFillet(BrepBody body,BrepMassPropertiesOptions options,@@ -787,23 +776,6 @@ public static class BrepMassPropertiesfaceVolume += tetraVolume;faceMoment += (av + bv + cv) * (tetraVolume / 4d);}- // Horizontal analytic faces are common cap faces whose trims may- // contain exact circular or elliptical arcs. Integrating their- // boundary with Green's theorem avoids assigning the area of the- // chordal display polygon to the authoritative boundary integral.- // Curved supports remain on the numerical path below; this is a- // deliberately narrow exact lane, not a claim that the whole body- // has become analytic.- if (TryEvaluateHorizontalPlanarFace(body, patch.FaceId, out var exactPlanarArea, out var exactPlanarVolume))- {- var meshVolume = faceVolume;- faceVolume = exactPlanarVolume;- faceArea = exactPlanarArea;- if (System.Math.Abs(meshVolume) > 1e-18d)- {- faceMoment *= faceVolume / meshVolume;- }- }volume += faceVolume;area += faceArea;moment += faceMoment;@@ -813,43 +785,6 @@ public static class BrepMassPropertiesreturn new(volume, area, moment, contributions, null);}- private static bool TryEvaluateHorizontalPlanarFace(BrepBody body, FaceId faceId, out double area, out double signedVolume)- {- area = 0d;- signedVolume = 0d;- if (!body.TryGetFaceSurfaceGeometry(faceId, out var surface)- || surface?.Kind != SurfaceGeometryKind.Plane- || surface.Plane is not { } plane- || System.Math.Abs(plane.Normal.ToVector().Z) < 1d - 1e-10d)- return false;-- var loops = body.GetLoopIds(faceId);- // Multi-loop planar faces require geometric containment classification;- // leave them on the established path until that role is explicit.- if (loops.Count != 1)- return false;-- var signedArea = 0d;- foreach (var loopId in loops)- {- var loopAreaTwice = 0d;- foreach (var coedgeId in body.GetCoedgeIds(loopId))- {- var coedge = body.Topology.GetCoedge(coedgeId);- var edge = body.Topology.GetEdge(coedge.EdgeId);- var from = DirectedEdgeUse.Resolve(edge, coedge).StartVertexId;- if (!TrySignedPlanarCurveAreaTwice(body, edge.Id, from, out var contribution))- return false;- loopAreaTwice += contribution;- }- signedArea += loopAreaTwice / 2d;- }-- area = System.Math.Abs(signedArea);- signedVolume = plane.Origin.Z * plane.Normal.ToVector().Z * area / 3d;- return double.IsFinite(area) && area > 0d && double.IsFinite(signedVolume);- }-private static BrepMassPropertiesTopologyDiagnostics ValidateTopology(BrepBody body){var messages = new List<string>();diff --git a/Aetheris.Kernel.Firmament.Tests/Integration/ProfileEdgeFinishMixedShellPlanTests.cs b/Aetheris.Kernel.Firmament.Tests/Integration/ProfileEdgeFinishMixedShellPlanTests.csindex 9edfa5f5..8fd069d8 100644--- a/Aetheris.Kernel.Firmament.Tests/Integration/ProfileEdgeFinishMixedShellPlanTests.cs+++ b/Aetheris.Kernel.Firmament.Tests/Integration/ProfileEdgeFinishMixedShellPlanTests.cs@@ -171,9 +171,9 @@ public sealed class ProfileEdgeFinishMixedShellPlanTests}[Theory]- [InlineData("profile-edgefinish-chimera-fillet.firmament", 34224.362848131015)]- [InlineData("profile-edgefinish-chimera-reflex-sphere-compat.firmament", 34460.92921874538)]- public void SevenStationFillet_ReimportedHorizontalCapUsesExactCurvedBoundaryArea(string fixture, double expectedTopArea)+ [InlineData("profile-edgefinish-chimera-fillet.firmament")]+ [InlineData("profile-edgefinish-chimera-reflex-sphere-compat.firmament")]+ public void SevenStationFillet_ReimportedMassIsNonAuthoritativeSanityEvidence(string fixture){var source = FirmamentCorpusHarness.ResolveFixtureFullPath($"fixtures/FirmamentV2/Canonical/valid/{fixture}");var built = FirmamentBuildAndExport.Run(source, Path.Combine(Path.GetTempPath(), $"aetheris-{Guid.NewGuid():N}.step"));@@ -182,14 +182,13 @@ public sealed class ProfileEdgeFinishMixedShellPlanTestsAssert.True(imported.IsSuccess, string.Join(Environment.NewLine, imported.Diagnostics.Select(diagnostic => diagnostic.Message)));var mass = BrepMassProperties.Evaluate(Assert.IsType<Aetheris.Kernel.Core.Brep.BrepBody>(imported.Value));- var top = Assert.Single(mass.FaceContributions, contribution =>- contribution.SurfaceKind == SurfaceGeometryKind.Plane- && contribution.SurfaceArea > 30_000d- && contribution.SignedVolume > 200_000d- && contribution.SignedVolume < 300_000d);-- Assert.Equal(expectedTopArea, top.SurfaceArea, 8);- Assert.Equal(expectedTopArea * 8d, top.SignedVolume, 8);+ Assert.False(mass.IsAuthoritativeForVolumeAssertion);+ Assert.True(mass.IsTessellatedSanityEstimate);+ var sanityComparison = FirmamentV2VolumeAssertionComparer.Compare(+ new FirmamentV2VolumeAssertion("sanity", "Body", 1d, 0d, null, new FirmamentV2SourceSpan(0, 0)),+ mass);+ Assert.False(sanityComparison.MeasurementAuthoritative);+ Assert.False(sanityComparison.Passed);}private static (ResolvedProfile2D Profile, ProfileBoundaryChamferTarget Target) ReleaseCard(string fixture, ProfileEdgeFinishKind kind)diff --git a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.csindex 19d0ddfa..2cc26941 100644--- a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs+++ b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs@@ -75,7 +75,11 @@ public static class FirmamentBuildAndExport}var mass = BrepMassProperties.Evaluate(imported.Value);var results = assertions.Select(assertion => FirmamentV2VolumeAssertionComparer.Compare(assertion, mass)).ToArray();- var failures = results.Where(result => !result.Passed).Select(result => new Kernel.Core.Diagnostics.KernelDiagnostic(+ // Display-tessellation estimates remain useful evidence, but they do+ // not gate a production build as the definition of occupied volume.+ // Analytic B-rep recognizers retain their existing bounded gate until+ // the post-Preview-1 CIR authority path is implemented.+ var failures = results.Where(result => result.MeasurementAuthoritative && !result.Passed).Select(result => new Kernel.Core.Diagnostics.KernelDiagnostic(Kernel.Core.Diagnostics.KernelDiagnosticCode.ValidationFailed, Kernel.Core.Diagnostics.KernelDiagnosticSeverity.Error,result.Diagnostic ?? "firmament-v2-assert-volume-failed", "FirmamentV2.AssertVolume")).ToArray();return failures.Length == 0diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2VolumeAssertions.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2VolumeAssertions.csindex 93864f7d..baac47dd 100644--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2VolumeAssertions.cs+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2VolumeAssertions.cs@@ -24,6 +24,7 @@ public sealed record FirmamentV2VolumeAssertionResult(string? Note,string MeasurementMethod,double? MeasurementErrorBoundMm3,+ bool MeasurementAuthoritative,string? Diagnostic,FirmamentV2SourceSpan SourceSpan,string Provenance);@@ -37,7 +38,7 @@ public static class FirmamentV2VolumeAssertionComparerif (mass.Status == BrepMassPropertiesStatus.Unavailable){return new(assertion.Id, assertion.TargetBodyId, assertion.ExpectedMm3, null, null, null, assertion.ToleranceMm3, false,- assertion.Note, mass.EvaluationMethod, mass.ErrorBound,+ assertion.Note, mass.EvaluationMethod, mass.ErrorBound, mass.IsAuthoritativeForVolumeAssertion,$"firmament-v2-assert-volume-measurement-unavailable:{assertion.TargetBodyId}:{assertion.Id}", assertion.SourceSpan, assertion.Provenance);}@@ -46,6 +47,6 @@ public static class FirmamentV2VolumeAssertionComparervar passed = absoluteDelta <= assertion.ToleranceMm3;var diagnostic = passed ? null : $"firmament-v2-assert-volume-failed:target={assertion.TargetBodyId}:expectedMm3={assertion.ExpectedMm3:G17}:measuredMm3={mass.AbsoluteVolume:G17}:deltaMm3={delta:G17}:toleranceMm3={assertion.ToleranceMm3:G17}:method={mass.EvaluationMethod}:errorBoundMm3={mass.ErrorBound?.ToString("G17", System.Globalization.CultureInfo.InvariantCulture) ?? "unavailable"}";return new(assertion.Id, assertion.TargetBodyId, assertion.ExpectedMm3, mass.AbsoluteVolume, delta, absoluteDelta, assertion.ToleranceMm3,- passed, assertion.Note, mass.EvaluationMethod, mass.ErrorBound, diagnostic, assertion.SourceSpan, assertion.Provenance);+ passed, assertion.Note, mass.EvaluationMethod, mass.ErrorBound, mass.IsAuthoritativeForVolumeAssertion, diagnostic, assertion.SourceSpan, assertion.Provenance);}}diff --git a/docs/firmament/assert-volume-m1.md b/docs/firmament/assert-volume-m1.mdindex 3d292fbb..ccb027ae 100644--- a/docs/firmament/assert-volume-m1.md+++ b/docs/firmament/assert-volume-m1.md@@ -17,12 +17,15 @@ bind to one canonical material-body symbol. Lengths, areas, angles, scalars,unknown targets, duplicate/unknown fields, and malformed notes are rejected atparse/bind time.-Builds materialize normally, reimport the just-produced STEP, and evaluate its-body through `BrepMassProperties.Evaluate`. The shared+Builds materialize normally and reimport the just-produced STEP. Bounded+analytic BRep recognizers can gate assertions for their explicitly admitted+families. The generic display-tessellation mass result is recorded only as a+non-authoritative sanity estimate and never gates the build. The shared`FirmamentV2VolumeAssertionComparer` records expected, measured, signed and-absolute deltas, tolerance, note, source provenance, method, and error bound.-It passes only when `abs(measured - expected) <= tolerance`; unavailable mass-properties are a distinct failure. Failed assertions fail `build`; `validate`+absolute deltas, tolerance, note, source provenance, method, error bound, and+whether the measurement is authoritative. An authoritative measurement passes+only when `abs(measured - expected) <= tolerance`; unavailable mass properties+are a distinct failure. Failed authoritative assertions fail `build`; `validate`only performs source checks. `build --json` exposes successful records under`assertions`. Artifact-only `verify` cannot recover source contracts from aSTEP file and deliberately does not infer them.diff --git a/docs/release/p1-cir-volume-closeout-m3.md b/docs/release/p1-cir-volume-closeout-m3.mdnew file mode 100644index 00000000..591a567b--- /dev/null+++ b/docs/release/p1-cir-volume-closeout-m3.md@@ -0,0 +1,46 @@+# P1-CIR-VOLUME-CLOSEOUT-M3++## Decision++Outcome B: intentional defer. Correct post-STEP CIR/FRep occupied-volume verification is a large reconstruction project, not Preview 1 wiring. Whole-loop Fillet remains Experimental.++## Architecture map++| Layer | Implemented responsibility | Relevant limits |+| --- | --- | --- |+| Firmament primitive lowering | Boxes, cylinders, cones, spheres, tori and basic Boolean composition lower to `CirNode` | canonical Profile/Compose whole-loop Fillet does not lower to CIR; `Fillet` is explicitly rejected by `FirmamentCirLowerer` |+| CIR semantic field | Primitive signed-distance evaluators, transforms, union, subtraction and intersection | no node describing a trimmed Profile Fillet or its ExactRolling/compatibility policy |+| CIR runtime | `CirTape` point and interval evaluation | primitive/Boolean instruction set only |+| CIR volume | dense regular-cell center sampling and adaptive region subdivision/direct sampling | deterministic and approximate, but no returned absolute error bound or convergence certificate |+| CIR to BRep | narrow rematerializers for box-minus-cylinder and box-minus-box; torus subtraction recognized but unsupported | direction is opposite the required bridge |+| BRep to CIR | none | reconstructing occupied material from arbitrary imported trimmed analytic faces requires topology/domain interpretation |+| BRep | exact topology/boundaries and STEP export/reimport | bounded exact mass recognizers exist for a few families; generic mass uses display tessellation |+| Tessellation | display and diagnostic volume estimate | not authoritative for `Assert Volume` after M3 |++The whole-loop BRep producer constructs analytic Plane/Cylinder/Sphere/Torus patches directly. It does not retain a CIR mirror in `FirmamentStepExportResult`, and CIR does not survive STEP. Consequently neither policy has a pre-export CIR occupied-region model suitable for volume comparison.++## Current Assert Volume pipeline++Before M3:++`Assert source -> build BRep -> STEP -> reimport BRep -> BrepMassProperties -> compare -> build gate`++The substitution point is `FirmamentBuildAndExport.EvaluateVolumeAssertions`. A future CIR measurement result can be supplied there without changing syntax or STEP topology verification. Today there is no correct CIR input at that point.++After M3, exact BRep recognizers retain their existing bounded gate. The generic `DeterministicTrimmedFaceTriangulationBoundaryIntegral` result is explicitly tagged `IsTessellatedSanityEstimate=true`, `IsAuthoritativeForVolumeAssertion=false`, is serialized with the assertion result, and does not fail a build. It remains useful for diagnostics and comparison.++## Complexity classification++Post-STEP CIR is **Large**. It needs either a BRep-to-occupied-region interpreter for trimmed periodic analytic surfaces and shell orientation, or a dual-representation Profile Fillet CIR lowering plus an artifact-equivalence contract. Both also need a CIR volume estimator with an explicit error contract. Existing adaptive sampling reports counts and an estimate but no lower/upper volume interval. Wiring it as authoritative would merely replace triangle sampling with unbounded voxel sampling.++## Evidence and promotion++M2 remains the forensic comparison. ExactRolling is externally/source-derived as 913725.7396023329 mm³ while the BRep sanity estimate is 881896.8785532190 mm³. Compatibility is 913733.5792146825 mm³ while its sanity estimate is 879274.5010217372 mm³. FreeCAD 1.0.2 matches the source-derived values. M2's partial planar experiment was reverted after M3 full-corpus validation exposed incorrect shared trim orientation on other bodies. CIR values do not exist for either whole-loop policy, so no new tolerance is justified and the promotion gate fails.++Authority boundaries are now explicit:++- BRep owns topology, exact boundaries, and interchange.+- CIR/FRep owns occupied-region evaluation and is the intended future volume authority.+- tessellation owns display and coarse sanity evidence.++No geometry, STEP artifact, support status, or freeze-manifest claim changed.diff --git a/docs/release/p1-harden-m2-mass-audit.md b/docs/release/p1-harden-m2-mass-audit.mdindex 90dfa79a..9021cad4 100644--- a/docs/release/p1-harden-m2-mass-audit.md+++ b/docs/release/p1-harden-m2-mass-audit.md@@ -9,7 +9,6 @@| Plane/cylinder vertical line-arc prism | exact section-area integration; circles and lines || Axis-aligned finite quarter-cylinder box fillet | exact recognized volume || Sphere/cylinder seam lattice family | exact recognized caps and cylinders |-| Single-loop horizontal Plane with line/circle/ellipse trims | exact Green-boundary area and planar divergence contribution (M2 narrow fix) || Other Plane, Cylinder, Cone, Sphere, Torus trims | deterministic display tessellation at two resolutions || B-spline or a face the tessellator cannot fill | unavailable; partial volume is rejected |@@ -28,9 +27,9 @@ The defect is both value and bound, not bound alone. Before M2 code changes, aut| ExactRolling | 913725.7396023329 | 881896.8785532190 | -31828.8610491139 | -3.4834% | 41238.3782898643 || SphereSeamCompatibility | 913733.5792146825 | 879274.5010217372 | -34459.0781929452 | -3.7712% | 41262.7733089027 |-The two-resolution delta was only 6.1364 mm³ for ExactRolling while its absolute bias was 31,828.8610 mm³. Refinement convergence therefore did not detect systematic trim-domain error. Face evidence localized a major part to the horizontal trimmed cap: its chordal display-domain area was 33,556.4996 mm². Exact Green integration of its reimported line/circle boundary gives 34,224.3628 mm². The compatibility cap similarly gives 34,460.9292 mm².+The two-resolution delta was only 6.1364 mm³ for ExactRolling while its absolute bias was 31,828.8610 mm³. Refinement convergence therefore did not detect systematic trim-domain error. Face evidence localized a major part to the horizontal trimmed cap: its chordal display-domain area was 33,556.4996 mm².-The narrow exact planar lane improves the remaining volume deltas to 26,485.9554 mm³ and 16,468.6089 mm³ respectively. It deliberately does not tighten the reported whole-shell bound or claim promotion: cylinder/ellipse, sphere, ring-torus, and horn-torus trim-domain integrals remain on the mesh route.+M2's attempted Green-boundary replacement produced apparently improved chimera values but M3 full-corpus validation exposed shared curve-orientation regressions up to 4,000,000 mm³ on established prismatic fixtures. That attempt was therefore reverted rather than retained as a brittle special case. Cylinder/ellipse, sphere, ring-torus, horn-torus, and general trim-domain integrals remain on the non-authoritative mesh route.## Orientation and trim findingsdiff --git a/docs/release/p1-harden-m2.md b/docs/release/p1-harden-m2.mdindex df47c01e..cebd20a5 100644--- a/docs/release/p1-harden-m2.md+++ b/docs/release/p1-harden-m2.md@@ -4,7 +4,7 @@ This pass reached **meaningful progression**, not release closure.The original hypothesis was only partly correct: the ~41k mm³ number is an overconservative whole-shell `area × 0.1 mm × 4` envelope, but the measured values are also materially biased. The generic mass route consumes display tessellation rather than integrating exact trimmed analytic patches. A close two-resolution delta concealed a 1.8–3.8% trim-domain bias.-The current geometry was frozen under `artifacts/release/p1-harden-m2-baseline/`. No Fillet construction, topology, policy, or STEP exporter code changed. A narrow Green-theorem lane now integrates single-loop horizontal planar faces bounded by exact lines, circles, and ellipses. Permanent reimport tests cover both seven-station policies.+The current geometry was frozen under `artifacts/release/p1-harden-m2-baseline/`. No Fillet construction, topology, policy, or STEP exporter code changed. M2 attempted a narrow Green-theorem cap lane; M3 full-corpus validation proved that its shared curve-orientation assumptions regressed other prismatic bodies, so the production attempt was removed. The forensic localization remains useful, but no partial cap integral is shipped as authority.This isolates the remaining blocker to curved supports: cylinder/ellipse miter trims, sphere trims, and ring/horn-torus trims still need a parameter-domain boundary integral or deterministic adaptive quadrature with a meaningful error estimate. Until that exists, literal tolerances cannot be tightened and promotion would be unsupported.diff --git a/docs/roadmap/cir-frep-authoritative-volume-post-preview1.md b/docs/roadmap/cir-frep-authoritative-volume-post-preview1.mdnew file mode 100644index 00000000..e71a9c75--- /dev/null+++ b/docs/roadmap/cir-frep-authoritative-volume-post-preview1.md@@ -0,0 +1,34 @@+# CIR/FRep authoritative volume after Preview 1++## Target++Make `Assert Volume` consume a deterministic CIR/FRep occupied-volume result with an explicit absolute error interval, while independently requiring exact-BRep STEP reimport and topology validation.++## Missing work++1. Define a volume-result contract: estimate, lower/upper bounds, absolute target, convergence state, method, and deterministic work limits.+2. Upgrade adaptive CIR integration from sampled mixed cells to certified occupancy bounds. Interval-classified inside/outside cells already provide the scaffold; unresolved cells must contribute explicit `[0, cellVolume]` uncertainty and subdivide until the requested bound or resource limit.+3. Add semantic CIR mirrors for admitted Profile/Compose families. Whole-loop Fillet needs the same radius, station, ExactRolling versus SphereSeamCompatibility, rounded-source, miter, and top/side occupancy semantics as the BRep planner.+4. Preserve that CIR mirror through the build result for dual-representation verification. Do not serialize it into STEP or pretend STEP contains CIR.+5. Decide artifact-equivalence policy. The Preview-safe design is semantic CIR volume plus separate post-STEP manifold, analytic-family, and determinism gates. Generic post-STEP BRep-to-CIR reconstruction should be a distinct later project.+6. Replace `EvaluateVolumeAssertions`' measurement dependency with a representation-neutral occupied-volume result. Retain BRep analytic/tessellated values as cross-check fields.+7. Add fault tests for wrong radius, missing hole/feature, and policy mismatch; add scale, translation, determinism, and performance matrices.++## Milestone decomposition++- V1: certified adaptive CIR volume bounds for existing primitives and Boolean compositions.+- V2: dual-representation build-result contract and primitive/hole `Assert Volume` migration.+- V3: Profile extrusion and bounded chamfer/fillet CIR mirrors.+- V4: seven-station ExactRolling and SphereSeamCompatibility parity, oracle comparison, and promotion reconsideration.+- V5, separately justified: imported BRep-to-CIR reconstruction, only if product requirements demand volumetric analysis of arbitrary STEP input.++## Existing oracles++- primitive and hole analytic formulas;+- `CirAdaptiveVolumeEstimatorTests` and calibration tests;+- M2 frozen STEP hashes and per-face forensic evidence;+- independent whole-loop values 913725.7396023329 and 913733.5792146825 mm³;+- FreeCAD/OCCT validity and matching volume evidence;+- deterministic STEP, manifold, analytic-family, and zero-NURBS tests.++Display tessellation must remain non-authoritative because M2 demonstrated close coarse/fine convergence alongside 1.8–3.8% systematic trim-domain bias.diff --git a/docs/verification/aetheris-verification-m8.md b/docs/verification/aetheris-verification-m8.mdindex 9b648632..6e10b532 100644--- a/docs/verification/aetheris-verification-m8.md+++ b/docs/verification/aetheris-verification-m8.md@@ -14,7 +14,7 @@ The evaluator consumes a materialized `BrepBody`, never fixture expected-volumeSupported materialized surface families are planes, cylinders, cones, spheres, and tori. The evaluator refines its verification mesh twice. At each resolution it corrects each curved triangle to the face's bound `SameSense`, sums triangle area, and integrates oriented tetrahedra `(0,a,b,c)`. Thus `V = sum dot(a, cross(b,c))/6`; the first moment is each tetrahedron's signed volume times `(a+b+c)/4`. The centroid is that first moment divided by signed volume.-The surface mesh is verification-only and never becomes authoritative geometry. Results are `NumericalConverged`, `NumericalWithBound`, or `Unavailable`; no tessellated value is called exact. The reported bound is the larger of the coarse/refined delta and `4 × sampled-area × chord-tolerance`, which remains conservative when deterministic segment caps leave chord error. The coarse pass receives half the declared segment cap and the refined pass receives the full cap, so a capped pair cannot be reported converged without an actual triangle-count increase. Face-level signed-volume, area, triangle-count, surface-family, and orientation evidence are preserved.+The surface mesh is display-derived diagnostic evidence and never becomes authoritative geometry or occupied-volume evidence. Results are `NumericalConverged`, `NumericalWithBound`, or `Unavailable`; no tessellated value is called exact. The reported envelope is the larger of the coarse/refined delta and `4 × sampled-area × chord-tolerance`. M2 proved that this envelope can contain a systematic trim-domain bias even when refinement appears stable, so the generic result is explicitly a non-authoritative sanity estimate. Face-level signed-volume, area, triangle-count, surface-family, and orientation evidence remain useful for debugging.## M8B bounded trimmed-cone repair@@ -24,7 +24,7 @@ The admitted repair is intentionally narrow. For exactly two closed, full-periodThe direct and STEP-reimported `Frustum<Hollow>` both now have five participating faces. At the declared maximum 512 angular/generator segments per cone, the refined artifact result is volume `47273.485526 mm³`, area `47817.126229 mm²`, centroid approximately `(0,0,41.687779) mm`, and a conservative bound `19.126850 mm³`. Its analytic witness is `47274.672097 mm³`; delta `-1.186572 mm³` is within the bound. Cone patches contain 524,288 triangles each, have machine-evaluation support residuals (the focused test requires `<= 1e-8 mm`), and have opposite material-facing senses.-The older CLI `analyze volume` planar signed-shell path remains a separate, exact planar-only route and is not used by `verify`. Its four historical Box/derivation/PMI failures were caused by applying projected-loop orientation after the planar triangulator had already oriented the triangles; the duplicate sign inverted valid faces. That second sign is removed and the affected regression filter now passes. New curved or general verification callers should use `verify` / `BrepMassProperties`.+The older CLI `analyze volume` planar signed-shell path remains a separate, exact planar-only route and is not used by `verify`. Its four historical Box/derivation/PMI failures were caused by applying projected-loop orientation after the planar triangulator had already oriented the triangles; the duplicate sign inverted valid faces. That second sign is removed and the affected regression filter now passes. `verify` / `BrepMassProperties` may report the generic curved estimate, but callers must treat it as a sanity cross-check rather than occupied-volume authority.## External CAD Assistant observation