Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Preserve authored CRLF spans and serialize bounded corpus qualification
Yuechen Li9c1fa0ee9198
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.ymlindex 496ed537..897f7cb0 100644--- a/.github/workflows/dotnet.yml+++ b/.github/workflows/dotnet.yml@@ -67,7 +67,7 @@ jobs:- name: Test full solutionenv:AETHERIS_TEST_PDFTOPPM: /usr/bin/pdftoppm- run: dotnet test Aetheris.slnx --configuration Release --no-build -m:1 -- RunConfiguration.MaxCpuCount=1+ run: dotnet test Aetheris.slnx --configuration Release --no-build -m:1 -- RunConfiguration.MaxCpuCount=1 xUnit.ParallelizeTestCollections=false- name: Qualify portable CLI packageshell: pwsh@@ -139,7 +139,7 @@ jobs:dotnet restore Aetheris.slnxdotnet build Aetheris.slnx --no-restore /m:1 -c Release- name: Test the release candidate- run: dotnet test Aetheris.slnx -c Release --no-build -m:1 -- RunConfiguration.MaxCpuCount=1+ run: dotnet test Aetheris.slnx -c Release --no-build -m:1 -- RunConfiguration.MaxCpuCount=1 xUnit.ParallelizeTestCollections=false- name: Package exact release bytesid: versionshell: pwshdiff --git a/Aetheris.Kernel.Firmament.Tests/Assembly/AssemblyTypedModuleTests.cs b/Aetheris.Kernel.Firmament.Tests/Assembly/AssemblyTypedModuleTests.csindex ed58abfb..83b594a3 100644--- a/Aetheris.Kernel.Firmament.Tests/Assembly/AssemblyTypedModuleTests.cs+++ b/Aetheris.Kernel.Firmament.Tests/Assembly/AssemblyTypedModuleTests.cs@@ -74,7 +74,7 @@ public sealed class AssemblyTypedModuleTestspublic void ReorderingKeysPreservesOccurrenceIdentityAndPlacement(){var first = new AssemblyM1Pipeline().CompileProject(Project());- var reordered = Root.Replace("C1 => standard\n C2 => standard with { x: 40mm }", "C2 => standard with { x: 40mm }\n C1 => standard");+ var reordered = Root.ReplaceLineEndings("\n").Replace("C1 => standard\n C2 => standard with { x: 40mm }", "C2 => standard with { x: 40mm }\n C1 => standard");Assert.NotEqual(Root,reordered);var second = new AssemblyM1Pipeline().CompileProject(Project(reordered));Assert.True(first.IsSuccess); Assert.True(second.IsSuccess);diff --git a/Aetheris.Kernel.Firmament.Tests/FirmamentAssertionsTests.cs b/Aetheris.Kernel.Firmament.Tests/FirmamentAssertionsTests.csindex 9fd02e04..681e4713 100644--- a/Aetheris.Kernel.Firmament.Tests/FirmamentAssertionsTests.cs+++ b/Aetheris.Kernel.Firmament.Tests/FirmamentAssertionsTests.cs@@ -55,12 +55,15 @@ public sealed class FirmamentAssertionsTests}[Theory]- [InlineData("expected: 480mm^3", "expected: 479mm^3", "firmament-v2-assert-volume-failed")]- [InlineData("faces: 6", "faces: 5", "firmament-v2-assert-topology-failed")]- [InlineData("max: [5mm", "max: [6mm", "firmament-v2-assert-bounds-failed")]- public void FalseAssertionsFailAtTheirOwnSourceSpan(string before, string after, string code)+ [InlineData("expected: 480mm^3", "expected: 479mm^3", "firmament-v2-assert-volume-failed", "\n")]+ [InlineData("faces: 6", "faces: 5", "firmament-v2-assert-topology-failed", "\n")]+ [InlineData("max: [5mm", "max: [6mm", "firmament-v2-assert-bounds-failed", "\n")]+ [InlineData("expected: 480mm^3", "expected: 479mm^3", "firmament-v2-assert-volume-failed", "\r\n")]+ [InlineData("faces: 6", "faces: 5", "firmament-v2-assert-topology-failed", "\r\n")]+ [InlineData("max: [5mm", "max: [6mm", "firmament-v2-assert-bounds-failed", "\r\n")]+ public void FalseAssertionsFailAtTheirOwnSourceSpan(string before, string after, string code, string newline){- var source = Source("box").Replace(before, after, StringComparison.Ordinal);+ var source = Source("box").ReplaceLineEndings(newline).Replace(before, after, StringComparison.Ordinal);var built = FirmamentBuildAndExport.CompileSource(source);Assert.False(built.IsSuccess);var diagnostic = Assert.Single(built.Diagnostics.Where(d => d.Message.StartsWith(code, StringComparison.Ordinal)));@@ -69,6 +72,16 @@ public sealed class FirmamentAssertionsTestsAssert.True(FirmamentBuildAndExport.CompileForMeasurement(source).IsSuccess);}+ [Fact]+ public void SourceLineEndingsDoNotChangeQualifiedGeometry()+ {+ var lf = FirmamentBuildAndExport.CompileSource(Source("box").ReplaceLineEndings("\n"));+ var crlf = FirmamentBuildAndExport.CompileSource(Source("box").ReplaceLineEndings("\r\n"));+ Assert.True(lf.IsSuccess);+ Assert.True(crlf.IsSuccess, string.Join("; ", crlf.Diagnostics.Select(d => d.Message)));+ Assert.Equal(lf.Value.StepText, crlf.Value.StepText);+ }+[Fact]public void UnknownFieldsAndNonExportedTargetsNeverDisappear(){diff --git a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.csindex 86851d4a..5f541807 100644--- a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs+++ b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs@@ -46,6 +46,8 @@ public static partial class FirmamentBuildAndExportif (lockDiagnostics.Count > 0) return KernelResult<FirmamentBuildAndExportResult>.Failure(lockDiagnostics.Select(d => SchemaDiagnostic(d.Code + ": " + d.Message)).ToArray());var sourceText = File.ReadAllText(fullSourcePath, Encoding.UTF8);+ // The lexer accepts authored line endings. Keep their offsets intact for+ // admission diagnostics and runtime assertion spans on Windows as well.var frontend = FirmamentFrontendSchemas.Select(sourceText);if (!frontend.IsSuccess) return KernelResult<FirmamentBuildAndExportResult>.Failure(frontend.LocatedDiagnostics.Select(d => SchemaDiagnostic(d.Code + ": " + d.Message)).ToArray());sourceText = frontend.Source;@@ -66,7 +68,6 @@ public static partial class FirmamentBuildAndExportreturn KernelResult<FirmamentBuildAndExportResult>.Success(new(fullSourcePath, pipingOutputPath,new(piping.StepText, "piping-system:" + report.PipingSystem, -1, "Assembly", "PipingSystem", Piping: report)));}- sourceText = NormalizeLf(sourceText);if (StructuralAuthoring.IsStructuralSource(sourceText)){var structural = StructuralAuthoring.Compile(sourceText, fullSourcePath);@@ -136,6 +137,7 @@ public static partial class FirmamentBuildAndExportIReadOnlyDictionary<string, string>? resources = null){ArgumentNullException.ThrowIfNull(sourceText);+ // Do not collapse CRLF here: bound declaration spans belong to this input.var normalized = sourceText;var frontend = FirmamentFrontendSchemas.Select(normalized);if (!frontend.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(frontend.LocatedDiagnostics.Select(d => SchemaDiagnostic(d.Code + ": " + d.Message)).ToArray());@@ -147,7 +149,6 @@ public static partial class FirmamentBuildAndExport? KernelResult<FirmamentStepExportResult>.Success(new(piping.StepText, "piping-system:" + piping.Report.PipingSystem, -1, "Assembly", "PipingSystem", Piping: piping.Report)): KernelResult<FirmamentStepExportResult>.Failure(piping.KernelDiagnostics());}- normalized = NormalizeLf(normalized);if (StructuralAuthoring.IsStructuralSource(normalized)){var structural = StructuralAuthoring.Compile(normalized, sourceDirectory ?? "memory");@@ -3057,6 +3058,4 @@ public static partial class FirmamentBuildAndExportreturn Path.ChangeExtension(fullSourcePath, ".step");}- private static string NormalizeLf(string value) =>- value.Replace("\r\n", "\n", StringComparison.Ordinal).Replace("\r", "\n", StringComparison.Ordinal);}diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/ConceptIr.cs b/Aetheris.Kernel.Firmament/FirmamentV2/ConceptIr.csindex 49f7047b..7f48e0ba 100644--- a/Aetheris.Kernel.Firmament/FirmamentV2/ConceptIr.cs+++ b/Aetheris.Kernel.Firmament/FirmamentV2/ConceptIr.cs@@ -316,12 +316,8 @@ internal static class ConceptIrResolver{if (statement is not DeclarationSyntax feature || !(feature.Type.Name.Text.Equals("Hole", StringComparison.OrdinalIgnoreCase) || feature.Type.Name.Text is "Pattern" or "EdgeFinish"))diagnostics.Add($"{FirmamentV2Parser.CanonicalDeclarationUnknown}:Modify:{(statement as DeclarationSyntax)?.Type.Name.Text ?? "expression"}");- // The hole reader below looks fields up by name, so any other field would be- // dropped silently. This path admits shaft holes with exactly these fields.- else if (feature.Type.Name.Text.Equals("Hole", StringComparison.OrdinalIgnoreCase))- foreach (var holeField in feature.Body?.Statements.OfType<FieldSyntax>() ?? [])- if (!ConceptHoleFields.Any(name => FirmamentSyntaxFields.SameField(holeField.Name.Text, name)))- diagnostics.Add($"{FirmamentV2Parser.CanonicalFieldUnknown}:Hole:{holeField.Name.Text}");+ // ParseConceptHoles owns field consumption, including generated+ // Pattern elements; do not maintain a second check here.}IReadOnlyList<double>? size = null;ConceptIrBox3Value? resolvedBounds = null;diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentBuildAdmissionValidation.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentBuildAdmissionValidation.csindex 84fe673e..4d92813c 100644--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentBuildAdmissionValidation.cs+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentBuildAdmissionValidation.cs@@ -43,7 +43,7 @@ public static class FirmamentBuildAdmissionValidationvar parsed = FirmamentV2Parser.Parse(source);var original = parsed.SyntaxDiagnostics.FirstOrDefault(d => d.Code == code || d.Code.StartsWith(code + ":", StringComparison.Ordinal));if (original is not null) return Locate(original, source, sourceFile);- if (diagnostic.SourceSpan is { } produced && FirmamentV2Parser.Parse(source.ReplaceLineEndings("\n")).DiagnosticSource is { } input)+ if (diagnostic.SourceSpan is { } produced && parsed.DiagnosticSource is { } input){var origins = new Syntax.FirmamentSyntaxOrigins(Syntax.FirmamentSyntaxParser.Parse(FirmamentSourceSpelling.Normalize(source)).Document,Syntax.FirmamentSyntaxParser.Parse(input).Document);diff --git a/docs/development/reports/2026-10/RELEASE-2.0.0-CLOSEOUT.md b/docs/development/reports/2026-10/RELEASE-2.0.0-CLOSEOUT.mdindex 3ae12426..49fb751d 100644--- a/docs/development/reports/2026-10/RELEASE-2.0.0-CLOSEOUT.md+++ b/docs/development/reports/2026-10/RELEASE-2.0.0-CLOSEOUT.md@@ -104,9 +104,9 @@ with the new stable name retained. Five regression cases select that previouslyunused Plate recipe and confirm each inserted field rejects validate and build.These are explicit classifications, not a blanket exemption for Template bodies.-The public-byte build passed 5,988 tests before those final eleven closures.-The resulting source passes sixty focused CLI/edge-finish cases. A new complete-solution run and final source qualification remain gates. Both completed+The public-byte build passed 5,998 tests after those final eleven closures.+The resulting source also passes sixty focused CLI/edge-finish cases. Final+hosted release qualification remains a gate. Both completed380-file comparisons so far retained identical exits and byte-identical STEPfor all 297 successful engineering builds. The remaining 83 files compriselibrary/inspection sources, garment sources needing body input, and non-STEP@@ -118,3 +118,12 @@ alongside the corresponding source and command results.Qualification is in progress. No Aetheris stable tag has been published by thispass while the final gates remain open.++The first Windows release rehearsal exposed CRLF assertion offsets being used+against original source after LF normalization, and a stable-key test mutation+that assumed LF. Compilation now preserves authored line endings instead of+discarding those source offsets; six explicit LF/CRLF assertion cases and a+byte-identical STEP witness cover the repair. The key-order test normalizes its+own mutation input. Hosted qualification also serializes xUnit collections (in+addition to test assemblies), so independent corpus tessellations do not contend+against one another's bounded execution budgets. No product budget is enlarged.