Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Pin managed WGSL dependency to portable source hash
Yuechen Li174596bc7c0b
diff --git a/.github/actions/prepare-managed-wgsl/action.yml b/.github/actions/prepare-managed-wgsl/action.ymlnew file mode 100644index 00000000..e60c8090--- /dev/null+++ b/.github/actions/prepare-managed-wgsl/action.yml@@ -0,0 +1,22 @@+name: Prepare managed WGSL dependency+description: Build the reviewed Copeland source graph into Aetheris's ignored local NuGet feed.+runs:+ using: composite+ steps:+ - name: Read reviewed compiler commit+ id: pin+ shell: pwsh+ run: |+ $commit = (Get-Content scripts/managed-wgsl-commit-pin.txt -Raw).Trim()+ if ($commit -notmatch '^[0-9a-f]{40}$') { throw 'Invalid managed WGSL commit pin.' }+ "commit=$commit" | Out-File $env:GITHUB_OUTPUT -Encoding utf8 -Append+ - name: Checkout reviewed compiler+ uses: actions/checkout@v4+ with:+ repository: yuechen-li-dev/Copeland+ ref: ${{ steps.pin.outputs.commit }}+ path: artifacts/local/managed-wgsl/source+ persist-credentials: false+ - name: Pack source-pinned managed compiler+ shell: pwsh+ run: ./scripts/prepare-managed-wgsl.ps1 -CopelandRoot artifacts/local/managed-wgsl/sourcediff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.ymlindex e08660da..f2407c68 100644--- a/.github/workflows/dotnet.yml+++ b/.github/workflows/dotnet.yml@@ -24,6 +24,9 @@ jobs:with:dotnet-version: 10.0.x+ - name: Prepare managed WGSL dependency+ uses: ./.github/actions/prepare-managed-wgsl+- name: Restore serverrun: dotnet restore Aetheris.Server/Aetheris.Server.csproj@@ -58,6 +61,8 @@ jobs:- uses: actions/setup-dotnet@v4with:dotnet-version: 10.0.x+ - name: Prepare managed WGSL dependency+ uses: ./.github/actions/prepare-managed-wgsl- name: Pack public library dependency graphshell: pwshrun: ./scripts/package-public-libraries.ps1 -OutputDirectory artifacts/packages/public-libraries@@ -170,6 +175,8 @@ jobs:$toolDirectory = "$source/dist"$toolDirectory | Out-File $env:GITHUB_PATH -Encoding utf8 -Append& "$toolDirectory/tspack.exe" --version+ - name: Prepare managed WGSL dependency+ uses: ./.github/actions/prepare-managed-wgsl- name: Restore and build Preview 3 frozen baselinerun: |dotnet restore Aetheris.slnxdiff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242NistAuditHarnessTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242NistAuditHarnessTests.csindex 20c7204b..828b3694 100644--- a/Aetheris.Kernel.Core.Tests/Step242/Step242NistAuditHarnessTests.cs+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242NistAuditHarnessTests.cs@@ -117,7 +117,25 @@ public sealed class Step242NistAuditHarnessTestsvar entries = JsonSerializer.Deserialize<LegacyAuditEntry[]>(snapshotJson, new JsonSerializerOptions(JsonSerializerDefaults.Web));Assert.NotNull(entries);- return entries.ToDictionary(e => e.Path, StringComparer.Ordinal);+ var byPath = entries.ToDictionary(e => e.Path, StringComparer.Ordinal);+ // Native libm changes the last digits of recovered pcurves. Exact serialized+ // geometry sharing then changes entity numbering too. Preserve strict byte+ // snapshots for the qualified Linux output without changing import evidence.+ if (OperatingSystem.IsLinux())+ {+ var linuxHashesPath = Path.Combine(Step242CorpusManifestRunner.RepoRoot(), "testdata", "step242", "manifests", "nist.v0.canonical-linux.json");+ var linuxHashes = JsonSerializer.Deserialize<Dictionary<string, string>>(File.ReadAllText(linuxHashesPath, Encoding.UTF8));+ Assert.NotNull(linuxHashes);+ foreach (var (path, hash) in linuxHashes)+ {+ Assert.True(byPath.TryGetValue(path, out var baseline), $"Linux hash references missing snapshot entry '{path}'.");+ Assert.NotNull(baseline);+ Assert.Equal("success", baseline.Status);+ Assert.Matches("^[0-9a-f]{64}$", hash);+ byPath[path] = baseline with { CanonicalSha256 = hash };+ }+ }+ return byPath;}private static string NistSnapshotPath() => Path.Combine(Step242CorpusManifestRunner.RepoRoot(), "testdata", "step242", "manifests", "nist.v0.report.json");diff --git a/Aetheris.Kernel.Firmament/Aetheris.Kernel.Firmament.csproj b/Aetheris.Kernel.Firmament/Aetheris.Kernel.Firmament.csprojindex 20c6a9e3..b3047132 100644--- a/Aetheris.Kernel.Firmament/Aetheris.Kernel.Firmament.csproj+++ b/Aetheris.Kernel.Firmament/Aetheris.Kernel.Firmament.csproj@@ -9,7 +9,7 @@</PropertyGroup><ItemGroup>- <PackageReference Include="Copeland.TS.Backend.Wgsl" Version="0.1.0-preview.1-a3.7329cf8ff04d504a" />+ <PackageReference Include="Copeland.TS.Backend.Wgsl" Version="0.1.0-preview.1-a3.16c0ce996358af80" /><PackageReference Include="Machina.Typography.OpenFont" Version="1.0.0" /><ProjectReference Include="..\Aetheris.Firmament.SchemaGenerator\Aetheris.Firmament.SchemaGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" /><ProjectReference Include="..\Aetheris.Continuum\Aetheris.Continuum.csproj" />diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 81509275..f7283338 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -8,7 +8,15 @@ Thank you for improving Aetheris. Keep changes focused, explain the engineering## Build and test-Install the .NET SDK selected by [`global.json`](global.json), then use the canonical solution:+Install the .NET SDK selected by [`global.json`](global.json). Firmament uses an exact managed WGSL compiler package built from a reviewed Copeland commit. A fresh checkout must prepare that ignored local feed before restoring the solution:++```powershell+git clone --no-checkout https://github.com/yuechen-li-dev/Copeland.git artifacts/local/managed-wgsl/source+git -C artifacts/local/managed-wgsl/source checkout (Get-Content scripts/managed-wgsl-commit-pin.txt -Raw).Trim()+./scripts/prepare-managed-wgsl.ps1 -CopelandRoot artifacts/local/managed-wgsl/source+```++The preparation script checks the transitive compiler source hash with canonical LF text and `/` paths, so Windows and Linux checkouts produce the same package version. CI performs this prerequisite through `.github/actions/prepare-managed-wgsl`. Compiler source stays outside the tracked Aetheris tree. Then use the canonical solution:```powershelldotnet restore Aetheris.slnx@@ -38,6 +46,14 @@ merely running fewer tests. `Aetheris.Kernel.Firmament.Tests` has the trait too,spread evenly across real geometry work rather than concentrated in corpus I/O, so the splitbuys much less there.+The NIST audit keeps strict canonical STEP byte snapshots. Three recovered-pcurve specimens+have qualified Linux hashes in `testdata/step242/manifests/nist.v0.canonical-linux.json`:+native math changes tiny UV values and exact geometry sharing changes entity numbering.+The companion overrides only their expected hash on Linux; status, diagnostics, file size+and topology counts still use the common snapshot. When refreshing these specimens,+qualify both Windows and Linux exports and refresh the companion explicitly. All other+specimens retain the common byte hash on both platforms.+### Importing corpus files in testsDo not call `File.ReadAllText` + `Step242Importer.ImportBody` directly in a test. Use the shareddiff --git a/Directory.Build.props b/Directory.Build.propsindex ae5b6dc3..2fd60fac 100644--- a/Directory.Build.props+++ b/Directory.Build.props@@ -1,6 +1,6 @@<Project><PropertyGroup>- <RestoreAdditionalProjectSources>$(RestoreAdditionalProjectSources);$(MSBuildThisFileDirectory)artifacts/local/cir-artifact-binding/packages</RestoreAdditionalProjectSources>+ <RestoreAdditionalProjectSources Condition="Exists('$(MSBuildThisFileDirectory)artifacts/local/cir-artifact-binding/packages')">$(RestoreAdditionalProjectSources);$(MSBuildThisFileDirectory)artifacts/local/cir-artifact-binding/packages</RestoreAdditionalProjectSources><Version>2.0.0-preview.3</Version><AssemblyVersion>2.0.0.0</AssemblyVersion><FileVersion>2.0.0.0</FileVersion>diff --git a/docs/release/P4-01A3-CIR-SHADER-BINDING-CLOSEOUT.md b/docs/release/P4-01A3-CIR-SHADER-BINDING-CLOSEOUT.mdindex 6c8cd4be..914c0e3e 100644--- a/docs/release/P4-01A3-CIR-SHADER-BINDING-CLOSEOUT.md+++ b/docs/release/P4-01A3-CIR-SHADER-BINDING-CLOSEOUT.md@@ -60,8 +60,13 @@ and occurrences reuse one artifact; appearance/placement changes do not specialithe program.The managed dependency uses exact package version-`0.1.0-preview.1-a3.7329cf8ff04d504a`, with reviewed producer source hash-`7329cf8ff04d504a062e8b5f62adcb9e12a1bbd13159c9c0af42b94576ba38d9`.+`0.1.0-preview.1-a3.16c0ce996358af80`, with portable producer source hash+`16c0ce996358af80d0a0812f6c93dd97cd6e48cf6bef31c12ec3bd1fcd2ba10c`.+The producer is pinned to Copeland commit `70b6cbe742ecfb2947c9c6a31cfa8e1d3a89067b`.+The 2026-10-07 CI repair canonicalized text line endings and UTF-8 BOMs before+hashing. This supersedes the checkout-byte pin `7329cf8ff04d504a`; the clean+producer checkout has the same semantic source. Every CI build job now prepares+the feed explicitly before restore.`scripts/prepare-managed-wgsl.ps1 -CopelandRoot <explicit checkout>` verifies thatsource graph and packs the existing projects into an ignored local feed. This isa build prerequisite for a fresh checkout, not a production sibling-projectdiff --git a/scripts/managed-wgsl-commit-pin.txt b/scripts/managed-wgsl-commit-pin.txtnew file mode 100644index 00000000..4cd4a208--- /dev/null+++ b/scripts/managed-wgsl-commit-pin.txt@@ -0,0 +1 @@+70b6cbe742ecfb2947c9c6a31cfa8e1d3a89067bdiff --git a/scripts/managed-wgsl-source-pin.txt b/scripts/managed-wgsl-source-pin.txtindex 053c124c..bf7c9fa1 100644--- a/scripts/managed-wgsl-source-pin.txt+++ b/scripts/managed-wgsl-source-pin.txt@@ -1 +1 @@-7329cf8ff04d504a062e8b5f62adcb9e12a1bbd13159c9c0af42b94576ba38d9+16c0ce996358af80d0a0812f6c93dd97cd6e48cf6bef31c12ec3bd1fcd2ba10cdiff --git a/scripts/prepare-managed-wgsl.ps1 b/scripts/prepare-managed-wgsl.ps1index 3cf7fb51..1bf627c9 100644--- a/scripts/prepare-managed-wgsl.ps1+++ b/scripts/prepare-managed-wgsl.ps1@@ -1,4 +1,7 @@-param([Parameter(Mandatory=$true)][string]$CopelandRoot)+param(+ [Parameter(Mandatory=$true)][string]$CopelandRoot,+ [switch]$VerifyOnly+)$ErrorActionPreference = 'Stop'$repo = Split-Path $PSScriptRoot -Parent$backend = Join-Path $CopelandRoot 'src/Copeland/Copeland.TS.Backend.Wgsl/Copeland.TS.Backend.Wgsl.csproj'@@ -16,18 +19,25 @@ $files = @($projects | ForEach-Object {Get-ChildItem -LiteralPath (Split-Path $_ -Parent) -Recurse -File |Where-Object { $_.Extension -in '.cs','.csproj' -and $_.FullName -notmatch '[\\/](bin|obj)[\\/]' }}) + @(Get-ChildItem -LiteralPath $CopelandRoot -Filter 'Directory.*.props')-$manifest = ($files | Sort-Object FullName -Unique | ForEach-Object {- [IO.Path]::GetRelativePath($CopelandRoot,$_.FullName).Replace('\','/') + ':' + (Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash-}) -join "`n"+$sourceHashes = [Collections.Generic.SortedDictionary[string,string]]::new([StringComparer]::Ordinal)+foreach ($file in $files) {+ $relative = [IO.Path]::GetRelativePath($CopelandRoot,$file.FullName).Replace('\','/')+ # Source identity must survive LF/CRLF and UTF-8 BOM differences between checkouts.+ $text = [IO.File]::ReadAllText($file.FullName).Replace("`r`n", "`n")+ $sourceHashes[$relative] = [Convert]::ToHexString([Security.Cryptography.SHA256]::HashData([Text.Encoding]::UTF8.GetBytes($text)))+}+$manifest = ($sourceHashes.GetEnumerator() | ForEach-Object { $_.Key + ':' + $_.Value }) -join "`n"$hash = [Convert]::ToHexString([Security.Cryptography.SHA256]::HashData([Text.Encoding]::UTF8.GetBytes($manifest))).ToLowerInvariant()$version = '0.1.0-preview.1-a3.' + $hash.Substring(0,16)$pin = Join-Path $repo 'scripts/managed-wgsl-source-pin.txt'-if ((Test-Path $pin) -and (Get-Content $pin -Raw).Trim() -ne $hash) { throw 'Managed WGSL producer source differs from the reviewed source pin.' }+if (-not (Test-Path $pin)) { throw 'Managed WGSL producer source pin is missing.' }+if ((Get-Content $pin -Raw).Trim() -ne $hash) { throw "Managed WGSL producer source differs from the reviewed source pin: actual $hash." }+Write-Output "Source pin: $hash"+Write-Output "Package version: $version"+if ($VerifyOnly) { return }$output = Join-Path $repo 'artifacts/local/cir-artifact-binding/packages'New-Item -ItemType Directory -Force $output | Out-Nullforeach ($project in $projects | Sort-Object) {dotnet pack $project -c Release -o $output "-p:PackageVersion=$version" "-p:Version=$version" --nologoif ($LASTEXITCODE -ne 0) { throw "Managed WGSL dependency pack failed: $project" }}-Write-Output "Source pin: $hash"-Write-Output "Package version: $version"diff --git a/testdata/step242/manifests/nist.v0.canonical-linux.json b/testdata/step242/manifests/nist.v0.canonical-linux.jsonnew file mode 100644index 00000000..87f8ee96--- /dev/null+++ b/testdata/step242/manifests/nist.v0.canonical-linux.json@@ -0,0 +1,5 @@+{+ "testdata/step242/nist/CTC/nist_ctc_03_asme1_ap242-e2.stp": "4020b5730a2b71e9d3678f171c46f4b5891ce3beff5c344eff7cd6dbda10e6cd",+ "testdata/step242/nist/FTC/nist_ftc_09_asme1_ap242-e1.stp": "96dd2fa0c9e673f97c9905dbf0f7d597d3191abe5df87a160064dc9bf9d92646",+ "testdata/step242/nist/STC/nist_stc_09_asme1_ap242-e3.stp": "0a97849ebbb96a0c7761516b769faf7425ff99e1080e74a6e9a3ec0eb704e7c5"+}