Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add Scene length expressions, site recipes, and emissive appearances
Yuechen Li9730ddf73175
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirVisualTsLoweringTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirVisualTsLoweringTests.csnew file mode 100644index 00000000..7787dc9b--- /dev/null+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirVisualTsLoweringTests.cs@@ -0,0 +1,43 @@+using Aetheris.Continuum.Backends.Sdf;+using Aetheris.Kernel.Core.Math;++namespace Aetheris.Continuum.Tests.Backends.Sdf;++public sealed class CirVisualTsLoweringTests+{+ [Fact]+ public void EqualDefinitionsShareProgramIdentityAndDifferentDimensionsDoNotAlias()+ {+ var first = CirVisualTsLowerer.Lower(new SdfCylinderNode(2, 6));+ var equal = CirVisualTsLowerer.Lower(new SdfCylinderNode(2, 6));+ var different = CirVisualTsLowerer.Lower(new SdfCylinderNode(3, 6));+ Assert.True(first.Success);+ Assert.Equal(first.Program!.StructuralHash, equal.Program!.StructuralHash);+ Assert.NotEqual(first.Program.StructuralHash, different.Program!.StructuralHash);+ Assert.Equal(new SdfCylinderNode(2, 6).Bounds, first.Program.Bounds);+ }++ [Fact]+ public void AffineDistanceFieldsAndInvalidDimensionsFailWithInspectableFallback()+ {+ var affine = new SdfTransformNode(new SdfSphereNode(2), Transform3D.CreateScale(0.1));+ var result = CirVisualTsLowerer.Lower(affine);+ Assert.False(result.Success);+ Assert.Contains("transform-not-rigid", result.FallbackReason);+ Assert.False(CirVisualTsLowerer.Lower(new SdfCylinderNode(double.NaN, 2)).Success);+ Assert.False(CirVisualTsLowerer.Lower(new SdfTorusNode(1, 2)).Success);+ }++ [Fact]+ public void RigidCsgSpecializesStraightLineTapeAndRetainsAuthoritativeBounds()+ {+ SdfNode node = new SdfSubtractNode(new SdfCylinderNode(2, 6),+ new SdfTransformNode(new SdfSphereNode(1), Transform3D.CreateTranslation(new Vector3D(1, 0, 0))));+ var result = CirVisualTsLowerer.Lower(node);+ Assert.True(result.Success);+ Assert.Equal(node.Bounds, result.Program!.Bounds);+ Assert.Contains("Max(v", result.Program.FieldSource);+ Assert.DoesNotContain("switch", result.Program.FieldSource);+ Assert.DoesNotContain("for (", result.Program.FieldSource);+ }+}diff --git a/Aetheris.Continuum/Backends/Sdf/CirVisualTsLowerer.cs b/Aetheris.Continuum/Backends/Sdf/CirVisualTsLowerer.csnew file mode 100644index 00000000..1ef50993--- /dev/null+++ b/Aetheris.Continuum/Backends/Sdf/CirVisualTsLowerer.cs@@ -0,0 +1,151 @@+using System.Globalization;+using System.Security.Cryptography;+using System.Text;+using Aetheris.Kernel.Core.Math;++namespace Aetheris.Continuum.Backends.Sdf;++public sealed record CirVisualTsProgram(string StructuralHash, string FieldSource, SdfBounds Bounds);++public sealed record CirVisualTsLoweringResult(CirVisualTsProgram? Program, string? FallbackReason)+{+ public bool Success => Program is not null;+}++/// <summary>Specializes the existing CIR tape into Visual TypeScript source. No shader-side tape interpreter.</summary>+public static class CirVisualTsLowerer+{+ public const string CompatibilityVersion = "cir-visual-ts/1";++ public static CirVisualTsLoweringResult Lower(SdfNode root)+ {+ ArgumentNullException.ThrowIfNull(root);+ string? rejection = Validate(root);+ if (rejection is not null)+ {+ return new(null, rejection);+ }+ SdfTape tape = SdfTapeLowerer.Lower(root);+ var source = new StringBuilder();+ source.AppendLine("function Field(x: f32, y: f32, z: f32): f32 {");+ foreach (SdfTapeInstruction instruction in tape.Instructions)+ {+ string value = instruction.OpCode switch+ {+ SdfTapeOpCode.Min => $"Min(v{instruction.InputA}, v{instruction.InputB})",+ SdfTapeOpCode.Max => $"Max(v{instruction.InputA}, v{instruction.InputB})",+ SdfTapeOpCode.Neg => $"-v{instruction.InputA}",+ _ => EmitPrimitive(source, tape, instruction),+ };+ source.AppendLine($" const v{instruction.DestSlot}: f32 = {value};");+ }+ source.AppendLine($" return v{tape.OutputSlot};");+ source.AppendLine("}");+ string field = source.ToString().Replace("\r\n", "\n", StringComparison.Ordinal);+ string hash = Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(CompatibilityVersion + "\n" + field))).ToLowerInvariant();+ return new(new CirVisualTsProgram(hash, field, root.Bounds), null);+ }++ private static string? Validate(SdfNode node)+ {+ // The X0 numerical range is explicit; broader CIR occupancy capability alone is not admission.+ bool Positive(double value) => double.IsFinite(value) && value >= 0.00001 && value <= 1_000_000;+ switch (node)+ {+ case SdfSphereNode sphere when Positive(sphere.Radius):+ case SdfCylinderNode cylinder when Positive(cylinder.Radius) && Positive(cylinder.Height):+ case SdfBoxNode box when Positive(box.Width) && Positive(box.Height) && Positive(box.Depth):+ case SdfTorusNode torus when Positive(torus.MinorRadius) && Positive(torus.MajorRadius) && torus.MajorRadius >= torus.MinorRadius:+ case SdfConeNode cone when Positive(cone.Height) && cone.BottomRadius >= 0 && cone.TopRadius >= 0+ && Positive(Math.Max(cone.BottomRadius, cone.TopRadius)):+ return null;+ case SdfTransformNode transformed:+ if (!transformed.Transform.IsRigid())+ {+ return "cir-display-transform-not-rigid: affine fields do not preserve the X0 distance-step bound.";+ }+ if (transformed.Transform.ToRowMajor().Any(value => !double.IsFinite(value) || Math.Abs(value) > 1_000_000))+ {+ return "cir-display-transform-out-of-range";+ }+ return Validate(transformed.Child);+ case SdfUnionNode union:+ return Validate(union.Left) ?? Validate(union.Right);+ case SdfIntersectNode intersection:+ return Validate(intersection.Left) ?? Validate(intersection.Right);+ case SdfSubtractNode subtraction:+ return Validate(subtraction.Left) ?? Validate(subtraction.Right);+ default:+ return "cir-display-field-unqualified: unsupported node or invalid X0 primitive dimensions.";+ }+ }++ private static string EmitPrimitive(StringBuilder source, SdfTape tape, SdfTapeInstruction instruction)+ {+ int index = instruction.PayloadIndex;+ Transform3D inverse = instruction.OpCode switch+ {+ SdfTapeOpCode.EvalSphere => tape.SpherePayloads[index].InverseTransform,+ SdfTapeOpCode.EvalCylinder => tape.CylinderPayloads[index].InverseTransform,+ SdfTapeOpCode.EvalCone => tape.ConePayloads[index].InverseTransform,+ SdfTapeOpCode.EvalTorus => tape.TorusPayloads[index].InverseTransform,+ SdfTapeOpCode.EvalBox => tape.BoxPayloads[index].InverseTransform,+ _ => throw new InvalidOperationException("CIR tape operation has no qualified display lowering."),+ };+ double[] matrix = inverse.ToRowMajor();+ string prefix = $"p{instruction.DestSlot}";+ for (int axis = 0; axis < 3; axis++)+ {+ source.AppendLine($" const {prefix}{axis}: f32 = x * {Literal(matrix[axis])} + y * {Literal(matrix[4 + axis])} + z * {Literal(matrix[8 + axis])} + {Literal(matrix[12 + axis])};");+ }+ string x = prefix + "0";+ string y = prefix + "1";+ string z = prefix + "2";+ string radial = $"Sqrt({x} * {x} + {y} * {y})";+ switch (instruction.OpCode)+ {+ case SdfTapeOpCode.EvalSphere:+ return $"Sqrt({x} * {x} + {y} * {y} + {z} * {z}) - {Literal(tape.SpherePayloads[index].Radius)}";+ case SdfTapeOpCode.EvalTorus:+ var torus = tape.TorusPayloads[index];+ source.AppendLine($" const {prefix}r: f32 = {radial} - {Literal(torus.MajorRadius)};");+ return $"Sqrt({prefix}r * {prefix}r + {z} * {z}) - {Literal(torus.MinorRadius)}";+ case SdfTapeOpCode.EvalCylinder:+ var cylinder = tape.CylinderPayloads[index];+ source.AppendLine($" const {prefix}r: f32 = {radial} - {Literal(cylinder.Radius)};");+ source.AppendLine($" const {prefix}h: f32 = Abs({z}) - {Literal(cylinder.Height * 0.5)};");+ source.AppendLine($" const {prefix}a: f32 = Max({prefix}r, 0.0);");+ source.AppendLine($" const {prefix}b: f32 = Max({prefix}h, 0.0);");+ return $"Sqrt({prefix}a * {prefix}a + {prefix}b * {prefix}b) + Min(Max({prefix}r, {prefix}h), 0.0)";+ case SdfTapeOpCode.EvalBox:+ var box = tape.BoxPayloads[index];+ source.AppendLine($" const {prefix}a: f32 = Abs({x}) - {Literal(box.Width * 0.5)};");+ source.AppendLine($" const {prefix}b: f32 = Abs({y}) - {Literal(box.Height * 0.5)};");+ source.AppendLine($" const {prefix}c: f32 = Abs({z}) - {Literal(box.Depth * 0.5)};");+ source.AppendLine($" const {prefix}u: f32 = Max({prefix}a, 0.0);");+ source.AppendLine($" const {prefix}v: f32 = Max({prefix}b, 0.0);");+ source.AppendLine($" const {prefix}w: f32 = Max({prefix}c, 0.0);");+ return $"Sqrt({prefix}u * {prefix}u + {prefix}v * {prefix}v + {prefix}w * {prefix}w) + Min(Max({prefix}a, Max({prefix}b, {prefix}c)), 0.0)";+ case SdfTapeOpCode.EvalCone:+ // Same capped-frustum formula as SdfConeNode/SdfTape, expressed as straight-line typed locals.+ var cone = tape.ConePayloads[index];+ source.AppendLine($" const {prefix}r: f32 = {radial};");+ source.AppendLine($" var {prefix}cap: f32 = {Literal(cone.TopRadius)};");+ source.AppendLine($" if ({z} < 0.0) {{ {prefix}cap = {Literal(cone.BottomRadius)}; }}");+ double delta = cone.TopRadius - cone.BottomRadius;+ source.AppendLine($" const {prefix}a: f32 = {prefix}r - Min({prefix}r, {prefix}cap);");+ source.AppendLine($" const {prefix}b: f32 = Abs({z}) - {Literal(cone.Height * 0.5)};");+ source.AppendLine($" const {prefix}h: f32 = Clamp((({Literal(cone.TopRadius)} - {prefix}r) * {Literal(delta)} + ({Literal(cone.Height * 0.5)} - {z}) * {Literal(cone.Height)}) / {Literal(delta * delta + cone.Height * cone.Height)}, 0.0, 1.0);");+ source.AppendLine($" const {prefix}c: f32 = {prefix}r - {Literal(cone.TopRadius)} + {Literal(delta)} * {prefix}h;");+ source.AppendLine($" const {prefix}d: f32 = {z} - {Literal(cone.Height * 0.5)} + {Literal(cone.Height)} * {prefix}h;");+ source.AppendLine($" var {prefix}sign: f32 = 1.0;");+ source.AppendLine($" if ({prefix}c < 0.0 && {prefix}b < 0.0) {{ {prefix}sign = -1.0; }}");+ return $"{prefix}sign * Sqrt(Min({prefix}a * {prefix}a + {prefix}b * {prefix}b, {prefix}c * {prefix}c + {prefix}d * {prefix}d))";+ default:+ throw new InvalidOperationException("CIR tape primitive has no qualified display lowering.");+ }+ }++ private static string Literal(double value)+ => value.ToString("0.0###############################", CultureInfo.InvariantCulture);+}diff --git a/Aetheris.Kernel.Firmament.Tests/FactorySceneTests.cs b/Aetheris.Kernel.Firmament.Tests/FactorySceneTests.csnew file mode 100644index 00000000..81503148--- /dev/null+++ b/Aetheris.Kernel.Firmament.Tests/FactorySceneTests.cs@@ -0,0 +1,119 @@+using System.Buffers.Binary;+using System.Text.Json;+using Aetheris.Kernel.Firmament.FirmamentV2;+using Aetheris.Kernel.Firmament.Scene;++namespace Aetheris.Kernel.Firmament.Tests;++public sealed class FactorySceneTests+{+ private const string Rows = """+ Template<H: Length> Struct Block {+ RoundedRect2 outline { center: [0mm,0mm]; size: [100mm,100mm]; radius: 2mm; }+ Profile section { Loop Outer { outline |> TraceLoop } }+ Extrude body { profile: section; from: 0mm; to: H; }+ }+ Appearance signal { color: [.1,.2,.3]; metallic: 0; roughness: .4; emissive: [.2,.6,1]; }+ Linear Sites row { keys: [first, second]; start: [100mm,200mm,0mm]; step: [300mm,0mm,0mm]; }+ Mirrored Sites reflected From row { Across: YZ; }+ Scene Proof {+ units: m;+ Room hall { size: [2m + 500mm,3m,2m]; }+ Pattern originals over row {+ site => <Part item = Block<H:100mm>> appearance: signal;+ Placement { from: Origin; to: World; translateLocal: [site.X + .1m,site.Y,site.Z]; }+ </Part>+ }+ Pattern mirrors over reflected {+ site => <Part item = Block<H:100mm>> appearance: signal;+ Placement { from: Origin; to: World; translateLocal: [site.X,site.Y,site.Z]; }+ </Part>+ }+ }+ """;++ [Fact]+ public void SceneSiteRecipesRetainKeysShareGeometryAndExportEmission()+ {+ using var session = new FirmamentSceneSession();+ var first = session.Compile(Rows);+ Assert.True(first.IsSuccess,string.Join("\n",first.Diagnostics));+ var scene = first.Scene!;+ Assert.Equal(2500,scene.Source.Rooms.Single().SizeMm[0]);+ Assert.Equal(500,scene.Display.Occurrences.Single(o => o.Path == "Proof.originals.second.item").Transform[12]);+ Assert.Equal(-400,scene.Display.Occurrences.Single(o => o.Path == "Proof.mirrors.second.item").Transform[12]);+ Assert.Single(scene.Display.Occurrences.Where(o => o.Path.EndsWith(".item",StringComparison.Ordinal)).Select(o => o.DefinitionId).Distinct());+ Assert.Equal(2,scene.Source.Patterns.Single(p => p.Name == "mirrors").SiteRecipe!.Count);+ var bytes = SceneExport.Glb(scene);+ using var json = JsonDocument.Parse(bytes.AsMemory(20,BinaryPrimitives.ReadInt32LittleEndian(bytes.AsSpan(12,4))));+ var material = json.RootElement.GetProperty("materials").EnumerateArray().Single(m => m.GetProperty("name").GetString() == "signal");+ Assert.Equal(new[] {.2,.6,1},material.GetProperty("emissiveFactor").EnumerateArray().Select(v => v.GetDouble()));+ Assert.Contains("inputs:emissiveColor = (",SceneExport.Usd(scene));+ var changed = session.Compile(Rows.Replace("step: [300mm","step: [350mm",StringComparison.Ordinal));+ Assert.True(changed.IsSuccess,string.Join("\n",changed.Diagnostics));+ Assert.Equal(0,changed.Scene!.Performance.RebuiltEngineeringDefinitions);+ Assert.Equal(scene.Source.Occurrences.Select(o => o.Path),changed.Scene.Source.Occurrences.Select(o => o.Path));+ Assert.Equal(550,changed.Scene.Display.Occurrences.Single(o => o.Path == "Proof.originals.second.item").Transform[12]);+ Assert.Contains(FirmamentLanguageService.Complete("Appearance light { ","test","1",19).Fields,f => f.Name == "Emissive");+ }++ [Theory]+ [InlineData("[.2,.6,1]", "[.2,.6,1.1]")]+ [InlineData("[.2,.6,1]", "[.2,.6]")]+ [InlineData("[.2,.6,1]", "[-.2,.6,1]")]+ public void InvalidEmissionFailsAtAuthoringBoundary(string before,string after)+ {+ var result = SceneAuthoring.Parse(Rows.Replace(before,after,StringComparison.Ordinal));+ Assert.False(result.IsSuccess);+ Assert.Contains(result.Diagnostics,d => d.Code == "assembly-appearance-values-invalid");+ }++ [Theory]+ [InlineData("keys: [first, second]", "keys: [first, first]")]+ [InlineData("step: [300mm,0mm,0mm]", "step: [0mm,0mm,0mm]")]+ [InlineData("start: [100mm,200mm,0mm]", "start: [1m,200mm,0mm]")]+ public void SceneUsesSharedSiteRecipeRejectionBoundary(string before,string after)+ {+ var result = SceneAuthoring.Parse(Rows.Replace(before,after,StringComparison.Ordinal));+ Assert.False(result.IsSuccess);+ Assert.Contains(result.Diagnostics,d => d.Code == "scene-pattern-invalid");+ }++ [Theory]+ [InlineData("2m + 500mm", "2m + 3")]+ [InlineData("2m + 500mm", "2m * 3m")]+ [InlineData("2m + 500mm", "2m / 0")]+ public void SceneLengthExpressionsRemainDimensionChecked(string before,string after)+ {+ var result = SceneAuthoring.Parse(Rows.Replace(before,after,StringComparison.Ordinal));+ Assert.False(result.IsSuccess);+ Assert.Contains(result.Diagnostics,d => d.Code == "scene-length-unit-required");+ }++ [Fact]+ public void FactoryHasRequiredOperationalLayersAndRetainsDefinitionsAcrossLayoutEdits()+ {+ var path = FirmamentCorpusHarness.ResolveFixtureFullPath("fixtures/Canonical/Scene/FactoryX0/factory.firmament");+ var source = File.ReadAllText(path);+ using var session = new FirmamentSceneSession();+ var first = session.Compile(source,path);+ Assert.True(first.IsSuccess,string.Join("\n",first.Diagnostics));+ var scene = first.Scene!;+ Assert.Equal(new[] {42000d,28000,7000},scene.Source.Rooms.Single().SizeMm);+ Assert.Equal(3,scene.Source.Occurrences.Count(o => o.Path.Contains(".productionLines.",StringComparison.Ordinal)));+ Assert.Equal(2,scene.Source.Occurrences.Count(o => o.Path.Contains(".robotCells.",StringComparison.Ordinal)));+ Assert.Equal(5,scene.Source.Cameras.Count);+ Assert.True(scene.Display.Occurrences.Count(o => o.DefinitionId is not null) > 1000);+ var changed = session.Compile(source.Replace("[32m, 3.5m, 4.5m]","[31.5m, 3.5m, 4.5m]",StringComparison.Ordinal)+ .Replace("step: [0mm, 7000mm, 0mm]","step: [0mm, 7100mm, 0mm]",StringComparison.Ordinal),path);+ Assert.True(changed.IsSuccess,string.Join("\n",changed.Diagnostics));+ Assert.Equal(0,changed.Scene!.Performance.RebuiltEngineeringDefinitions);+ Assert.Equal(scene.Performance.UniqueEngineeringDefinitions,changed.Scene.Performance.ReusedEngineeringDefinitions);+ foreach (var definition in scene.Display.Definitions)+ {+ var reused = changed.Scene.Display.Definitions.Single(d => d.Id == definition.Id);+ Assert.Equal(definition.Positions,reused.Positions);+ Assert.Equal(definition.Indices,reused.Indices);+ }+ }+}diff --git a/Aetheris.Kernel.Firmament/Assembly/AssemblyAppearanceAuthoring.cs b/Aetheris.Kernel.Firmament/Assembly/AssemblyAppearanceAuthoring.csindex 929f6dc4..13f07578 100644--- a/Aetheris.Kernel.Firmament/Assembly/AssemblyAppearanceAuthoring.cs+++ b/Aetheris.Kernel.Firmament/Assembly/AssemblyAppearanceAuthoring.cs@@ -9,6 +9,7 @@ namespace Aetheris.Kernel.Firmament.Assembly;[FirmamentField("Metallic", "Metallic", FirmamentSchemaValueKind.Scalar, Required = true)][FirmamentField("Roughness", "Roughness", FirmamentSchemaValueKind.Scalar, Required = true)][FirmamentField("Opacity", "Opacity", FirmamentSchemaValueKind.Scalar, Default = "1")]+[FirmamentField("Emissive", "Emissive", FirmamentSchemaValueKind.Vector, Default = "[0,0,0]")]public static class AssemblyAppearanceDeclaration { }public sealed record AssemblyAppearance(string Name, AssemblyUsdMaterial Preview);@@ -42,7 +43,7 @@ internal static class AssemblyAppearanceAuthoringvar fields = Fields(body);var isAppearance = header.Groups["kind"].Value == "Appearance";var required = isAppearance ? new[] { "Color", "Metallic", "Roughness" } : new[] { "Identity", "Appearance" };- var allowed = isAppearance ? required.Append("Opacity").ToArray() : required;+ var allowed = isAppearance ? required.Concat(["Opacity", "Emissive"]).ToArray() : required;if (!required.All(fields.ContainsKey) || fields.Keys.Except(allowed).Any()) { Error("declaration-fields-invalid", name); continue; }if (isAppearance){@@ -50,8 +51,10 @@ internal static class AssemblyAppearanceAuthoringvar rgb = color.Success ? color.Groups["v"].Value.Split(',').Select(Number).ToArray() : [];var metal = Number(fields["Metallic"]); var rough = Number(fields["Roughness"]);var opacity = Number(fields.GetValueOrDefault("Opacity", "1"));- if (rgb.Length != 3 || rgb.Concat([metal, rough, opacity]).Any(v => !double.IsFinite(v) || v < 0 || v > 1)) Error("values-invalid", name);- else if (!appearances.TryAdd(name, new(name, new(rgb[0], rgb[1], rgb[2], metal, rough, opacity)))) Error("duplicate-appearance", name);+ var emission = Regex.Match(fields.GetValueOrDefault("Emissive", "[0,0,0]"), @"^\[(?<v>[^]]+)\]$");+ var emissive = emission.Success ? emission.Groups["v"].Value.Split(',').Select(Number).ToArray() : [];+ if (rgb.Length != 3 || emissive.Length != 3 || rgb.Concat(emissive).Concat([metal, rough, opacity]).Any(v => !double.IsFinite(v) || v < 0 || v > 1)) Error("values-invalid", name);+ else if (!appearances.TryAdd(name, new(name, new(rgb[0], rgb[1], rgb[2], metal, rough, opacity, emissive[0], emissive[1], emissive[2])))) Error("duplicate-appearance", name);}else{diff --git a/Aetheris.Kernel.Firmament/Assembly/AssemblyFrameAuthoring.cs b/Aetheris.Kernel.Firmament/Assembly/AssemblyFrameAuthoring.csindex e29981f8..4a4af002 100644--- a/Aetheris.Kernel.Firmament/Assembly/AssemblyFrameAuthoring.cs+++ b/Aetheris.Kernel.Firmament/Assembly/AssemblyFrameAuthoring.cs@@ -1,6 +1,7 @@using System.Globalization;using System.Text.RegularExpressions;using Aetheris.Kernel.Core.Math;+using Aetheris.Kernel.Firmament.FirmamentV2;using Aetheris.Semantics;namespace Aetheris.Kernel.Firmament.Assembly;@@ -45,9 +46,12 @@ internal static class AssemblyFrameAuthoringfor (var i = 0; i < 3; i++){var text = values[i];- if (lengths && !text.EndsWith("mm", StringComparison.Ordinal))- diagnostics.Add(new("assembly-frame-invalid-unit", $"Frame '{name}' translation components require mm."));- if (lengths && text.EndsWith("mm", StringComparison.Ordinal)) text = text[..^2];+ if (lengths)+ {+ if (!FirmamentV2FeatureExpansion.TryEvaluateScalar(text,out result[i],out var unit) || unit != "mm" || !double.IsFinite(result[i]))+ diagnostics.Add(new("assembly-frame-invalid-unit", $"Frame '{name}' translation components require finite mm length expressions."));+ continue;+ }if (!double.TryParse(text, NumberStyles.Float, CultureInfo.InvariantCulture, out result[i]) || !double.IsFinite(result[i]))diagnostics.Add(new("assembly-frame-invalid-vector", $"Frame '{name}' requires finite numeric components."));}diff --git a/Aetheris.Kernel.Firmament/Assembly/AssemblyGlbExporter.cs b/Aetheris.Kernel.Firmament/Assembly/AssemblyGlbExporter.csindex 3cf22fa5..0aa4aa84 100644--- a/Aetheris.Kernel.Firmament/Assembly/AssemblyGlbExporter.cs+++ b/Aetheris.Kernel.Firmament/Assembly/AssemblyGlbExporter.cs@@ -12,10 +12,12 @@ public sealed record AssemblyGlbAppearance(AssemblyUsdMaterial? Material = null,/// BRep/STEP remains engineering authority. No tessellation, shading graph, or animation here.</summary>public static class AssemblyGlbExporter{- private static Dictionary<string,object> Material(string name,object pbr,double opacity)+ private static Dictionary<string,object> Material(string name,object pbr,AssemblyUsdMaterial look){var result=new Dictionary<string,object> { ["name"]=name,["pbrMetallicRoughness"]=pbr };- if (opacity < 1) { result["alphaMode"]="BLEND"; result["doubleSided"]=true; }+ if (look.Opacity < 1) { result["alphaMode"]="BLEND"; result["doubleSided"]=true; }+ if (look.EmissiveRed != 0 || look.EmissiveGreen != 0 || look.EmissiveBlue != 0)+ result["emissiveFactor"]=new[] {look.EmissiveRed,look.EmissiveGreen,look.EmissiveBlue};return result;}public static byte[] Export(AssemblyM1CompilationResult compilation,@@ -96,7 +98,7 @@ public static class AssemblyGlbExporterthrow new InvalidOperationException("assembly-glb-invalid-normal:" + d.Identity);var appearance = appearances?.GetValueOrDefault(d.Identity) ?? new();var m = appearance.Material ?? new();- if (new[] { m.Red, m.Green, m.Blue, m.Metallic, m.Roughness, m.Opacity }.Any(v => !double.IsFinite(v) || v < 0 || v > 1))+ if (new[] { m.Red, m.Green, m.Blue, m.Metallic, m.Roughness, m.Opacity, m.EmissiveRed, m.EmissiveGreen, m.EmissiveBlue }.Any(v => !double.IsFinite(v) || v < 0 || v > 1))throw new InvalidOperationException("assembly-glb-invalid-material");var pbr = new Dictionary<string, object> { ["baseColorFactor"] = new[] { m.Red, m.Green, m.Blue, m.Opacity }, ["metallicFactor"] = m.Metallic, ["roughnessFactor"] = m.Roughness };var attributes = new Dictionary<string, object> { ["POSITION"] = Floats(d.Positions, 3, true), ["NORMAL"] = Floats(d.Normals, 3) };@@ -116,7 +118,7 @@ public static class AssemblyGlbExporter}else if (appearance.TextureCoordinates is not null || appearance.TextureMimeType is not null)throw new InvalidOperationException("assembly-glb-texture-missing");- materials.Add(Material(d.Identity,pbr,m.Opacity));+ materials.Add(Material(d.Identity,pbr,m));var indexView = AddView(() => { foreach (var index in d.Indices) writer.Write((uint)index); }, 34963);var indexAccessor = accessors.Count;accessors.Add(new { bufferView = indexView, componentType = 5125, count = d.Indices.Length, type = "SCALAR" });@@ -138,13 +140,13 @@ public static class AssemblyGlbExporterif (occurrenceLooks?.GetValueOrDefault(o.Id) is { } look){var m = look.Preview;- if (new[] {m.Red,m.Green,m.Blue,m.Metallic,m.Roughness,m.Opacity}.Any(v => !double.IsFinite(v) || v < 0 || v > 1))+ if (new[] {m.Red,m.Green,m.Blue,m.Metallic,m.Roughness,m.Opacity,m.EmissiveRed,m.EmissiveGreen,m.EmissiveBlue}.Any(v => !double.IsFinite(v) || v < 0 || v > 1))throw new InvalidOperationException("assembly-glb-invalid-material");if (!variants.TryGetValue((o.DefinitionId,m),out var variant)){// Material variants share all accessors and buffer views.var primitive = primitiveTemplates[meshIndex];- materials.Add(Material(look.Appearance,new {baseColorFactor=new[] {m.Red,m.Green,m.Blue,m.Opacity},metallicFactor=m.Metallic,roughnessFactor=m.Roughness},m.Opacity));+ materials.Add(Material(look.Appearance,new {baseColorFactor=new[] {m.Red,m.Green,m.Blue,m.Opacity},metallicFactor=m.Metallic,roughnessFactor=m.Roughness},m));meshes.Add(new {name=definitions[meshIndex].Identity,primitives=new[] {new {attributes=primitive.Attributes,indices=primitive.Indices,material=materials.Count-1}}});variants[(o.DefinitionId,m)]=variant=meshes.Count-1;}diff --git a/Aetheris.Kernel.Firmament/Assembly/AssemblyUsdExporter.cs b/Aetheris.Kernel.Firmament/Assembly/AssemblyUsdExporter.csindex 90d542c7..d5ce721e 100644--- a/Aetheris.Kernel.Firmament/Assembly/AssemblyUsdExporter.cs+++ b/Aetheris.Kernel.Firmament/Assembly/AssemblyUsdExporter.cs@@ -7,7 +7,8 @@ namespace Aetheris.Kernel.Firmament.Assembly;/// <summary>Downstream preview appearance, never engineering material or density authority.</summary>public sealed record AssemblyUsdMaterial(double Red = .48, double Green = .55, double Blue = .63,- double Metallic = .8, double Roughness = .28, double Opacity = 1);+ double Metallic = .8, double Roughness = .28, double Opacity = 1,+ double EmissiveRed = 0, double EmissiveGreen = 0, double EmissiveBlue = 0);public sealed record AssemblyUsdSample(double Time, IReadOnlyDictionary<string, double> State);public sealed record AssemblyUsdOptions(IReadOnlyDictionary<string, double>? State = null,IReadOnlyList<AssemblyUsdSample>? Samples = null,@@ -126,6 +127,8 @@ public static class AssemblyUsdExporterLine($" color3f inputs:diffuseColor = ({F(m.Red)}, {F(m.Green)}, {F(m.Blue)})");Line($" float inputs:metallic = {F(m.Metallic)}"); Line($" float inputs:roughness = {F(m.Roughness)}");if (m.Opacity != 1) Line($" float inputs:opacity = {F(m.Opacity)}");+ if (m.EmissiveRed != 0 || m.EmissiveGreen != 0 || m.EmissiveBlue != 0)+ Line($" color3f inputs:emissiveColor = ({F(m.EmissiveRed)}, {F(m.EmissiveGreen)}, {F(m.EmissiveBlue)})");Line(" token outputs:surface"); Line(" }"); Line(" }");}foreach (var look in authoredLooks)@@ -139,6 +142,8 @@ public static class AssemblyUsdExporterLine($" color3f inputs:diffuseColor = ({F(m.Red)}, {F(m.Green)}, {F(m.Blue)})");Line($" float inputs:metallic = {F(m.Metallic)}"); Line($" float inputs:roughness = {F(m.Roughness)}");if (m.Opacity != 1) Line($" float inputs:opacity = {F(m.Opacity)}");+ if (m.EmissiveRed != 0 || m.EmissiveGreen != 0 || m.EmissiveBlue != 0)+ Line($" color3f inputs:emissiveColor = ({F(m.EmissiveRed)}, {F(m.EmissiveGreen)}, {F(m.EmissiveBlue)})");Line(" token outputs:surface"); Line(" }"); Line(" }");}Line("}");@@ -255,7 +260,7 @@ public static class AssemblyUsdExporterprivate static void ValidateMaterial(AssemblyUsdMaterial m){- if (new[] { m.Red, m.Green, m.Blue, m.Metallic, m.Roughness, m.Opacity }.Any(v => !double.IsFinite(v) || v < 0 || v > 1))+ if (new[] { m.Red, m.Green, m.Blue, m.Metallic, m.Roughness, m.Opacity, m.EmissiveRed, m.EmissiveGreen, m.EmissiveBlue }.Any(v => !double.IsFinite(v) || v < 0 || v > 1))throw new InvalidOperationException("assembly-usd-invalid-material");}private static string Identifier(string value) => "N_" + new string(value.Select(c => char.IsAsciiLetterOrDigit(c) || c == '_' ? c : '_').ToArray());diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentSourceSpelling.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentSourceSpelling.csindex 86f9cddf..83bbb3e7 100644--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentSourceSpelling.cs+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentSourceSpelling.cs@@ -204,7 +204,7 @@ public static class FirmamentSourceSpellingAdd("RotateLocal", "Axis Angle");Add("Mate", "Interface Member At Gap Clocking Orientation Support");Add("Note", "Target Text");- Add("Appearance", "Color Metallic Roughness Opacity");+ Add("Appearance", "Color Metallic Roughness Opacity Emissive");Add("Material", "Identity Appearance");Add("Start End Corner RouteSite", "At On Radius");Add("SectionChain", "Continuity Start End");diff --git a/Aetheris.Kernel.Firmament/Scene/SceneAuthoring.cs b/Aetheris.Kernel.Firmament/Scene/SceneAuthoring.csindex 08befe28..576c6090 100644--- a/Aetheris.Kernel.Firmament/Scene/SceneAuthoring.cs+++ b/Aetheris.Kernel.Firmament/Scene/SceneAuthoring.cs@@ -116,11 +116,13 @@ public static class SceneAuthoringwhile (!original.End && original.Peek != "Scene"){var kind = original.Peek;- if (kind is not ("Template" or "Record" or "Static" or "Function" or "Appearance" or "Material" or "Concept"))+ if (kind is not ("Template" or "Record" or "Static" or "Function" or "Appearance" or "Material" or "Concept" or "Linear" or "Mirrored"))Fail("scene-declaration-unsupported", $"Unsupported Scene module declaration '{kind}'. Use AssemblyFile for independently compiled assemblies.");var declarationStart = original.Position;original.SkipDeclaration(); definitionEnd = original.Position;var declaration = text[declarationStart..definitionEnd];+ if (kind is "Linear" or "Mirrored" && !Regex.IsMatch(declaration,@"^(?:Linear|Mirrored)\s+Sites\b"))+ Fail("scene-declaration-unsupported", "Scene admits only the shared Linear Sites and Mirrored Sites recipes.");if (kind == "Concept"){var concept = Regex.Match(declaration,@"^Concept\s+Struct\s+(?<name>\w+)\s*\{");@@ -128,7 +130,7 @@ public static class SceneAuthoringconceptNames.Add(concept.Groups["name"].Value);}// Scene keyed Sets and preview looks are composition inputs, not geometry inputs.- if (kind is not ("Appearance" or "Material" or "Concept") && !Regex.IsMatch(declaration,@"^Static\s+\w+\s*:\s*Set\s*<"))+ if (kind is not ("Appearance" or "Material" or "Concept" or "Linear" or "Mirrored") && !Regex.IsMatch(declaration,@"^Static\s+\w+\s*:\s*Set\s*<"))geometryDeclarations.Add(declaration);}if (original.End) Fail("scene-root-missing", "Expected one Scene root.");@@ -310,12 +312,13 @@ public static class SceneAuthoring}internal static double Length(string value){- var m = Regex.Match(value.Trim(),@"^(?<n>[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?)(?<u>mm|m)$");- double n = 0;- if (!m.Success || !double.TryParse(m.Groups["n"].Value,NumberStyles.Float,CultureInfo.InvariantCulture,out n)- || !double.IsFinite(n) || !double.IsFinite(n*(m.Groups["u"].Value == "m" ? 1000 : 1)))- Fail("scene-length-unit-required", $"Expected a finite length with m or mm suffix, got '{value}'.");- return n*(m.Groups["u"].Value == "m" ? 1000 : 1);+ // Normalize metre literals at the Scene boundary, then use the existing+ // dimension-checked scalar evaluator. No separate Scene arithmetic engine.+ var expression = Regex.Replace(value, @"(?<![\w.])(?<n>(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?)m\b", m =>+ (double.Parse(m.Groups["n"].Value,CultureInfo.InvariantCulture)*1000).ToString("R",CultureInfo.InvariantCulture)+"mm");+ if (!FirmamentV2FeatureExpansion.TryEvaluateScalar(expression,out var n,out var unit) || unit != "mm" || !double.IsFinite(n))+ Fail("scene-length-unit-required", $"Expected a finite length expression with m or mm suffix, got '{value}'.");+ return n;}private static double Angle(string value){diff --git a/docs/public/firmament/factory-scene-x0.md b/docs/public/firmament/factory-scene-x0.mdnew file mode 100644index 00000000..0750d03c--- /dev/null+++ b/docs/public/firmament/factory-scene-x0.md@@ -0,0 +1,156 @@+# FACTORY-SCENE-X0++**Verdict: Success for the static Scene and presentation witness.** Simulation,+process fidelity and robotics execution remain outside the qualified claim.++## Scope and artifacts++An original static automated factory authored through the real Firmament Scene+compiler. The 42 × 28 × 7 metre hall contains three 16-metre production lines,+three packout stations, two robot islands, five storage racks, seven wheeled+carts, open totes, pallet buffers, inspection benches, cabinets, columns,+overhead luminaires and pedestrian lanes. Dimensions are visual design choices,+not an industrial engineering specification.++The canonical [Scene](../../../fixtures/Canonical/Scene/FactoryX0/factory.firmament)+owns the hall, Concept layout, equipment placements, markings and five cameras.+The [kit](../../../fixtures/Canonical/Scene/FactoryX0/kit.firmament) owns shared+parts and subassemblies. Production, packaging, robotics, storage and structure+have independent Assembly documents. Each subsystem moves as one component.++Generated output defaults to ignored `artifacts/local/factory-scene-x0/`:++| File | Purpose |+| --- | --- |+| `factory.usda` | Complete enclosure, hierarchy, shared instances, materials, five cameras |+| `factory-enclosed.glb` | Complete static GLB |+| `factory.glb` | Presentation cutaway: ceiling, south wall and east wall omitted |+| `hero.png`, `overview.png`, `line.png`, `robot.png`, `logistics.png` | Five 2560 × 1440 presentation stills |+| `factory.blend` | Imported compiled geometry, authored cameras and presentation lighting |+| `factory.pptx` | Two slides, each embedding the cutaway GLB and a PNG fallback |+| `timings.json`, `external-validation.json`, `blender-validation.json` | Measured qualification evidence and source/artifact hashes |++## Capabilities and authoring friction++Scene previously rejected the existing `Linear Sites` and `Mirrored Sites`+declarations. It now admits the shared producer without introducing another+pattern engine. Named keys, derivation metadata, positive-handed placements,+finite mm vectors and existing bounds/rejection rules remain intact. Scene+recipes do not enter engineering definition cache inputs.++Pattern offsets such as `site.Y - 600mm` previously failed as a nonliteral+length. Scene now normalizes metre literals and delegates dimension checking+to the existing scalar evaluator. Assembly translations use that evaluator+with their existing mm contract. This keeps shelf offsets and fixture+suspensions local to their definitions. Unitless additions, length products+and division by zero fail instead of producing arbitrary coordinates.++Appearance now admits `emissive: [r,g,b]`, finite linear RGB in `[0,1]` with+black as the default. GLB emits `emissiveFactor`; USD emits PreviewSurface+`emissiveColor`. Luminaires, monitor faces and status indicators use it. It is+portable appearance state rather than photometric light intensity.++The final source uses PascalCase construct/type names and camelCase field labels.+The CLI formatter confirms preferred spelling without changing any of the eight+Firmament documents. Shared component patterns replace copied part lists.+The rendering script adds area illumination at compiled diffuser locations and+two presentation fill lights. Concrete micro-bump is shader detail. It creates+no equipment and verifies that imported geometry and transforms remain unchanged.++## Reproduction++From the repository root with .NET 10, Blender, the repository's OpenUSD tools+and the Khronos validator installed:++```powershell+dotnet build Aetheris.slnx -c Release -m:1+./scripts/qualify-factory-scene-x0.ps1+dotnet test Aetheris.Kernel.Core.Tests -c Release --no-build --filter "Category!=SlowCorpus"+dotnet test Aetheris.slnx -c Release --no-build -m:1 -- RunConfiguration.MaxCpuCount=1+# Optional installed-PowerPoint native qualification:+./scripts/check-factory-powerpoint.ps1+```++The qualification script compiles the reviewed source, measures retained edits,+exports both GLB variants and USD, runs external validators, renders all views+and embeds actual GLB and PNG bytes via Aetheris's Model3D presentation compiler.+It fails on missing dependencies or failed commands. Build/test qualification+is a separate gate, not inferred from successful rendering.++## Evidence++The scene expands to 2,562 display nodes, 1,492 full-scene mesh occurrences,+124 display definitions and 92 engineering definitions across the independent+compiler sessions. The cutaway imports in Blender as 1,481 meshes sharing 114+mesh datablocks. Independent compilation sessions qualify reuse separately;+these counts do not claim a global cache across all subsystem documents.++Release solution build passed with four existing WASM native-varargs warnings+and no errors. The focused Scene lane passed 42 tests. The required fast Core+lane passed 1,005 tests. The final serial full solution lane passed **4,309 tests**+with zero failures and zero skips, including the slow interchange corpus. The+FrictionLab test assembly reports no discoverable tests. An earlier run caught+a link to this report before the file existed; the completed documentation and+final source passed the complete rerun. Test-generated STEP line-ending churn+was restored; it is not part of this change.++One measured Release retained-session run took 6.15 seconds cold, 1.12 seconds+unchanged, 0.92 seconds after a camera edit, 0.72 seconds after a row-pitch edit+and 0.75 seconds after a Scene appearance edit. Every retained build reused all+92 engineering definitions with zero rebuilds. The edit probes compare position+and index arrays against the original geometry. These are individual local+timings with JIT/cache warm-up effects, not a statistical benchmark. Display+preparation still runs; retained STEP reuse does not imply zero tessellation work.++Both complete and cutaway GLBs pass Khronos glTF Validator 2.0.0-dev.3.10 with+zero errors and warnings. Informational messages report identity matrices and+unused default/cutaway material meshes. OpenUSD 0.25.8 opens the complete Scene+with zero composition errors, 1,492 mesh occurrences, 124 shared prototypes and+five cameras. `usdchecker` passes. The final external validator additionally+checks finite vertices, index ranges, material bindings, emission and exact+agreement between independent USD bounds and CLI inspection.++The renderer uses Cycles, OptiX, adaptive sampling, denoising and at most 32+samples with a 60-second tracing budget per view. Presentation shader/lighting+choices are not photometric evidence. Each final image is inspected visually;+the Blender evidence compares a geometry/transform hash before and after+rendering and records actual render time and the source GLB hash.+The final five renders took 77.6, 17.8, 10.2, 11.7 and 15.1 seconds respectively+for Hero, Overview, Line, Robot and Logistics on an RTX 3070. Total import,+preparation, rendering and evidence generation took 138.2 seconds. The 60-second+budget bounds tracing, not import/BVH preparation, denoising or image writing.++The PowerPoint package passed exact embedded-model and preview byte checks with+two Model3D elements, two fallback pictures and zero external relationships.+Microsoft PowerPoint 16.0 opened both models natively through COM, changed native+rendered output after rotation, saved a separate copy, closed/reopened it,+preserved rotations and rotated both again. Native slide exports were visually+inspected for layout and real 3D output. The pre-rotation poster uses the authored+PNG; rotation refreshes the native model view. This is native automation evidence,+not a mouse/UI acceptance test. The separate roundtrip package is qualification+output; the delivered `factory.pptx` retains its authored views.+The saved Office package also retains both Model3D elements and the exact source+GLB bytes. Native PowerPoint lighting differs from the Cycles stills; the PNG+fallbacks preserve the rendered presentation finish.++## Honest boundary and shot plan++This is a programmable spatial/presentation witness. It demonstrates authored+geometry, shared components, spatial composition, retained compilation and+portable static assets. It does not qualify manufacturing process accuracy,+collision avoidance, safety guarding, logistics flow, physics, robot controls,+IK or production simulation. Robot arms are original simplified connected+silhouettes, not certified mechanisms. Machine windows are display panels, not+transparent views of modeled internals. Materials have nominal presentation+identities and no certified physical properties.++The PPTX package contains embedded static models and fallbacks. Native COM+rotation/save/reopen is qualified above; manual mouse interaction is untested.+The check uses the documented [Office Model3D API](https://learn.microsoft.com/en-us/office/vba/api/powerpoint.model3dformat).+OpenUSD parser/checker validation does not imply usdview interaction; usdview+was not opened during this qualification.++For a promo edit, use Overview (establish scale), Hero (operational floor), Line+(repeated modules), Robot (automation detail) and Logistics (material staging).+These are saved cameras and stills. No motion clip or simulated process execution+is claimed.diff --git a/docs/public/firmament/scenes.md b/docs/public/firmament/scenes.mdindex 33f8ae64..66b52ca5 100644--- a/docs/public/firmament/scenes.md+++ b/docs/public/firmament/scenes.md@@ -32,6 +32,10 @@ length and coordinate still requires an explicit `m` or `mm` suffix. Bindingnormalizes `1m` to `1000mm`; changing `units` never rescales explicit literals.Kernel geometry and tolerances remain in mm. Scene Set lengths are convertedat the existing typed pattern catalog boundary before occurrence expansion.+Scene lengths also accept finite dimension-checked expressions such as+`2m + 500mm` and `site.Y - 600mm`; these use the existing scalar evaluator after+metre-literal normalization. Unitless additions, length products and division+by zero fail. Assembly translation expressions retain the mm unit contract.A Room occupies `[0,width] × [0,depth] × [0,height]`, optionally translated by`at: [x,y,z]`. Its clear interior dimensions are `size`. Default enclosure@@ -108,6 +112,11 @@ The existing `Pattern name over keyedSet` frontend expands Parts and Assemblies;X0 adds no Scene loop language. Pattern containers are spatial groups, notengineered assemblies. Names, pattern keys, declaration spans, definitionidentities and placement authority survive inspection and USD metadata.+Scenes also admit the existing `Linear Sites` and `Mirrored Sites` recipes.+They keep their ordered keys, derivation metadata, mm-only vectors and shared+validation rules. For example, `Linear Sites rows { keys: [assembly, inspection];+start: [0mm, 0mm, 0mm]; step: [0mm, 7000mm, 0mm]; }` supplies a normal keyed+pattern. Changing pitch preserves occurrence identity without rebuilding parts.Each unique AssemblyFile compiles once per build. Repeated occurrences share itspart display definitions. Local Part specializations use the existing immutable@@ -124,6 +133,10 @@ Physical material/density selection remains in engineering definitions.Appearance also admits optional `opacity` in `[0,1]`, default one. USD emits`UsdPreviewSurface` opacity; GLB emits alpha and `BLEND` for translucent looks.Opacity does not encode refraction, physical glass properties, or a shader graph.+Optional `emissive: [r,g,b]` is finite linear RGB in `[0,1]`, default black.+It exports as glTF `emissiveFactor` and USD PreviewSurface `emissiveColor`.+It represents a luminous appearance, not calibrated light intensity or a Scene+light object. Renderers may add presentation illumination at fixture locations.## CLI and exports@@ -158,6 +171,11 @@ demonstrates top-down Concept layout, bottom-up furniture components, then Scenecomposition. Its [qualification report](../../release/ARCHVIZ-HOUSE-X0.md) recordsthe exact presentation and retained-session evidence.+The [factory witness](../../../fixtures/Canonical/Scene/FactoryX0/factory.firmament)+composes three production lines, original robot islands and a reusable logistics+kit in a 42 × 28 metre hall. Its [report](factory-scene-x0.md) gives reproduction+commands, measured reuse, export checks and presentation qualification limits.+Completion, hover and source diagnostics use compiler-owned schemas. Sceneformatting safely prefers camelCase field labels while preserving layout,comments, generic specialization spelling and authored identities. It isdiff --git a/docs/release/CIR-DISPLAY-X0.md b/docs/release/CIR-DISPLAY-X0.mdnew file mode 100644index 00000000..32086866--- /dev/null+++ b/docs/release/CIR-DISPLAY-X0.md@@ -0,0 +1,189 @@+# CIR-DISPLAY-X0++Status: **Meaningful progression**, 2026-10-05. The three identified shader-stack+blockers are resolved and sphere, cylinder, cone, torus and a CSG cut render on a+real browser GPU through the requested stack. Full Cadmata/Helios X0 acceptance+is not claimed. This release-report location follows the mission's explicit path.++## What CIR mathematically guarantees today++The audited display candidate is `Aetheris.Continuum/Backends/Sdf`, not every+implementation of the broader CIR occupancy interfaces. `SdfNodes.cs` implements+centered box, finite capped cylinder, finite capped cone/frustum, sphere and torus;+union is min, intersection is max and subtraction is max(left, -right).+`SdfTapeLowerer` flattens these into primitive evaluations and min/max/negation,+with accumulated inverse transforms in the existing row-vector convention.++For valid dimensions, the five primitive formulas are Euclidean signed distances+(ring/horn torus admission requires major radius >= minor radius). They are+1-Lipschitz. Rigid transforms preserve this bound. Min/max/negation preserve the+1-Lipschitz bound and occupancy sign, but generally not exact distance throughout+CSG interiors. These are sufficient for conservative outside distance stepping+in exact arithmetic, not a promise of exact engineering measurements from CSG+field values. The broader `IImplicitFieldCapability` does not provide a universal+distance or Lipschitz promise.++`SdfCapabilityAnalyzer` advertises sign, intervals, exact primitive distance and+gradient capability. It removes exact-distance capability for CSG and non-rigid+transforms. It does not expose a quantitative Lipschitz bound. Non-rigid+`SdfTransformNode` evaluates its child at the inverse point without distance+rescaling; blindly advancing a world ray by that value is unsafe. Display+admission therefore rejects non-rigid fields with `cir-display-transform-not-rigid`.++`SdfContinuumRegion.TryGradient` uses six central finite differences with h=1e-6+and returns a normalized direction. It is not automatic differentiation and is+not an unnormalized derivative suitable for unrestricted Newton refinement.+Gradients can fail at singularities and CSG seams. Bounds come from the existing+nodes; intersection currently uses the union box, which is conservative but loose.+No Fidget dependency, Fidget import or Fidget AD implementation was found in the+current C# tree. Historical lineage is not evidence for additional guarantees.++## What the shader pipeline actually supports today++The practical frontend is implemented: Copeland TS syntax/parser and+`GpuGraphicsBinder` emit frontend-neutral VD-MIR. `VdMirGraphicsHlslEmitter` and+`VdMirGraphicsBackend` produce HLSL and invoke DXC; `spirv-val` validates the+result. The old Aurelian SDSL-V AST lane also exists, but this work uses `*.v.ts`.+No Oct frontend port is needed. Current Oct pixel-output validation rejects+builtins, so fragment depth is a new documented Visual TypeScript extension.++Before this work, the graphics binder allowed locals, returns and restricted+branches, but no traversal loops, local mutation or numeric comparisons. Pixel+outputs were color targets only. DXC emitted Vulkan 1.3 SPIR-V, with no WGSL+conversion. DXC emits DXIL/SPIR-V rather than browser WGSL; browser shader modules+require WGSL. Sources: [DXC](https://github.com/microsoft/DirectXShaderCompiler),+[browser shader-module API](https://gpuweb.github.io/types/interfaces/GPUShaderModuleDescriptor.html).++Implemented now:++```text+CIR nodes -> existing CIR tape -> specialized Field() *.v.ts source+ -> Copeland TS parser/binder -> VD-MIR graphics.m4+ -> existing HLSL emitter -> DXC (Vulkan 1.1 SPIR-V for browser artifacts)+ -> spirv-val -> Naga 27.0.0 -> WGSL -> WGSL validation -> browser WebGPU+```++M4 adds bounded C-style for, typed mutation, scoped branches, numeric comparisons,+boolean logic, negation, break, pixel discard and `@builtin(frag_depth)`.+Depth survives compiled metadata separately from color targets. Loop counters+are readonly inside their bodies; literal bounds permit at most 4096 iterations+per loop. Range/step/descend syntax is deferred because the existing TS parser+already expresses the required traversal. Naga is an external translator, not a+replacement compiler or a handwritten WGSL renderer. The browser bridge preserves+clip coordinates with `--keep-coordinate-space`.++## CIR lowering, ownership and minimum remaining glue++`CirVisualTsLowerer` owns the one CIR-to-Visual-TS operation mapping in Aetheris.+It specializes tape instructions into straight-line typed source and preserves+node bounds. Sphere, cylinder, cone, torus, box, rigid transforms and min/max CSG+are admitted. Non-finite/invalid dimensions, spindle toruses, non-rigid fields and+unsupported nodes receive explicit fallback reasons. The X0 dimension range is+1e-5 to 1e6 in model units; this is a bounded qualification range, not support for+arbitrary CAD scales. Production source does not reference a Copeland checkout.+The qualification script takes the checkout and translator paths explicitly.++Copeland owns frontend syntax/binding and VD-MIR. Aurelian.Shaders owns HLSL,+DXC and the WGSL artifact bridge. Aetheris owns CIR mapping and future hybrid+admission. Three/Cadmata owns scene cameras, occurrence transforms, surface passes,+mesh fallback, overlay and selection projection. BRep remains engineering/topology+authority; STEP remains interchange authority.++The next isolated integration boundary is the display packet: SDK `index.d.ts`+exposes only `DisplayMeshDefinition` and `DisplayMeshOccurrence`; Web.Runtime+`Program.cs` tessellates BReps; Cadmata `AetherisViewport.tsx` uses React Three+Fiber Canvas; the Helios demo explicitly constructs `THREE.WebGLRenderer`.+Neither packet exposes admitted CIR programs nor does either viewport own a+WebGPU surface pass. Completing this requires a shared definition-level CIR+descriptor (bounds, program identity, appearance and stable engineering identity),+occurrence-only transforms and a shared depth attachment/pass lifecycle. It must+retain existing mesh picking proxies and BRep edge overlays. No surface meshes+are hidden or replaced before this contract and depth ownership are implemented.++The structural hash includes the specialized field and a compatibility version.+Equivalent definitions have equal identities; different dimensions do not alias.+There is no production GPU program cache yet. This is a cache key and sharing+seam, not a claim of measured occurrence cache hits. The witness compiles five+definitions once each; it does not exercise assembly instance reuse.++## Traversal and numerical boundary++The witness uses orthographic local rays, a 3x3x3 box enclosing its rotated+definitions, 256 steps maximum, absolute hit epsilon 1e-5, and 0.9*abs(field)+steps. Ray work is limited to this fixture box; it is not an unbounded world+post-effect. Correct depth for this orthographic witness is t/3. The GPU writes+actual hit depth through `SV_Depth`/`frag_depth`; no BRep modeling tolerance is+reused. Normals use central field differences with h=1e-4 and a 1e-8 denominator+floor. No tessellation normals are used.++The margin is an X0 numerical precaution, not a floating-point proof. Maximum+iterations can miss grazing rays; fixed epsilon is not screen-space termination.+There is no Newton/bisection refinement, perspective camera proof, arbitrary+world normal-transform proof, or extreme-zoom acceptance yet. General rendering+must intersect authoritative per-object bounds and transform rays/normals using+occurrence matrices; the small witness is not that renderer implementation.++## Evidence and reproduction++```powershell+# In Copeland, requires Cargo plus the existing DXC/SPIR-V toolchain:+./scripts/install-webgpu-compiler.ps1+dotnet test tests/Aurelian/Aurelian.Shaders.Tests -c Release -m:1++# In Aetheris, pass the actual installed paths explicitly:+./scripts/qualify-cir-display-x0.ps1 -CopelandRoot <Copeland-checkout> -NagaExecutable <naga-executable>+python -m http.server 8765 --bind 127.0.0.1 --directory artifacts/local/cir-display-x0+# Open http://127.0.0.1:8765 in a WebGPU-capable browser.+```++Generated source, HLSL, WGSL, metrics, browser readback report and screenshot live+under ignored `artifacts/local/cir-display-x0/`. The browser verifies shader+compilation, pipelines with a depth attachment, draw validation and nonempty+surface pixel readback for each primitive and the CSG cut. Edge 153, Windows,+NVIDIA Ampere adapter, DXC 1.9.2602.24 (d355aa836), Naga 27.0.0 qualified locally.+Browser privacy output did not expose the exact GPU model.++Initial normal-view readbacks: sphere 22,864 pixels; cylinder 25,868; cone 21,566;+torus 16,416. Generation was 0.66–18.44 ms, two-stage DXC 78.57–113.11 ms and+Naga conversion/revalidation 90.42–126.98 ms for these four definitions. First-run+browser pipeline+draw+readback was 34.1–56.4 ms. These include startup/compilation+and readback overhead and are not frame time or GPU timestamp measurements.+No mesh quality/performance comparison or universal benchmark claim is made.++Final validation: Aetheris Release solution build completed with zero errors;+Core fast lane passed 1,005 tests and the serial full solution lane passed 4,312+tests across 20 projects, with zero failures/skips. Copeland TS passed 1,375+tests; Aurelian's full solution lane passed 815 tests across 22 projects; the+final shader suite passed 151 tests after the additional boolean-literal test.+The final cleanup-focused lane passed 12 implicit graphics tests. CIR lowering+tests passed inside the Aetheris full lane. Raw commands/logs remain under+`artifacts/local/cir-display-x0-*.log`. Both repository diff-whitespace checks+passed. Test-generated tracked STEP line-ending changes were restored; pre-existing+factory-scene work was preserved.++## Friction log and cleanup review++| Boundary | Permanent owner | Resolution | Remaining qualification |+| --- | --- | --- | --- |+| Traversal loop, comparison and mutable locals absent | Copeland TS/VD-MIR | Graphics M4 implemented using existing parser | Optional Oct-style range grammar deferred |+| Fragment depth absent in TS and current Oct pixel output | Copeland binding, Aurelian emitter/contracts | Typed frag_depth + SV_Depth + separate metadata implemented | Mixed mesh/CIR depth orders in CAD viewport |+| DXC output not browser shader source | Aurelian.Shaders | DXC SPIR-V -> pinned Naga -> validated WGSL | Broader SPIR-V capability compatibility |+| Vulkan 1.3 discard is unsupported by Naga 27 | Aurelian DXC browser target | Browser-only Vulkan 1.1 selection; Vulkan default retained | Native/broader shader corpus |+| General CIR field lacks global distance promise | Aetheris CIR display admission | Valid primitive/rigid/CSG whitelist; affine rejection | Quantitative affine Lipschitz support deferred |+| SDK carries only mesh, renderers own WebGL surfaces | Aetheris display packet + shared renderer | Boundary isolated; existing display preserved | CIR descriptors, WebGPU pass and hybrid dispatch |+| Selection and Helios topology edges are mesh-based | Existing selection/overlay projection | No changes to picking or topology authority | Keep proxies and qualify overlay alignment |++Dedicated code review removed flattened lexical scopes, preserved immutable+material diagnostics, separated color/depth metadata, versioned new VD-MIR+features, bounded translator processes and cleanup, and kept all CIR primitive+mapping out of the browser. There is no shader VM, duplicated compiler, generated+tracked shader output, production sibling-path assumption or shader cache claim.++## Executive verdict++**Meaningful progression.** CIR -> practical Visual TS -> VD-MIR -> HLSL -> DXC+-> translated WGSL -> real browser GPU now works for all four target primitives.+The motivating CAD display has not yet changed: shared viewport consumption,+hybrid fallback, occurrence program cache, mixed depth, selection/topology,+side-by-side mesh comparison, close-up, real-part and assembly witnesses remain+unqualified. These are explicit acceptance gaps rather than compiler blockers.diff --git a/docs/release/CIR-DISPLAY-X1.md b/docs/release/CIR-DISPLAY-X1.mdnew file mode 100644index 00000000..5ae79c6c--- /dev/null+++ b/docs/release/CIR-DISPLAY-X1.md@@ -0,0 +1,210 @@+# CIR-DISPLAY-X1 — product integration boundary++Status: **Honest stop**, 2026-10-05. Cadmata and Helios cannot yet use CIR as+their default visual path. X0 remains qualified as a standalone GPU witness;+there is no X1 product-rendering qualification.++The audit found the render-graph migration described by the mission's honest-stop+criterion. Neither product currently supplies a shared WebGPU attachment/pass+owner. Adding a second canvas would leave CIR and mesh with independent depth;+switching Cadmata's renderer alone would break existing topology overlays and+background materials. No such workaround was installed, and Auto was not enabled.++## Reproducible evidence++Run from the repository root, after installing the client dependencies and+generating the X0 artifacts:++```powershell+node scripts/audit-cir-display-x1.mjs <HeliosCAD-root> artifacts/local/cir-display-x0/Sphere-fragment.wgsl+```++The explicit Helios path identifies the actual external product checkout rather+than substituting `demos/Aetherion.Helios`. The audit only reads that checkout.+Its JSON output defaults to ignored+`artifacts/local/cir-display-x1/compatibility-audit.json`.++This is a CPU compatibility probe against the installed Three implementation,+not a browser render, a mixed-depth test, or a production API dependency. The+probe imports private Three parsers solely to expose their actual behavior.++Observed with Three **0.183.2**:++| Existing input | WebGPU node conversion |+| --- | --- |+| `MeshStandardMaterial` | `MeshStandardNodeMaterial` |+| `LineBasicMaterial` | `LineBasicNodeMaterial` |+| `ShaderMaterial` | `null` |+| Drei's installed `LineMaterial` | `null` |++The actual generated `Sphere-fragment.wgsl` fails `WGSLNodeFunction` construction+with `FunctionNode: Function is not a WGSL code.` A standalone control function+parses successfully. Naga emits a complete module with structures, module state,+helpers and an annotated fragment entry point. Three's `wgslFn` interface expects+a function declaration; it is not a complete-module pipeline integration API.+This does **not** invalidate the X0 WGSL, which already ran on WebGPU.++Three's `NodeBuilder.build()` reports an incompatible material and substitutes+a generic node material when conversion returns null. That substitution cannot+preserve the existing GLSL background or thick-line shader behavior. Three's+[official migration documentation](https://threejs.org/manual/pages/webgpurenderer.html)+also explicitly requires migrating `ShaderMaterial`, `RawShaderMaterial` and+`onBeforeCompile` customizations to node materials/TSL.++## Actual ownership and coupling++| Responsibility | Cadmata today | Actual HeliosCAD today |+| --- | --- | --- |+| Renderer/frame ownership | R3F `Canvas` in `aetheris.client/src/viewer/AetherisViewport.tsx`, default WebGL | `THREE.WebGLRenderer` in external `src/viewport/Viewport.tsx` |+| Display input | Server analytic face packets and assembly display packets | Public SDK `ModelSession.mesh` |+| Definition sharing | Assembly mesh definitions/occurrences | One `BufferGeometry` per SDK definition, meshes per occurrence |+| Camera | Product orthographic camera, orbit and zoom | Product perspective/orthographic cameras and OrbitControls |+| Topology overlay | Server BRep wire points rendered by Drei `Line` | SDK BRep edge polylines rendered as `LineSegments` |+| Picking | Existing part pick-ray path and assembly occurrence interaction | Raycaster plus SDK `describeSelection` / `describeEdgeSelection` |+| Highlight | Existing face/edge/occurrence overlays | Occurrence tint and face/edge mesh overlays |+| Presentation | Theme lights/materials, custom GLSL background, axis text | Standard mesh materials, theme/grid, selection tint |++Cadmata's `EdgeLine` and axis guide use Drei's thick `Line`; their installed+implementation constructs the unsupported `LineMaterial`. Its theme background+constructs `ShaderMaterial`. Axis/PMI text also needs migration qualification:+the installed Troika derived-material implementation customizes+`onBeforeCompile`, another unsupported WebGPU seam. Text was inspected in source,+not independently rendered in this audit.++The actual external Helios checkout is ahead of the in-repository demo in edge+ownership: it draws kernel-provided semantic edge polylines, not mesh triangle+adjacency. The repair must preserve those polylines and their SDK edge identities.+Picking is **not** the fundamental blocker found here: its mesh proxy and stable+SDK selection mapping are suitable to retain during a visual-path migration.++Existing WebGL depth attachments cannot be bound as WebGPU render-pass depth+attachments. Thus a separate CIR canvas or a final color overlay would not meet+mixed-depth acceptance. The products need one device and explicit shared+color/depth attachment ownership for opaque mesh and CIR passes.++Three's public [ExternalTexture API](https://threejs.org/docs/pages/ExternalTexture.html)+and render-target APIs are promising seams for externally owned GPU textures.+Their existence does not prove the required depth, resizing, disposal, MSAA,+tone-mapping or fallback behavior. This audit does not claim Three makes the+integration impossible. It identifies the larger shared-host migration needed+before a product-safe implementation can be qualified.++## Compiler-host boundary++`Aetheris.Web.Runtime` targets `browser-wasm`. Its public `DisplayMesh` contract+contains definitions, occurrences, transforms, triangle selection ranges and+optional semantic edges; it contains no CIR shader artifact or provider.++X0's `WebGpuGraphicsBackend` invokes DXC through the existing backend and Naga+through `System.Diagnostics.Process`, with temporary files. That is a native+artifact compiler, not an executable browser-WASM service. Referencing that+backend from the browser SDK would not make dynamic authored shader compilation+available there. The existing server may host the same compiler for connected+clients, but standalone Helios needs an explicit capability/provider contract+and deterministic mesh fallback when that provider is absent. Fixed primitive+shader bundles would not cover arbitrary structural hashes and authored CSG.++There is also no existing X0 production cache to reuse: X0 supplies the structural+key and compatibility seam, not a measured cross-window artifact cache. X1 must+add that cache at the native artifact-provider boundary and a device-specific+pipeline cache in the shared browser host.++## Smallest architectural repair++These are proposed boundaries, not implemented capabilities:++1. Establish one framework-neutral display host exported by the Aetheris SDK+ (a separate optional Three adapter export). It owns WebGPU initialization,+ device/attachments, resize, frame scheduling, disposal and the legacy mesh+ fallback. Cadmata's R3F wrapper and Helios's imperative wrapper supply their+ existing scene/camera/interaction state; neither owns CIR shader semantics.+ Migrate Cadmata's thick topology lines, theme background and text to compatible+ Three materials in that host integration before replacing its default renderer.+2. Qualify that host with the **existing X0-generated modules** and ordinary Three+ meshes sharing physical depth, first in both depth orders and overlapping+ ranges. Establish projection/depth conventions, resource lifetime and resize+ behavior before adding authored-model routing. Then integrate product-camera+ ray generation through the existing Visual TS → VD-MIR → DXC → Naga path.+ Do not strip or rewrite Naga output to fit `wgslFn`.+3. Add a shared definition/occurrence descriptor and native shader-artifact+ provider, consumed by the server and SDK projection adapters. Wire authored+ compiler output into it; do not recover CIR from tessellated triangles or+ renderer-side primitive guesses. Preserve BRep meshes as selection proxies,+ semantic edge polylines as overlays, and existing authored appearance authority.+ Only then qualify Auto/CIR/Mesh dispatch and enable Auto for admitted definitions.++The proposed pass sequence is background/clear, opaque mesh and opaque CIR using+the same depth attachment, topology overlays with depth testing, selection+overlays, and gizmos. Opaque correctness must not depend on mesh/CIR submission+order. Transparent content remains on the mesh path and requires a separately+qualified final transparent pass. No PBR engine or CIR interpreter is proposed.++## Architecture review++| Question | Decision for the repair |+| --- | --- |+| CIR packet owner | Shared engine display projection: authoritative authored CIR + engineering definition identity; server/SDK serialize the same model |+| Shader artifact cache | Native artifact provider, keyed by CIR structure plus full compiler/render compatibility identity |+| WebGPU pipelines | Shared browser display host, partitioned by device and render-target compatibility |+| Product sharing | SDK Three adapter with thin R3F/imperative wrappers |+| Visual versus selection authority | CIR draws opaque surfaces; invisible mesh proxies retain existing SDK/BRep selection; BRep polylines retain edge identity |+| Mesh fallback | Missing provider/WebGPU, unsupported CIR, compiler/pipeline failure, transparent or imported/recovered geometry |+| Shader invalidation | Field/structure or shader compatibility changes; not camera, rigid occurrence transform or material binding changes |++Proposed occurrence buffers invalidate on placement changes; appearance bindings+on authored appearance/highlight changes; bounds on geometry or placement changes;+picking proxies on BRep/mesh revision changes. Reloads should retain compatible+artifact keys while removing obsolete device resources. These rules remain+unqualified until implemented and tested; no cache-hit or 100-instance claim is made.++## Friction log++| Friction | Workaround accepted? | Correct owner / permanent repair |+| --- | --- | --- |+| Two WebGL frame owners, no shared GPU pass | No second CIR renderer/canvas | Shared SDK display host and product wrappers |+| Independent WebGL/WebGPU depth | No color-only composition or pass-order trick | One WebGPU device and shared attachments |+| Unsupported Cadmata background/thick lines/text | No generic-material substitution or disappearing overlays | Cadmata presentation adapters migrated to supported node materials |+| Full Naga module versus `wgslFn` | No output stripping or handwritten field evaluator | Custom compiled-module pass in the shared host |+| Browser-WASM cannot run native compiler subprocesses | No sibling executable assumption in SDK | Explicit native artifact provider; standalone mesh fallback |+| Definition packet/cache absent | No per-occurrence/per-frame compiler | Shared engine projection and versioned artifact/device cache |+| Transform/projection agreement | No X0 orthographic witness camera reused as product camera | Product camera/occurrence bindings, qualify near/far and extreme zoom |+| Appearance agreement | No CIR-only material semantics | Existing authored appearance projection; qualify shared lighting |+| Overlay alignment and picking | No new face identity system | Preserve existing BRep polylines/proxies; qualify after host migration |++## Validation and limitations++The compatibility probe completed and produced the findings above. The dedicated+quality audit found no production renderer duplication added by this work. The+diagnostic script has no production imports/callers; generated evidence stays+under ignored `artifacts/local/`. Existing X0 and unrelated factory-scene work+were preserved. No shader frontend/backend changes were needed for this audit.++Validation logs are under `artifacts/local/cir-display-x1/`:++- Release solution build: passed, zero errors, two warnings.+- Kernel fast lane: 1,005 passed, zero failed/skipped.+- Full serial solution lane: 4,312 passed across 20 projects, zero failed/skipped.+- Cadmata production build: passed; 82 tests passed across 16 files.+- External Helios development build: passed; 29 tests passed across 7 files.++No product CIR pixels, mixed-depth/selection/overlay captures, performance figures,+memory measurements, resource-reuse counts or browser X1 qualification were+produced. Prior X0 browser evidence is documented in `CIR-DISPLAY-X0.md`; it must+not be presented as X1 product evidence. Product acceptance criteria remain unmet.++Executive verdict: **Honest stop** at the shared render-host migration. The+shader chain is preserved, the exact existing material and host coupling is+reproducible, and the smallest repair is identified. A partial packet or a+second renderer would not satisfy the mission's meaningful-progression criteria.++## Subsequent compiler boundary repair++VD-WGSL-X0 subsequently added Copeland's managed `Copeland.TS.Backend.Wgsl`+assembly and demonstrated the real `.v.ts` frontend plus direct WGSL emission+inside browser WASM. All five X0 fields executed without native compiler tools.+See Copeland's `docs/release/VD-WGSL-X0.md` for qualification evidence.++The native artifact-provider requirement above describes the earlier X0 path;+it is no longer necessary for a browser host that adopts this direct backend.+The existing Aetheris SDK has not yet adopted it. Shared render-host/depth ownership+and compatible Cadmata overlays remain the X1 product integration boundary.diff --git a/docs/release/DISPLAY-HOST-X0.md b/docs/release/DISPLAY-HOST-X0.mdnew file mode 100644index 00000000..7d9ccd05--- /dev/null+++ b/docs/release/DISPLAY-HOST-X0.md@@ -0,0 +1,65 @@+# DISPLAY-HOST-X0++Verdict: **Honest stop**. The requested shared production display host is not implemented. A real browser experiment isolated a dependency limitation before changing either working product.++## Ownership audit++Cadmata owns an R3F WebGL renderer in `aetheris.client/src/viewer/AetherisViewport.tsx`. Its background is a ShaderMaterial, its semantic edge path uses Drei's WebGL LineMaterial, and its text/PMI layers use material extensions. Its assembly packet has shared definitions and occurrence transforms, but its part path builds per-face meshes.++The actual external application is `C:/Users/yuech/source/repos/HeliosCAD`, specifically `src/viewport/Viewport.tsx`. It owns a separate WebGLRenderer, resize observer, geometry/material lifetimes, picking, and highlighting. It already shares mesh definitions among occurrences and draws SDK BRep polylines rather than inventing topology from tessellation. SDK selection resolution remains the semantic authority. Cadmata uses installed Three 0.183.2; Helios uses installed Three 0.186.0.++The SDK has no display host today. The managed direct WGSL backend is already qualified separately by VD-WGSL-X0; this task did not reopen that compiler or introduce DXC/Naga into browser execution.++## Attempt and exact blocker++The attempted architecture retained Three's existing mesh material implementation on an explicitly supplied GPUDevice, with host-created color/depth textures wrapped in the public ExternalTexture class and assigned to a public RenderTarget. The intended sequence was mesh submission, a raw WGSL pass loading the same color/depth attachments, and canvas presentation. No backend state mutation or private pass interception was used.++The minimal retained reproducer is `scripts/display-host-x0-attachment-probe.js` and its HTML page. Every run first renders a curved sphere with MeshStandardMaterial into ordinary Three-owned color/depth attachments on the same device, scene, and camera. This control succeeds with no captured validation errors. It then substitutes external attachments with explicit dimensions, Three format/type, and GPU render/texture/copy usage.++Real Edge browser results for **both installed versions**:++| Case | r183 / Cadmata | r186 / Helios |+| --- | --- | --- |+| Ordinary color + depth | Pass | Pass |+| External color + external depth | Required `GPUDepthStencilState.format` is undefined | Same |+| External color + ordinary depth | Required `GPUColorTargetState.format` is undefined | Same |++These are synchronous GPUDevice.createRenderPipeline descriptor errors, before successful mesh submission. They are not a WGSL compiler failure or lack of WebGPU on this machine.++In both dependencies, `src/renderers/webgpu/utils/WebGPUTextureUtils.js` takes an early return for `texture.isExternalTexture`, assigning `textureData.texture` and `initialized`, but omitting `textureData.format`. `WebGPUUtils.getTextureFormatGPU()` reads that backend metadata. Public `texture.format`, `type`, and `internalFormat` cannot populate the omitted metadata through this branch. The [current upstream source](https://github.com/mrdoob/three.js/blob/dev/src/renderers/webgpu/utils/WebGPUTextureUtils.js) inspected during qualification also retains the early return. The public [ExternalTexture documentation](https://threejs.org/docs/pages/ExternalTexture.html) does not establish external render-target compatibility.++There is also ownership drift: r183 destroys wrapped GPU textures during texture disposal; r186 excludes external textures from that destruction. Any eventual adapter must explicitly qualify texture ownership across its pinned dependency version.++## Decision and smallest repair++Do not ship a nominal shared renderer which still hides its real depth attachments inside Three. Do not monkeypatch private backend maps merely to make this experiment pass. Such a patch would also need to preserve metadata, attachment replacement, disposal, pipeline keys, and resize behavior across the two different installed versions.++The smallest concrete repair is a maintained, pinned Three dependency change establishing external render-target metadata and lifetime behavior, followed by overlap/load-store/resize/disposal browser tests. This is a dependency repair; a public API for externally owned render attachments would be preferable. Merely upgrading to the Helios installed version does not fix the demonstrated failure. This repair has not been implemented or qualified here.++The alternative is a shared host that owns raw mesh and semantic edge pipelines, retaining Three only for cameras, controls, and CPU raycasting. That requires replacing the current material/render submission boundary and qualifying appearance and product overlays; it is a larger renderer redesign, not a wrapper migration. The mission's honest-stop condition for Three limitations applies at this boundary.++Production Cadmata and Helios are preserved. No new SDK export, renderer fork, hidden WebGL fallback, or claimed CIR pass slot was installed. The discarded host prototype was reduced to an isolated diagnostic script.++## Reproduce++From the Aetheris repository root:++```powershell+./scripts/prepare-display-host-x0-probe.ps1 -HeliosRoot C:/Users/yuech/source/repos/HeliosCAD+python -m http.server 8766 --bind 127.0.0.1+```++Open these pages in a WebGPU-capable browser:++- `http://127.0.0.1:8766/scripts/display-host-x0-attachment-probe.html`+- `http://127.0.0.1:8766/scripts/display-host-x0-attachment-probe.html?ownedDepth`+- `http://127.0.0.1:8766/artifacts/local/display-host-x0/helios-probe.html`+- `http://127.0.0.1:8766/artifacts/local/display-host-x0/helios-probe.html?ownedDepth`++Preparation reads the explicit actual Helios installation and copies its installed Three build files to ignored `artifacts/local/display-host-x0/`; it does not change Helios. Browser reports and a screenshot are saved alongside dependency/build/test evidence there. No background service or startup hook is created.++## Qualification limits++The browser experiment qualifies the dependency failure and its successful ordinary-attachment control. It does **not** qualify either product on WebGPU, authored appearance parity, shared picking, semantic thick lines, a large scene, performance, shader caching, or a direct compiler artifact pass. No before/after product image or performance gain is claimed; those gates were not reached. All twenty acceptance requirements remain unaccepted as a production host capability.++Validation: JavaScript syntax check; all four real browser cases above with passing ordinary-attachment controls; Aetheris Release solution build; fast kernel lane **1,005 passed**; full serial solution lane **4,312 passed across 20 suites**, zero failed/skipped. Build retains two pre-existing WebAssembly SQLite warnings. The full corpus run rewrote only line endings in one generated STEP fixture; its content was checked and that test side effect restored.diff --git a/fixtures/Canonical/Scene/FactoryX0/cart.firmament b/fixtures/Canonical/Scene/FactoryX0/cart.firmamentnew file mode 100644index 00000000..d38ae57b--- /dev/null+++ b/fixtures/Canonical/Scene/FactoryX0/cart.firmament@@ -0,0 +1,7 @@+include "kit.firmament";+Assembly WheeledCart {+ <Assembly WheeledCart>+ <Assembly cart = Cart> Placement { from: Origin; to: World; } </Assembly>+ </Assembly>+ anchor: WheeledCart;+}diff --git a/fixtures/Canonical/Scene/FactoryX0/factory-presentation.json b/fixtures/Canonical/Scene/FactoryX0/factory-presentation.jsonnew file mode 100644index 00000000..af7c5bb4--- /dev/null+++ b/fixtures/Canonical/Scene/FactoryX0/factory-presentation.json@@ -0,0 +1,33 @@+{+ "title": "Aetheris programmable factory environment",+ "slides": [+ {+ "title": "A programmable factory environment",+ "subtitle": "Firmament composes shared equipment into a large operational Scene",+ "caption": "Compiled geometry for digital twin and Physical AI visualization. Static presentation witness; simulation and robotics control are unqualified.",+ "models": [{+ "name": "FactoryX0 interactive environment",+ "source": "../../../../artifacts/local/factory-scene-x0/factory.glb",+ "preview": "../../../../artifacts/local/factory-scene-x0/hero.png",+ "x": 66.3, "y": 56, "width": 206, "height": 115.875,+ "camera": { "centerXMetres": 21, "centerYMetres": 3.5, "centerZMetres": -14,+ "presentationScale": 0.045, "rotationXDegrees": 28, "rotationYDegrees": 32,+ "cameraDistanceMetres": 2.2, "fieldOfViewDegrees": 45 }+ }]+ },+ {+ "title": "Shared modules at factory scale",+ "subtitle": "Three production lines, robot islands, packaging and material staging",+ "caption": "Presentation cutaway hides the ceiling and front/right walls. Full enclosure, shared definitions and five cameras remain in OpenUSD.",+ "models": [{+ "name": "FactoryX0 floor overview",+ "source": "../../../../artifacts/local/factory-scene-x0/factory.glb",+ "preview": "../../../../artifacts/local/factory-scene-x0/overview.png",+ "x": 66.3, "y": 56, "width": 206, "height": 115.875,+ "camera": { "centerXMetres": 21, "centerYMetres": 3.5, "centerZMetres": -14,+ "presentationScale": 0.045, "rotationXDegrees": 38, "rotationYDegrees": -28,+ "cameraDistanceMetres": 2.2, "fieldOfViewDegrees": 45 }+ }]+ }+ ]+}diff --git a/fixtures/Canonical/Scene/FactoryX0/factory.firmament b/fixtures/Canonical/Scene/FactoryX0/factory.firmamentnew file mode 100644index 00000000..87b93880--- /dev/null+++ b/fixtures/Canonical/Scene/FactoryX0/factory.firmament@@ -0,0 +1,94 @@+// FACTORY-SCENE-X0. Original presentation environment, 42 × 28 × 7 metres.+// Scene owns spatial organization; equipment documents own engineering geometry.+Template<L: Length, W: Length, H: Length> Struct Marker {+ RoundedRect2 outline { center: [0mm, 0mm]; size: [L, W]; radius: 2mm; }+ Profile section { Loop Outer { outline |> TraceLoop } }+ Extrude body { profile: section; from: 0mm; to: H; }+}+Appearance concrete { color: [.43, .49, .53]; metallic: .05; roughness: .27; }+Appearance wallWhite { color: [.76, .81, .85]; metallic: .05; roughness: .65; }+Appearance safetyYellow { color: [.95, .65, .025]; metallic: 0; roughness: .45; }+Appearance pedestrianTeal { color: [.025, .24, .26]; metallic: .05; roughness: .4; }+Appearance glass { color: [.65, .83, .9]; metallic: 0; roughness: .12; opacity: .18; }+Appearance windowFrame { color: [.06, .085, .11]; metallic: .7; roughness: .3; }+Concept Struct FactoryLayout {+ Plane floor { from: hall.floor; }+ DatumFrame production { on: floor; at: [6000mm, 6000mm]; x: [1, 0]; }+ DatumFrame packout { on: floor; at: [25000mm, 6000mm]; x: [1, 0]; }+ DatumFrame robotics { on: floor; at: [25500mm, 10500mm]; x: [1, 0]; }+ DatumFrame storage { on: floor; at: [37000mm, 6000mm]; x: [0, 1]; }+}+// The existing finite site producer now works at Scene scale too. Recipe vectors+// retain its mm contract; scene placements/cameras use explicit metre literals.+Linear Sites lineSites { keys: [componentAssembly, integration, finalInspection]; start: [0mm, 0mm, 0mm]; step: [0mm, 7000mm, 0mm]; }+Linear Sites robotSites { keys: [transfer, packAssist]; start: [0mm, 0mm, 0mm]; step: [0mm, 7000mm, 0mm]; }+Linear Sites cartSites { keys: [infeed, workInProgress, inspection, dispatch]; start: [3000mm, 4000mm, 0mm]; step: [8500mm, 0mm, 0mm]; }+Linear Sites rearCartSites { keys: [return01, return02, return03]; start: [9000mm, 24500mm, 0mm]; step: [8000mm, 0mm, 0mm]; }+Linear Sites laneSites { keys: [front, aisle01, aisle02, rear]; start: [21000mm, 2300mm, 1mm]; step: [0mm, 7000mm, 0mm]; }+Linear Sites crossingSites { keys: [s01, s02, s03, s04, s05, s06, s07, s08, s09, s10, s11, s12]; start: [33500mm, 4100mm, 2mm]; step: [0mm, 450mm, 0mm]; }+Scene FactoryX0 {+ units: m;+ Room hall { size: [42m, 28m, 7m]; thickness: 180mm; appearance: wallWhite; floorAppearance: concrete; }+ Door dispatch { on: hall.eastWall; along: 20m; width: 5m; height: 4.5m; }+ Door personnel { on: hall.southWall; along: 1m; width: 1.4m; height: 2.5m; }+ Window northDaylight { on: hall.northWall; along: 2m; width: 37m; height: 1.7m; sill: 4m;+ glazingAppearance: glass; frameAppearance: windowFrame; frameWidth: 80mm; }+ Window westDaylight { on: hall.westWall; along: 3m; width: 21m; height: 1.7m; sill: 4m;+ glazingAppearance: glass; frameAppearance: windowFrame; frameWidth: 80mm; }+ <Assembly structure = AssemblyFile<"hall-structure.firmament">>+ Placement { from: Origin; to: World; }+ </Assembly>+ Pattern productionLines over lineSites {+ site => <Assembly line = AssemblyFile<"production-line.firmament">>+ Placement { from: Origin; to: FactoryLayout.production; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ Pattern packaging over lineSites {+ site => <Assembly packout = AssemblyFile<"packout.firmament">>+ Placement { from: Origin; to: FactoryLayout.packout; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ Pattern robotCells over robotSites {+ site => <Assembly cell = AssemblyFile<"robot-island.firmament">>+ Placement { from: Origin; to: FactoryLayout.robotics; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ <Assembly logistics = AssemblyFile<"logistics.firmament">>+ Placement { from: Origin; to: FactoryLayout.storage; }+ </Assembly>+ Pattern carts over cartSites {+ site => <Assembly cart = AssemblyFile<"cart.firmament">>+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ Pattern returns over rearCartSites {+ site => <Assembly cart = AssemblyFile<"cart.firmament">>+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; rotateLocal: { axis: Z; angle: 90deg; } }+ </Assembly>+ }+ Pattern pedestrianLanes over laneSites {+ site => <Part lane = Marker<L:38000mm,W:1000mm,H:2mm>> appearance: pedestrianTeal;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Part>+ <Part nearStripe = Marker<L:38000mm,W:70mm,H:2mm>> appearance: safetyYellow;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y - 600mm, site.Z]; }+ </Part>+ <Part farStripe = Marker<L:38000mm,W:70mm,H:2mm>> appearance: safetyYellow;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y + 600mm, site.Z]; }+ </Part>+ }+ Pattern crossing over crossingSites {+ site => <Part stripe = Marker<L:1800mm,W:220mm,H:2mm>> appearance: safetyYellow;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Part>+ }+ <Part logisticsLane = Marker<L:1500mm,W:22000mm,H:2mm>> appearance: pedestrianTeal;+ Placement { from: Origin; to: World; translateLocal: [33.5m, 14m, 1mm]; }+ </Part>+ // Cameras are canonical authored state; exports carry all five views.+ Camera Hero { position: [32m, 3.5m, 4.5m]; lookAt: [16m, 14m, 1.1m]; fov: 66deg; }+ Camera Overview { position: [54m, -24m, 43m]; lookAt: [21m, 14m, .3m]; fov: 42deg; }+ Camera Line { position: [23.5m, 3.5m, 2.4m]; lookAt: [8m, 7m, 1.2m]; fov: 59deg; }+ Camera Robot { position: [30.4m, 7.4m, 3.2m]; lookAt: [26m, 10.5m, 1.35m]; fov: 54deg; }+ Camera Logistics { position: [33m, 24.5m, 4m]; lookAt: [37m, 12m, 1.6m]; fov: 62deg; }+}diff --git a/fixtures/Canonical/Scene/FactoryX0/hall-structure.firmament b/fixtures/Canonical/Scene/FactoryX0/hall-structure.firmamentnew file mode 100644index 00000000..429c4ce0--- /dev/null+++ b/fixtures/Canonical/Scene/FactoryX0/hall-structure.firmament@@ -0,0 +1,50 @@+include "kit.firmament";+Linear Sites columnSites { keys: [c01, c02, c03, c04]; start: [5000mm, 900mm, 0mm]; step: [10000mm, 0mm, 0mm]; }+Linear Sites beamSites { keys: [b01, b02, b03, b04, b05]; start: [21000mm, 3000mm, 6500mm]; step: [0mm, 5500mm, 0mm]; }+Linear Sites lightSites { keys: [l01, l02, l03, l04, l05, l06]; start: [4000mm, 0mm, 6100mm]; step: [6500mm, 0mm, 0mm]; }+Linear Sites lightRows { keys: [front, centre, rear]; start: [0mm, 5500mm, 0mm]; step: [0mm, 8000mm, 0mm]; }+Subassembly LightRow {+ <Assembly LightRow>+ Pattern lights over lightSites {+ site => <Part housing = Panel<L:2400mm,W:380mm,H:90mm,R:30mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Part>+ <Part diffuser = Panel<L:2300mm,W:310mm,H:15mm,R:25mm>> material: Luminaire;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z - 15mm]; }+ </Part>+ <Part suspension = Panel<L:30mm,W:30mm,H:310mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z + 90mm]; }+ </Part>+ }+ </Assembly>+ anchor: LightRow;+}+Assembly HallStructure {+ <Assembly HallStructure>+ Pattern columns over columnSites {+ site => <Part front = Panel<L:380mm,W:380mm,H:6500mm,R:12mm>> material: PaintedSteel;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, 0mm]; }+ </Part>+ <Part rear = Panel<L:380mm,W:380mm,H:6500mm,R:12mm>> material: PaintedSteel;+ Placement { from: Origin; to: World; translateLocal: [site.X, 27100mm, 0mm]; }+ </Part>+ <Part frontGuard = Panel<L:440mm,W:440mm,H:700mm,R:20mm>> material: SafetySteel;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, 0mm]; }+ </Part>+ <Part rearGuard = Panel<L:440mm,W:440mm,H:700mm,R:20mm>> material: SafetySteel;+ Placement { from: Origin; to: World; translateLocal: [site.X, 27100mm, 0mm]; }+ </Part>+ }+ Pattern beams over beamSites {+ site => <Part beam = Panel<L:42000mm,W:220mm,H:380mm,R:10mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Part>+ }+ Pattern illumination over lightRows {+ site => <Assembly row = LightRow>+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ </Assembly>+ anchor: HallStructure;+}diff --git a/fixtures/Canonical/Scene/FactoryX0/kit.firmament b/fixtures/Canonical/Scene/FactoryX0/kit.firmamentnew file mode 100644index 00000000..67355443--- /dev/null+++ b/fixtures/Canonical/Scene/FactoryX0/kit.firmament@@ -0,0 +1,235 @@+// FACTORY-SCENE-X0 reusable kit. Millimetres, Z-up, origin on the floor.+// Simplified exact solids with separate component/material identities.+Template<L: Length, W: Length, H: Length, R: Length = 2mm> Struct Panel {+ RoundedRect2 outline { center: [0mm, 0mm]; size: [L, W]; radius: R; }+ Profile section { Loop Outer { outline |> TraceLoop } }+ Extrude body { profile: section; from: 0mm; to: H; }+}+Template<R: Length, H: Length> Struct Drum {+ Circle2 outline { center: [0mm, 0mm]; radius: R; }+ Profile section { Loop Outer { outline |> TraceLoop } }+ Extrude body { profile: section; from: 0mm; to: H; }+}+// Open bins carry a bottom and four walls, rather than solid blue blocks.+Template<L: Length, W: Length, H: Length> Struct Bin {+ RoundedRect2 outer { center: [0mm, 0mm]; size: [L, W]; radius: 16mm; }+ RoundedRect2 inner { center: [0mm, 0mm]; size: [L - 16mm, W - 16mm]; radius: 8mm; }+ Profile base { Loop Outer { outer |> TraceLoop } }+ Profile rim { Loop Outer { outer |> TraceLoop } Loop Inner { inner |> TraceLoop } }+ Extrude bottom { profile: base; from: 0mm; to: 8mm; }+ Extrude sides { profile: rim; from: 8mm; to: H; }+}+Appearance porcelain { color: [.78, .82, .85]; metallic: .25; roughness: .28; }+Appearance graphite { color: [.035, .045, .058]; metallic: .65; roughness: .32; }+Appearance aluminium { color: [.52, .59, .65]; metallic: .85; roughness: .26; }+Appearance belt { color: [.022, .028, .032]; metallic: .05; roughness: .65; }+Appearance automationOrange { color: [.95, .25, .035]; metallic: .2; roughness: .28; }+Appearance toteBlue { color: [.035, .24, .54]; metallic: .05; roughness: .4; }+Appearance safetyYellow { color: [.95, .65, .025]; metallic: .1; roughness: .4; }+Appearance carton { color: [.57, .38, .19]; metallic: 0; roughness: .85; }+Appearance screen { color: [.012, .1, .15]; metallic: .25; roughness: .18; emissive: [.025, .32, .5]; }+Appearance ready { color: [.04, .55, .24]; metallic: .1; roughness: .25; emissive: [.04, .7, .2]; }+Appearance diffuser { color: [.9, .94, 1]; metallic: 0; roughness: .3; emissive: [.85, .92, 1]; }+Material PaintedSteel { identity: "steel.painted.presentation"; appearance: porcelain; }+Material BlackSteel { identity: "steel.black.presentation"; appearance: graphite; }+Material Aluminium { identity: "aluminium.presentation"; appearance: aluminium; }+Material Rubber { identity: "rubber.presentation"; appearance: belt; }+Material RobotSteel { identity: "steel.robot.presentation"; appearance: automationOrange; }+Material Polymer { identity: "polymer.bin.presentation"; appearance: toteBlue; }+Material SafetySteel { identity: "steel.safety.presentation"; appearance: safetyYellow; }+Material Cardboard { identity: "cardboard.presentation"; appearance: carton; }+Material Display { identity: "display.presentation"; appearance: screen; }+Material Signal { identity: "indicator.presentation"; appearance: ready; }+Material Luminaire { identity: "diffuser.presentation"; appearance: diffuser; }+Record Foot { x: Length; y: Length; }+Static conveyorFeet: Set<Foot> {+ nearLeft => Foot { x: -760mm; y: -380mm; }+ nearRight => Foot { x: -760mm; y: 380mm; }+ farLeft => Foot { x: 760mm; y: -380mm; }+ farRight => Foot { x: 760mm; y: 380mm; }+}+Linear Sites rollerSites {+ keys: [r01, r02, r03, r04, r05, r06, r07, r08, r09, r10, r11, r12];+ start: [-880mm, 360mm, 910mm]; step: [160mm, 0mm, 0mm];+}+Subassembly ConveyorStraight {+ <Assembly ConveyorStraight>+ <Part bed = Panel<L:1980mm,W:740mm,H:60mm>> material: Rubber;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 820mm]; }+ </Part>+ Pattern feet over conveyorFeet {+ foot => <Part leg = Panel<L:70mm,W:70mm,H:820mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [foot.x, foot.y, 0mm]; }+ </Part>+ <Part pad = Panel<L:120mm,W:120mm,H:20mm,R:12mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [foot.x, foot.y, 0mm]; }+ </Part>+ }+ Pattern rollers over rollerSites {+ site => <Part roller = Drum<R:35mm,H:720mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; rotateLocal: { axis: X; angle: 90deg; } }+ </Part>+ }+ <Part railNear = Panel<L:1980mm,W:55mm,H:140mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [0mm, -400mm, 805mm]; }+ </Part>+ <Part railFar = Panel<L:1980mm,W:55mm,H:140mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [0mm, 400mm, 805mm]; }+ </Part>+ </Assembly>+ anchor: ConveyorStraight;+}+Subassembly MachineBox {+ <Assembly MachineBox>+ <Part plinth = Panel<L:1500mm,W:1400mm,H:160mm,R:25mm>> material: BlackSteel;+ Placement { from: Origin; to: World; }+ </Part>+ <Part enclosure = Panel<L:1500mm,W:1400mm,H:1840mm,R:25mm>> material: PaintedSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 160mm]; }+ </Part>+ <Part serviceDoor = Panel<L:1200mm,W:24mm,H:1420mm,R:10mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, -708mm, 380mm]; }+ </Part>+ <Part window = Panel<L:1040mm,W:12mm,H:900mm,R:4mm>> material: Display;+ Placement { from: Origin; to: World; translateLocal: [0mm, -726mm, 820mm]; }+ </Part>+ <Part windowMullion = Panel<L:40mm,W:20mm,H:940mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [0mm, -730mm, 800mm]; }+ </Part>+ <Part handle = Panel<L:25mm,W:40mm,H:220mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [500mm, -744mm, 530mm]; }+ </Part>+ <Part accent = Panel<L:1500mm,W:30mm,H:100mm>> material: RobotSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, -700mm, 250mm]; }+ </Part>+ <Part signalStem = Drum<R:18mm,H:160mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [600mm, 400mm, 2000mm]; }+ </Part>+ <Part status = Drum<R:40mm,H:90mm>> material: Signal;+ Placement { from: Origin; to: World; translateLocal: [600mm, 400mm, 2160mm]; }+ </Part>+ </Assembly>+ anchor: MachineBox;+}+Subassembly InspectionBench {+ <Assembly InspectionBench>+ <Part cabinet = Panel<L:1100mm,W:650mm,H:860mm,R:12mm>> material: PaintedSteel;+ Placement { from: Origin; to: World; }+ </Part>+ <Part worktop = Panel<L:1200mm,W:750mm,H:50mm,R:20mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 860mm]; }+ </Part>+ <Part monitorPost = Panel<L:60mm,W:60mm,H:450mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, 240mm, 910mm]; }+ </Part>+ <Part monitor = Panel<L:600mm,W:40mm,H:360mm,R:12mm>> material: Display;+ Placement { from: Origin; to: World; translateLocal: [0mm, 220mm, 1160mm]; }+ </Part>+ <Part keyboard = Panel<L:450mm,W:160mm,H:25mm,R:10mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, -160mm, 910mm]; }+ </Part>+ </Assembly>+ anchor: InspectionBench;+}+Static cartFeet: Set<Foot> {+ nearLeft => Foot { x: -420mm; y: -280mm; }+ nearRight => Foot { x: -420mm; y: 280mm; }+ farLeft => Foot { x: 420mm; y: -280mm; }+ farRight => Foot { x: 420mm; y: 280mm; }+}+Subassembly Cart {+ <Assembly Cart>+ Pattern casters over cartFeet {+ foot => <Part wheel = Drum<R:90mm,H:50mm>> material: Rubber;+ Placement { from: Origin; to: World; translateLocal: [foot.x, foot.y, 90mm]; rotateLocal: { axis: X; angle: 90deg; } }+ </Part>+ <Part fork = Panel<L:45mm,W:70mm,H:90mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [foot.x, foot.y, 110mm]; }+ </Part>+ <Part upright = Panel<L:35mm,W:35mm,H:800mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [foot.x, foot.y, 180mm]; }+ </Part>+ }+ <Part shelfLow = Panel<L:1000mm,W:700mm,H:35mm,R:16mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 200mm]; }+ </Part>+ <Part shelfHigh = Panel<L:1000mm,W:700mm,H:35mm,R:16mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 650mm]; }+ </Part>+ <Part handle = Panel<L:35mm,W:590mm,H:35mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [-420mm, 0mm, 980mm]; }+ </Part>+ <Part toteLow = Bin<L:600mm,W:400mm,H:270mm>> material: Polymer;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 235mm]; }+ </Part>+ <Part toteHigh = Bin<L:600mm,W:400mm,H:270mm>> material: Polymer;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 685mm]; }+ </Part>+ </Assembly>+ anchor: Cart;+}+Static rackFeet: Set<Foot> {+ nearLeft => Foot { x: -1200mm; y: -550mm; }+ nearRight => Foot { x: -1200mm; y: 550mm; }+ farLeft => Foot { x: 1200mm; y: -550mm; }+ farRight => Foot { x: 1200mm; y: 550mm; }+}+Linear Sites shelfLevels { keys: [low, middle, high]; start: [0mm, 0mm, 400mm]; step: [0mm, 0mm, 1050mm]; }+Subassembly StorageRack {+ <Assembly StorageRack>+ Pattern posts over rackFeet {+ foot => <Part post = Panel<L:80mm,W:80mm,H:3500mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [foot.x, foot.y, 0mm]; }+ </Part>+ }+ Pattern shelves over shelfLevels {+ site => <Part shelf = Panel<L:2480mm,W:1180mm,H:65mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Part>+ <Part beam = Panel<L:2480mm,W:90mm,H:130mm>> material: RobotSteel;+ Placement { from: Origin; to: World; translateLocal: [site.X, -550mm, site.Z]; }+ </Part>+ <Part leftBin = Bin<L:750mm,W:800mm,H:550mm>> material: Polymer;+ Placement { from: Origin; to: World; translateLocal: [-720mm, 0mm, site.Z + 65mm]; }+ </Part>+ <Part rightBin = Bin<L:750mm,W:800mm,H:550mm>> material: Polymer;+ Placement { from: Origin; to: World; translateLocal: [200mm, 0mm, site.Z + 65mm]; }+ </Part>+ }+ </Assembly>+ anchor: StorageRack;+}+Subassembly PalletBuffer {+ <Assembly PalletBuffer>+ <Part base = Panel<L:1200mm,W:1000mm,H:160mm,R:10mm>> material: BlackSteel;+ Placement { from: Origin; to: World; }+ </Part>+ <Part lower = Panel<L:1050mm,W:850mm,H:440mm,R:12mm>> material: Cardboard;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 160mm]; }+ </Part>+ <Part upper = Panel<L:1050mm,W:850mm,H:440mm,R:12mm>> material: Cardboard;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 600mm]; }+ </Part>+ <Part band = Panel<L:70mm,W:870mm,H:900mm>> material: PaintedSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 155mm]; }+ </Part>+ </Assembly>+ anchor: PalletBuffer;+}+Subassembly ControlCabinet {+ <Assembly ControlCabinet>+ <Part case = Panel<L:700mm,W:550mm,H:1700mm,R:15mm>> material: PaintedSteel;+ Placement { from: Origin; to: World; }+ </Part>+ <Part door = Panel<L:630mm,W:18mm,H:1500mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [0mm, -282mm, 100mm]; }+ </Part>+ <Part display = Panel<L:420mm,W:14mm,H:280mm,R:5mm>> material: Display;+ Placement { from: Origin; to: World; translateLocal: [0mm, -299mm, 1180mm]; }+ </Part>+ <Part pull = Panel<L:25mm,W:30mm,H:160mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [240mm, -300mm, 710mm]; }+ </Part>+ </Assembly>+ anchor: ControlCabinet;+}diff --git a/fixtures/Canonical/Scene/FactoryX0/logistics.firmament b/fixtures/Canonical/Scene/FactoryX0/logistics.firmamentnew file mode 100644index 00000000..d55ac761--- /dev/null+++ b/fixtures/Canonical/Scene/FactoryX0/logistics.firmament@@ -0,0 +1,18 @@+include "kit.firmament";+Linear Sites rackSites { keys: [bay01, bay02, bay03, bay04, bay05]; start: [0mm, 0mm, 0mm]; step: [2700mm, 0mm, 0mm]; }+Linear Sites stagingSites { keys: [s01, s02, s03, s04]; start: [1200mm, -2600mm, 0mm]; step: [2700mm, 0mm, 0mm]; }+Assembly Logistics {+ <Assembly Logistics>+ Pattern racks over rackSites {+ site => <Assembly rack = StorageRack>+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ Pattern staging over stagingSites {+ site => <Assembly pallet = PalletBuffer>+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ </Assembly>+ anchor: Logistics;+}diff --git a/fixtures/Canonical/Scene/FactoryX0/packout.firmament b/fixtures/Canonical/Scene/FactoryX0/packout.firmamentnew file mode 100644index 00000000..ae6a8e45--- /dev/null+++ b/fixtures/Canonical/Scene/FactoryX0/packout.firmament@@ -0,0 +1,27 @@+include "kit.firmament";+Linear Sites packSites { keys: [p01, p02, p03]; start: [0mm, 0mm, 0mm]; step: [2000mm, 0mm, 0mm]; }+Linear Sites cartons { keys: [c01, c02, c03, c04]; start: [-600mm, 0mm, 945mm]; step: [1400mm, 0mm, 0mm]; }+Assembly Packout {+ <Assembly Packout>+ Pattern conveyors over packSites {+ site => <Assembly segment = ConveyorStraight>+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ Pattern outputs over cartons {+ site => <Part box = Panel<L:650mm,W:450mm,H:450mm,R:10mm>> material: Cardboard;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Part>+ }+ <Assembly sealer = MachineBox>+ Placement { from: Origin; to: World; translateLocal: [2000mm, 1450mm, 0mm]; }+ </Assembly>+ <Assembly bench = InspectionBench>+ Placement { from: Origin; to: World; translateLocal: [0mm, -1500mm, 0mm]; }+ </Assembly>+ <Assembly pallet = PalletBuffer>+ Placement { from: Origin; to: World; translateLocal: [5000mm, -1500mm, 0mm]; }+ </Assembly>+ </Assembly>+ anchor: Packout;+}diff --git a/fixtures/Canonical/Scene/FactoryX0/production-line.firmament b/fixtures/Canonical/Scene/FactoryX0/production-line.firmamentnew file mode 100644index 00000000..4ccf97f2--- /dev/null+++ b/fixtures/Canonical/Scene/FactoryX0/production-line.firmament@@ -0,0 +1,33 @@+include "kit.firmament";+Linear Sites conveyorSites { keys: [infeed, s02, s03, s04, s05, s06, s07, outfeed]; start: [0mm, 0mm, 0mm]; step: [2000mm, 0mm, 0mm]; }+Linear Sites machineSites { keys: [form, assemble, inspect, finish]; start: [1000mm, 1450mm, 0mm]; step: [4000mm, 0mm, 0mm]; }+Linear Sites workSites { keys: [input, inspection, output]; start: [0mm, -1500mm, 0mm]; step: [6000mm, 0mm, 0mm]; }+Linear Sites traySites { keys: [t01, t02, t03, t04, t05, t06, t07]; start: [0mm, 0mm, 945mm]; step: [2000mm, 0mm, 0mm]; }+Assembly ProductionLine {+ <Assembly ProductionLine>+ Pattern conveyor over conveyorSites {+ site => <Assembly segment = ConveyorStraight>+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ Pattern machines over machineSites {+ site => <Assembly process = MachineBox>+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ Pattern benches over workSites {+ site => <Assembly station = InspectionBench>+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Assembly>+ }+ Pattern trays over traySites {+ site => <Part tote = Bin<L:550mm,W:400mm,H:160mm>> material: Polymer;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Part>+ }+ <Assembly controls = ControlCabinet>+ Placement { from: Origin; to: World; translateLocal: [14500mm, 1450mm, 0mm]; }+ </Assembly>+ </Assembly>+ anchor: ProductionLine;+}diff --git a/fixtures/Canonical/Scene/FactoryX0/robot-island.firmament b/fixtures/Canonical/Scene/FactoryX0/robot-island.firmamentnew file mode 100644index 00000000..be354060--- /dev/null+++ b/fixtures/Canonical/Scene/FactoryX0/robot-island.firmament@@ -0,0 +1,64 @@+include "kit.firmament";+// Static original manipulator silhouette. Connected links; no control or IK claim.+Linear Sites fencePosts { keys: [p01, p02, p03, p04]; start: [-1400mm, 1300mm, 0mm]; step: [1000mm, 0mm, 0mm]; }+Linear Sites guardBars { keys: [b01, b02, b03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20]; start: [-1300mm, 1300mm, 250mm]; step: [150mm, 0mm, 0mm]; }+Assembly RobotIsland {+ <Assembly RobotIsland>+ <Part platform = Panel<L:3600mm,W:2800mm,H:30mm,R:30mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [300mm, 0mm, 0mm]; }+ </Part>+ <Part pedestal = Panel<L:700mm,W:650mm,H:1000mm,R:40mm>> material: PaintedSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 30mm]; }+ </Part>+ <Part turntable = Drum<R:270mm,H:130mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, 0mm, 1030mm]; }+ </Part>+ <Part shoulder = Drum<R:165mm,H:360mm>> material: RobotSteel;+ Placement { from: Origin; to: World; translateLocal: [0mm, 180mm, 1200mm]; rotateLocal: { axis: X; angle: 90deg; } }+ </Part>+ <Part upperArm = Panel<L:1050mm,W:230mm,H:210mm,R:55mm>> material: RobotSteel;+ Placement { from: Origin; to: World; translateLocal: [300mm, 0mm, 1630mm]; rotateLocal: { axis: Y; angle: -55deg; } }+ </Part>+ <Part elbow = Drum<R:155mm,H:320mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [600mm, 160mm, 2060mm]; rotateLocal: { axis: X; angle: 90deg; } }+ </Part>+ <Part forearm = Panel<L:1000mm,W:180mm,H:160mm,R:40mm>> material: PaintedSteel;+ Placement { from: Origin; to: World; translateLocal: [1010mm, 0mm, 1773mm]; rotateLocal: { axis: Y; angle: 35deg; } }+ </Part>+ <Part wrist = Drum<R:125mm,H:230mm>> material: RobotSteel;+ Placement { from: Origin; to: World; translateLocal: [1420mm, 0mm, 1290mm]; }+ </Part>+ <Part gripper = Panel<L:320mm,W:260mm,H:100mm,R:25mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [1420mm, 0mm, 1190mm]; }+ </Part>+ <Part fingerNear = Panel<L:50mm,W:50mm,H:180mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [1420mm, -105mm, 1010mm]; }+ </Part>+ <Part fingerFar = Panel<L:50mm,W:50mm,H:180mm>> material: Aluminium;+ Placement { from: Origin; to: World; translateLocal: [1420mm, 105mm, 1010mm]; }+ </Part>+ <Assembly transfer = ConveyorStraight>+ Placement { from: Origin; to: World; translateLocal: [1300mm, -150mm, 30mm]; rotateLocal: { axis: Z; angle: 90deg; } }+ </Assembly>+ Pattern guarding over fencePosts {+ site => <Part post = Panel<L:60mm,W:60mm,H:1900mm>> material: SafetySteel;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Part>+ }+ Pattern bars over guardBars {+ site => <Part bar = Panel<L:14mm,W:20mm,H:1500mm>> material: BlackSteel;+ Placement { from: Origin; to: World; translateLocal: [site.X, site.Y, site.Z]; }+ </Part>+ }+ <Part guardTop = Panel<L:3060mm,W:60mm,H:60mm>> material: SafetySteel;+ Placement { from: Origin; to: World; translateLocal: [100mm, 1300mm, 1800mm]; }+ </Part>+ <Part guardBottom = Panel<L:3060mm,W:60mm,H:60mm>> material: SafetySteel;+ Placement { from: Origin; to: World; translateLocal: [100mm, 1300mm, 190mm]; }+ </Part>+ <Assembly controls = ControlCabinet>+ Placement { from: Origin; to: World; translateLocal: [-1100mm, -900mm, 30mm]; }+ </Assembly>+ </Assembly>+ anchor: RobotIsland;+}diff --git a/scripts/audit-cir-display-x1.mjs b/scripts/audit-cir-display-x1.mjsnew file mode 100644index 00000000..625fe8e4--- /dev/null+++ b/scripts/audit-cir-display-x1.mjs@@ -0,0 +1,62 @@+// CPU compatibility evidence for X1. This does not qualify a GPU render path.+// Uses the installed Three implementation, including private parsers for diagnosis+// only. No production code may depend on those private APIs.+import { readFile, mkdir, writeFile } from 'node:fs/promises';+import { resolve, dirname, join } from 'node:path';+import { fileURLToPath, pathToFileURL } from 'node:url';++const repo = resolve(dirname(fileURLToPath(import.meta.url)), '..');+const [heliosRoot, fragmentPath] = process.argv.slice(2);+if (!heliosRoot || !fragmentPath) {+ throw new Error('Usage: node scripts/audit-cir-display-x1.mjs <HeliosCAD root> <X0 fragment.wgsl>');+}+const threeRoot = join(repo, 'aetheris.client', 'node_modules', 'three');+const load = relative => import(pathToFileURL(join(threeRoot, relative)).href);+const [{ ShaderMaterial, MeshStandardMaterial, LineBasicMaterial },+ { default: StandardNodeLibrary }, { default: WGSLNodeFunction }, { LineMaterial }] = await Promise.all([+ load('build/three.module.js'),+ load('src/renderers/webgpu/nodes/StandardNodeLibrary.js'),+ load('src/renderers/webgpu/nodes/WGSLNodeFunction.js'),+ import(pathToFileURL(join(repo, 'aetheris.client/node_modules/@react-three/drei/node_modules/three-stdlib/lines/LineMaterial.js')).href),+]);+const library = new StandardNodeLibrary();+const materials = [new MeshStandardMaterial(), new LineBasicMaterial(), new ShaderMaterial(), new LineMaterial()];+const materialResults = materials.map(material => {+ const converted = library.fromMaterial(material);+ const result = { type: material.type, convertedType: converted?.type ?? null };+ material.dispose();+ converted?.dispose();+ return result;+});+let moduleParseError = null;+try { new WGSLNodeFunction(await readFile(resolve(fragmentPath), 'utf8')); }+catch (error) { moduleParseError = error.message; }+// A control distinguishes an incompatible module from a broken import/parser.+const functionControl = new WGSLNodeFunction('fn identity(value: f32) -> f32 { return value; }');+const [cadmata, background, helios, sdk, runtime, threePackage] = await Promise.all([+ readFile(join(repo, 'aetheris.client/src/viewer/AetherisViewport.tsx'), 'utf8'),+ readFile(join(repo, 'aetheris.client/src/viewer/ThemeBackground.tsx'), 'utf8'),+ readFile(join(resolve(heliosRoot), 'src/viewport/Viewport.tsx'), 'utf8'),+ readFile(join(repo, 'Aetheris.Web.Runtime/sdk/src/index.d.ts'), 'utf8'),+ readFile(join(repo, 'Aetheris.Web.Runtime/Aetheris.Web.Runtime.csproj'), 'utf8'),+ readFile(join(threeRoot, 'package.json'), 'utf8'),+]);+const report = {+ qualification: 'CPU compatibility audit only; no product GPU rendering qualified',+ threeVersion: JSON.parse(threePackage).version,+ materialResults,+ compiledModule: { path: resolve(fragmentPath), moduleParseError, functionControl: functionControl.name },+ hosts: {+ cadmata: { defaultCanvas: /<Canvas[\s\S]*?gl=\{\{ alpha: false, antialias: true \}\}/.test(cadmata),+ shaderBackground: /new ShaderMaterial\(/.test(background), thickLines: /<Line\b/.test(cadmata) },+ helios: { path: resolve(heliosRoot), webgl: /new THREE.WebGLRenderer\(/.test(helios),+ semanticEdges: /describeEdgeSelection/.test(helios) && /definitionEdges/.test(helios) },+ sdk: { browserWasm: /<RuntimeIdentifier>browser-wasm<\/RuntimeIdentifier>/.test(runtime),+ displayMesh: /readonly mesh: DisplayMesh/.test(sdk),+ cirProgram: /VertexWgsl|FragmentWgsl|cirProgram|CirDisplay/.test(sdk) },+ },+};+const output = join(repo, 'artifacts/local/cir-display-x1');+await mkdir(output, { recursive: true });+await writeFile(join(output, 'compatibility-audit.json'), JSON.stringify(report, null, 2) + '\n');+console.log(JSON.stringify(report, null, 2));diff --git a/scripts/check-factory-powerpoint.ps1 b/scripts/check-factory-powerpoint.ps1new file mode 100644index 00000000..d44ebcff--- /dev/null+++ b/scripts/check-factory-powerpoint.ps1@@ -0,0 +1,55 @@+[CmdletBinding()]+param([string]$OutDir = 'artifacts/local/factory-scene-x0')+$ErrorActionPreference = 'Stop'+# Native PowerPoint automation over this task's files only. It closes only the+# presentations opened here and preserves any unrelated existing PowerPoint work.+# API: https://learn.microsoft.com/en-us/office/vba/api/powerpoint.model3dformat+$out = [IO.Path]::GetFullPath($OutDir)+$app = New-Object -ComObject PowerPoint.Application+$presentation = $null+try {+ $presentation = $app.Presentations.Open("$out/factory.pptx",0,0,0)+ if ($presentation.Slides.Count -ne 2) { throw 'Expected two native slides.' }+ $rotations = @()+ for ($i=1; $i -le 2; $i++) {+ $slide = $presentation.Slides.Item($i)+ $models = @($slide.Shapes | Where-Object { $_.Type -eq 30 })+ if ($models.Count -ne 1) { throw "Slide $i did not load exactly one native 3D model." }+ $model = $models[0].Model3D+ $slide.Export("$out/powerpoint-slide-$i.png",'PNG',1600,900)+ $before = (Get-FileHash -LiteralPath "$out/powerpoint-slide-$i.png").Hash+ $model.IncrementRotationX(15)+ $model.IncrementRotationY(25)+ $slide.Export("$out/powerpoint-rotated-$i.png",'PNG',1600,900)+ $after = (Get-FileHash -LiteralPath "$out/powerpoint-rotated-$i.png").Hash+ if ($before -eq $after) { throw "Slide $i did not visibly change after native model rotation." }+ $rotations += [pscustomobject]@{slide=$i; x=$model.RotationX; y=$model.RotationY; z=$model.RotationZ; changedRender=$true}+ }+ $presentation.SaveAs("$out/factory-office-roundtrip.pptx",24)+ $presentation.Close()+ $presentation = $app.Presentations.Open("$out/factory-office-roundtrip.pptx",0,0,0)+ foreach ($r in $rotations) {+ $slide = $presentation.Slides.Item($r.slide)+ $models = @($slide.Shapes | Where-Object { $_.Type -eq 30 })+ if ($models.Count -ne 1) { throw 'Native model was lost on reopen.' }+ $model = $models[0].Model3D+ if ([Math]::Abs($model.RotationX-$r.x) -gt .01 -or [Math]::Abs($model.RotationY-$r.y) -gt .01) {+ throw 'Native rotation was lost on save/reopen.'+ }+ $model.IncrementRotationX(-10)+ $slide.Export("$out/powerpoint-reopened-$($r.slide).png",'PNG',1600,900)+ if ((Get-FileHash -LiteralPath "$out/powerpoint-reopened-$($r.slide).png").Hash -eq+ (Get-FileHash -LiteralPath "$out/powerpoint-rotated-$($r.slide).png").Hash) {+ throw 'Repeat rotation after reopen did not change native rendering.'+ }+ }+ [pscustomobject]@{ application='Microsoft PowerPoint'; version=$app.Version; slides=2; nativeModels=2;+ rotationChangedRendering=$true; savedClosedReopened=$true; rotationsPreserved=$true; rotatedAgainAfterReopen=$true;+ interaction='COM Model3D rotation and native slide rendering, not a mouse/UI test'; rotations=$rotations } |+ ConvertTo-Json -Depth 6 | Set-Content -LiteralPath "$out/powerpoint-native-validation.json" -Encoding utf8+ Write-Output 'Native PowerPoint model load, rotation, save/reopen and repeat rotation passed.'+}+finally {+ if ($null -ne $presentation) { $presentation.Close() }+ [Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) | Out-Null+}diff --git a/scripts/cir-display-x0-witness.html b/scripts/cir-display-x0-witness.htmlnew file mode 100644index 00000000..63f8d165--- /dev/null+++ b/scripts/cir-display-x0-witness.html@@ -0,0 +1,93 @@+<!doctype html>+<html lang="en">+<meta charset="utf-8">+<title>CIR DISPLAY X0 — shader bridge qualification</title>+<style>+ body { background: #152029; color: #ecede9; font: 16px system-ui; margin: 30px; }+ main { display: flex; flex-wrap: wrap; gap: 20px; }+ canvas { width: 256px; height: 256px; border: 1px solid #58727f; }+ h2 { font-size: 18px; }+ pre { white-space: pre-wrap; font-size: 13px; }+</style>+<h1>CIR GPU evaluation</h1>+<p>Authored CIR → Visual TypeScript → VD-MIR → HLSL → DXC → SPIR-V → Naga → WGSL.</p>+<p>Bounded compiler/GPU witness. Cadmata integration and comparison witnesses remain unqualified.</p>+<main></main>+<pre id="status">Requesting WebGPU…</pre>+<script type="module">+ const status = document.querySelector('#status');+ try {+ if (!navigator.gpu) throw new Error('WebGPU is unavailable.');+ const adapter = await navigator.gpu.requestAdapter();+ if (!adapter) throw new Error('No WebGPU adapter.');+ const device = await adapter.requestDevice();+ const programs = await (await fetch('programs.json')).json();+ const vertices = new Float32Array([-1, -1, 0, 1, -1, 0, -1, 1, 0, -1, 1, 0, 1, -1, 0, 1, 1, 0]);+ const vertexBuffer = device.createBuffer({ size: vertices.byteLength, usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST });+ device.queue.writeBuffer(vertexBuffer, 0, vertices);+ const results = [];+ for (const [name, program] of Object.entries(programs)) {+ const section = document.createElement('section');+ const heading = document.createElement('h2');+ heading.textContent = name;+ const canvas = document.createElement('canvas');+ canvas.width = canvas.height = 256;+ section.append(heading, canvas);+ document.querySelector('main').append(section);+ const context = canvas.getContext('webgpu');+ const format = navigator.gpu.getPreferredCanvasFormat();+ context.configure({ device, format, usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC });+ const vertex = device.createShaderModule({ code: program.Vertex });+ const fragment = device.createShaderModule({ code: program.Fragment });+ for (const module of [vertex, fragment]) {+ const info = await module.getCompilationInfo();+ const errors = info.messages.filter(message => message.type === 'error');+ if (errors.length) throw new Error(name + ': ' + errors.map(error => error.message).join('\n'));+ }+ device.pushErrorScope('validation');+ const start = performance.now();+ const pipeline = await device.createRenderPipelineAsync({+ layout: 'auto',+ vertex: { module: vertex, entryPoint: 'VertexMain', buffers: [{ arrayStride: 12, attributes: [{ shaderLocation: 0, offset: 0, format: 'float32x3' }] }] },+ fragment: { module: fragment, entryPoint: 'PixelMain', targets: [{ format }] },+ primitive: { topology: 'triangle-list' },+ depthStencil: { format: 'depth32float', depthWriteEnabled: true, depthCompare: 'less' },+ });+ const depth = device.createTexture({ size: [256, 256], format: 'depth32float', usage: GPUTextureUsage.RENDER_ATTACHMENT });+ const target = context.getCurrentTexture();+ const readback = device.createBuffer({ size: 256 * 256 * 4, usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ });+ const encoder = device.createCommandEncoder();+ const pass = encoder.beginRenderPass({+ colorAttachments: [{ view: target.createView(), clearValue: [0, 0, 0, 1], loadOp: 'clear', storeOp: 'store' }],+ depthStencilAttachment: { view: depth.createView(), depthClearValue: 1, depthLoadOp: 'clear', depthStoreOp: 'store' },+ });+ pass.setPipeline(pipeline);+ pass.setVertexBuffer(0, vertexBuffer);+ pass.draw(6);+ pass.end();+ encoder.copyTextureToBuffer({ texture: target }, { buffer: readback, bytesPerRow: 1024 }, [256, 256]);+ device.queue.submit([encoder.finish()]);+ await readback.mapAsync(GPUMapMode.READ);+ const pixels = new Uint8Array(readback.getMappedRange());+ let hitPixels = 0;+ for (let index = 0; index < pixels.length; index += 4) {+ if (pixels[index] + pixels[index + 1] + pixels[index + 2] > 0) hitPixels++;+ }+ readback.unmap();+ readback.destroy();+ depth.destroy();+ const error = await device.popErrorScope();+ if (error) throw new Error(name + ': ' + error.message);+ if (hitPixels < 1000 || hitPixels > 60000) throw new Error(name + ': invalid surface coverage ' + hitPixels);+ results.push({ name, hitPixels, compileDrawReadbackMs: performance.now() - start, structuralHash: program.StructuralHash });+ }+ vertexBuffer.destroy();+ const report = { status: 'PASS', browser: navigator.userAgent, gpu: { vendor: adapter.info.vendor, architecture: adapter.info.architecture, description: adapter.info.description }, results };+ globalThis.cirQualification = report;+ status.textContent = JSON.stringify(report, null, 2);+ } catch (error) {+ globalThis.cirQualification = { status: 'FAIL', error: String(error) };+ status.textContent = JSON.stringify(globalThis.cirQualification, null, 2);+ }+</script>+</html>diff --git a/scripts/display-host-x0-attachment-probe.html b/scripts/display-host-x0-attachment-probe.htmlnew file mode 100644index 00000000..bd6aab05--- /dev/null+++ b/scripts/display-host-x0-attachment-probe.html@@ -0,0 +1,14 @@+<!doctype html>+<meta charset="utf-8">+<title>DISPLAY-HOST-X0 attachment qualification</title>+<script type="importmap">{"imports":{"three":"/aetheris.client/node_modules/three/build/three.core.js","three/webgpu":"/aetheris.client/node_modules/three/build/three.webgpu.js","three/tsl":"/aetheris.client/node_modules/three/build/three.tsl.js"}}</script>+<pre id="report">Running attachment qualification...</pre>+<script type="module">+import { probeExternalAttachments } from './display-host-x0-attachment-probe.js';+try {+ window.displayHostProbe = await probeExternalAttachments(new URLSearchParams(location.search).has('ownedDepth'));+} catch (error) {+ window.displayHostProbe = { status: 'BLOCKED', setupException: String(error) };+}+document.querySelector('#report').textContent = JSON.stringify(window.displayHostProbe, null, 2);+</script>diff --git a/scripts/display-host-x0-attachment-probe.js b/scripts/display-host-x0-attachment-probe.jsnew file mode 100644index 00000000..0cd43537--- /dev/null+++ b/scripts/display-host-x0-attachment-probe.js@@ -0,0 +1,57 @@+import * as THREE from 'three/webgpu';++// Diagnostic only. No SDK export or product migration is claimed by this probe.+export async function probeExternalAttachments(probeOwnedDepth) {+ const result = { revision: THREE.REVISION, probeOwnedDepth, errors: [], scopes: [] };+ if (!navigator.gpu) throw new Error('DISPLAY_WEBGPU_UNAVAILABLE');+ const adapter = await navigator.gpu.requestAdapter();+ if (!adapter) throw new Error('DISPLAY_WEBGPU_NO_ADAPTER');+ const device = await adapter.requestDevice();+ device.addEventListener('uncapturederror', event => result.errors.push(event.error.message));+ const renderer = new THREE.WebGPURenderer({ device, antialias: false });+ const targets = [], textures = [];+ const geometry = new THREE.SphereGeometry(1, 24, 16);+ const material = new THREE.MeshStandardMaterial({ color: 0x90bba0, roughness: 0.6, metalness: 0.1 });+ try {+ await renderer.init();+ const scene = new THREE.Scene(); scene.background = new THREE.Color(0x18221c);+ const camera = new THREE.PerspectiveCamera(45, 1, 0.1, 100); camera.position.z = 5;+ scene.add(new THREE.Mesh(geometry, material), new THREE.HemisphereLight(0xffffff, 0x303030, 3));+ const control = new THREE.RenderTarget(256, 256, { depthTexture: new THREE.DepthTexture(256, 256, THREE.FloatType) });+ targets.push(control);+ const run = async target => {+ device.pushErrorScope('validation');+ let exception = null;+ renderer.setRenderTarget(target);+ try { renderer.render(scene, camera); }+ catch (error) { exception = String(error); }+ finally { renderer.setRenderTarget(null); }+ await device.queue.onSubmittedWorkDone();+ const validation = (await device.popErrorScope())?.message ?? null;+ return { exception, validation };+ };+ result.control = await run(control);+ const external = (format, threeFormat, type) => {+ const gpu = device.createTexture({ size: [256, 256], format,+ usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC });+ textures.push(gpu);+ const texture = new THREE.ExternalTexture(gpu);+ texture.image = { width: 256, height: 256, depth: 1 };+ texture.format = threeFormat; texture.type = type;+ return texture;+ };+ const color = external('rgba8unorm', THREE.RGBAFormat, THREE.UnsignedByteType);+ const depth = probeOwnedDepth ? new THREE.DepthTexture(256, 256, THREE.FloatType)+ : external('depth32float', THREE.DepthFormat, THREE.FloatType);+ const target = new THREE.RenderTarget(256, 256, { depthTexture: depth });+ target.texture = color; targets.push(target);+ result.external = await run(target);+ result.status = result.external.exception || result.external.validation || result.errors.length ? 'BLOCKED' : 'PASS';+ return result;+ } finally {+ for (const target of targets) target.dispose();+ // r183 forwards external disposal; r186 leaves ownership to the application.+ for (const texture of textures) texture.destroy();+ geometry.dispose(); material.dispose(); renderer.dispose(); device.destroy();+ }+}diff --git a/scripts/measure-factory-scene-x0.cs b/scripts/measure-factory-scene-x0.csnew file mode 100644index 00000000..694b531b--- /dev/null+++ b/scripts/measure-factory-scene-x0.cs@@ -0,0 +1,53 @@+#:project ../Aetheris.Kernel.Firmament/Aetheris.Kernel.Firmament.csproj+#:property PublishAot=false+#:property JsonSerializerIsReflectionEnabledByDefault=true+using System.Diagnostics;+using System.Security.Cryptography;+using System.Text.Json;+using Aetheris.Kernel.Firmament.Scene;++// Evidence orchestration only. Reviewed Firmament is the authoring authority.+var path = Path.GetFullPath(args.Length > 0 ? args[0] : "fixtures/Canonical/Scene/FactoryX0/factory.firmament");+var output = Path.GetFullPath(args.Length > 1 ? args[1] : "artifacts/local/factory-scene-x0");+Directory.CreateDirectory(output);+var source = File.ReadAllText(path);+var records = new List<object>();+using var retained = new FirmamentSceneSession();+CompiledScene Measure(string name,string text,bool requireReuse = false)+{+ var watch = Stopwatch.StartNew();+ var compiled = retained.Compile(text,path);+ var ms = watch.Elapsed.TotalMilliseconds;+ if (!compiled.IsSuccess) throw new InvalidOperationException(string.Join("\n",compiled.Diagnostics));+ var scene = compiled.Scene!;+ if (requireReuse && (scene.Performance.RebuiltEngineeringDefinitions != 0 ||+ scene.Performance.ReusedEngineeringDefinitions != scene.Performance.UniqueEngineeringDefinitions))+ throw new InvalidOperationException(name + " rebuilt geometry.");+ records.Add(new { name, milliseconds=ms, scene.Performance });+ return scene;+}+var cold = Measure("cold-session",source);+Measure("retained-unchanged",source,true);+foreach (var (name,before,after) in new[] {+ ("camera-only","[32m, 3.5m, 4.5m]","[31.5m, 3.5m, 4.5m]"),+ ("layout-pitch-only","step: [0mm, 7000mm, 0mm]","step: [0mm, 7100mm, 0mm]"),+ ("appearance-only","color: [.43, .49, .53]","color: [.45, .5, .54]") })+{+ if (!source.Contains(before,StringComparison.Ordinal)) throw new InvalidOperationException("Missing edit specimen: "+name);+ var edited = Measure(name,source.Replace(before,after,StringComparison.Ordinal),true);+ foreach (var d in cold.Display.Definitions)+ {+ var same = edited.Display.Definitions.Single(v => v.Id == d.Id);+ if (!d.Positions.SequenceEqual(same.Positions) || !d.Indices.SequenceEqual(same.Indices))+ throw new InvalidOperationException(name + " changed geometry.");+ }+}+var formatted = Aetheris.Kernel.Firmament.FirmamentV2.FirmamentLanguageAnalysisService.Format(source,path,"1").Text;+if (formatted != source) throw new InvalidOperationException("Factory source needs preferred-spelling cleanup.");+var report = new { milestone="FACTORY-SCENE-X0", builds=records,+ displayDefinitions=cold.Display.Definitions.Count, displayNodes=cold.Display.Occurrences.Count,+ meshOccurrences=cold.Display.Occurrences.Count(o => o.DefinitionId is not null),+ sources=Directory.GetFiles(Path.GetDirectoryName(path)!,"*.firmament").OrderBy(p => p,StringComparer.Ordinal)+ .Select(p => new { file=Path.GetFileName(p),sha256=Convert.ToHexString(SHA256.HashData(File.ReadAllBytes(p))) }).ToArray() };+File.WriteAllText(Path.Combine(output,"timings.json"),JsonSerializer.Serialize(report,new JsonSerializerOptions { WriteIndented=true })+"\n");+Console.WriteLine(JsonSerializer.Serialize(report));diff --git a/scripts/prepare-display-host-x0-probe.ps1 b/scripts/prepare-display-host-x0-probe.ps1new file mode 100644index 00000000..98e6722d--- /dev/null+++ b/scripts/prepare-display-host-x0-probe.ps1@@ -0,0 +1,20 @@+param([Parameter(Mandatory = $true)][string]$HeliosRoot)+$ErrorActionPreference = 'Stop'+$repo = Split-Path $PSScriptRoot -Parent+$helios = (Resolve-Path -LiteralPath $HeliosRoot).Path+$output = Join-Path $repo 'artifacts/local/display-host-x0'+$threeOutput = Join-Path $output 'helios-three'+New-Item -ItemType Directory -Force $threeOutput | Out-Null+foreach ($name in @('three.core.js', 'three.webgpu.js', 'three.tsl.js')) {+ Copy-Item -LiteralPath (Join-Path $helios "node_modules/three/build/$name") -Destination $threeOutput+}+$html = Get-Content -LiteralPath (Join-Path $PSScriptRoot 'display-host-x0-attachment-probe.html') -Raw+$html = $html.Replace('/aetheris.client/node_modules/three/build/', '/artifacts/local/display-host-x0/helios-three/')+$html = $html.Replace("'./display-host-x0-attachment-probe.js'", "'/scripts/display-host-x0-attachment-probe.js'")+Set-Content -LiteralPath (Join-Path $output 'helios-probe.html') -Value $html -Encoding utf8+$cadmataPackage = Get-Content -LiteralPath (Join-Path $repo 'aetheris.client/node_modules/three/package.json') -Raw | ConvertFrom-Json+$heliosPackage = Get-Content -LiteralPath (Join-Path $helios 'node_modules/three/package.json') -Raw | ConvertFrom-Json+@{ cadmataThree = $cadmataPackage.version; heliosThree = $heliosPackage.version; heliosRoot = $helios } |+ ConvertTo-Json | Set-Content -LiteralPath (Join-Path $output 'dependencies.json') -Encoding utf8+Write-Output 'Serve the repository root on localhost, then open /scripts/display-host-x0-attachment-probe.html and /artifacts/local/display-host-x0/helios-probe.html.'+Write-Output 'Repeat each with ?ownedDepth to isolate external color. Three-owned attachment controls run in every page.'diff --git a/scripts/qualify-cir-display-x0.cs b/scripts/qualify-cir-display-x0.csnew file mode 100644index 00000000..b182edf7--- /dev/null+++ b/scripts/qualify-cir-display-x0.cs@@ -0,0 +1,89 @@+using System.Diagnostics;+using System.Text.Json;+using Aetheris.Continuum.Backends.Sdf;+using Aetheris.Kernel.Core.Math;+using Aurelian.Shaders.Graphics;+using Copeland.TS.Gpu;+using Copeland.TS.Gpu.VdMir;++string output = args[0];+string naga = args[1];+var definitions = new Dictionary<string, SdfNode>+{+ ["Sphere"] = new SdfSphereNode(1),+ ["Cylinder"] = new SdfCylinderNode(0.8, 2),+ ["Cone"] = new SdfConeNode(1, 0.2, 2),+ ["Torus"] = new SdfTorusNode(0.8, 0.25),+ ["CSG"] = new SdfSubtractNode(new SdfCylinderNode(0.8, 2),+ new SdfTransformNode(new SdfSphereNode(0.7), Transform3D.CreateTranslation(new Vector3D(0, 0, -0.8)))),+};+var programs = new Dictionary<string, object>();+foreach (var (name, root) in definitions)+{+ // Rotate the authored field, not a renderer-specific substitute primitive.+ var field = new SdfTransformNode(root, Transform3D.CreateRotationX(0.6) * Transform3D.CreateRotationY(0.3));+ var timer = Stopwatch.StartNew();+ var lowering = CirVisualTsLowerer.Lower(field);+ if (!lowering.Success) throw new InvalidOperationException(lowering.FallbackReason);+ double generationMs = timer.Elapsed.TotalMilliseconds;+ string source = lowering.Program!.FieldSource + "\n" + """+ @space(clip.position)+ type ClipPosition = float4;+ stream Input { @location(0) position: float3; }+ stream Varyings {+ @builtin(position) position: ClipPosition;+ @location(0) local: float3;+ }+ stream Output {+ @target(0) color: float4;+ @builtin(frag_depth) depth: f32;+ }+ @vertex+ function VertexMain(input: Input): Varyings {+ return { position: float4(input.position.x, input.position.y, 0.0, 1.0), local: input.position };+ }+ @pixel+ function PixelMain(input: Varyings): Output {+ var t: f32 = 0.0;+ for (var i: u32 = 0; i < 256; i = i + 1) {+ const x: f32 = input.local.x * 1.5;+ const y: f32 = input.local.y * 1.5;+ const z: f32 = -1.5 + t;+ const d: f32 = Field(x, y, z);+ if (Abs(d) < 0.00001) {+ const gx: f32 = Field(x + 0.0001, y, z) - Field(x - 0.0001, y, z);+ const gy: f32 = Field(x, y + 0.0001, z) - Field(x, y - 0.0001, z);+ const gz: f32 = Field(x, y, z + 0.0001) - Field(x, y, z - 0.0001);+ const length: f32 = Max(Sqrt(gx * gx + gy * gy + gz * gz), 0.00000001);+ const light: f32 = 0.2 + 0.8 * Max((gx * 0.3 + gy * 0.4 - gz * 0.866) / length, 0.0);+ return { color: float4(light * 0.8, light * 0.6, light * 0.25, 1.0), depth: t / 3.0 };+ }+ t = t + Abs(d) * 0.9;+ if (t > 3.0) { break; }+ }+ Discard();+ return { color: float4(0.0, 0.0, 0.0, 1.0), depth: 1.0 };+ }+ """;+ var module = GpuGraphicsBinder.Compile(new GpuCompilationRequest([new GpuSourceFile(name + ".v.ts", source)]));+ if (!module.Success) throw new InvalidOperationException(string.Join("\n", module.Diagnostics.Select(item => item.Message)));+ var backend = VdMirGraphicsBackend.Compile(module, "vulkan1.1");+ var browser = WebGpuGraphicsBackend.Translate(module, backend, naga);+ File.WriteAllText(Path.Combine(output, name + ".v.ts"), source);+ File.WriteAllText(Path.Combine(output, name + ".hlsl"), backend.Hlsl);+ File.WriteAllText(Path.Combine(output, name + "-vertex.wgsl"), browser.VertexWgsl);+ File.WriteAllText(Path.Combine(output, name + "-fragment.wgsl"), browser.FragmentWgsl);+ programs[name] = new+ {+ lowering.Program.StructuralHash,+ Bounds = lowering.Program.Bounds,+ Vertex = browser.VertexWgsl,+ Fragment = browser.FragmentWgsl,+ generationMs,+ DxcMs = backend.Vertex.DxcMilliseconds + backend.Pixel.DxcMilliseconds,+ browser.TranslationMilliseconds,+ backend.DxcPath,+ };+ Console.WriteLine($"{name}: CIR -> Visual TS -> VD-MIR -> DXC -> validated WGSL");+}+File.WriteAllText(Path.Combine(output, "programs.json"), JsonSerializer.Serialize(programs, new JsonSerializerOptions { WriteIndented = true }));diff --git a/scripts/qualify-cir-display-x0.ps1 b/scripts/qualify-cir-display-x0.ps1new file mode 100644index 00000000..49ffcf66--- /dev/null+++ b/scripts/qualify-cir-display-x0.ps1@@ -0,0 +1,42 @@+param(+ [Parameter(Mandatory = $true)][string]$CopelandRoot,+ [Parameter(Mandatory = $true)][string]$NagaExecutable,+ [string]$OutputDirectory+)+$ErrorActionPreference = 'Stop'+$repository = Split-Path $PSScriptRoot -Parent+if (-not $OutputDirectory) {+ $OutputDirectory = Join-Path $repository 'artifacts/local/cir-display-x0'+}+$OutputDirectory = [IO.Path]::GetFullPath($OutputDirectory)+$CopelandRoot = [IO.Path]::GetFullPath($CopelandRoot)+$shaderProject = Join-Path $CopelandRoot 'src/Aurelian/Aurelian.Shaders/Aurelian.Shaders.csproj'+if (-not (Test-Path -LiteralPath $shaderProject)) {+ throw 'CopelandRoot must contain the real Aurelian.Shaders project.'+}+if (-not (Test-Path -LiteralPath $NagaExecutable)) {+ throw 'NagaExecutable must identify the installed Naga CLI.'+}+New-Item -ItemType Directory -Path $OutputDirectory -Force | Out-Null+$continuumProject = Join-Path $repository 'Aetheris.Continuum/Aetheris.Continuum.csproj'+$escapedShader = [Security.SecurityElement]::Escape($shaderProject)+$escapedContinuum = [Security.SecurityElement]::Escape($continuumProject)+$project = @"+<Project Sdk="Microsoft.NET.Sdk">+ <PropertyGroup>+ <OutputType>Exe</OutputType>+ <TargetFramework>net10.0</TargetFramework>+ <ImplicitUsings>enable</ImplicitUsings>+ <Nullable>enable</Nullable>+ </PropertyGroup>+ <ItemGroup>+ <ProjectReference Include="$escapedShader" />+ <ProjectReference Include="$escapedContinuum" />+ </ItemGroup>+</Project>+"@+Set-Content -LiteralPath (Join-Path $OutputDirectory 'Qualification.csproj') -Value $project -Encoding utf8+Copy-Item -LiteralPath (Join-Path $PSScriptRoot 'qualify-cir-display-x0.cs') -Destination (Join-Path $OutputDirectory 'Program.cs')+dotnet run --project (Join-Path $OutputDirectory 'Qualification.csproj') -c Release -- $OutputDirectory ([IO.Path]::GetFullPath($NagaExecutable))+if ($LASTEXITCODE -ne 0) { throw 'CIR shader qualification failed.' }+Copy-Item -LiteralPath (Join-Path $PSScriptRoot 'cir-display-x0-witness.html') -Destination (Join-Path $OutputDirectory 'index.html')diff --git a/scripts/qualify-factory-scene-x0.ps1 b/scripts/qualify-factory-scene-x0.ps1new file mode 100644index 00000000..17e3d4d1--- /dev/null+++ b/scripts/qualify-factory-scene-x0.ps1@@ -0,0 +1,47 @@+[CmdletBinding()]+param(+ [string]$OutDir = 'artifacts/local/factory-scene-x0',+ [string]$Blender = 'C:/Program Files/Blender Foundation/Blender 5.2/blender.exe',+ [string]$UsdRoot = 'artifacts/local/usd-x0/tools/openusd',+ [string]$GltfValidator = 'artifacts/local/presentation-3d-x0/tools/node_modules/gltf-validator'+)+$ErrorActionPreference = 'Stop'+$repoRoot = Split-Path -Parent $PSScriptRoot+$priorPath = $env:PATH+$priorPython = $env:PYTHONPATH+Push-Location $repoRoot+try {+ $out = [IO.Path]::GetFullPath($OutDir)+ $usd = [IO.Path]::GetFullPath($UsdRoot)+ foreach ($dependency in @($Blender,"$usd/bin/usdchecker.exe","$usd/python/python.exe",$GltfValidator)) {+ if (!(Test-Path -LiteralPath $dependency)) { throw "Missing qualification dependency: $dependency" }+ }+ New-Item -ItemType Directory -Force $out | Out-Null+ function Invoke-Logged([string]$Program,[string[]]$Arguments,[string]$Log) {+ & $Program @Arguments *> $Log+ if ($LASTEXITCODE -ne 0) { throw "Command failed ($LASTEXITCODE): $Program. See $Log" }+ }+ Invoke-Logged 'dotnet' @('build','Aetheris.CLI','-c','Release','-m:1','--nologo','-v:q') "$out/cli-build.log"+ $cli = 'Aetheris.CLI/bin/Release/net10.0/aetheris.dll'+ $source = 'fixtures/Canonical/Scene/FactoryX0/factory.firmament'+ Invoke-Logged 'dotnet' @($cli,'validate',$source,'--json') "$out/source-validation.json"+ Invoke-Logged 'dotnet' @($cli,'scene','inspect',$source,'--repeat','2','--json') "$out/inspection.json"+ Invoke-Logged 'dotnet' @('run','scripts/measure-factory-scene-x0.cs','-c','Release','--',$source,$out) "$out/retained.log"+ Invoke-Logged 'dotnet' @($cli,'scene','export-usd',$source,"$out/factory.usda",'--json') "$out/usd-export.json"+ Invoke-Logged 'dotnet' @($cli,'scene','export-glb',$source,"$out/factory-enclosed.glb",'--json') "$out/enclosed-export.json"+ Invoke-Logged 'dotnet' @($cli,'scene','export-glb',$source,"$out/factory.glb",'--hide-boundary','hall.ceiling','--hide-boundary','hall.southWall','--hide-boundary','hall.eastWall','--json') "$out/glb-export.json"+ Invoke-Logged 'node' @('scripts/validate-presentation-glb.cjs',$GltfValidator,"$out/factory.glb","$out/factory-enclosed.glb") "$out/glb-validator.log"+ $env:PATH = "$usd/python;$usd/bin;$usd/lib;$usd/plugin/usd;$env:PATH"+ $env:PYTHONPATH = "$usd/lib/python;$usd/pip-packages"+ Invoke-Logged "$usd/bin/usdchecker.exe" @("$out/factory.usda") "$out/usdchecker.log"+ Invoke-Logged $Blender @('--background','--python-exit-code','1','--python','scripts/render-factory-scene-x0.py','--',"$out/factory.glb",$out) "$out/render.log"+ $deck = Get-Content -Raw fixtures/Canonical/Scene/FactoryX0/factory-presentation.json | ConvertFrom-Json+ foreach ($slide in $deck.slides) { $slide.models[0].source = "$out/factory.glb" }+ $deck.slides[0].models[0].preview = "$out/hero.png"+ $deck.slides[1].models[0].preview = "$out/overview.png"+ $deck | ConvertTo-Json -Depth 20 | Set-Content -LiteralPath "$out/deck.json" -Encoding utf8+ Invoke-Logged 'dotnet' @($cli,'presentation','compile',"$out/deck.json","$out/factory.pptx",'--json') "$out/pptx-export.json"+ Invoke-Logged "$usd/python/python.exe" @('scripts/validate-factory-scene-x0.py',$out) "$out/external-validation.log"+ Write-Host "Factory artifacts validated: $out. Desktop PowerPoint interaction is a separate gate."+}+finally { $env:PATH = $priorPath; $env:PYTHONPATH = $priorPython; Pop-Location }diff --git a/scripts/render-factory-scene-x0.py b/scripts/render-factory-scene-x0.pynew file mode 100644index 00000000..53cf525a--- /dev/null+++ b/scripts/render-factory-scene-x0.py@@ -0,0 +1,127 @@+"""Render the real Scene GLB. No generated/replacement equipment or layout.++blender --background --python-exit-code 1 --python scripts/render-factory-scene-x0.py+ -- factory.glb artifacts/local/factory-scene-x0 [--preview] [--view Hero]+Renderer-only area lights derive from authored luminaire locations. Floor bump+is finish detail. Camera transforms and every product mesh remain unchanged.+"""+import argparse+import hashlib+import json+import math+import sys+import time+from pathlib import Path+import bpy+from mathutils import Vector++parser = argparse.ArgumentParser()+parser.add_argument('source', type=Path)+parser.add_argument('output', type=Path)+parser.add_argument('--preview', action='store_true')+parser.add_argument('--view', choices=['Hero', 'Overview', 'Line', 'Robot', 'Logistics'])+args = parser.parse_args(sys.argv[sys.argv.index('--') + 1:])+args.output.mkdir(parents=True, exist_ok=True)+started = time.perf_counter()+bpy.ops.wm.read_factory_settings(use_empty=True)+bpy.ops.import_scene.gltf(filepath=str(args.source.resolve()))+scene = bpy.context.scene+products = [o for o in scene.objects if o.type == 'MESH']+cameras = {o.name: o for o in scene.objects if o.type == 'CAMERA'}+assert len(cameras) == 5 and len(products) > 1000+assert all(o.matrix_world.determinant() > 0 and o.data.polygons for o in products)+points = [o.matrix_world @ Vector(c) for o in products for c in o.bound_box]+lo = [min(p[i] for p in points) for i in range(3)]+hi = [max(p[i] for p in points) for i in range(3)]+assert all(math.isfinite(v) for v in lo + hi)++def geometry_hash():+ result = hashlib.sha256()+ for obj in sorted(products, key=lambda o: o.name):+ result.update(obj.name.encode())+ result.update(str(tuple(tuple(row) for row in obj.matrix_world)).encode())+ for vertex in obj.data.vertices:+ result.update(str(tuple(vertex.co)).encode())+ for polygon in obj.data.polygons:+ result.update(str(tuple(polygon.vertices)).encode())+ return result.hexdigest()++before = geometry_hash()+for material in bpy.data.materials:+ if not material.use_nodes or material.name.split('.')[0] != 'concrete':+ continue+ nodes, links = material.node_tree.nodes, material.node_tree.links+ bsdf = next(n for n in nodes if n.type == 'BSDF_PRINCIPLED')+ noise = nodes.new('ShaderNodeTexNoise')+ noise.inputs['Scale'].default_value = 95+ noise.inputs['Detail'].default_value = 2+ bump = nodes.new('ShaderNodeBump')+ bump.inputs['Strength'].default_value = .1+ bump.inputs['Distance'].default_value = .00025+ links.new(noise.outputs['Fac'], bump.inputs['Height'])+ links.new(bump.outputs['Normal'], bsdf.inputs['Normal'])++def area(name, location, target, watts, size, color=(.91, .96, 1)):+ data = bpy.data.lights.new(name, 'AREA')+ data.energy, data.size, data.color = watts, size, color+ obj = bpy.data.objects.new(name, data)+ scene.collection.objects.link(obj)+ obj.location = location+ obj.rotation_euler = (Vector(target) - obj.location).to_track_quat('-Z', 'Y').to_euler()++for obj in products:+ if obj.name.endswith('.diffuser'):+ p = sum((obj.matrix_world @ Vector(c) for c in obj.bound_box), Vector()) / 8+ area('Luminaire illumination ' + obj.name, p - Vector((0, 0, .02)), p - Vector((0, 0, 1)), 350, 3)+area('Front soft daylight', (18, -2, 8), (18, 14, 0), 3000, 22)+area('North soft daylight', (20, 26, 5.8), (20, 12, 1), 2500, 18)+scene.world = bpy.data.worlds.new('Neutral industrial presentation')+scene.world.use_nodes = True+scene.world.node_tree.nodes['Background'].inputs['Color'].default_value = (.55, .67, .82, 1)+scene.world.node_tree.nodes['Background'].inputs['Strength'].default_value = .25+scene.render.engine = 'CYCLES'+scene.cycles.samples = 16 if args.preview else 32+scene.cycles.use_denoising = True+scene.cycles.use_adaptive_sampling = True+scene.cycles.adaptive_threshold = .08 if args.preview else .04+scene.cycles.time_limit = 60+scene.cycles.max_bounces = 6+device = 'CPU'+try:+ preferences = bpy.context.preferences.addons['cycles'].preferences+ preferences.compute_device_type = 'OPTIX'+ preferences.get_devices()+ for available in preferences.devices:+ available.use = available.type == 'OPTIX'+ if any(d.use for d in preferences.devices):+ scene.cycles.device = 'GPU'+ device = ', '.join(d.name for d in preferences.devices if d.use)+except Exception:+ pass+scene.render.resolution_x = 1200 if args.preview else 2560+scene.render.resolution_y = 675 if args.preview else 1440+scene.render.resolution_percentage = 100+scene.render.image_settings.file_format = 'PNG'+scene.view_settings.view_transform = 'AgX'+scene.view_settings.look = 'AgX - Medium High Contrast'+timings = {}+for name in ([args.view] if args.view else list(cameras)):+ scene.camera = cameras[name]+ scene.camera.data.clip_start, scene.camera.data.clip_end = .01, 250+ scene.render.filepath = str((args.output / (name.lower() + '.png')).resolve())+ timer = time.perf_counter()+ print('Rendering', name, device, scene.cycles.samples, 'samples', flush=True)+ bpy.ops.render.render(write_still=True)+ timings[name] = time.perf_counter() - timer+assert geometry_hash() == before, 'Renderer changed compiled geometry'+scene.camera = cameras['Hero']+bpy.ops.wm.save_as_mainfile(filepath=str((args.output / 'factory.blend').resolve()))+report = dict(tool='Blender', version=bpy.app.version_string, device=device,+ sourceSha256=hashlib.sha256(args.source.read_bytes()).hexdigest(),+ meshOccurrences=len(products), sharedMeshData=len({o.data.as_pointer() for o in products}),+ geometryUnchanged=True, geometryHash=before, boundsMetres=dict(min=lo, max=hi),+ cameras=list(cameras), renderSeconds=timings, totalSeconds=time.perf_counter() - started,+ maximumSamples=scene.cycles.samples, renderTimeLimitSeconds=scene.cycles.time_limit,+ presentationLights=len([o for o in scene.objects if o.type == 'LIGHT']))+(args.output / 'blender-validation.json').write_text(json.dumps(report, indent=2) + '\n')+print(json.dumps(report))diff --git a/scripts/validate-factory-scene-x0.py b/scripts/validate-factory-scene-x0.pynew file mode 100644index 00000000..40aeb506--- /dev/null+++ b/scripts/validate-factory-scene-x0.py@@ -0,0 +1,80 @@+"""Independent OpenUSD topology, appearance, bounds and PPTX media validation.+Run with the repository's OpenUSD Python environment after qualification exports.+"""+import hashlib+import json+import math+import sys+import xml.etree.ElementTree as ET+import zipfile+from pathlib import Path+from pxr import Usd, UsdGeom, UsdShade++output = Path(sys.argv[1] if len(sys.argv) > 1 else 'artifacts/local/factory-scene-x0').resolve()+stage = Usd.Stage.Open(str(output / 'factory.usda'))+assert stage and not stage.GetCompositionErrors()+assert UsdGeom.GetStageUpAxis(stage) == 'Z'+assert abs(UsdGeom.GetStageMetersPerUnit(stage) - .001) < 1e-12+prims = list(Usd.PrimRange.Stage(stage, Usd.TraverseInstanceProxies()))+meshes = [p for p in prims if p.IsA(UsdGeom.Mesh)]+cameras = [p for p in prims if p.IsA(UsdGeom.Camera)]+assert len(cameras) == 5 and len(meshes) > 1000+looks, luminous = set(), []+for prim in meshes:+ mesh = UsdGeom.Mesh(prim)+ points = mesh.GetPointsAttr().Get()+ indices = mesh.GetFaceVertexIndicesAttr().Get()+ assert points and indices and all(0 <= i < len(points) for i in indices)+ assert all(math.isfinite(v) for point in points for v in point)+ material, _ = UsdShade.MaterialBindingAPI(prim).ComputeBoundMaterial()+ assert material, str(prim.GetPath())+ looks.add(str(material.GetPath()))+ surface = material.ComputeSurfaceSource()[0]+ emission = surface.GetInput('emissiveColor').Get()+ if emission is not None and any(v > 0 for v in emission):+ luminous.append(str(prim.GetPath()))+assert len(luminous) >= 18+inspection = json.loads((output / 'usd-export.json').read_text(encoding='utf-8-sig'))+assert len(meshes) == sum(n['kind'] in ('Part', 'EnvironmentPanel', 'WindowFinish') for n in inspection['nodes'])+box = UsdGeom.BBoxCache(Usd.TimeCode.Default(), ['default', 'render']).ComputeWorldBound(stage.GetDefaultPrim()).ComputeAlignedRange()+lo, hi = list(box.GetMin()), list(box.GetMax())+for actual, expected in zip(lo + hi, inspection['bounds']['minimumMm'] + inspection['bounds']['maximumMm']):+ assert abs(actual - expected) < .01, (actual, expected)+ns = {'m': 'http://schemas.microsoft.com/office/drawing/2017/model3d',+ 'p': 'http://schemas.openxmlformats.org/presentationml/2006/main',+ 'mc': 'http://schemas.openxmlformats.org/markup-compatibility/2006'}+models = fallbacks = 0+with zipfile.ZipFile(output / 'factory.pptx') as archive:+ for name in archive.namelist():+ if name.endswith('.rels'):+ assert not any(r.attrib.get('TargetMode') == 'External' for r in ET.fromstring(archive.read(name)))+ if name.startswith('ppt/slides/slide') and name.endswith('.xml'):+ xml = ET.fromstring(archive.read(name))+ models += len(xml.findall('.//m:model3d', ns))+ fallbacks += len(xml.findall('.//mc:Fallback/p:pic', ns))+ for slide, preview in [(1, 'hero.png'), (2, 'overview.png')]:+ assert archive.read(f'ppt/media/model3d-{slide}-1.glb') == (output / 'factory.glb').read_bytes()+ assert archive.read(f'ppt/media/model3d-{slide}-1.png') == (output / preview).read_bytes()+assert models == fallbacks == 2+office_roundtrip = None+if (output / 'factory-office-roundtrip.pptx').exists():+ with zipfile.ZipFile(output / 'factory-office-roundtrip.pptx') as archive:+ model_parts = [n for n in archive.namelist() if n.endswith('.glb')]+ assert model_parts and all(archive.read(n) == (output / 'factory.glb').read_bytes() for n in model_parts)+ model_count = sum(len(ET.fromstring(archive.read(n)).findall('.//m:model3d', ns))+ for n in archive.namelist() if n.startswith('ppt/slides/slide') and n.endswith('.xml'))+ assert model_count == 2+ office_roundtrip = dict(model3d=model_count, embeddedModelParts=len(model_parts), exactGlbBytes=True)+validators = {}+for name in ('factory', 'factory-enclosed'):+ issues = json.loads((output / (name + '.validator.json')).read_text())['issues']+ assert issues['numErrors'] == issues['numWarnings'] == 0+ validators[name] = {k: issues[k] for k in ('numErrors', 'numWarnings', 'numInfos')}+report = dict(openUsd=dict(version=Usd.GetVersion(), compositionErrors=0, meshOccurrences=len(meshes),+ sharedPrototypes=len(stage.GetPrototypes()), cameras=len(cameras), boundLooks=len(looks),+ emissiveOccurrences=len(luminous), boundsMm=dict(min=lo,max=hi)),+ glb=validators, powerpointPackage=dict(slides=2, model3d=models, fallbackPictures=fallbacks,+ embeddedModelSha256=hashlib.sha256((output / 'factory.glb').read_bytes()).hexdigest(), externalRelationships=0,+ officeRoundtrip=office_roundtrip, desktopInteraction='see powerpoint-native-validation.json'))+(output / 'external-validation.json').write_text(json.dumps(report, indent=2) + '\n')+print(json.dumps(report))