Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Add Antonia adoption candidate and demote X0 topology

Yuechen Li9d040262d9a2
diff --git a/Aetheris.Humanoid.Tests/HumanoidX1Tests.cs b/Aetheris.Humanoid.Tests/HumanoidX1Tests.cs
new file mode 100644
index 00000000..11cf17e9
--- /dev/null
+++ b/Aetheris.Humanoid.Tests/HumanoidX1Tests.cs
@@ -0,0 +1,62 @@
+using System.Numerics;
+using Aetheris.Humanoid;
+using Aetheris.Kernel.Core.Math;
+using Xunit;
+
+namespace Aetheris.Humanoid.Tests;
+
+public sealed class HumanoidX1Tests
+{
+ [Fact]
+ public void UnpromotedSurfaceUsesRealSkinEvaluatorWithoutInventingCanonicalSemantics()
+ {
+ var bind = Matrix4x4.CreateTranslation(10, 0, 0);
+ Matrix4x4.Invert(bind, out var inverse);
+ var skeleton = new HumanoidSkeleton("test", "bind", "row-vector LBS",
+ [new("joint", HumanoidJointKind.Root, AnatomicalSide.Center, null,
+ HumanoidTransform.FromTranslation(new(10, 0, 0)), bind, inverse)],
+ new Dictionary<HumanoidJointKind, HumanoidJointKind>());
+ var surface = new HumanoidSurface("unpromoted", "triangle", "test",
+ [new("v", new(12, 0, 0), HumanoidRegionKind.Chest, 0)], [], [], null,
+ [new(0, [new(0, 1)])], [], new Dictionary<HumanoidRegionKind, HumanoidRegionKind>());
+ var neutral = HumanoidPosing.EvaluateVertices(surface, skeleton, new("bind", [], HumanoidTransform.Identity));
+ Assert.Equal(new Point3D(12, 0, 0), neutral[0]);
+ var posed = HumanoidPosing.EvaluateVertices(surface, skeleton,
+ new("quarter-turn", [new(HumanoidJointKind.Root, Quaternion.CreateFromAxisAngle(Vector3.UnitZ, MathF.PI / 2))], HumanoidTransform.Identity));
+ Assert.InRange((posed[0] - new Point3D(10, 2, 0)).Length, 0, .00001);
+ }
+
+ [Theory]
+ [InlineData("{\"status\":\"NeedsReview-NONCANONICAL\"}")]
+ [InlineData("{\"schemaVersion\":\"aetheris.humanoid.canonical.v1\"}")]
+ public void CandidateAndIncompleteArtifactsCannotLoadAsCanonical(string json)
+ {
+ var path = Path.GetTempFileName();
+ try { File.WriteAllText(path, json); Assert.Throws<InvalidDataException>(() => HumanoidArtifactIO.Load(path)); }
+ finally { File.Delete(path); }
+ }
+
+ [Fact]
+ public void AdmissionRejectsUnpinnedSourceBeforeParsingOrReadingOtherInputs()
+ {
+ var path = Path.GetTempFileName();
+ try
+ {
+ File.WriteAllText(path, "v 0 0 0\nf 1 1 1");
+ var error = Assert.Throws<HumanoidDomainException>(() => AntoniaSurfaceAdoption.Prepare(path, "absent-notice"));
+ Assert.Equal(HumanoidDiagnosticCode.HUM002_ReferenceHashMismatch, error.Diagnostic.Code);
+ }
+ finally { File.Delete(path); }
+ }
+
+ [Fact]
+ public void SweepIncludesAllSixRequiredMovementsWithFixedAngles()
+ {
+ var poses = AntoniaSurfaceAdoption.QualificationPoses();
+ Assert.Equal(12, poses.Count);
+ Assert.Equal(12, poses.Select(p => p.PoseId).Distinct().Count());
+ Assert.Contains(poses, p => p.PoseId == "shoulder-flexion-70");
+ Assert.Contains(poses, p => p.PoseId == "hip-abduction-70");
+ Assert.All(poses, p => Assert.InRange(p.LocalRotations.Single().LocalRotation.Length(), .999999f, 1.000001f));
+ }
+}
diff --git a/Aetheris.Humanoid.Tests/HumanoidX2Tests.cs b/Aetheris.Humanoid.Tests/HumanoidX2Tests.cs
new file mode 100644
index 00000000..208212bc
--- /dev/null
+++ b/Aetheris.Humanoid.Tests/HumanoidX2Tests.cs
@@ -0,0 +1,146 @@
+using System.Numerics;
+using Aetheris.Humanoid;
+using Aetheris.Kernel.Core.Math;
+using Xunit;
+
+namespace Aetheris.Humanoid.Tests;
+
+public sealed class HumanoidX2Tests
+{
+ private static HumanoidSkeleton Mechanism()
+ {
+ var specs = new (HumanoidJointKind Kind, int? Parent, Vector3 Position)[]
+ {
+ (HumanoidJointKind.Root, null, Vector3.Zero),
+ (HumanoidJointKind.Pelvis, 0, new(0, 0, 1000)),
+ (HumanoidJointKind.LeftHip, 1, new(-100, 0, 1000)),
+ (HumanoidJointKind.LeftKnee, 2, new(-100, 0, 600)),
+ (HumanoidJointKind.LeftAnkle, 3, new(-100, 0, 200)),
+ (HumanoidJointKind.LeftShoulder, 1, new(-200, 0, 1400)),
+ (HumanoidJointKind.LeftElbow, 5, new(-200, 0, 1100)),
+ (HumanoidJointKind.LeftWrist, 6, new(-200, 0, 800))
+ };
+ return new("mechanism", "rest", "row-vector", specs.Select(s =>
+ {
+ var translation = s.Position - (s.Parent is int p ? specs[p].Position : Vector3.Zero);
+ var bind = Matrix4x4.CreateTranslation(s.Position);
+ Matrix4x4.Invert(bind, out var inverse);
+ return new HumanoidJoint(s.Kind.ToString(), s.Kind, s.Kind.ToString().StartsWith("Left") ? AnatomicalSide.Left : AnatomicalSide.Center,
+ s.Parent, HumanoidTransform.FromTranslation(new(translation.X, translation.Y, translation.Z)), bind, inverse);
+ }).ToArray(), new Dictionary<HumanoidJointKind, HumanoidJointKind>());
+ }
+ private static RequestedHumanoidPose Request(params AnatomicalJointRequest[] joints) => new("test", "mechanism", "rest", 0, joints);
+
+ [Fact]
+ public void HipAndKnee90HaveAnalyticEndpointAndPreserveEveryLink()
+ {
+ var result = HumanoidKinematicSolver.Solve(Mechanism(), Request(new AnatomicalJointRequest(HumanoidJointKind.LeftHip, 90), new(HumanoidJointKind.LeftKnee, 90)));
+ Assert.True(result.IsSolved);
+ var ankle = result.Pose!.GlobalTransforms[4].Translation;
+ Assert.InRange(Vector3.Distance(ankle, new(-100, 400, 600)), 0, .001);
+ Assert.All(result.Pose.Residuals, r => { Assert.InRange(r.CenterMm, 0, .001); Assert.InRange(r.LinkLengthMm, 0, .001); });
+ }
+ [Theory]
+ [InlineData(HumanoidJointKind.LeftElbow, -45)]
+ [InlineData(HumanoidJointKind.LeftKnee, -30)]
+ [InlineData(HumanoidJointKind.LeftHip, 160)]
+ public void InvalidCoordinatesRejectOrProjectExplicitly(HumanoidJointKind joint, double degrees)
+ {
+ var request = Request(new AnatomicalJointRequest(joint, degrees));
+ var rejected = HumanoidKinematicSolver.Solve(Mechanism(), request);
+ Assert.False(rejected.IsSolved);
+ Assert.Equal("HUM200", Assert.Single(rejected.Diagnostics).Code);
+ var projected = HumanoidKinematicSolver.Solve(Mechanism(), request, policy: AnatomicalSolvePolicy.Project);
+ Assert.True(projected.IsSolved);
+ Assert.Single(projected.Projections);
+ Assert.Equal("HUM205", Assert.Single(projected.Diagnostics).Code);
+ }
+ [Fact]
+ public void HipEllipsePreventsIndependentLimitCornerAndReducesTwistAtBoundary()
+ {
+ var result = HumanoidKinematicSolver.Solve(Mechanism(), Request(new AnatomicalJointRequest(HumanoidJointKind.LeftHip, 120, 45, 45)), policy: AnatomicalSolvePolicy.Project);
+ var solved = Assert.Single(result.Pose!.Joints);
+ Assert.InRange(Math.Pow(solved.FlexionDegrees / 120, 2) + Math.Pow(solved.AbductionDegrees / 45, 2), .999999, 1.000001);
+ Assert.Equal(22.5, solved.TwistDegrees);
+ }
+ [Fact]
+ public void KneeSecondaryDofsCannotBypassHinge()
+ {
+ var result = HumanoidKinematicSolver.Solve(Mechanism(), Request(new AnatomicalJointRequest(HumanoidJointKind.LeftKnee, 90, 20, 10)), policy: AnatomicalSolvePolicy.Project);
+ Assert.Equal(new(HumanoidJointKind.LeftKnee, 90), Assert.Single(result.Pose!.Joints));
+ }
+ [Fact]
+ public void ElbowHingeBendsForwardInsteadOfAbducting()
+ {
+ var result = HumanoidKinematicSolver.Solve(Mechanism(), Request(new AnatomicalJointRequest(HumanoidJointKind.LeftElbow, 90)));
+ Assert.InRange(Vector3.Distance(result.Pose!.GlobalTransforms[7].Translation, new(-200, 300, 1100)), 0, .001);
+ }
+ [Fact]
+ public void SolveIsDeterministicAndDoesNotChangeRestFrames()
+ {
+ var skeleton = Mechanism(); var before = skeleton.Joints.ToArray();
+ var request = Request(new AnatomicalJointRequest(HumanoidJointKind.LeftHip, 90));
+ var a = HumanoidKinematicSolver.Solve(skeleton, request).Pose!;
+ var b = HumanoidKinematicSolver.Solve(skeleton, request).Pose!;
+ Assert.Equal(a.GlobalTransforms, b.GlobalTransforms);
+ Assert.Equal(before, skeleton.Joints);
+ }
+ [Theory]
+ [InlineData(double.NaN)]
+ [InlineData(double.PositiveInfinity)]
+ public void NonfiniteIsRejected(double value) => Assert.False(HumanoidKinematicSolver.Solve(Mechanism(), Request(new AnatomicalJointRequest(HumanoidJointKind.LeftHip, value))).IsSolved);
+
+ [Fact]
+ public void ExtremeFiniteRequestProducesFiniteProjectionEvidence()
+ {
+ var result = HumanoidKinematicSolver.Solve(Mechanism(), Request(new AnatomicalJointRequest(HumanoidJointKind.LeftHip, double.MaxValue, double.MaxValue, double.MaxValue)), policy: AnatomicalSolvePolicy.Project);
+ Assert.True(result.IsSolved);
+ Assert.True(double.IsFinite(Assert.Single(result.Projections).ParameterCorrectionDegrees));
+ }
+ [Fact]
+ public void DuplicateStaleUnknownAndUnsupportedRequestsFailClosed()
+ {
+ var s = Mechanism(); var j = new AnatomicalJointRequest(HumanoidJointKind.LeftHip);
+ Assert.False(HumanoidKinematicSolver.Solve(s, Request(j, j)).IsSolved);
+ Assert.False(HumanoidKinematicSolver.Solve(s, Request(j) with { ShapeRevision = 1 }).IsSolved);
+ Assert.False(HumanoidKinematicSolver.Solve(s, Request(j) with { RestPoseId = "other" }).IsSolved);
+ Assert.False(HumanoidKinematicSolver.Solve(s, Request(new AnatomicalJointRequest((HumanoidJointKind)999))).IsSolved);
+ Assert.Equal("HUM209", Assert.Single(HumanoidKinematicSolver.Solve(s, Request(new AnatomicalJointRequest(HumanoidJointKind.LeftShoulder, 90))).Diagnostics).Code);
+ }
+ [Fact]
+ public void CorruptBindSideAndHierarchyAreRejected()
+ {
+ var s = Mechanism();
+ foreach (var bad in new[] { s.Joints[3] with { ParentIndex = 7 }, s.Joints[3] with { Side = AnatomicalSide.Right }, s.Joints[3] with { GlobalBind = Matrix4x4.Identity } })
+ {
+ var joints = s.Joints.ToArray(); joints[3] = bad;
+ Assert.False(HumanoidKinematicSolver.Solve(s with { Joints = joints }, Request()).IsSolved);
+ }
+ }
+ [Fact]
+ public void SurfaceRequiresMatchingSolveAndRetainsFiniteRigidPatch()
+ {
+ var skeleton = Mechanism();
+ var solved = HumanoidKinematicSolver.Solve(skeleton, Request(new AnatomicalJointRequest(HumanoidJointKind.LeftHip, 90))).Pose!;
+ var surface = Patch();
+ var output = HumanoidConstrainedSurface.Evaluate(surface, skeleton, 0, solved);
+ Assert.True(output.Evidence.IsAdmissible);
+ Assert.Throws<InvalidOperationException>(() => HumanoidConstrainedSurface.Evaluate(surface, skeleton, 1, solved));
+ var joints = skeleton.Joints.ToArray(); joints[3] = joints[3] with { Id = "changed" };
+ Assert.Throws<InvalidOperationException>(() => HumanoidConstrainedSurface.Evaluate(surface, skeleton with { Joints = joints }, 0, solved));
+ }
+ [Fact]
+ public void SurfaceCollapseAndReversalAreNotAccepted()
+ {
+ var s = Mechanism(); var surface = Patch();
+ var globals = HumanoidPosing.GlobalPose(s, new("rest", [], HumanoidTransform.Identity));
+ var collapsed = HumanoidConstrainedSurface.Inspect(surface, s, globals, [Point3D.Origin, Point3D.Origin, Point3D.Origin]);
+ Assert.False(collapsed.IsAdmissible); Assert.Equal(1, collapsed.CollapsedTriangles);
+ var reversed = HumanoidConstrainedSurface.Inspect(surface, s, globals, [surface.Vertices[0].Position, surface.Vertices[2].Position, surface.Vertices[1].Position]);
+ Assert.False(reversed.IsAdmissible); Assert.Single(reversed.FlaggedFaceIds);
+ }
+ private static HumanoidSurface Patch() => new("patch", "triangle", "test",
+ [new("a", new(-100,0,900), HumanoidRegionKind.LeftThigh, 0), new("b", new(-90,0,900), HumanoidRegionKind.LeftThigh, 1), new("c", new(-100,10,900), HumanoidRegionKind.LeftThigh, 2)],
+ [new("f",0,1,2,HumanoidRegionKind.LeftThigh,null)], [], null,
+ [new(0,[new(2,1)]),new(1,[new(2,1)]),new(2,[new(2,1)])],[],new Dictionary<HumanoidRegionKind,HumanoidRegionKind>());
+}
diff --git a/Aetheris.Humanoid/AntoniaSurfaceAdoption.cs b/Aetheris.Humanoid/AntoniaSurfaceAdoption.cs
new file mode 100644
index 00000000..a2cd4df8
--- /dev/null
+++ b/Aetheris.Humanoid/AntoniaSurfaceAdoption.cs
@@ -0,0 +1,406 @@
+using System.Globalization;
+using System.Numerics;
+using System.Security.Cryptography;
+using System.Text;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Humanoid;
+
+public sealed record AntoniaSourcePolygon(int SourceFaceIndex, int[] SourceVertexIndices, string Group, string Material);
+public sealed record AntoniaPreparationEvidence(bool Finite, int OrientationReversalProxies, int CollapsedTriangles,
+ double MaximumEdgeLengthRatio, double BindReconstructionMaximumMm,
+ IReadOnlyDictionary<HumanoidRegionKind, int> ReversalsByRegion, IReadOnlyList<string> ReversalFaceIds,
+ IReadOnlyList<string> WorstEdgeVertexIds);
+public sealed record AntoniaAdoptionCandidate(string Status, HumanoidSurface SourcePoseSurface,
+ HumanoidSkeleton SourcePoseSkeleton, HumanoidPoseState PreparationPose,
+ IReadOnlyList<Point3D> PreparedPositions, IReadOnlyList<AntoniaSourcePolygon> SourcePolygons,
+ IReadOnlyList<int> SourceVertexIndices, double ScaleToMm, double SourceSoleY,
+ double SourcePelvisZ, double SymmetryMaximumMm, double PreparedSymmetryMaximumMm, AntoniaPreparationEvidence PreparationEvidence,
+ HumanoidSkeleton PreparedSkeleton, IReadOnlyDictionary<string, AntoniaPreparationEvidence> PoseSweep,
+ HumanoidProvenance Provenance);
+
+/// <summary>
+/// Bounded, hash-pinned adoption experiment for the original CC-BY Antonia 1.2 figure.
+/// A candidate is deliberately not a CanonicalHumanoid: source-pose preparation must pass
+/// geometric and human review before landmarks, measurements and canonical admission exist.
+/// No source rig, weights, textures, morphs, Blender data or CharMorph code are consumed.
+/// </summary>
+public static class AntoniaSurfaceAdoption
+{
+ public const string Revision = "08c9767691daad1382dfc6980ee83e31514b4879";
+ public const string SourceSha256 = "0d9e918f19a497adebb51dc8f4ac921c41753b157c50809a1d760dd45ec01194";
+ public const string NoticeSha256 = "e9385525cf613450e8673703f7959cd869e2d9c1290d474a99ca4863d734f4ae";
+ public const string CandidateTopologyId = "aetheris.humanoid.antonia.adoption-candidate.v1";
+ public const string Version = "antonia-original-adoption.v1";
+ public const string SourceRepository = "https://github.com/odf/Antonia.Polygon";
+
+ private static readonly HashSet<string> AdmittedMaterials = new(StringComparer.Ordinal)
+ {
+ "skin_ARMS", "skin_BODY", "skin_HEAD", "skin_LEGS", "lips", "nailsFingers", "nailsToes",
+ "scleraLeft", "scleraRight", "irisLeft", "irisRight", "pupilLeft", "pupilRight", "corneaLeft", "corneaRight"
+ };
+
+ public static AntoniaAdoptionCandidate Prepare(string objPath, string noticePath)
+ {
+ Verify(objPath, SourceSha256);
+ Verify(noticePath, NoticeSha256);
+ var source = new List<Point3D>();
+ var polygons = new List<AntoniaSourcePolygon>();
+ string group = "", material = "";
+ var faceIndex = 0;
+ foreach (var line in File.ReadLines(objPath))
+ {
+ var fields = line.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries);
+ if (fields.Length == 0) continue;
+ switch (fields[0])
+ {
+ case "v":
+ source.Add(new(Parse(fields[1]), Parse(fields[2]), Parse(fields[3])));
+ break;
+ case "g": group = fields[1]; break;
+ case "usemtl": material = fields[1]; break;
+ case "f":
+ if (fields.Length != 5) throw new InvalidDataException("Pinned Antonia source must contain only quads.");
+ if (AdmittedMaterials.Contains(material))
+ polygons.Add(new(faceIndex, fields.Skip(1).Select(x => int.Parse(x.Split('/')[0], CultureInfo.InvariantCulture) - 1).ToArray(), group, material));
+ faceIndex++;
+ break;
+ }
+ }
+ if (source.Count != 38822 || faceIndex != 38614) throw new InvalidDataException("Original Antonia topology count mismatch.");
+ var sourceIds = polygons.SelectMany(p => p.SourceVertexIndices).Distinct().Order().ToArray();
+ var remap = sourceIds.Select((id, i) => (id, i)).ToDictionary(x => x.id, x => x.i);
+ var groups = polygons.GroupBy(p => p.Group).ToDictionary(g => g.Key, g => g.SelectMany(p => p.SourceVertexIndices).Distinct().Order().ToArray());
+ var sole = sourceIds.Min(i => source[i].Y);
+ var scale = 1750 / (sourceIds.Max(i => source[i].Y) - sole);
+ var pelvisZ = groups["hip"].Intersect(groups["waist"]).Select(i => source[i].Z).Average();
+ // (-X, Z, Y) has determinant +1. Original l* groups have positive X.
+ Point3D Map(Point3D p) => new(-p.X * scale, (p.Z - pelvisZ) * scale, (p.Y - sole) * scale);
+ var memberships = sourceIds.ToDictionary(i => i, _ => new List<string>());
+ foreach (var (name, ids) in groups) foreach (var id in ids) memberships[id].Add(name);
+ var positions = sourceIds.Select(i => Map(source[i])).ToArray();
+ var symmetry = PairSymmetry(positions);
+ var vertices = sourceIds.Select((id, i) => new HumanoidVertex($"antonia:v:{id:D6}", positions[i],
+ Region(memberships[id].Order(StringComparer.Ordinal).First()), symmetry[i])).ToArray();
+ var faces = new List<HumanoidFace>();
+ var componentFaces = new Dictionary<HumanoidComponentKind, List<int>>();
+ foreach (var polygon in polygons)
+ {
+ var ids = polygon.SourceVertexIndices.Select(i => remap[i]).ToArray();
+ var region = Region(polygon.Group);
+ var kind = polygon.Group switch { "lEye" => HumanoidComponentKind.LeftEye, "rEye" => HumanoidComponentKind.RightEye, _ => HumanoidComponentKind.OuterSkin };
+ if (!componentFaces.TryGetValue(kind, out var list)) componentFaces[kind] = list = [];
+ // Preserve authored polygon identity in SourcePolygons; freeze 0-2 binding diagonal.
+ for (var t = 0; t < 2; t++)
+ {
+ list.Add(faces.Count);
+ faces.Add(new($"antonia:f:{polygon.SourceFaceIndex:D6}:t{t}", ids[0], ids[t + 1], ids[t + 2], region, null));
+ }
+ }
+ var components = componentFaces.OrderBy(x => x.Key).Select(x => new HumanoidComponent(
+ "antonia:" + x.Key, x.Key, x.Value, ["Material-subset boundaries retained; watertightness not asserted."])).ToArray();
+ var skeleton = BuildSkeleton(groups, source, Map);
+ var weights = GenerateWeights(sourceIds, memberships,
+ polygons.Select(p => p.SourceVertexIndices.Select(i => remap[i]).ToArray()).ToArray(), skeleton);
+ var hash = Hash(string.Join(";", faces.Select(f => $"{f.A},{f.B},{f.C}")));
+ var regions = Enum.GetValues<HumanoidRegionKind>().ToDictionary(r => r, r => Swap(r));
+ var surface = new HumanoidSurface(CandidateTopologyId, CandidateTopologyId + ".quad-diagonal-02.v1", hash,
+ vertices, faces, faces.Select((f, i) => new BindingTriangle(f.Id, i, f.A, f.B, f.C)).ToArray(),
+ null, weights, components, regions);
+ var preparation = Preparation(skeleton);
+ var prepared = HumanoidPosing.EvaluateVertices(surface, skeleton, preparation);
+ var bind = HumanoidPosing.EvaluateVertices(surface, skeleton, new("source-bind", [], HumanoidTransform.Identity));
+ var bindError = bind.Select((p, i) => (p - positions[i]).Length).Max();
+ var evidence = InspectPreparation(surface, skeleton, preparation, prepared, bindError);
+ var preparedSkeleton = Rebind(skeleton, HumanoidPosing.GlobalPose(skeleton, preparation));
+ var preparedSurface = surface with { Vertices = vertices.Select((v, i) => v with { Position = prepared[i] }).ToArray() };
+ var preparedBind = HumanoidPosing.EvaluateVertices(preparedSurface, preparedSkeleton, new("prepared-bind", [], HumanoidTransform.Identity));
+ var preparedBindError = preparedBind.Select((p, i) => (p - prepared[i]).Length).Max();
+ var sweep = new Dictionary<string, AntoniaPreparationEvidence>();
+ foreach (var pose in QualificationPoses())
+ sweep.Add(pose.PoseId, InspectPreparation(preparedSurface, preparedSkeleton, pose,
+ HumanoidPosing.EvaluateVertices(preparedSurface, preparedSkeleton, pose), preparedBindError));
+ var symmetryError = positions.Select((p, i) => (new Point3D(-p.X, p.Y, p.Z) - positions[symmetry[i]]).Length).Max();
+ var preparedSymmetryError = prepared.Select((p, i) => (new Point3D(-p.X, p.Y, p.Z) - prepared[symmetry[i]]).Length).Max();
+ var failed = preparedSymmetryError > .001 || sweep.Values.Append(evidence).Any(e => !e.Finite || e.CollapsedTriangles != 0 || e.OrientationReversalProxies != 0);
+ return new(failed ? "FailedDeformationGate-NONCANONICAL" : "NeedsReview-NONCANONICAL", surface, skeleton, preparation, prepared, polygons, sourceIds,
+ scale, sole, pelvisZ, symmetryError, preparedSymmetryError, evidence, preparedSkeleton, sweep,
+ new("aetheris.humanoid.provenance.v1",
+ [new("antonia-original-1.2", "adopted-base-figure", SourceRepository, Revision, SourceSha256,
+ "CC-BY-3.0", "selected original body/eye polygons; source-pose preparation experiment", true,
+ "Antonia Polygon by Olaf Delgado-Friedrichs, with phantom3D, MikeJ and others credited in the preserved original notice. No endorsement implied."),
+ new("antonia-original-notice", "license-evidence", SourceRepository + "/blob/" + Revision + "/Runtime/Docs/Antonia/README",
+ Revision, NoticeSha256, "CC-BY-3.0", "original notice retained", true, "Not a grant for separately distributed extras.")],
+ ["admitted material subset; original vertex and polygon indices retained", "right-handed frame (-sourceX, sourceZ-pelvisZ, sourceY-soleY), uniformly normalized to 1750 mm",
+ "fixed quad diagonal 0-2; original polygons retained separately", "joint proxies from shared source group boundary centroids; no source rig",
+ "group membership skin seeds; 16 authored-quad-edge adjacency averaging passes; binding diagonals excluded", "shared Aetheris LBS; shoulders and elbows target bilateral 35-degree arms from vertical"],
+ Version, Hash(Version + SourceSha256 + NoticeSha256), hash, "SourceAdmitted-RuntimePromotionBlocked",
+ ["All source-pose preparation, anatomical proxies and difficult regions require review. No canonical landmark, measurement, attachment or morph admission."]));
+ }
+
+ public static IReadOnlyList<HumanoidPoseState> QualificationPoses()
+ {
+ var result = new List<HumanoidPoseState>();
+ foreach (var (name, joint, axis) in new[]
+ {
+ ("shoulder-abduction", HumanoidJointKind.LeftShoulder, Vector3.UnitY),
+ ("shoulder-flexion", HumanoidJointKind.LeftShoulder, Vector3.UnitX),
+ ("elbow-flexion", HumanoidJointKind.LeftElbow, Vector3.UnitY),
+ ("hip-flexion", HumanoidJointKind.LeftHip, Vector3.UnitX),
+ ("hip-abduction", HumanoidJointKind.LeftHip, Vector3.UnitY),
+ ("knee-flexion", HumanoidJointKind.LeftKnee, -Vector3.UnitX)
+ })
+ foreach (var degrees in new[] { 35, 70 })
+ result.Add(new(name + "-" + degrees,
+ [new(joint, Quaternion.CreateFromAxisAngle(axis, degrees * MathF.PI / 180))], HumanoidTransform.Identity));
+ return result;
+ }
+
+ private static HumanoidSkeleton Rebind(HumanoidSkeleton source, IReadOnlyList<Matrix4x4> globals)
+ {
+ var joints = source.Joints.Select((j, i) =>
+ {
+ var position = new Vector3(globals[i].M41, globals[i].M42, globals[i].M43);
+ var parent = j.ParentIndex is { } pi ? new Vector3(globals[pi].M41, globals[pi].M42, globals[pi].M43) : Vector3.Zero;
+ var delta = position - parent;
+ var bind = Matrix4x4.CreateTranslation(position);
+ Matrix4x4.Invert(bind, out var inverse);
+ return j with { LocalRest = new(new(delta.X, delta.Y, delta.Z), Quaternion.Identity), GlobalBind = bind, InverseBind = inverse };
+ }).ToArray();
+ return source with { RestPoseId = "antonia.candidate.apose.v1", Joints = joints };
+ }
+
+ private static HumanoidSkeleton BuildSkeleton(Dictionary<string, int[]> groups, List<Point3D> source, Func<Point3D, Point3D> map)
+ {
+ Point3D Mean(IEnumerable<int> ids)
+ {
+ var p = ids.Select(i => source[i]).ToArray();
+ if (p.Length == 0) throw new InvalidDataException("Missing group-boundary joint proxy.");
+ return map(new(p.Average(v => v.X), p.Average(v => v.Y), p.Average(v => v.Z)));
+ }
+ Point3D Seam(string a, string b) => Mean(groups[a].Intersect(groups[b]));
+ var specs = new List<(HumanoidJointKind Kind, HumanoidJointKind? Parent, Point3D P)>();
+ void Add(HumanoidJointKind k, HumanoidJointKind? parent, Point3D p) => specs.Add((k, parent, p));
+ Add(HumanoidJointKind.Root, null, Point3D.Origin);
+ Add(HumanoidJointKind.Pelvis, HumanoidJointKind.Root, Seam("hip", "waist"));
+ Add(HumanoidJointKind.SpineLower, HumanoidJointKind.Pelvis, Seam("waist", "abdomen"));
+ Add(HumanoidJointKind.SpineMid, HumanoidJointKind.SpineLower, Seam("abdomen", "chest"));
+ Add(HumanoidJointKind.Chest, HumanoidJointKind.SpineMid, Mean(groups["chest"]));
+ Add(HumanoidJointKind.Neck, HumanoidJointKind.Chest, Seam("chest", "neck"));
+ Add(HumanoidJointKind.Head, HumanoidJointKind.Neck, Seam("neck", "head"));
+ foreach (var side in new[] { "l", "r" })
+ {
+ HumanoidJointKind K(string s) => Enum.Parse<HumanoidJointKind>((side == "l" ? "Left" : "Right") + s);
+ Add(K("Clavicle"), HumanoidJointKind.Chest, Seam("chest", side + "Collar"));
+ Add(K("Shoulder"), K("Clavicle"), Seam(side + "Collar", side + "Shldr"));
+ Add(K("Elbow"), K("Shoulder"), Seam(side + "Shldr", side + "ForeArm"));
+ Add(K("Wrist"), K("Elbow"), Seam(side + "ForeArm", side + "Hand"));
+ Add(K("Hip"), HumanoidJointKind.Pelvis, Seam("hip", side + "Thigh"));
+ Add(K("Knee"), K("Hip"), Seam(side + "Thigh", side + "Shin"));
+ Add(K("Ankle"), K("Knee"), Seam(side + "Shin", side + "Foot"));
+ Add(K("ToeBase"), K("Ankle"), Seam(side + "Foot", side + "Instep"));
+ foreach (var (sourceName, name) in new[] { ("Thumb", "Thumb"), ("Index", "Index"), ("Mid", "Middle"), ("Ring", "Ring"), ("Pinky", "Little") })
+ {
+ var first = name == "Thumb" ? "Metacarpal" : "Proximal";
+ var second = name == "Thumb" ? "Proximal" : "Intermediate";
+ Add(K(name + first), K("Wrist"), Seam(side + "Hand", side + sourceName + "1"));
+ Add(K(name + second), K(name + first), Seam(side + sourceName + "1", side + sourceName + "2"));
+ Add(K(name + "Distal"), K(name + second), Seam(side + sourceName + "2", side + sourceName + "3"));
+ }
+ Add(K("Eye"), HumanoidJointKind.Head, Mean(groups[side + "Eye"]));
+ }
+ var index = specs.Select((s, i) => (s.Kind, i)).ToDictionary(x => x.Kind, x => x.i);
+ var joints = specs.Select(s =>
+ {
+ int? parent = s.Parent is { } k ? index[k] : null;
+ var delta = s.P - (parent is { } pi ? specs[pi].P : Point3D.Origin);
+ var global = Matrix4x4.CreateTranslation((float)s.P.X, (float)s.P.Y, (float)s.P.Z);
+ if (!Matrix4x4.Invert(global, out var inverse)) throw new InvalidDataException("Singular source bind.");
+ var side = s.Kind.ToString().StartsWith("Left") ? AnatomicalSide.Left : s.Kind.ToString().StartsWith("Right") ? AnatomicalSide.Right : AnatomicalSide.Center;
+ return new HumanoidJoint("joint:" + s.Kind, s.Kind, side, parent, new(new(delta.X, delta.Y, delta.Z), Quaternion.Identity), global, inverse,
+ s.Kind is HumanoidJointKind.LeftEye or HumanoidJointKind.RightEye);
+ }).ToArray();
+ return new(CanonicalAdultStandardV1.SkeletonId, "antonia.original-source-pose.v1",
+ "linear-blend-skinning; System.Numerics row-vector matrices; pWorld=pModel*InverseBind*GlobalPose",
+ joints, Enum.GetValues<HumanoidJointKind>().ToDictionary(k => k, k => Swap(k)));
+ }
+
+ private static IReadOnlyList<VertexSkinWeights> GenerateWeights(int[] sourceIds, Dictionary<int, List<string>> memberships,
+ IReadOnlyList<int[]> quads, HumanoidSkeleton skeleton)
+ {
+ var indices = skeleton.Joints.Select((j, i) => (j.Kind, i)).ToDictionary(x => x.Kind, x => x.i);
+ var n = sourceIds.Length;
+ var count = skeleton.Joints.Count;
+ var weights = new double[n][];
+ var adjacency = Enumerable.Range(0, n).Select(_ => new SortedSet<int>()).ToArray();
+ // Binding diagonals are not authored edges. Using them would introduce a
+ // left/right bias into otherwise symmetric weights on mirrored quads.
+ foreach (var quad in quads)
+ for (var edge = 0; edge < 4; edge++)
+ {
+ var a = quad[edge]; var b = quad[(edge + 1) % 4];
+ adjacency[a].Add(b); adjacency[b].Add(a);
+ }
+ for (var i = 0; i < n; i++)
+ {
+ weights[i] = new double[count];
+ var joints = memberships[sourceIds[i]].Select(GroupJoint).Distinct().ToArray();
+ foreach (var joint in joints) weights[i][indices[joint]] = 1d / joints.Length;
+ }
+ for (var pass = 0; pass < 16; pass++)
+ {
+ var next = new double[n][];
+ for (var i = 0; i < n; i++)
+ {
+ next[i] = new double[count];
+ for (var j = 0; j < count; j++)
+ next[i][j] = adjacency[i].Count == 0 ? weights[i][j] : .5 * weights[i][j] + .5 * adjacency[i].Sum(k => weights[k][j]) / adjacency[i].Count;
+ }
+ weights = next;
+ }
+ return weights.Select((row, i) =>
+ {
+ var kept = row.Select((w, j) => new JointWeight(j, w)).Where(w => w.Weight > 1e-8).ToArray();
+ var total = kept.Sum(w => w.Weight);
+ return new VertexSkinWeights(i, kept.Select(w => w with { Weight = w.Weight / total }).ToArray());
+ }).ToArray();
+ }
+
+ private static HumanoidPoseState Preparation(HumanoidSkeleton skeleton)
+ {
+ var joints = skeleton.Joints.ToDictionary(j => j.Kind);
+ Vector3 P(HumanoidJointKind k) { var m = joints[k].GlobalBind; return new(m.M41, m.M42, m.M43); }
+ var rotations = new List<JointPose>();
+ foreach (var left in new[] { true, false })
+ {
+ var shoulder = left ? HumanoidJointKind.LeftShoulder : HumanoidJointKind.RightShoulder;
+ var elbow = left ? HumanoidJointKind.LeftElbow : HumanoidJointKind.RightElbow;
+ var wrist = left ? HumanoidJointKind.LeftWrist : HumanoidJointKind.RightWrist;
+ var target = new Vector3((left ? -1 : 1) * MathF.Sin(35 * MathF.PI / 180), 0, -MathF.Cos(35 * MathF.PI / 180));
+ var upper = FromTo(P(elbow) - P(shoulder), target);
+ var lower = FromTo(P(wrist) - P(elbow), Vector3.Transform(target, Quaternion.Inverse(upper)));
+ rotations.Add(new(shoulder, upper)); rotations.Add(new(elbow, lower));
+ }
+ return new("antonia.apose-preparation.v1", rotations, HumanoidTransform.Identity);
+ }
+
+ private static AntoniaPreparationEvidence InspectPreparation(HumanoidSurface surface, HumanoidSkeleton skeleton,
+ HumanoidPoseState pose, IReadOnlyList<Point3D> prepared, double bindError)
+ {
+ var globals = HumanoidPosing.GlobalPose(skeleton, pose);
+ var reversals = new Dictionary<HumanoidRegionKind, int>();
+ var reversalIds = new List<string>();
+ var worstEdge = Array.Empty<string>();
+ var collapsed = 0;
+ var maxStretch = 1d;
+ foreach (var face in surface.Faces)
+ {
+ Point3D P(int i) => surface.Vertices[i].Position;
+ var oldNormal = (P(face.B) - P(face.A)).Cross(P(face.C) - P(face.A));
+ var normal = (prepared[face.B] - prepared[face.A]).Cross(prepared[face.C] - prepared[face.A]);
+ var joint = new[] { face.A, face.B, face.C }.SelectMany(i => surface.SkinWeights[i].Weights)
+ .GroupBy(w => w.JointIndex).OrderByDescending(g => g.Sum(w => w.Weight)).ThenBy(g => g.Key).First().Key;
+ var expected = Vector3.TransformNormal(new((float)oldNormal.X, (float)oldNormal.Y, (float)oldNormal.Z), skeleton.Joints[joint].InverseBind * globals[joint]);
+ if (normal.LengthSquared < 4e-8) collapsed++;
+ else if (normal.Dot(new(expected.X, expected.Y, expected.Z)) <= 0)
+ {
+ reversals[face.Region] = reversals.GetValueOrDefault(face.Region) + 1;
+ reversalIds.Add(face.Id);
+ }
+ foreach (var (a, b) in new[] { (face.A, face.B), (face.B, face.C), (face.C, face.A) })
+ {
+ var before = (P(a) - P(b)).Length;
+ var after = (prepared[a] - prepared[b]).Length;
+ if (before == 0 || after == 0) throw new InvalidDataException("Collapsed source or preparation edge.");
+ var ratio = Math.Max(after / before, before / after);
+ if (ratio > maxStretch) { maxStretch = ratio; worstEdge = [surface.Vertices[a].Id, surface.Vertices[b].Id]; }
+ }
+ }
+ return new(prepared.All(p => double.IsFinite(p.X) && double.IsFinite(p.Y) && double.IsFinite(p.Z)),
+ reversals.Values.Sum(), collapsed, maxStretch, bindError, reversals, reversalIds, worstEdge);
+ }
+
+ private static int[] PairSymmetry(IReadOnlyList<Point3D> points)
+ {
+ var buckets = points.Select((p, i) => (Key: Key(p), i)).GroupBy(x => x.Key).ToDictionary(g => g.Key, g => g.Select(x => x.i).Order().ToArray());
+ var pair = Enumerable.Repeat(-1, points.Count).ToArray();
+ for (var i = 0; i < points.Count; i++)
+ {
+ if (pair[i] >= 0) continue;
+ var p = points[i];
+ if (Math.Abs(p.X) < .0001) { pair[i] = i; continue; }
+ var target = new Point3D(-p.X, p.Y, p.Z);
+ var (x, y, z) = Key(target);
+ var candidates = new List<int>();
+ for (var dx = -1; dx <= 1; dx++)
+ for (var dy = -1; dy <= 1; dy++)
+ for (var dz = -1; dz <= 1; dz++)
+ if (buckets.TryGetValue((x + dx, y + dy, z + dz), out var matches))
+ candidates.AddRange(matches.Where(j => pair[j] < 0 && (target - points[j]).Length < .001));
+ if (candidates.Count == 0) throw new InvalidDataException($"No unpaired symmetry partner within 0.001 mm for source vertex {i}.");
+ var j = candidates.OrderBy(j => (target - points[j]).LengthSquared).ThenBy(j => j).First();
+ pair[i] = j; pair[j] = i;
+ }
+ return pair;
+ static (long, long, long) Key(Point3D p) => ((long)Math.Floor(p.X), (long)Math.Floor(p.Y), (long)Math.Floor(p.Z));
+ }
+
+ private static HumanoidRegionKind Region(string group)
+ {
+ if (group is "head" or "neck" or "chest" or "abdomen" or "waist" or "hip")
+ return group switch { "head" => HumanoidRegionKind.Head, "neck" => HumanoidRegionKind.Neck, "chest" => HumanoidRegionKind.Chest, "abdomen" or "waist" => HumanoidRegionKind.Abdomen, _ => HumanoidRegionKind.Pelvis };
+ var prefix = group[0] == 'l' ? "Left" : "Right";
+ var stem = group[1..];
+ var region = stem switch
+ {
+ "Eye" => "Eye", "Collar" => "Shoulder", "Shldr" => "UpperArm", "ForeArm" => "Forearm", "Hand" => "Hand",
+ "Thigh" => "Thigh", "Shin" => "Shin", "Foot" or "Instep" => "Foot", "Toe" or "BigToe1" or "BigToe2" => "Toes",
+ _ when stem.StartsWith("Thumb") => "Thumb", _ when stem.StartsWith("Index") => "Index", _ when stem.StartsWith("Mid") => "Middle",
+ _ when stem.StartsWith("Ring") => "Ring", _ when stem.StartsWith("Pinky") => "Little",
+ _ => throw new InvalidDataException("Unmapped source group: " + group)
+ };
+ return Enum.Parse<HumanoidRegionKind>(prefix + region);
+ }
+
+ private static HumanoidJointKind GroupJoint(string group)
+ {
+ if (group is "head" or "neck" or "chest" or "abdomen" or "waist" or "hip")
+ return group switch { "head" => HumanoidJointKind.Head, "neck" => HumanoidJointKind.Neck, "chest" => HumanoidJointKind.Chest, "abdomen" => HumanoidJointKind.SpineMid, "waist" => HumanoidJointKind.SpineLower, _ => HumanoidJointKind.Pelvis };
+ var prefix = group[0] == 'l' ? "Left" : "Right";
+ var stem = group[1..];
+ var joint = stem switch
+ {
+ "Eye" => "Eye", "Collar" => "Clavicle", "Shldr" => "Shoulder", "ForeArm" => "Elbow", "Hand" => "Wrist",
+ "Thigh" => "Hip", "Shin" => "Knee", "Foot" => "Ankle", "Instep" or "Toe" or "BigToe1" or "BigToe2" => "ToeBase",
+ _ => Finger(stem)
+ };
+ return Enum.Parse<HumanoidJointKind>(prefix + joint);
+ static string Finger(string s)
+ {
+ var name = s[..^1] switch { "Mid" => "Middle", "Pinky" => "Little", var other => other };
+ var segment = s[^1] switch { '1' => name == "Thumb" ? "Metacarpal" : "Proximal", '2' => name == "Thumb" ? "Proximal" : "Intermediate", '3' => "Distal", _ => throw new InvalidDataException("Unknown finger group") };
+ return name + segment;
+ }
+ }
+
+ private static T Swap<T>(T value) where T : struct, Enum
+ {
+ var s = value.ToString();
+ return s.StartsWith("Left") ? Enum.Parse<T>("Right" + s[4..]) : s.StartsWith("Right") ? Enum.Parse<T>("Left" + s[5..]) : value;
+ }
+ private static Quaternion FromTo(Vector3 from, Vector3 to)
+ {
+ from = Vector3.Normalize(from); to = Vector3.Normalize(to);
+ var dot = Vector3.Dot(from, to);
+ if (dot < -.99999f) throw new InvalidDataException("Ambiguous antiparallel preparation rotation.");
+ return Quaternion.Normalize(new Quaternion(Vector3.Cross(from, to), 1 + dot));
+ }
+ private static double Parse(string s) => double.Parse(s, CultureInfo.InvariantCulture);
+ private static string Hash(string s) => Convert.ToHexStringLower(SHA256.HashData(Encoding.UTF8.GetBytes(s)));
+ private static void Verify(string path, string expected)
+ {
+ using var stream = File.OpenRead(path);
+ if (Convert.ToHexStringLower(SHA256.HashData(stream)) != expected)
+ throw new HumanoidDomainException(new(HumanoidDiagnosticCode.HUM002_ReferenceHashMismatch, HumanoidDiagnosticSeverity.Error, "Pinned original Antonia input hash mismatch.", Path.GetFileName(path)));
+ }
+}
diff --git a/Aetheris.Humanoid/CanonicalAdultTemplate.cs b/Aetheris.Humanoid/CanonicalAdultTemplate.cs
index b75e0c8a..be541965 100644
--- a/Aetheris.Humanoid/CanonicalAdultTemplate.cs
+++ b/Aetheris.Humanoid/CanonicalAdultTemplate.cs
@@ -7,7 +7,7 @@ using Aetheris.Kernel.Core.Math;
namespace Aetheris.Humanoid;
/// <summary>
-/// Independently authored X0 topology. Connectivity comes from a fixed tetrahedral lattice over explicit
+/// NONCANONICAL synthetic X0 regression topology. Connectivity comes from a fixed tetrahedral lattice over explicit
/// semantic anatomical primitives; no external mesh positions or connectivity participate in generation.
/// </summary>
public static class CanonicalAdultTemplate
@@ -62,11 +62,11 @@ public static class CanonicalAdultTemplate
GeneratorVersion,
configHash,
connectivityHash,
- "AuthoredTemplate",
- ["X0 topology and facial/hand/foot quality require visual review; no third-party connectivity used."]);
+ "NONCANONICAL-SyntheticRegressionFixture",
+ ["Failed X0 surface retained only for synthetic qualification, regression and registration stress tests. Not a usable canonical human. No third-party connectivity used."]);
return new CanonicalHumanoid(
"aetheris.humanoid.canonical.v1",
- new("adult-standard-v1", "Canonical Adult Standard V1", "adult-v1", "Adult-only engineering humanoid foundation; not medical or population-statistical authority."),
+ new("adult-standard-v1", "NONCANONICAL X0 Synthetic Regression Body", "adult-v1", "Legacy X0 identity retained for regression replay only; failed procedural surface, not a production canonical adult."),
new("mm", "right-handed", new(1, 0, 0), new(0, 1, 0), new(0, 0, 1), Point3D.Origin, CanonicalAdultStandardV1.NeutralHeightMm),
surface,
skeleton,
diff --git a/Aetheris.Humanoid/HumanoidConstrainedSurface.cs b/Aetheris.Humanoid/HumanoidConstrainedSurface.cs
new file mode 100644
index 00000000..4e53a7b9
--- /dev/null
+++ b/Aetheris.Humanoid/HumanoidConstrainedSurface.cs
@@ -0,0 +1,95 @@
+using System.Numerics;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Humanoid;
+
+public sealed record RegionDistortion(HumanoidRegionKind Region, int Edges,
+ double Median, double P95, double P99, double Maximum, int OrientationReversalProxies);
+public sealed record ConstrainedSurfaceEvidence(bool IsAdmissible, bool Finite, int CollapsedTriangles,
+ IReadOnlyList<string> FlaggedFaceIds, IReadOnlyList<RegionDistortion> Regions,
+ IReadOnlyList<KinematicDiagnostic> Diagnostics);
+public sealed record HumanoidSurfaceEvaluation(IReadOnlyList<Point3D> Positions, ConstrainedSurfaceEvidence Evidence);
+
+/// <summary>
+/// LBS remains interpolation only. A solved pose is required, and surface screening is independent
+/// of pose validity. Failed positions are diagnostic evidence, never an accepted export mesh.
+/// </summary>
+public static class HumanoidConstrainedSurface
+{
+ // A screening bound, not an anatomical claim: catches X1's 16.44x catastrophe while
+ // retaining smaller nonzero deformations for diagnosis. Any reversal also fails.
+ public const double MaximumEdgeRatio = 4;
+
+ public static HumanoidSurfaceEvaluation Evaluate(HumanoidSurface surface, HumanoidSkeleton skeleton,
+ long shapeRevision, SolvedHumanoidPose solved)
+ {
+ if (solved.ShapeRevision != shapeRevision || skeleton.SkeletonId != solved.Skeleton.SkeletonId ||
+ skeleton.RestPoseId != solved.Skeleton.RestPoseId || !skeleton.Joints.SequenceEqual(solved.Skeleton.Joints))
+ throw new InvalidOperationException("HUM208: Solved pose belongs to a different rest skeleton or shape revision; solve again after morphing.");
+ ValidateBindings(surface, skeleton);
+ var positions = HumanoidPosing.EvaluateVertices(surface, solved.Skeleton, solved.State).ToArray();
+ return new(Array.AsReadOnly(positions), Inspect(surface, solved.Skeleton, solved.GlobalTransforms, positions));
+ }
+
+ /// <summary>Explicit diagnostic inspector, also used to compare the historical unconstrained baseline.</summary>
+ public static ConstrainedSurfaceEvidence Inspect(HumanoidSurface surface, HumanoidSkeleton skeleton,
+ IReadOnlyList<Matrix4x4> globals, IReadOnlyList<Point3D> positions)
+ {
+ ValidateBindings(surface, skeleton);
+ if (globals.Count != skeleton.Joints.Count || positions.Count != surface.Vertices.Count)
+ throw new InvalidDataException("Surface inspection array size mismatch.");
+ var finite = positions.All(Finite);
+ var collapsed = 0;
+ var flagged = new List<string>();
+ var regions = new List<RegionDistortion>();
+ foreach (var group in surface.Faces.GroupBy(f => f.Region).OrderBy(g => g.Key))
+ {
+ var edges = new SortedSet<(int, int)>();
+ var reversed = 0;
+ foreach (var f in group)
+ {
+ var original = (surface.Vertices[f.B].Position - surface.Vertices[f.A].Position)
+ .Cross(surface.Vertices[f.C].Position - surface.Vertices[f.A].Position);
+ var normal = (positions[f.B] - positions[f.A]).Cross(positions[f.C] - positions[f.A]);
+ var joint = new[] { f.A, f.B, f.C }.SelectMany(i => surface.SkinWeights[i].Weights)
+ .GroupBy(w => w.JointIndex).OrderByDescending(g => g.Sum(w => w.Weight)).ThenBy(g => g.Key).First().Key;
+ var expected = Vector3.TransformNormal(new((float)original.X, (float)original.Y, (float)original.Z), skeleton.Joints[joint].InverseBind * globals[joint]);
+ if (normal.LengthSquared < 4e-8) collapsed++;
+ else if (normal.Dot(new(expected.X, expected.Y, expected.Z)) <= 0) { reversed++; flagged.Add(f.Id); }
+ Add(f.A, f.B); Add(f.B, f.C); Add(f.C, f.A);
+ }
+ var ratios = edges.Select(e =>
+ {
+ var before = (surface.Vertices[e.Item1].Position - surface.Vertices[e.Item2].Position).Length;
+ var after = (positions[e.Item1] - positions[e.Item2]).Length;
+ // Keep serialized evidence finite while still unconditionally failing collapsed/nonfinite edges.
+ return before > 0 && after > 0 && double.IsFinite(after) ? Math.Max(before / after, after / before) : double.MaxValue;
+ }).Order().ToArray();
+ regions.Add(new(group.Key, ratios.Length, Percentile(.5), Percentile(.95), Percentile(.99), ratios[^1], reversed));
+ double Percentile(double p) => ratios[(int)Math.Ceiling(p * ratios.Length) - 1];
+ void Add(int a, int b) => edges.Add(a < b ? (a, b) : (b, a));
+ }
+ var d = new List<KinematicDiagnostic>();
+ if (!finite || collapsed > 0 || regions.Any(r => r.Maximum > MaximumEdgeRatio))
+ d.Add(new("HUM206", "Surface is nonfinite, collapsed, or exceeds the 4x bidirectional edge-ratio screening bound."));
+ if (flagged.Count > 0) d.Add(new("HUM207", "Dominant-influence transported-normal screen failed; this is an orientation proxy, not a self-intersection count."));
+ return new(d.Count == 0, finite, collapsed, flagged.AsReadOnly(), regions.AsReadOnly(), d.AsReadOnly());
+ }
+
+ private static void ValidateBindings(HumanoidSurface surface, HumanoidSkeleton skeleton)
+ {
+ if (surface.Vertices.Count == 0 || surface.Faces.Count == 0 || surface.SkinWeights.Count != surface.Vertices.Count)
+ throw new InvalidDataException("HUM005: Incomplete surface or skin bindings.");
+ for (var i = 0; i < surface.Vertices.Count; i++)
+ {
+ var skin = surface.SkinWeights[i];
+ if (!Finite(surface.Vertices[i].Position) || skin.VertexIndex != i || skin.Weights.Count == 0 ||
+ skin.Weights.Any(w => w.JointIndex < 0 || w.JointIndex >= skeleton.Joints.Count || !double.IsFinite(w.Weight) || w.Weight < 0) ||
+ Math.Abs(skin.Weights.Sum(w => w.Weight) - 1) > CanonicalAdultStandardV1.WeightTolerance)
+ throw new InvalidDataException("HUM005: Invalid surface coordinate or normalized skin binding.");
+ }
+ if (surface.Faces.Any(f => new[] { f.A, f.B, f.C }.Any(i => i < 0 || i >= surface.Vertices.Count) || f.A == f.B || f.A == f.C || f.B == f.C))
+ throw new InvalidDataException("HUM008: Invalid face binding.");
+ }
+ private static bool Finite(Point3D p) => double.IsFinite(p.X) && double.IsFinite(p.Y) && double.IsFinite(p.Z);
+}
diff --git a/Aetheris.Humanoid/HumanoidKinematics.cs b/Aetheris.Humanoid/HumanoidKinematics.cs
new file mode 100644
index 00000000..81f5424c
--- /dev/null
+++ b/Aetheris.Humanoid/HumanoidKinematics.cs
@@ -0,0 +1,212 @@
+using System.Numerics;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Humanoid;
+
+public enum AnatomicalSolvePolicy { Reject, Project }
+public sealed record AnatomicalJointRequest(HumanoidJointKind Joint, double FlexionDegrees = 0,
+ double AbductionDegrees = 0, double TwistDegrees = 0);
+public sealed record RequestedHumanoidPose(string PoseId, string SkeletonId, string RestPoseId,
+ long ShapeRevision, IReadOnlyList<AnatomicalJointRequest> Joints);
+public sealed record KinematicDiagnostic(string Code, string Message, HumanoidJointKind? Joint = null);
+public sealed record AnatomicalLink(string Id, HumanoidJointKind Parent, HumanoidJointKind Child, double LengthMm);
+public sealed record JointConstraintResidual(HumanoidJointKind Joint, double CenterMm, double LinkLengthMm);
+public sealed record JointProjection(AnatomicalJointRequest Requested, AnatomicalJointRequest Solved,
+ double ParameterCorrectionDegrees);
+
+/// <summary>Parent socket and child origin coincide. Rotation is subordinate to this interface.</summary>
+public abstract record AnatomicalJointInterface(HumanoidJointKind Joint, HumanoidJointKind Parent,
+ Point3D ParentSocket, double MinimumFlexion, double MaximumFlexion);
+public sealed record AnatomicalHingeInterface(HumanoidJointKind Joint, HumanoidJointKind Parent,
+ Point3D ParentSocket, Vector3 Axis, double MinimumFlexion, double MaximumFlexion)
+ : AnatomicalJointInterface(Joint, Parent, ParentSocket, MinimumFlexion, MaximumFlexion);
+public sealed record AnatomicalBallInterface(HumanoidJointKind Joint, HumanoidJointKind Parent,
+ Point3D ParentSocket, double MinimumFlexion, double MaximumFlexion,
+ double MinimumAbduction, double MaximumAbduction, double MaximumTwist)
+ : AnatomicalJointInterface(Joint, Parent, ParentSocket, MinimumFlexion, MaximumFlexion);
+
+/// <summary>Unforgeable through public constructors; immutable snapshots bind a solve to one rest skeleton.</summary>
+public sealed class SolvedHumanoidPose
+{
+ internal SolvedHumanoidPose(HumanoidSkeleton skeleton, long revision, HumanoidPoseState state,
+ Matrix4x4[] globals, AnatomicalJointRequest[] joints, JointConstraintResidual[] residuals)
+ {
+ Skeleton = skeleton; ShapeRevision = revision; State = state;
+ GlobalTransforms = Array.AsReadOnly(globals); Joints = Array.AsReadOnly(joints);
+ Residuals = Array.AsReadOnly(residuals);
+ }
+ internal HumanoidSkeleton Skeleton { get; }
+ internal HumanoidPoseState State { get; }
+ public long ShapeRevision { get; }
+ public IReadOnlyList<Matrix4x4> GlobalTransforms { get; }
+ public IReadOnlyList<AnatomicalJointRequest> Joints { get; }
+ public IReadOnlyList<JointConstraintResidual> Residuals { get; }
+}
+public sealed record HumanoidSolveResult(SolvedHumanoidPose? Pose,
+ IReadOnlyList<KinematicDiagnostic> Diagnostics, IReadOnlyList<JointProjection> Projections)
+{
+ public bool IsSolved => Pose is not null;
+}
+
+/// <summary>
+/// Bounded X2 progression: hip ball and elbow/knee hinge interfaces. Other joints remain at rest.
+/// Shoulder requests fail closed until a qualified compound shoulder interface exists.
+/// Angles are engineering coordinates relative to the supplied rest pose, not clinical measurements.
+/// </summary>
+public static class HumanoidKinematicSolver
+{
+ public const double LinearToleranceMm = .001;
+ public const string Version = "humanoid.x2.lower-limb-and-hinge.v1";
+
+ public static IReadOnlyList<AnatomicalJointInterface> Interfaces(HumanoidSkeleton skeleton)
+ {
+ var result = new List<AnatomicalJointInterface>();
+ foreach (var joint in skeleton.Joints)
+ {
+ if (joint.ParentIndex is not int parent) continue;
+ var kind = joint.Kind.ToString();
+ if (kind.EndsWith("Hip"))
+ result.Add(new AnatomicalBallInterface(joint.Kind, skeleton.Joints[parent].Kind,
+ joint.LocalRest.Translation, -20, 120, -25, 45, 45));
+ if (kind.EndsWith("Knee") || kind.EndsWith("Elbow"))
+ {
+ var isKnee = kind.EndsWith("Knee");
+ var nextKind = Enum.Parse<HumanoidJointKind>((joint.Side == AnatomicalSide.Left ? "Left" : "Right") + (isKnee ? "Ankle" : "Wrist"));
+ var next = skeleton.Joints.SingleOrDefault(j => j.Kind == nextKind);
+ if (next is null) continue;
+ var direction = Position(next.GlobalBind) - Position(joint.GlobalBind);
+ var axis = Vector3.Cross(direction, Vector3.UnitY);
+ if (axis.LengthSquared() < 1e-10f) continue;
+ axis = Vector3.Normalize(axis) * (isKnee ? -1 : 1);
+ result.Add(new AnatomicalHingeInterface(joint.Kind, skeleton.Joints[parent].Kind,
+ joint.LocalRest.Translation, axis, 0, isKnee ? 140 : 145));
+ }
+ }
+ return result.AsReadOnly();
+ }
+
+ public static IReadOnlyList<AnatomicalLink> Links(HumanoidSkeleton skeleton) => skeleton.Joints
+ .Where(j => j.ParentIndex is not null).Select(j => new AnatomicalLink("link:" + j.Kind,
+ skeleton.Joints[j.ParentIndex!.Value].Kind, j.Kind,
+ Vector3.Distance(Position(j.GlobalBind), Position(skeleton.Joints[j.ParentIndex.Value].GlobalBind))))
+ .ToArray();
+
+ public static HumanoidSolveResult Solve(HumanoidSkeleton skeleton, RequestedHumanoidPose request,
+ long shapeRevision = 0, AnatomicalSolvePolicy policy = AnatomicalSolvePolicy.Reject)
+ {
+ var diagnostics = new List<KinematicDiagnostic>();
+ var projections = new List<JointProjection>();
+ HumanoidSolveResult Reject(string code, string message, HumanoidJointKind? joint = null)
+ { diagnostics.Add(new(code, message, joint)); return new(null, diagnostics.AsReadOnly(), projections.AsReadOnly()); }
+ if (!Enum.IsDefined(policy)) return Reject("HUM208", "Unknown solve policy.");
+ if (request.SkeletonId != skeleton.SkeletonId || request.RestPoseId != skeleton.RestPoseId || request.ShapeRevision != shapeRevision)
+ return Reject("HUM208", "Requested skeleton, rest pose or shape revision is stale.");
+ var skeletonError = ValidateRest(skeleton);
+ if (skeletonError is not null) return Reject("HUM208", skeletonError);
+ // Freeze all collections used by the solve. Caller mutation cannot alter an issued pose.
+ skeleton = skeleton with { Joints = Array.AsReadOnly(skeleton.Joints.ToArray()),
+ Symmetry = new System.Collections.ObjectModel.ReadOnlyDictionary<HumanoidJointKind, HumanoidJointKind>(skeleton.Symmetry.ToDictionary()) };
+ var inputs = request.Joints.ToArray();
+ if (inputs.Select(j => j.Joint).Distinct().Count() != inputs.Length)
+ return Reject("HUM208", "Duplicate requested joint.");
+ var interfaces = Interfaces(skeleton).ToDictionary(j => j.Joint);
+ var states = new List<AnatomicalJointRequest>();
+ var rotations = new List<JointPose>();
+ foreach (var input in inputs.OrderBy(j => j.Joint))
+ {
+ if (!double.IsFinite(input.FlexionDegrees) || !double.IsFinite(input.AbductionDegrees) || !double.IsFinite(input.TwistDegrees))
+ return Reject("HUM208", "Joint coordinates must be finite.", input.Joint);
+ if (!interfaces.TryGetValue(input.Joint, out var joint))
+ return Reject("HUM209", "No qualified anatomical interface for this joint; arbitrary transforms are not admitted.", input.Joint);
+ var solved = Project(input, joint);
+ var deltas = new[] { Math.Abs(input.FlexionDegrees - solved.FlexionDegrees),
+ Math.Abs(input.AbductionDegrees - solved.AbductionDegrees), Math.Abs(input.TwistDegrees - solved.TwistDegrees) };
+ var scale = deltas.Max();
+ var correction = scale == 0 ? 0 : Math.Min(double.MaxValue, scale * Math.Sqrt(deltas.Sum(d => Square(d / scale))));
+ if (correction > 1e-9)
+ {
+ if (policy == AnatomicalSolvePolicy.Reject) return Reject("HUM200", "Requested joint coordinates exceed the coupled admissible domain.", input.Joint);
+ projections.Add(new(input, solved, correction));
+ diagnostics.Add(new("HUM205", "Projected joint coordinates into the engineering domain.", input.Joint));
+ }
+ states.Add(solved);
+ Quaternion rotation;
+ if (joint is AnatomicalHingeInterface hinge) rotation = Rotate(hinge.Axis, solved.FlexionDegrees);
+ else
+ {
+ // Exponential-map swing in the anatomical sagittal/coronal plane, followed by axial twist.
+ // This is a coupled ellipse, not independent Euler limits.
+ var sign = input.Joint.ToString().StartsWith("Left") ? 1 : -1;
+ var swing = new Vector3((float)solved.FlexionDegrees, (float)(sign * solved.AbductionDegrees), 0);
+ var angle = swing.Length();
+ var q = angle == 0 ? Quaternion.Identity : Rotate(swing / angle, angle);
+ rotation = Quaternion.Concatenate(Rotate(-Vector3.UnitZ, sign * solved.TwistDegrees), q);
+ }
+ rotations.Add(new(input.Joint, rotation));
+ }
+ var state = new HumanoidPoseState(request.PoseId, rotations.AsReadOnly(), HumanoidTransform.Identity);
+ var globals = HumanoidPosing.GlobalPose(skeleton, state).ToArray();
+ var residuals = new List<JointConstraintResidual>();
+ for (var i = 0; i < skeleton.Joints.Count; i++)
+ {
+ var j = skeleton.Joints[i];
+ if (j.ParentIndex is not int p) continue;
+ var socket = j.LocalRest.Translation;
+ var expected = Vector3.Transform(new((float)socket.X, (float)socket.Y, (float)socket.Z), globals[p]);
+ var center = Vector3.Distance(expected, Position(globals[i]));
+ var length = Math.Abs(Vector3.Distance(Position(globals[i]), Position(globals[p])) -
+ Vector3.Distance(Position(j.GlobalBind), Position(skeleton.Joints[p].GlobalBind)));
+ residuals.Add(new(j.Kind, center, length));
+ if (!double.IsFinite(center) || center > LinearToleranceMm) return Reject("HUM201", "Joint center residual exceeds 0.001 mm.", j.Kind);
+ if (!double.IsFinite(length) || length > LinearToleranceMm) return Reject("HUM202", "Link length residual exceeds 0.001 mm.", j.Kind);
+ }
+ return new(new(skeleton, shapeRevision, state, globals, states.ToArray(), residuals.ToArray()), diagnostics.AsReadOnly(), projections.AsReadOnly());
+ }
+
+ private static AnatomicalJointRequest Project(AnatomicalJointRequest input, AnatomicalJointInterface joint)
+ {
+ if (joint is AnatomicalHingeInterface)
+ return input with { FlexionDegrees = Math.Clamp(input.FlexionDegrees, joint.MinimumFlexion, joint.MaximumFlexion), AbductionDegrees = 0, TwistDegrees = 0 };
+ var ball = (AnatomicalBallInterface)joint;
+ // Clamp before squaring to avoid overflow on adversarial finite coordinates.
+ var f = Math.Clamp(input.FlexionDegrees, ball.MinimumFlexion, ball.MaximumFlexion);
+ var a = Math.Clamp(input.AbductionDegrees, ball.MinimumAbduction, ball.MaximumAbduction);
+ var radius = Math.Sqrt(Square(f / (f < 0 ? -ball.MinimumFlexion : ball.MaximumFlexion)) +
+ Square(a / (a < 0 ? -ball.MinimumAbduction : ball.MaximumAbduction)));
+ if (radius > 1) { f /= radius; a /= radius; }
+ var twistLimit = ball.MaximumTwist * (1 - .5 * Math.Min(radius, 1));
+ return input with { FlexionDegrees = f, AbductionDegrees = a, TwistDegrees = Math.Clamp(input.TwistDegrees, -twistLimit, twistLimit) };
+ }
+
+ private static string? ValidateRest(HumanoidSkeleton skeleton)
+ {
+ if (skeleton.Joints.Count == 0 || skeleton.Joints.Select(j => j.Kind).Distinct().Count() != skeleton.Joints.Count)
+ return "Skeleton must have nonempty, unique joints.";
+ for (var i = 0; i < skeleton.Joints.Count; i++)
+ {
+ var j = skeleton.Joints[i];
+ if (j.ParentIndex is int p && (p < 0 || p >= i)) return "Skeleton parents must precede children.";
+ if (i == 0 ? j.ParentIndex is not null : j.ParentIndex is null) return "Skeleton must have exactly one root in first position.";
+ if (j.LocalRest.Rotation != Quaternion.Identity) return "X2 progression requires translation-only rest frames; rotated rest frames are not silently reinterpreted.";
+ var expectedSide = j.Kind.ToString().StartsWith("Left") ? AnatomicalSide.Left : j.Kind.ToString().StartsWith("Right") ? AnatomicalSide.Right : AnatomicalSide.Center;
+ if (!Enum.IsDefined(j.Kind) || j.Side != expectedSide) return "Invalid joint kind or anatomical side.";
+ var expected = j.ParentIndex is int parent ? j.LocalRest.Matrix * skeleton.Joints[parent].GlobalBind : j.LocalRest.Matrix;
+ if (!Near(expected, j.GlobalBind) || !Near(j.GlobalBind * j.InverseBind, Matrix4x4.Identity)) return "Non-finite or inconsistent rest/bind frames.";
+ var name = j.Kind.ToString();
+ var stem = name.StartsWith("Left") ? name[4..] : name.StartsWith("Right") ? name[5..] : name;
+ var expectedParent = stem switch { "Hip" => "Pelvis", "Knee" => name.Replace("Knee", "Hip"), "Ankle" => name.Replace("Ankle", "Knee"), "Elbow" => name.Replace("Elbow", "Shoulder"), "Wrist" => name.Replace("Wrist", "Elbow"), _ => null };
+ if (expectedParent is not null && (j.ParentIndex is not int pi || skeleton.Joints[pi].Kind.ToString() != expectedParent)) return "Anatomical parent/side mismatch at " + name;
+ if (expectedParent is not null && j.LocalRest.Translation == Point3D.Origin) return "Zero-length anatomical link at " + name;
+ }
+ return null;
+ }
+
+ internal static bool Near(Matrix4x4 a, Matrix4x4 b)
+ {
+ float[] Values(Matrix4x4 m) => [m.M11,m.M12,m.M13,m.M14,m.M21,m.M22,m.M23,m.M24,m.M31,m.M32,m.M33,m.M34,m.M41,m.M42,m.M43,m.M44];
+ return Values(a).Zip(Values(b)).All(x => float.IsFinite(x.First) && float.IsFinite(x.Second) && Math.Abs(x.First - x.Second) <= .0001);
+ }
+ private static Quaternion Rotate(Vector3 axis, double degrees) => Quaternion.CreateFromAxisAngle(axis, (float)(degrees * Math.PI / 180));
+ private static double Square(double x) => x * x;
+ internal static Vector3 Position(Matrix4x4 m) => new(m.M41, m.M42, m.M43);
+}
diff --git a/Aetheris.Humanoid/HumanoidModel.cs b/Aetheris.Humanoid/HumanoidModel.cs
index 31134474..a1b7b8bb 100644
--- a/Aetheris.Humanoid/HumanoidModel.cs
+++ b/Aetheris.Humanoid/HumanoidModel.cs
@@ -74,7 +74,7 @@ public sealed record HumanoidSurface(
IReadOnlyList<HumanoidComponent> Components,
IReadOnlyDictionary<HumanoidRegionKind, HumanoidRegionKind> RegionSymmetry);
-/// <summary>Column-vector rigid transform. Local joint transforms map child-local coordinates into the parent frame.</summary>
+/// <summary>System.Numerics row-vector rigid transform. Local joint transforms map child-local coordinates into the parent frame.</summary>
public readonly record struct HumanoidTransform(Point3D Translation, Quaternion Rotation)
{
public static HumanoidTransform Identity => new(Point3D.Origin, Quaternion.Identity);
diff --git a/Aetheris.Humanoid/HumanoidRuntime.cs b/Aetheris.Humanoid/HumanoidRuntime.cs
index d47661ce..530747fa 100644
--- a/Aetheris.Humanoid/HumanoidRuntime.cs
+++ b/Aetheris.Humanoid/HumanoidRuntime.cs
@@ -88,14 +88,21 @@ public static class HumanoidMeasurements
public static class HumanoidPosing
{
public static IReadOnlyList<Matrix4x4> GlobalPose(CanonicalHumanoid h,HumanoidPoseState pose)
+ => GlobalPose(h.Skeleton, pose);
+
+ public static IReadOnlyList<Matrix4x4> GlobalPose(HumanoidSkeleton skeleton,HumanoidPoseState pose)
{
- var rotations=pose.LocalRotations.ToDictionary(x=>x.Joint,x=>x.LocalRotation);var result=new Matrix4x4[h.Skeleton.Joints.Count];
- for(var i=0;i<result.Length;i++){var j=h.Skeleton.Joints[i];var q=rotations.GetValueOrDefault(j.Kind,Quaternion.Identity);var local=Matrix4x4.CreateFromQuaternion(q)*j.LocalRest.Matrix;result[i]=j.ParentIndex is int parent?local*result[parent]:local*pose.RootTransform.Matrix;}return result;
+ var rotations=pose.LocalRotations.ToDictionary(x=>x.Joint,x=>x.LocalRotation);var result=new Matrix4x4[skeleton.Joints.Count];
+ for(var i=0;i<result.Length;i++){var j=skeleton.Joints[i];var q=rotations.GetValueOrDefault(j.Kind,Quaternion.Identity);var local=Matrix4x4.CreateFromQuaternion(q)*j.LocalRest.Matrix;result[i]=j.ParentIndex is int parent?local*result[parent]:local*pose.RootTransform.Matrix;}return result;
}
public static IReadOnlyList<Point3D> EvaluateVertices(CanonicalHumanoid h,HumanoidPoseState pose)
+ => EvaluateVertices(h.Surface, h.Skeleton, pose);
+
+ /// <summary>Shared skin evaluator for canonical instances and explicitly unpromoted adoption candidates.</summary>
+ public static IReadOnlyList<Point3D> EvaluateVertices(HumanoidSurface surface,HumanoidSkeleton skeleton,HumanoidPoseState pose)
{
- var globals=GlobalPose(h,pose);var output=new Point3D[h.Surface.Vertices.Count];
- foreach(var skin in h.Surface.SkinWeights){var source=h.Surface.Vertices[skin.VertexIndex].Position;var p=new Vector3((float)source.X,(float)source.Y,(float)source.Z);var sum=Vector3.Zero;foreach(var w in skin.Weights){var transformed=Vector3.Transform(p,h.Skeleton.Joints[w.JointIndex].InverseBind*globals[w.JointIndex]);sum+=transformed*(float)w.Weight;}output[skin.VertexIndex]=new(sum.X,sum.Y,sum.Z);}return output;
+ var globals=GlobalPose(skeleton,pose);var output=new Point3D[surface.Vertices.Count];
+ foreach(var skin in surface.SkinWeights){var source=surface.Vertices[skin.VertexIndex].Position;var p=new Vector3((float)source.X,(float)source.Y,(float)source.Z);var sum=Vector3.Zero;foreach(var w in skin.Weights){var transformed=Vector3.Transform(p,skeleton.Joints[w.JointIndex].InverseBind*globals[w.JointIndex]);sum+=transformed*(float)w.Weight;}output[skin.VertexIndex]=new(sum.X,sum.Y,sum.Z);}return output;
}
public static AttachmentFrame EvaluateAttachment(CanonicalHumanoid h,string siteId,HumanoidPoseState pose)
{
@@ -132,7 +139,17 @@ public static class HumanoidArtifactIO
public static JsonSerializerOptions JsonOptions { get; }=CreateOptions();
private static JsonSerializerOptions CreateOptions(){var o=new JsonSerializerOptions{WriteIndented=true,PropertyNamingPolicy=JsonNamingPolicy.CamelCase,IncludeFields=true};o.Converters.Add(new JsonStringEnumConverter());return o;}
public static void Save(CanonicalHumanoid humanoid,string path){Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(path))!);File.WriteAllText(path,JsonSerializer.Serialize(humanoid,JsonOptions));}
- public static CanonicalHumanoid Load(string path)=>JsonSerializer.Deserialize<CanonicalHumanoid>(File.ReadAllText(path),JsonOptions)??throw new InvalidDataException("Canonical humanoid artifact was empty.");
+ public static CanonicalHumanoid Load(string path)
+ {
+ var json = File.ReadAllText(path);
+ using var document = JsonDocument.Parse(json);
+ if (!document.RootElement.TryGetProperty("schemaVersion", out var schema) || schema.GetString() != "aetheris.humanoid.canonical.v1")
+ throw new InvalidDataException("Expected a canonical humanoid artifact; an adoption candidate is not a canonical runtime instance.");
+ var result = JsonSerializer.Deserialize<CanonicalHumanoid>(json, JsonOptions);
+ if (result?.Surface is null || result.Skeleton is null || result.Provenance is null)
+ throw new InvalidDataException("Canonical humanoid artifact is incomplete.");
+ return result;
+ }
public static void SaveObj(CanonicalHumanoid humanoid,string path,IReadOnlyList<Point3D>? positions=null)
{
positions??=humanoid.Surface.Vertices.Select(x=>x.Position).ToArray();Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(path))!);using var w=new StreamWriter(path,false,new UTF8Encoding(false));w.WriteLine("# Aetheris canonical humanoid display mesh; millimeters; +X anatomical right +Y forward +Z up");foreach(var p in positions)w.WriteLine(FormattableString.Invariant($"v {p.X:R} {p.Y:R} {p.Z:R}"));foreach(var group in humanoid.Surface.Faces.Select((f,i)=>(f,i)).GroupBy(x=>x.f.Region)){w.WriteLine("g "+group.Key);foreach(var (f,_) in group)w.WriteLine($"f {f.A+1} {f.B+1} {f.C+1}");}
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md
index ef6f5bbb..392dc714 100644
--- a/THIRD_PARTY_NOTICES.md
+++ b/THIRD_PARTY_NOTICES.md
@@ -4,6 +4,32 @@ Aetheris source code is licensed separately under the GNU Affero General
Public License v3.0 (`AGPL-3.0`). The assets below retain their respective
licenses, terms, and provenance and are not relicensed as Aetheris source code.
+## Antonia Polygon original base figure
+
+The HUMANOID-X1 adoption candidate is based on **Antonia Polygon** by
+**Olaf Delgado-Friedrichs**, with contributions from phantom3D, MikeJ and
+others credited in the original package. The original figure is licensed under
+[Creative Commons Attribution 3.0 Unported](https://creativecommons.org/licenses/by/3.0/).
+Source: [Antonia 1.2.0](https://github.com/odf/Antonia.Polygon/tree/08c9767691daad1382dfc6980ee83e31514b4879).
+The original notice is preserved without modification at
+`fixtures/Canonical/Humanoid/antonia-original-LICENSE.txt`; exact input hashes
+and component scope are in the adjacent `antonia-original.sidecar.json`.
+
+Aetheris modifies/adapts selected original body and eye geometry by converting
+the coordinate frame, freezing binding triangles, assigning stable identities
+and provisional semantic regions, constructing joint proxies and skin weights,
+and testing a neutral A-pose conversion. Original vertex/polygon mappings are
+retained. **No endorsement is implied**, and Aetheris makes no exclusive
+authorship claim over the adopted topology. These derived geometric assets
+retain their source license and attribution; they are not relicensed as AGPL code.
+
+Source and expanded derived geometry are generated under ignored
+`artifacts/local/humanoid-x1/`; this repository tracks the original notice,
+admission manifest, reproducible implementation and compact evidence. The
+candidate has **not** been promoted to the canonical adult runtime. No
+CharMorph/Blender conversion, source rig/weights, textures, morph arrays,
+shared libraries, or separately distributed extras are consumed by this path.
+
## Stanford Bunny
The reconstructed Bunny evidence under
diff --git a/docs/public/humanoid-kinematics.md b/docs/public/humanoid-kinematics.md
new file mode 100644
index 00000000..160ca2e8
--- /dev/null
+++ b/docs/public/humanoid-kinematics.md
@@ -0,0 +1,151 @@
+# Humanoid X2 constrained kinematics research
+
+**Status: Meaningful progression, not an accepted humanoid.** Antonia remains
+the X1 adoption candidate. The new solve admits hip, elbow and knee requests;
+it does not claim a complete anatomical domain or replace the historical
+quaternion research API. See the [X2 release record](../release/HUMANOID-X2.md).
+
+## Public API
+
+The `Aetheris.Humanoid` project exposes:
+
+```csharp
+using System.Text.Json;
+using Aetheris.Humanoid;
+
+var candidate = JsonSerializer.Deserialize<AntoniaAdoptionCandidate>(
+ File.ReadAllText("artifacts/local/humanoid-x1/antonia-adoption-candidate.json"),
+ HumanoidArtifactIO.JsonOptions)!;
+var skeleton = candidate.PreparedSkeleton;
+var surface = candidate.SourcePoseSurface with
+{
+ Vertices = candidate.SourcePoseSurface.Vertices.Select((v, i) =>
+ v with { Position = candidate.PreparedPositions[i] }).ToArray()
+};
+const long shapeRevision = 0;
+var request = new RequestedHumanoidPose(
+ "hip-knee-90", skeleton.SkeletonId, skeleton.RestPoseId, shapeRevision,
+ [new(HumanoidJointKind.LeftHip, FlexionDegrees: 90),
+ new(HumanoidJointKind.LeftKnee, FlexionDegrees: 90)]);
+var result = HumanoidKinematicSolver.Solve(skeleton, request, shapeRevision);
+if (result.Pose is { } solved)
+{
+ // GlobalTransforms has the same order as skeleton.Joints.
+ // Joints reports solved coordinates; Residuals exposes CenterMm and LinkLengthMm.
+ var surfaceResult = HumanoidConstrainedSurface.Evaluate(surface, skeleton, shapeRevision, solved);
+ // Positions remain available as diagnostic evidence when Evidence.IsAdmissible is false.
+ // Do not present a failed surface as an accepted humanoid or production export.
+}
+// Inspect result.Diagnostics and result.Projections even when a solve succeeds.
+```
+
+`AnatomicalSolvePolicy.Reject` is the default. Pass
+`policy: AnatomicalSolvePolicy.Project` to request deterministic parameter
+projection. It is radial projection after component clipping, not a minimum
+geodesic-distance optimization. Rejected requests have no `Pose`.
+
+`RequestedHumanoidPose` accepts semantic angles only; it cannot express joint
+translation, scale, arbitrary quaternion, or link-length edits. These are
+not disguised as zero-residual requests. Duplicate/unknown joints, nonfinite
+angles, stale skeleton/rest/revision identities, corrupt binds, invalid
+hierarchy and side mismatches fail closed. `SolvedHumanoidPose` has no public
+constructor or mutable exposed collections. Skin evaluation rejects a solved
+pose from another rest skeleton or shape revision.
+
+For the local candidate, deserialize `AntoniaAdoptionCandidate` with
+`HumanoidArtifactIO.JsonOptions`, use `PreparedSkeleton`, and replace the
+positions in `SourcePoseSurface.Vertices` with `PreparedPositions` using `with`.
+Use revision 0. Do not load this candidate as `CanonicalHumanoid` or substitute
+the X0 synthetic fixture. This conversion changes positions only; connectivity
+and weights are retained.
+
+## Interfaces and pose invariants
+
+`HumanoidKinematicSolver.Interfaces(skeleton)` returns typed
+`AnatomicalHingeInterface` and `AnatomicalBallInterface` definitions with
+participants, parent socket, axes/ranges. `Links(skeleton)` returns parent/child
+identities and rest lengths. They follow Aetheris' participant, constraint,
+residual and explicit rejection patterns. This progression does not register a
+new Firmament `Concept<T>` or `Interface<T>` compiler family.
+
+| Interface | Admitted coordinates | Projection and equation |
+|---|---|---|
+| Hip | Flexion −20..120°, abduction −25..45°, twist ±45° at rest | Normalized flexion/abduction squared sum ≤1; twist limit decreases to ±22.5° at swing boundary |
+| Elbow | Flexion 0..145° | Hinge axis from rest forearm × forward; abduction and twist zero |
+| Knee | Flexion 0..140° | Hinge axis opposite rest lower leg × forward; abduction and twist zero |
+
+Hip uses an exponential-map swing vector `(flexion, side*abduction, 0)` and
+axial rotation around −Z. This is an engineering approximation in the supplied
+translation-only anatomical rest frame, not a clinically calibrated femoral
+coordinate system. Positive hip flexion moves the leg forward; positive knee
+flexion moves the lower leg backward. The elbow axis is rebuilt from rest
+geometry. The X1 sweep used +X at the knee (opposite the X2 knee direction), and
++Y at the elbow (abduction rather than a forearm flexion hinge).
+
+These bounds are explicit engineering assumptions. The
+[CDC reference study](https://archive.cdc.gov/www_cdc_gov/ncbddd/jointrom/index.html)
+provides context for useful adult flexion ranges; the coupled domain and
+twist reduction above are not values validated by that study. No medical
+certification or complete human ROM coverage is claimed.
+
+Every parent socket transformed by the parent's solved frame must coincide
+with the child origin within **0.001 mm**. All parent-child distances must
+remain within **0.001 mm** of rest length. Rest/bind consistency uses a
+0.0001 matrix-component tolerance. Finite rigid transforms, acyclic ordered
+hierarchy, side consistency and current revision are checked before skinning.
+Input order is canonicalized by joint kind. Unsupported joints remain at rest
+when omitted; explicitly requesting one returns `HUM209`, even at zero.
+
+The current shoulder is deliberately **unsupported**. There is no qualified
+clavicle/scapular coupling. A request for `LeftShoulder` abduction 90° returns
+`HUM209` with no solved pose; it does not silently use a ball joint. Wrist,
+ankle, neck, spine and finger requests are also unsupported. Collision,
+self-contact, scapular frames and full anatomical pose-concept validation
+remain unimplemented.
+
+## Surface screening and migration boundary
+
+Order: validate rest and request → reject/project coordinates → compute rigid
+transforms → validate center/length residuals → LBS → inspect surface.
+`HUM200` means a rejected range; `HUM201/202` identify failed center/length
+residuals; `HUM205` records projection; `HUM208` identifies invalid/stale input;
+`HUM209` identifies unsupported interfaces. Surface `HUM206/207` diagnostics
+are independent of pose success.
+
+The surface screen rejects nonfinite positions, triangles below 0.0001 mm²,
+bidirectional edge ratio above 4, or a dominant-influence normal reversal.
+It reports unique edges per face region with nearest-rank median/p95/p99/max.
+An edge shared by different regions participates in each region's statistics.
+The 4× bound is a provisional catastrophe screen, not visual acceptance.
+The reversal count is a transported-normal proxy, not a certified inversion
+or self-intersection count. Self-intersection and volume are unavailable.
+
+There are **no admitted Antonia foot attachment frames, landmarks, morphs or
+measurements**. The existing 88 landmarks/19 attachments belong to the X0
+regression fixture. A solved ankle matrix is not a sole attachment frame.
+Morphing must rebuild binds and frames and increment the shape revision before
+solving again. Antonia morph qualification is still blocked.
+
+`HumanoidPosing` remains the unconstrained historical evaluator needed for
+source-pose preparation and X0/X1 comparison. It can bypass X2 constraints;
+therefore the overall runtime replacement criterion is not met. Callers of
+the new constrained path must use `HumanoidKinematicSolver` followed by
+`HumanoidConstrainedSurface`, and preserve failure evidence.
+
+## Reproduce
+
+```powershell
+dotnet run --project tools/Aetheris.Humanoid.X0 -- constrained-antonia --input artifacts/local/humanoid-x1/antonia-adoption-candidate.json --out-dir artifacts/local/humanoid-x2
+dotnet test Aetheris.Humanoid.Tests/Aetheris.Humanoid.Tests.csproj
+```
+
+The candidate is produced by the existing [X1 workflow](humanoid-research.md).
+`evidence.json` is deterministic; `timings.json` is separate. Failed OBJ
+outputs include `.failed-diagnostic` in their filenames. Passing numeric
+screens do not constitute human visual signoff.
+
+Render with Blender's background mode and `scripts/render-humanoid-x2.py`.
+Optional repeatable `--fbx <local-file>` arguments inspect supplied references
+without copying them into the repository. ASCII FBX receives a declaration
+inventory because the installed Blender importer rejects ASCII; no FBX posed
+deformation comparison is claimed in that case.
diff --git a/docs/public/humanoid-research.md b/docs/public/humanoid-research.md
new file mode 100644
index 00000000..1baa8fb2
--- /dev/null
+++ b/docs/public/humanoid-research.md
@@ -0,0 +1,57 @@
+# Humanoid research tooling
+
+The humanoid module is experimental. **No usable canonical adult is currently
+promoted.** `CanonicalAdultTemplate.Create()` retains the NONCANONICAL X0
+synthetic body for regression tests. Its legacy `adult.standard.v1` identity
+must not be mistaken for a qualified Antonia body.
+
+The X1 tool admits the original Antonia 1.2.0 base figure with its CC-BY 3.0
+notice, retains source polygon identity, generates candidate skin weights and
+evaluates A-pose preparation through Aetheris's normal skin evaluator. Its
+output is an `AntoniaAdoptionCandidate`, **not** a `CanonicalHumanoid`.
+Candidate loading as a canonical runtime artifact is rejected.
+
+From the repository root:
+
+```powershell
+pwsh -File scripts/qualify-humanoid-x1.ps1
+# Cached inputs, focused tests, and evidence rendering:
+pwsh -File scripts/qualify-humanoid-x1.ps1 -SkipFetch -SkipFullTests
+# Direct bounded adoption, without Blender or network:
+dotnet run --project tools/Aetheris.Humanoid.X0 -- adopt-antonia --source artifacts/local/humanoid-x1/source/Antonia-1.2.obj --notice artifacts/local/humanoid-x1/source/README --out-dir artifacts/local/humanoid-x1
+```
+
+The script verifies source/license hashes, runs adoption twice, checks exact
+JSON/OBJ replay, renders evidence, and runs tests. `-SkipRender` omits Blender;
+Blender only renders the exported Aetheris geometry. Source rig, CharMorph and
+Rigify are never runtime dependencies. A successful reproduction exit means
+the recorded experiment ran, **not** that deformation passed.
+
+Inspect `adoption-evidence.json` for counts, identities, bind error, symmetry,
+weight coverage and each failed pose. The expanded
+`antonia-adoption-candidate.json` contains source/prepared positions, fixed
+binding triangles, original quads, source index maps, regions, components,
+paired vertices, 55-joint proxies, weights, preparation rotations and
+provenance. All generated output stays in ignored `artifacts/local/humanoid-x1/`.
+
+The first generated weights cause shoulder and hip deformation defects. X1
+therefore supplies **no canonical measurement, landmark, attachment or morph
+API for this candidate**. The existing `inspect`, `morph`, `pose`, and `sweep`
+commands still operate on X0-format runtime artifacts; they cannot qualify an
+X1 candidate by relabeling it.
+
+For a future separately licensed reference, retain it as `ImportedHumanoid`,
+verify its frame, pose and component admission, then fit positions against the
+eventually approved canonical topology with reviewed landmarks and bounded
+correspondence. Keep canonical vertex/face IDs, connectivity and binding
+triangulation unchanged. Source vertex indices, rig names and weights cannot
+be copied by index onto a different topology. Any unresolved admission or
+deformation gate prevents canonical promotion.
+
+Implementing that adapter is blocked until a qualified target and its explicit
+versioned identity are selected. The legacy X0 `adult.standard.v1` must not be
+reused for Antonia's different connectivity. Fitting algorithms and numerical
+budgets will need qualification against the approved target.
+
+See [the X1 release record](../release/HUMANOID-X1.md) for evidence and
+[third-party notices](../../THIRD_PARTY_NOTICES.md) for attribution.
diff --git a/docs/release/HUMANOID-X0.md b/docs/release/HUMANOID-X0.md
index 6deb0e43..a151d441 100644
--- a/docs/release/HUMANOID-X0.md
+++ b/docs/release/HUMANOID-X0.md
@@ -3,6 +3,13 @@
Date: 2026-09-16
Verdict: **Meaningful progression**
+**X1 status correction:** The procedural body below is now explicitly
+`NONCANONICAL-SyntheticRegressionFixture`; historical identity and test APIs
+remain for replay only. The earlier proposed follow-up of improving its Antonia
+fit is superseded by [HUMANOID-X1](HUMANOID-X1.md), which adopts original
+Antonia topology as an unpromoted candidate. Historical descriptions of the X0
+surface as canonical are not a current usability or production-admission claim.
+
> Did Aetheris successfully create and validate an independently authored canonical adult humanoid topology that can be deterministically fitted to a screened licensed reference and used as a stable semantic humanoid substrate?
**Partly.** Aetheris now owns and validates a real canonical adult domain: independently generated topology, stable identity, semantic regions, skeleton, skin weights, typed landmarks, measurement protocols, morphs, attachment frames, display export, diagnostics, and provenance. Deterministic Antonia registration runs and preserves connectivity, but it does not meet X0 fit budgets. The pose sweep also reports orientation-reversal proxies at the major joints. In addition, the recon review does not clear the converted `char.blend` component as canonical output. The authored neutral template therefore remains canonical; fitted positions are local research evidence only.
diff --git a/docs/release/HUMANOID-X1.evidence.json b/docs/release/HUMANOID-X1.evidence.json
new file mode 100644
index 00000000..38d3c21f
--- /dev/null
+++ b/docs/release/HUMANOID-X1.evidence.json
@@ -0,0 +1,449 @@
+{
+ "schema": "aetheris.humanoid.x1-adoption-evidence.v1",
+ "status": "FailedDeformationGate-NONCANONICAL",
+ "sourceRevision": "08c9767691daad1382dfc6980ee83e31514b4879",
+ "sourceSha256": "0d9e918f19a497adebb51dc8f4ac921c41753b157c50809a1d760dd45ec01194",
+ "sourceVertices": 38822,
+ "sourceQuads": 38614,
+ "selectedVertices": 27193,
+ "selectedQuads": 27112,
+ "bindingTriangles": 54224,
+ "topologyId": "aetheris.humanoid.antonia.adoption-candidate.v1",
+ "connectivityHash": "2e2f787499ba2da1f02bab14f352b86070938fbb5d7cae60e8bd7d59edb2b7a2",
+ "components": [
+ {
+ "id": "antonia:OuterSkin",
+ "kind": "OuterSkin",
+ "triangles": 51408
+ },
+ {
+ "id": "antonia:LeftEye",
+ "kind": "LeftEye",
+ "triangles": 1408
+ },
+ {
+ "id": "antonia:RightEye",
+ "kind": "RightEye",
+ "triangles": 1408
+ }
+ ],
+ "regions": [
+ {
+ "region": "Abdomen",
+ "triangles": 1424
+ },
+ {
+ "region": "Chest",
+ "triangles": 1936
+ },
+ {
+ "region": "Head",
+ "triangles": 10336
+ },
+ {
+ "region": "Pelvis",
+ "triangles": 3056
+ },
+ {
+ "region": "LeftToes",
+ "triangles": 3392
+ },
+ {
+ "region": "LeftShoulder",
+ "triangles": 1992
+ },
+ {
+ "region": "LeftEye",
+ "triangles": 1408
+ },
+ {
+ "region": "LeftFoot",
+ "triangles": 1456
+ },
+ {
+ "region": "LeftForearm",
+ "triangles": 864
+ },
+ {
+ "region": "LeftHand",
+ "triangles": 2168
+ },
+ {
+ "region": "LeftIndex",
+ "triangles": 848
+ },
+ {
+ "region": "LeftMiddle",
+ "triangles": 848
+ },
+ {
+ "region": "LeftLittle",
+ "triangles": 848
+ },
+ {
+ "region": "LeftRing",
+ "triangles": 848
+ },
+ {
+ "region": "LeftShin",
+ "triangles": 1224
+ },
+ {
+ "region": "LeftUpperArm",
+ "triangles": 592
+ },
+ {
+ "region": "LeftThigh",
+ "triangles": 1104
+ },
+ {
+ "region": "LeftThumb",
+ "triangles": 976
+ },
+ {
+ "region": "Neck",
+ "triangles": 336
+ },
+ {
+ "region": "RightToes",
+ "triangles": 3392
+ },
+ {
+ "region": "RightShoulder",
+ "triangles": 1992
+ },
+ {
+ "region": "RightEye",
+ "triangles": 1408
+ },
+ {
+ "region": "RightFoot",
+ "triangles": 1456
+ },
+ {
+ "region": "RightForearm",
+ "triangles": 864
+ },
+ {
+ "region": "RightHand",
+ "triangles": 2168
+ },
+ {
+ "region": "RightIndex",
+ "triangles": 848
+ },
+ {
+ "region": "RightMiddle",
+ "triangles": 848
+ },
+ {
+ "region": "RightLittle",
+ "triangles": 848
+ },
+ {
+ "region": "RightRing",
+ "triangles": 848
+ },
+ {
+ "region": "RightShin",
+ "triangles": 1224
+ },
+ {
+ "region": "RightUpperArm",
+ "triangles": 592
+ },
+ {
+ "region": "RightThigh",
+ "triangles": 1104
+ },
+ {
+ "region": "RightThumb",
+ "triangles": 976
+ }
+ ],
+ "joints": 55,
+ "scaleToMm": 2504.5606618474717,
+ "sourceSoleY": 0.00089007,
+ "sourcePelvisZ": -0.00950344604166667,
+ "symmetryMaximumMm": 4.3380263155391075E-05,
+ "preparedSymmetryMaximumMm": 0.0003063418047014443,
+ "preparationEvidence": {
+ "finite": true,
+ "orientationReversalProxies": 0,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 2.2665780012181385,
+ "bindReconstructionMaximumMm": 0.00030851712518765426,
+ "reversalsByRegion": {},
+ "reversalFaceIds": [],
+ "worstEdgeVertexIds": [
+ "antonia:v:006169",
+ "antonia:v:016044"
+ ]
+ },
+ "poseSweep": {
+ "shoulder-abduction-35": {
+ "finite": true,
+ "orientationReversalProxies": 0,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 1.615976768497449,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {},
+ "reversalFaceIds": [],
+ "worstEdgeVertexIds": [
+ "antonia:v:006169",
+ "antonia:v:016044"
+ ]
+ },
+ "shoulder-abduction-70": {
+ "finite": true,
+ "orientationReversalProxies": 0,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 2.4654790254997345,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {},
+ "reversalFaceIds": [],
+ "worstEdgeVertexIds": [
+ "antonia:v:024548",
+ "antonia:v:031634"
+ ]
+ },
+ "shoulder-flexion-35": {
+ "finite": true,
+ "orientationReversalProxies": 0,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 1.3971647542797778,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {},
+ "reversalFaceIds": [],
+ "worstEdgeVertexIds": [
+ "antonia:v:026132",
+ "antonia:v:025233"
+ ]
+ },
+ "shoulder-flexion-70": {
+ "finite": true,
+ "orientationReversalProxies": 0,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 1.972669663302808,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {},
+ "reversalFaceIds": [],
+ "worstEdgeVertexIds": [
+ "antonia:v:026132",
+ "antonia:v:025233"
+ ]
+ },
+ "elbow-flexion-35": {
+ "finite": true,
+ "orientationReversalProxies": 0,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 2.135178683330794,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {},
+ "reversalFaceIds": [],
+ "worstEdgeVertexIds": [
+ "antonia:v:006381",
+ "antonia:v:024319"
+ ]
+ },
+ "elbow-flexion-70": {
+ "finite": true,
+ "orientationReversalProxies": 5,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 5.7263823055339325,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {
+ "LeftUpperArm": 5
+ },
+ "reversalFaceIds": [
+ "antonia:f:024241:t0",
+ "antonia:f:024241:t1",
+ "antonia:f:024372:t0",
+ "antonia:f:024380:t1",
+ "antonia:f:024424:t1"
+ ],
+ "worstEdgeVertexIds": [
+ "antonia:v:032044",
+ "antonia:v:022895"
+ ]
+ },
+ "hip-flexion-35": {
+ "finite": true,
+ "orientationReversalProxies": 0,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 2.9603444726168817,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {},
+ "reversalFaceIds": [],
+ "worstEdgeVertexIds": [
+ "antonia:v:031782",
+ "antonia:v:012979"
+ ]
+ },
+ "hip-flexion-70": {
+ "finite": true,
+ "orientationReversalProxies": 12,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 16.444624569815698,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {
+ "Pelvis": 10,
+ "LeftThigh": 2
+ },
+ "reversalFaceIds": [
+ "antonia:f:009382:t0",
+ "antonia:f:009382:t1",
+ "antonia:f:009397:t0",
+ "antonia:f:009397:t1",
+ "antonia:f:009398:t1",
+ "antonia:f:009427:t0",
+ "antonia:f:009428:t1",
+ "antonia:f:009449:t1",
+ "antonia:f:009495:t0",
+ "antonia:f:009498:t1",
+ "antonia:f:024620:t1",
+ "antonia:f:024625:t0"
+ ],
+ "worstEdgeVertexIds": [
+ "antonia:v:031783",
+ "antonia:v:008100"
+ ]
+ },
+ "hip-abduction-35": {
+ "finite": true,
+ "orientationReversalProxies": 2,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 4.852287949995794,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {
+ "Pelvis": 2
+ },
+ "reversalFaceIds": [
+ "antonia:f:009393:t1",
+ "antonia:f:009435:t0"
+ ],
+ "worstEdgeVertexIds": [
+ "antonia:v:023450",
+ "antonia:v:031503"
+ ]
+ },
+ "hip-abduction-70": {
+ "finite": true,
+ "orientationReversalProxies": 56,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 7.128263390099271,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {
+ "Pelvis": 31,
+ "LeftThigh": 25
+ },
+ "reversalFaceIds": [
+ "antonia:f:009384:t0",
+ "antonia:f:009385:t0",
+ "antonia:f:009385:t1",
+ "antonia:f:009386:t0",
+ "antonia:f:009386:t1",
+ "antonia:f:009391:t0",
+ "antonia:f:009391:t1",
+ "antonia:f:009392:t0",
+ "antonia:f:009392:t1",
+ "antonia:f:009393:t0",
+ "antonia:f:009393:t1",
+ "antonia:f:009403:t0",
+ "antonia:f:009403:t1",
+ "antonia:f:009404:t0",
+ "antonia:f:009404:t1",
+ "antonia:f:009405:t0",
+ "antonia:f:009431:t0",
+ "antonia:f:009431:t1",
+ "antonia:f:009435:t0",
+ "antonia:f:009435:t1",
+ "antonia:f:009438:t0",
+ "antonia:f:009439:t1",
+ "antonia:f:009452:t1",
+ "antonia:f:009456:t0",
+ "antonia:f:009456:t1",
+ "antonia:f:009457:t0",
+ "antonia:f:009457:t1",
+ "antonia:f:009474:t0",
+ "antonia:f:009474:t1",
+ "antonia:f:009503:t0",
+ "antonia:f:009503:t1",
+ "antonia:f:024579:t0",
+ "antonia:f:024579:t1",
+ "antonia:f:024580:t1",
+ "antonia:f:024622:t0",
+ "antonia:f:024622:t1",
+ "antonia:f:024624:t0",
+ "antonia:f:024630:t0",
+ "antonia:f:024630:t1",
+ "antonia:f:024631:t0",
+ "antonia:f:024631:t1",
+ "antonia:f:024632:t0",
+ "antonia:f:024632:t1",
+ "antonia:f:024758:t0",
+ "antonia:f:024758:t1",
+ "antonia:f:024789:t0",
+ "antonia:f:024789:t1",
+ "antonia:f:024809:t0",
+ "antonia:f:024809:t1",
+ "antonia:f:024874:t0",
+ "antonia:f:024875:t0",
+ "antonia:f:024875:t1",
+ "antonia:f:024961:t0",
+ "antonia:f:024961:t1",
+ "antonia:f:024962:t1",
+ "antonia:f:024973:t0"
+ ],
+ "worstEdgeVertexIds": [
+ "antonia:v:024486",
+ "antonia:v:006089"
+ ]
+ },
+ "knee-flexion-35": {
+ "finite": true,
+ "orientationReversalProxies": 0,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 2.052043899704688,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {},
+ "reversalFaceIds": [],
+ "worstEdgeVertexIds": [
+ "antonia:v:017276",
+ "antonia:v:031427"
+ ]
+ },
+ "knee-flexion-70": {
+ "finite": true,
+ "orientationReversalProxies": 2,
+ "collapsedTriangles": 0,
+ "maximumEdgeLengthRatio": 4.611195016571972,
+ "bindReconstructionMaximumMm": 0.0002441410906608432,
+ "reversalsByRegion": {
+ "LeftThigh": 2
+ },
+ "reversalFaceIds": [
+ "antonia:f:024445:t0",
+ "antonia:f:024829:t1"
+ ],
+ "worstEdgeVertexIds": [
+ "antonia:v:015607",
+ "antonia:v:005787"
+ ]
+ }
+ },
+ "minimumWeight": 1.0328554793659351E-08,
+ "maximumWeightSumError": 3.3306690738754696E-16,
+ "uncoveredVertices": 0,
+ "artifactSha256": "af45c535ab21d93ae2c23f7a63f71925f3c6cfc6a68e5af9c04e1ab0033834dd",
+ "sourcePoseObjSha256": "099572385a643aa369eb0a999a90c49a507a1818adae52730c76f7f5993fb764",
+ "preparedObjSha256": "fe3b785bfaab444a01b3a9f8d89ef422a6eade69cc05adf5e290fff9d270675f",
+ "canonicalPromotion": false,
+ "missingGates": [
+ "reviewed A-pose preparation",
+ "canonical region and anatomical proxy review",
+ "landmarks, measurements and attachment migration",
+ "morph and pose qualification",
+ "human visual review"
+ ]
+}
\ No newline at end of file
diff --git a/docs/release/HUMANOID-X1.md b/docs/release/HUMANOID-X1.md
new file mode 100644
index 00000000..e61a9763
--- /dev/null
+++ b/docs/release/HUMANOID-X1.md
@@ -0,0 +1,322 @@
+# HUMANOID-X1 — Original Antonia adoption and deformation gate
+
+Date: 2026-09-16. Verdict: **Meaningful progression**. **Not Accepted.**
+
+> Did Aetheris successfully promote a screened CC-BY human topology into a stable,
+> semantically rich canonical adult humanoid runtime suitable for future fitting,
+> posing, measurement, attachment, and morph workflows?
+
+**No.** The source-admission blocker is removed and original Antonia connectivity
+now runs through a deterministic Aetheris adoption and skinning path. The first
+Aetheris-generated skin weights fail neutral shoulder quality and bounded hip,
+elbow and knee deformation. No Antonia candidate is promoted to
+`CanonicalHumanoid`, and no usable canonical adult runtime is claimed.
+
+This is a measured gate stop, not completion of the remaining X1 mission.
+Continuing by binding 88 landmarks, 19 sites and geometry-specific morphs to
+this visibly defective rest shape would freeze unqualified geometry as authority.
+The next bounded problem is **reviewed shoulder/hip joint proxies and skin-weight
+transitions on the original adopted mesh**, followed by the same pose sweep.
+No second procedural body, shrinkwrap of X0, or independent retopology was attempted.
+
+## Source admission and attribution
+
+The original author repository supplies the original base figure and notice:
+
+| Item | Pinned identity |
+|---|---|
+| Source | [odf/Antonia.Polygon](https://github.com/odf/Antonia.Polygon/tree/08c9767691daad1382dfc6980ee83e31514b4879) |
+| Release/revision | 1.2.0 / `08c9767691daad1382dfc6980ee83e31514b4879` |
+| OBJ | `Runtime/geometries/Antonia/Antonia-1.2.obj` |
+| OBJ SHA-256 | `0d9e918f19a497adebb51dc8f4ac921c41753b157c50809a1d760dd45ec01194` |
+| Notice | `Runtime/Docs/Antonia/README` |
+| Notice SHA-256 | `e9385525cf613450e8673703f7959cd869e2d9c1290d474a99ca4863d734f4ae` |
+| License | [CC BY 3.0 Unported](https://creativecommons.org/licenses/by/3.0/) |
+
+Based on **Antonia Polygon by Olaf Delgado-Friedrichs**, with phantom3D, MikeJ
+and others credited in the original notice. Aetheris adapts the base figure by
+selecting body/eye components, converting coordinates, freezing binding
+triangulation, assigning stable IDs, constructing semantic proxies and skin
+weights, and experimenting with rest-pose preparation. **No endorsement is
+implied.** Aetheris does not claim exclusive authorship of source connectivity.
+Attribution is also in [THIRD_PARTY_NOTICES](../../THIRD_PARTY_NOTICES.md);
+the [original notice](../../fixtures/Canonical/Humanoid/antonia-original-LICENSE.txt)
+is preserved byte-for-byte beside the [admission sidecar](../../fixtures/Canonical/Humanoid/antonia-original.sidecar.json).
+
+This is the original base-figure route admitted by the mission, not a new grant
+inferred for `char.blend`. The old CharMorph sidecar remains unchanged and its
+conversion remains unadmitted. No source rig, weights, morphs, textures,
+Blender-specific data, shared library or CharMorph code is consumed. The author's
+separate mesh-only CC0 release was discovered but is not the input or license
+used here. No Reom or VRoid geometry is used.
+
+Selected OBJ material labels: `skin_ARMS`, `skin_BODY`, `skin_HEAD`, `skin_LEGS`,
+`lips`, `nailsFingers`, `nailsToes`, and bilateral sclera/iris/pupil/cornea.
+Mouth interior, teeth, tongue, toe caps, invisible polygons, eyebrows, eyelashes
+and lacrimals are excluded. Materials are selection evidence only; no texture
+or material library is loaded. Subset openings are retained and watertightness
+is not asserted.
+
+## Deterministic adoption artifact
+
+The original OBJ contains **38,822 vertices / 38,614 quads**, not the recon's
+36,030-vertex converted Blender mesh. The difference is explicit, not silently
+treated as identical connectivity.
+
+| Property | Candidate result |
+|---|---:|
+| Selected vertices | 27,193 |
+| Selected authored quads | 27,112 |
+| Fixed binding triangles | 54,224 |
+| Body triangles | 51,408 |
+| Eye triangles | 1,408 per eye |
+| Provisional region labels | 33 |
+| Semantic joints | 55 |
+| Vertex symmetry max reflected residual | 0.00004338 mm |
+| Prepared symmetry max reflected residual | 0.00030634 mm |
+| Uncovered skin vertices | 0 |
+| Maximum skin sum error | below 1e-15 |
+
+Candidate identity: `aetheris.humanoid.antonia.adoption-candidate.v1`.
+This is **not** `adult.standard.v1`. The latter remains the historical X0
+synthetic identity for regression replay. A future promotion must deliberately
+version the final rest geometry, regions, landmarks and binding policy; the
+candidate ID cannot silently become a different qualified topology.
+
+Source vertices are selected in original index order; IDs retain their original
+indices (`antonia:v:NNNNNN`). Original quad indices and four original vertex
+indices are stored in `SourcePolygons`. Two triangles per quad use the fixed
+0–2 diagonal; their IDs are `antonia:f:NNNNNN:t0/t1`. Vertex compaction has an
+explicit original-index map. No weld, remeshing or face deletion by quality
+heuristic occurs. Triangle connectivity hash is
+`2e2f787499ba2da1f02bab14f352b86070938fbb5d7cae60e8bd7d59edb2b7a2`.
+
+Region assignment is provisional original-group mapping: collar→shoulder,
+shoulder actor→upper arm, forearm→forearm, hand/finger chains→corresponding
+regions, thigh/shin/foot/toes→limb regions, waist/abdomen→abdomen, hip→pelvis,
+and separate eye regions. Boundary vertex ties use ordinal group ordering;
+face ownership retains the original group. This covers every admitted face but
+does not yet resolve face/ear, elbow, wrist, patella or ankle subregions.
+It is not represented as a completed migration of X0's semantic partition.
+
+Vertex symmetry is stored as a bijective involution, using reflected matching
+within 0.001 mm and deterministic tie-breaking. Region/joint semantic pairs
+are explicit. Triangle symmetry is not claimed because fixed quad diagonals
+need not reflect onto the same triangle. Landmark pairing awaits migration.
+
+## Frame, rest preparation and bind semantics
+
+The source OBJ uses +Y up and has positive-X `l*` groups. Canonical mapping is:
+
+```text
+X = -sourceX * 2504.5606618474717
+Y = (sourceZ - (-0.00950344604166667)) * 2504.5606618474717
+Z = (sourceY - 0.00089007) * 2504.5606618474717
+```
+
+The axis transform has determinant +1. Coordinates are mm, +X anatomical
+right, +Y forward, +Z up. Scale uniformly normalizes the selected outer extent
+to 1750 mm; it is an engineering normalization, not a source physical-scale or
+population-average claim. Sole is the selected body's minimum source Y;
+pelvis forward origin is the hip/waist shared-boundary centroid. Bilateral
+grounding and a reviewed sole protocol remain promotion checks.
+
+Joint vocabulary reuses X0's 55 joints, including its two eye joints. Centers
+come from shared source mesh-group boundary centroids: collar/upper arm,
+upper arm/forearm, forearm/hand, hip/thigh, thigh/shin, shin/foot and finger
+segment seams. Central torso/head and eye proxies are explicit. These are
+geometric proxies requiring review, not source control-bone locations.
+
+Skin seeds follow group membership, then undergo exactly 16 half-self,
+half-neighbor averaging passes over authored quad-edge adjacency. Binding
+diagonals are excluded: the first experiment exposed a 6.74 mm left/right bias
+when smoothing used them. Correcting adjacency reduces prepared symmetry
+residual to 0.000307 mm. Influences
+below 1e-8 are discarded and remaining weights normalized. There are no
+helper/control influences. This is a reproducible baseline, **not a qualified
+heat/geodesic solver**. Uniform topological averaging has no anatomical
+volume-preservation guarantee.
+
+Source-pose binds are rebuilt from these centers. Shoulder rotations align
+upper-arm chains 35° from vertical; elbow rotations align forearms to the
+same direction. Exact quaternions are in the candidate artifact. The ordinary
+`HumanoidPosing` LBS evaluator prepares the connected mesh; regions are not
+rotated as disconnected pieces. Prepared joints and inverse binds are rebuilt
+in the prepared frame. No source or X0 inverse-bind matrices are reused.
+Neutral wrist/finger orientation is not qualified by this chain alignment.
+
+Preparation has zero collapsed triangles and zero dominant-joint-normal
+reversal proxies. Source-bind reconstruction maximum is 0.000309 mm.
+Numerical preparation success does **not** override the visible shoulder defect.
+
+## Pose gate and diagnosis
+
+All 12 fixed poses are finite and have zero collapsed triangles. The table
+reports **max(before/after, after/before)** edge-length ratio: it measures both
+stretch and compression and is not an Antonia fitting residual.
+
+| Movement | 35° reversal proxies / max ratio | 70° reversal proxies / max ratio |
+|---|---:|---:|
+| Shoulder abduction | 0 / 1.616 | 0 / 2.465 |
+| Shoulder flexion | 0 / 1.397 | 0 / 1.973 |
+| Elbow flexion | 0 / 2.135 | 5 / 5.726 |
+| Hip flexion | 0 / 2.960 | 12 / 16.445 |
+| Hip abduction | 2 / 4.852 | 56 / 7.128 |
+| Knee flexion | 0 / 2.052 | 2 / 4.611 |
+
+At hip-abduction 70°, 31 flagged triangles belong to pelvis and 25 to left
+thigh. Hip-flexion 70° flags 10 pelvis / 2 thigh. Elbow-flexion 70° flags 5
+upper-arm triangles; knee-flexion 70° flags 2 thigh triangles. Shoulder
+screens report zero reversals but still fail visual contour quality.
+Exact stable face IDs and worst-edge vertex IDs are retained
+in [compact evidence](HUMANOID-X1.evidence.json).
+
+The orientation screen transports each original triangle normal by its
+dominant skin influence and compares against the deformed normal. It is a
+**proxy**, not a certified intersection or local Jacobian test. Bind
+reconstruction is within tolerance, topology is unchanged, and defects occur
+at generated blend transitions. Evidence therefore implicates joint proxies
+and weighting/rest conversion rather than corrupt connectivity or reused binds;
+it does not isolate weights versus proxy placement causally. Self-intersection,
+collision and volume-preservation checks remain unqualified.
+
+X0's reversal problem is **not resolved** by adopting better topology alone.
+Changing thresholds or smoothing until proxy counts vanish would not establish
+anatomical usefulness. Reviewed placement/weights must precede downstream
+semantic migration.
+
+## Render evidence and review
+
+Local renders use existing Blender evidence tooling on exported Aetheris OBJ,
+flat shading and neutral material. Blender does not calculate the deformation.
+
+![Prepared candidate, front](../../artifacts/local/humanoid-x1/neutral-front.png)
+
+[Side](../../artifacts/local/humanoid-x1/neutral-side.png),
+[back](../../artifacts/local/humanoid-x1/neutral-back.png),
+[iso](../../artifacts/local/humanoid-x1/neutral-iso.png),
+[source pose](../../artifacts/local/humanoid-x1/source-front.png),
+[wireframe front](../../artifacts/local/humanoid-x1/wireframe-front.png),
+[shoulder](../../artifacts/local/humanoid-x1/wireframe-shoulder.png),
+[pelvis](../../artifacts/local/humanoid-x1/wireframe-pelvis.png),
+[hand](../../artifacts/local/humanoid-x1/wireframe-hand.png),
+[face](../../artifacts/local/humanoid-x1/wireframe-face.png),
+[feet](../../artifacts/local/humanoid-x1/wireframe-feet.png).
+
+![Failed hip-abduction witness](../../artifacts/local/humanoid-x1/pose-hip-abduction-70.png)
+
+[Shoulder](../../artifacts/local/humanoid-x1/pose-shoulder-flexion-70.png),
+[elbow](../../artifacts/local/humanoid-x1/pose-elbow-flexion-70.png),
+[hip flexion](../../artifacts/local/humanoid-x1/pose-hip-flexion-70.png),
+[knee](../../artifacts/local/humanoid-x1/pose-knee-flexion-70.png).
+
+These are **assistant visual-screen findings**, not fabricated human signoff:
+
+| Region | Screen | Specific observation |
+|---|---|---|
+| Face/ears | NeedsReview | Recognizable neutral facial loops, eyelids and ears; no landmark-placement or oral-boundary review yet. |
+| Shoulders | Fail | Bulky hooked transitions in prepared neutral instead of coherent shoulder contour. |
+| Armpits/chest | Fail / NeedsReview | Armpit crease is distorted by preparation; chest detail remains visible, but shoulder weighting intrudes into its transition. |
+| Pelvis/crotch | Fail under pose | Hip abduction creates a sharp folded groin transition; high edge distortion and localized reversal proxies corroborate concern. |
+| Hands/fingers | NeedsReview | Fingers remain distinct; original wrist orientation is carried through preparation, not proven neutral; no finger pose sweep. |
+| Knees/ankles | NeedsReview / Fail numerical gate | Neutral envelope is legible; 70° knee flexion reports two reversals. No calibrated joint-center review. |
+| Feet | NeedsReview | Toes and heels remain distinct; no footwear/sole protocol or posed foot qualification. |
+
+**Human review status: NeedsReview for every region; no human reviewer has
+signed off.** Failures already prevent acceptance. Landmark/frame overlays and
+morph images are not generated because those semantics are not admitted on
+this candidate.
+
+## X0 migration, runtime boundary and unfinished acceptance gates
+
+Preserved: domain types, skeleton vocabulary, shared skin evaluator,
+registration qualification, measurement/landmark/attachment types, morph
+infrastructure and regression tests. The old body now explicitly says
+`NONCANONICAL-SyntheticRegressionFixture` in metadata/provenance. Its legacy
+topology ID is retained solely to avoid silently relabeling old artifacts.
+
+Added: original source admission, selected authored connectivity and source
+index maps, provisional region/component maps, stored vertex symmetry,
+source/prepared bind skeletons, generated weights, controlled preparation,
+12-case sweep, hash replay and original attribution. The runtime loader
+rejects candidate-shaped or incomplete JSON instead of returning a malformed
+canonical instance.
+
+Deferred at the failed deformation gate: all 88 landmark migration/review,
+all 19 attachment sites/frames, measurement qualification, morph endpoint
+qualification, 1800-mm and longer-limb witnesses, contour protocols and
+canonical artifact embedding. No measurements are reported as anatomically
+valid merely because an extent is finite. No cloned X0 mappings or hardcoded
+X0 morph coordinates are applied to Antonia.
+
+There is no new accepted `adult.standard.v1` artifact. Candidate replay uses
+only pinned original source inputs and .NET; saved output contains full
+geometry, joints, weights and transforms and requires no source tooling to
+inspect. That is not yet proof of an independent **qualified canonical
+runtime**. Normal unit tests remain offline and do not fetch Antonia.
+
+Three fresh-context agents received only the public guide, this report and
+the candidate artifact, with no implementation source:
+
+- **Basic use: BLOCKED.** The real `inspect --input .../antonia-adoption-candidate.json`
+ command exited 1: `Expected a canonical humanoid artifact; an adoption candidate
+ is not a canonical runtime instance.` No height, shoulder width or wrist frame
+ was invented, and X0 was not substituted.
+- **Morph: BLOCKED.** The real `morph` command with `--height 1800 --leg-length 50`
+ produced the same rejection and no output file. Therefore no measurements or
+ topology-invariance result exists for a morphed X1 body.
+- **Adapter thinking: PASS for conceptual understandability only.** The agent
+ correctly retained a new reference as imported evidence, preserved future
+ canonical IDs/connectivity and required reviewed correspondence. It identified
+ the ambiguous request to target legacy `adult.standard.v1`; the public guide
+ now explicitly blocks adapter implementation until a qualified target and
+ its versioned identity are selected.
+
+## Reproduction and validation
+
+```powershell
+pwsh -File scripts/qualify-humanoid-x1.ps1
+pwsh -File scripts/qualify-humanoid-x1.ps1 -SkipFetch -SkipFullTests
+```
+
+The command chain verifies pinned mesh/license inputs, builds IDs and maps,
+constructs joints/weights, prepares the rest-pose candidate, emits the bounded
+sweep and JSON/OBJ evidence, checks a second byte-identical replay, renders,
+and runs tests. It exits on tool/test errors. A completed reproduction is
+explicitly reported as **canonical promotion blocked**, not a passed sweep.
+Usage is in [the public research guide](../public/humanoid-research.md).
+
+| Deterministic item | SHA-256 |
+|---|---|
+| Candidate artifact | `af45c535ab21d93ae2c23f7a63f71925f3c6cfc6a68e5af9c04e1ab0033834dd` |
+| Connectivity | `2e2f787499ba2da1f02bab14f352b86070938fbb5d7cae60e8bd7d59edb2b7a2` |
+| Source-pose OBJ | `099572385a643aa369eb0a999a90c49a507a1818adae52730c76f7f5993fb764` |
+| Prepared-pose OBJ | `fe3b785bfaab444a01b3a9f8d89ef422a6eade69cc05adf5e290fff9d270675f` |
+| Hip-flexion 70° OBJ | `9b71dbaa8401e57b62feee35f5b3cb267852e9348745f97e4915b61cf52d909b` |
+
+No canonical/morph-result hash exists. Candidate/evidence JSON and all 14 OBJ
+files were byte-identical across two runs. Tests: focused humanoid **30/30
+passed**; final solution build passed with 0 errors and 2 existing WebAssembly
+warnings. The initial build passed with 7 WebAssembly/analyzer warnings. A
+premature rebuild during the full CLI tests hit MSB3027/MSB3021 DLL locks;
+the final serialized rebuild after test completion passed.
+
+Full active solution tests (`Category!=SlowCorpus`): **3,615 passed, 2 failed,
+0 skipped**, 3,617 cases across 20 test assemblies. This initial run was not
+green. The two failures were:
+
+- `PublicMarkdownRelativeLinksResolveInsideRepository`: the new public guide
+ was checked while the release report was still being written. The report now
+ exists; the isolated recheck passed.
+- `DisplayPrepare_Ftc07_ReturnsPartialDisplayInsteadOfWholeBodyFailure`: an
+ existing STEP display test received an empty collection under the full run.
+ The unchanged isolated recheck passed. No timing budget/assertion was weakened.
+
+The repository layout guard passed for 4,357 tracked files. New files were
+separately checked against the allowed module/tests, scripts, public docs,
+release records and fixture locations; no expanded generated asset is tracked.
+`git diff --check` passed. Logs remain under `artifacts/local/humanoid-x1/`.
+
+The actual Aetheris.CLI `--help` and `modules --json` paths were inspected; there is no
+humanoid-specific inspection command, so the existing research tool was
+extended with one `adopt-antonia` command rather than introducing a second CLI.
diff --git a/docs/release/HUMANOID-X2.md b/docs/release/HUMANOID-X2.md
new file mode 100644
index 00000000..3b1cea90
--- /dev/null
+++ b/docs/release/HUMANOID-X2.md
@@ -0,0 +1,275 @@
+# HUMANOID-X2 — constrained anatomical kinematics
+
+**Verdict: Meaningful progression. Not Accepted.**
+
+Aetheris now has a separate constrained hip/elbow/knee research path with
+typed interfaces, requested/solved states, deterministic rejection/projection,
+rigid-link residual checks and solve-before-skin evaluation. It has **not**
+replaced every unconstrained character-rig path or produced an accepted
+Antonia humanoid. The real Antonia witness isolates the next blocker:
+valid constrained hip flexion still creates catastrophic skin distortion.
+
+## What was removed, and what blocks convergence
+
+Previously, the research path could apply an arbitrary quaternion without a
+joint-domain check. The new path rejects impossible hinge/hip coordinates,
+supports explicit projection, refuses unsupported joints, and binds an
+immutable solved state to its rest skeleton and shape revision. Synthetic
+hip/knee and elbow mechanisms prove expected endpoint motion, not only zero
+self-reported residuals. All 55 candidate joints are retained; no new
+canonical joint, scapular proxy or control-helper influence is invented.
+
+At unchanged **70° hip flexion**, constrained evaluation reproduces X1's
+**16.44×** bidirectional edge ratio and **12** normal-reversal flags. At **90°**,
+the constrained hip is solved but the surface reaches **17.23× / 55 flags**.
+This rules out impossible requested angle, pose-induced dislocation and
+pose-induced bone stretching as sufficient explanations. It does **not** rule
+out a badly located rest joint center. Rest preparation, center calibration,
+generated weights and LBS remain unresolved causes. No corrective deltas,
+face edits or reduced flexion limit conceal the failure.
+
+The worst edge joins `antonia:v:008100` (Pelvis) to `antonia:v:031783`
+(LeftThigh): **11.7887804 mm → 0.7168677 mm** at hip70. The 16.444849×
+metric is therefore severe **compression**, not outward stretching. Its
+endpoint hip weights are 0.3416352 and 0.5112091; the remaining influence is
+Pelvis. This is a concrete blend-transition witness, not proof that painting
+alone will fix it. The metric intentionally captures compression and stretch.
+
+Further surface tuning without a calibrated anatomical reference would
+conflate those causes. This progression stops at that evidenced boundary
+instead of claiming a completed shoulder mechanism or promoting failed skin.
+
+## Interface and concept status
+
+The [public API guide](../public/humanoid-kinematics.md) specifies equations,
+participants, DOFs, engineering ROM, tolerances, solve policies and diagnostics.
+Typed domain interfaces follow existing Aetheris mechanical validation
+patterns; no generic compiler `Concept<T>` / `Interface<T>` family was added.
+
+Implemented: hip coupled swing/twist domain, elbow/knee hinges, finite and
+revision checks, hierarchy and side checks, rest/bind consistency, all-link
+length and parent-socket coincidence checks, immutable solve result, surface
+screening, deterministic replay. No competing strategy is selected, so
+JudgmentEngine is not inserted into deterministic projection math.
+
+Not implemented: compound shoulder, scapulohumeral coupling, pelvis/chest
+collision proxies, wrist/ankle/neck/spine/finger domains, full anatomical
+pose-concept admission, surface self-intersection/volume, surface influence
+recomputation, migrated landmarks/attachments/morphs/measurements, production
+runtime migration. Unsupported explicit requests return `HUM209` with no pose.
+Legacy `HumanoidPosing` remains necessary for X1 preparation/comparison and can
+bypass constraints; this alone prevents overall acceptance.
+
+## Antonia witness
+
+All retained poses are finite and have zero collapsed triangles. Across 918
+per-link observations, maximum center residual is 0 mm and maximum link-length
+error is 0.00006103515625 mm, below the 0.001 mm tolerance. Values below
+are bidirectional edge ratios, not stretch-only values. Per-region
+median/p95/p99/max, face IDs, per-link residuals, requested/solved coordinates
+and diagnostics are in local `artifacts/local/humanoid-x2/evidence.json`.
+
+| Pose | Solved | Max edge ratio | Reversal proxies | Surface screen |
+|---|---|---:|---:|---|
+| Neutral | Yes | 1.00 | 0 | Pass, not visual acceptance |
+| Hip flexion 45° | Yes | 3.48 | 0 | Pass |
+| Hip flexion 70° | Yes | 16.44 | 12 | Fail |
+| Hip flexion 90° | Yes | 17.23 | 55 | Fail |
+| Hip flexion 120° | Yes | 11.41 | 68 | Fail |
+| Hip abduction 30° | Yes | 3.72 | 0 | Pass |
+| Hip abduction 45° | Yes | 5.48 | 26 | Fail |
+| Hip abduction 70° | Projected to 45° | 5.48 | 26 | Fail; not a same-angle improvement |
+| Elbow flexion 90° | Yes | 4.85 | 1 | Fail |
+| Knee flexion 90° | Yes | 8.91 | 19 | Fail |
+| Hip 90° + knee 90° | Yes | 17.23 | 74 | Fail |
+
+The hip ellipse admits useful 90° and 120° flexion. It is not tightened to
+game surface acceptance. The provisional 4× screening threshold catches
+catastrophic ratios but does not certify anatomy. Historical X1 knee +X
+rotation is opposite anatomical flexion in this frame; X2 corrects the hinge
+direction. Historical elbow +Y rotation is also replaced by a rest-derived
+forward-flexion hinge. Those are not identical-pose visual improvements.
+
+Invalid witnesses: backward elbow −45° rejects with `HUM200`; knee −30°
+projects to 0° with `HUM205`; hip abduction 160° rejects with `HUM200`;
+the 120°/45°/45° hip corner projects onto the coupled ellipse with 22.5° twist.
+Shoulder 90° returns `HUM209` rather than inventing a compound solution.
+Joint translation and bone scaling are unrepresentable in the new request
+type; arbitrary transform-import validation is not implemented.
+
+## Visual evidence
+
+![X1 left, X2 right, identical hip 70-degree request](../../artifacts/local/humanoid-x2/x1-left-x2-right-hip70.png)
+
+The same-angle render confirms unchanged deformation. The groin/thigh fold
+persists, and hooked shoulder contours already exist in neutral. Separate
+[hip 90° surface](../../artifacts/local/humanoid-x2/hip-flexion-90.png) and
+[mechanism](../../artifacts/local/humanoid-x2/hip-flexion-90.mechanism.png),
+[combined pose](../../artifacts/local/humanoid-x2/hip-knee-90.png),
+[elbow](../../artifacts/local/humanoid-x2/elbow-flexion-90.png) and
+[knee](../../artifacts/local/humanoid-x2/knee-flexion-90.png) are diagnostic
+outputs. Blender only renders Aetheris-computed positions.
+
+Assistant visual screen: shoulder/clavicle/armpit **Fail** from unchanged
+neutral contour; groin/hip transition **Fail** under flexion. Elbow/knee
+numerical screens **Fail**. Wrist/ankle and all attachment semantics
+**NeedsReview**. **Human review: NeedsReview, no signoff supplied.** No
+surface-screen pass is presented as a human-review pass.
+
+## Local FBX oracle
+
+The three supplied files are inspected in place, never copied or committed.
+They are ASCII FBX 7.7. The installed Blender 5.2 importer reports
+`ASCII FBX files are not supported`; qualification therefore records only
+lexical model/parent, geometry, cluster and animation-curve declarations plus
+SHA-256. This is a hierarchy inventory, not an FBX transform, skin-weight or
+posed-deformation interpretation. Detailed local inventories are under the
+X2 artifact directory. No legal permission or redistribution is inferred.
+No runtime or ML dependency is introduced. Each file declares 65 limb nodes,
+2 geometries, 129 skin clusters and 315 animation curves. Declared parent
+chains include Spine2 → Shoulder → Arm → ForeArm and Hips → UpLeg → Leg.
+These names do not establish a mechanical scapula or validate our rest centers.
+
+## Recommended next bounded milestone
+
+Following the user's mannequin example, the recommended sequence now starts
+with a **semantic segment assembly**, then authors its skin attachment field.
+Lines are a useful lowering/debug view but cannot retain socket surfaces,
+segment extent, exclusion volume or attachment-region semantics by themselves.
+
+### Concept Struct / assembly feasibility
+
+Current code already supports Concept Struct authoring, typed exposed semantic
+members, reusable ordinary Struct parts, hierarchical occurrences and
+Interface/Mate constraints. The live command
+`dotnet run --no-build --project Aetheris.CLI -- asm inspect fixtures/Canonical/AssemblyInterfaces/executable-machine.firmament --json`
+returned `success: true`; its included cell defines geometry from a Concept
+Struct. Local output is `concept-assembly-feasibility.json`/`.log`.
+`FirmamentV2ConceptStructStepPipelineTests` demonstrates that Concept Structs
+are erased before feature AIR while semantic provenance survives. Therefore
+simply naming a struct `Pelvis` is insufficient: anatomical authority must be
+retained in a typed segment descriptor before lowering.
+
+Proposed bounded architecture (not implemented in X2):
+
+- **Pelvis segment:** reviewed spatial extent and exclusion proxy, left/right
+ socket frames and supported pelvis-skin attachment region.
+- **Thigh segment:** invariant head-to-knee structure, femoral-head frame,
+ shaft/condylar proxy and thigh-skin attachment region.
+- **Lower-leg segment:** knee/ankle frames, invariant extent and calf/shin
+ attachment region.
+- **Joint interfaces:** use the actual exposed participants to solve requested
+ configurations, enforce socket/head coincidence, ROM and exclusions, and
+ report residuals. The current Assembly compiler supports Fixed/Axial/Revolute
+ and atomic placement relations; an admitted free rotation is not yet a
+ bounded anatomical actuator. Hip ball domains and shoulder coupling require
+ explicit domain extensions.
+- **Continuous skin:** deform one connected Antonia mesh through segment-local
+ attachment fields. Stable region/vertex IDs and reviewed weights select
+ support; material/deformation constraints determine admissibility. Do not
+ split flesh into rigid mesh islands or imply that a more anatomical-looking
+ mannequin automatically improves interpolation.
+
+The existing `TypedSemanticAuthorityBinding<TAuthority>` provides a retention
+pattern; the Gear bridge demonstrates typed endpoints across assembly
+occurrences. Reuse those seams with an anatomy-owned segment authority and
+the existing pose evaluator, rather than a second parser or executor. Solved
+matrices can remain the efficient skinning/compatibility output, with segment
+geometry and interface semantics preserved above that lowering.
+
+First witness: pelvis + left thigh + lower leg at neutral, hip45/70/90 and
+hip90+knee90. Show segment volumes, socket/head frames and exclusion checks
+before skin evaluation. Then compare the existing and reviewed attachment
+fields at those exact poses. Extend to chest/clavicle/scapula/humerus only
+after this three-segment path is demonstrated. This is feasible incrementally;
+it is not already supplied by the current general Assembly solver.
+
+### Attachment-field experiment
+
+The user's marked image identifies the groin/upper-thigh crease in both
+70° renders. Test **anatomically constrained hip attachments and reviewed
+weights** next, with the current pose solver and deformation gates retained.
+
+1. Review the hip center against orthogonal rest-surface sections and a visible
+ pelvis/femur proxy. Center coincidence alone does not establish correct
+ anatomical placement. Freeze the reviewed center before comparing weights.
+2. Author three explicit regions: pelvis-anchored, femur-anchored, and a
+ transition across groin/gluteal tissue. Paint influence support and boundary
+ weights on the existing stable vertex IDs. Do not smooth uniformly across
+ every neighboring group or use weights to move the joint itself.
+3. Use existing Blender weight painting for the first experiment, exporting
+ only a topology-hash-bound, normalized weight/region sidecar. Preserve
+ protected regions, mirror through the existing correspondence and reject
+ unknown links, negative/nonfinite weights or sum errors. Aetheris owns
+ validation and evaluation; no new painting application is needed.
+4. Compare old and authored weights with identical centers, LBS, geometry and
+ **45°/70°/90° flexion, 30°/45° abduction, hip90+knee90**. Keep both-side
+ front/side/back renders, edge percentiles/max, reversal flags and attachment
+ drift. The marked crease must materially improve without transferring a
+ collapse to the buttock or opposite groin. Do not relax the gates or ROM.
+5. If reviewed weights still fail, record that failure before selecting a
+ bounded deformation extension: constrained tangential sliding or regional
+ volume preservation. Painting influences alone does not impose these
+ material behaviors. Full FEM and a general tissue solver remain outside
+ this experiment.
+
+This recommendation treats painting as authoring the attachment field.
+Joint admissibility and allowable surface deformation remain constraints.
+Blender supports locked groups and normalization in its existing
+[weight-paint workflow](https://docs.blender.org/manual/en/5.0/sculpt_paint/weight_paint/tool_settings/options.html);
+that tooling is optional authoring infrastructure, not anatomical authority.
+
+## Migration and verification
+
+All 88 landmarks and 19 attachments remain X0-only. Antonia has no admitted
+foot attachment frame, measurement protocol or bounded morph endpoints.
+The shape-revision guard works, but that is not Antonia morph qualification.
+
+Reproduce using the public guide. The existing Aetheris.CLI `--help` was run;
+there is no humanoid inspection command. The existing humanoid research tool
+therefore owns `constrained-antonia`; no second CAD CLI or general dynamics
+solver was introduced. Generated geometry, images, detailed evidence and logs
+remain under ignored `artifacts/local/humanoid-x2/`.
+
+Fresh-agent qualification used only the public guide, candidate JSON and
+exported DLL signatures. The probe rejected impossible knee/elbow/hip requests
+with `HUM200`; projection returned `HUM205`. Hip90+knee90 solved without
+projection with the residual maxima reported above. It correctly refused to
+invent a foot attachment or compound shoulder solution (`HUM209` under both
+policies). This passes bounded API understandability, not the complete X2
+fresh-agent acceptance criteria. The guide's example now includes imports,
+candidate deserialization and exact residual property names after that review.
+
+Replay evidence SHA-256:
+`c30b66c74849613a8912caf6ef5ddb68dfc0dd3b5215afa2c7e9503dffcd4e78`.
+Timing is stored separately because it is not deterministic; observed warm
+solves were sub-millisecond in the initial run, while combined surface
+evaluation/validation was roughly 100–330 ms. These are measurements, not a
+performance guarantee or separate skin/validation profiling.
+
+Final validation:
+
+- .NET SDK 10.0.401 is available. Final `dotnet build Aetheris.slnx -m:1`
+ passed with 0 errors and 2 existing WebAssembly warnings.
+- Focused humanoid tests: **45/45 passed**, including 15 new X2 cases.
+- `qualify-humanoid-x2.ps1 -SkipRender -SkipFullTests` passed after the final
+ numerical hardening. **35** evidence/OBJ/mechanism files match their replay
+ byte-for-byte. The earlier Blender render and local FBX inventory completed.
+- Full active solution suite (`Category!=SlowCorpus`): **3,625 passed,
+ 6 failed, 0 skipped**, 20 assemblies. That run preceded the final added
+ extreme-finite-projection test; the final focused run above includes it.
+ The full suite is **not green**.
+- The six failures were four `DisplayPreparationFallbackBuilderTests`
+ (accepted scaffold determinism, single-face scaffold, unsupported-body
+ fallback, scaffold with hole) and two `RecognizedConstructionRecipeTests`
+ (direct recipe overhead for `cir`, no meaningful runtime regression).
+ Their unchanged two classes passed an isolated **17/17** recheck. No kernel
+ code, test tolerance or timeout was changed; the isolated pass does not
+ erase the full-run failures.
+- Repository layout guard passed over 4,357 tracked files. New files follow
+ existing module/test, scripts, public-guide and release-record locations.
+ Existing X1 work was preserved; no raw FBX or generated mesh was staged.
+
+Detailed logs, timings, fresh-agent probe and failed geometry remain in
+`artifacts/local/humanoid-x2/`. This release record is the compact evidence;
+the milestone remains Meaningful progression.
diff --git a/fixtures/Canonical/Humanoid/README.md b/fixtures/Canonical/Humanoid/README.md
index 9d52c696..301ba125 100644
--- a/fixtures/Canonical/Humanoid/README.md
+++ b/fixtures/Canonical/Humanoid/README.md
@@ -1,7 +1,16 @@
-# Canonical humanoid X0 fixtures
+# Humanoid research fixtures
-`adult-standard-v1.fixture.json` is the compact tracked identity of the independently authored canonical topology. Generate the full artifact into ignored local output with the recorded command; ordinary unit tests construct it in memory and never fetch third-party data.
+`adult-standard-v1.fixture.json` is the compact tracked identity of the **NONCANONICAL X0 synthetic regression topology**. Its historical ID is retained for replay, not production admission. Generate the full artifact into ignored local output with the recorded command; ordinary unit tests construct it in memory and never fetch third-party data.
`antonia-reference.sidecar.json` records the exact external reference and the narrow research-fit scope. It does not contain Antonia geometry and does not upgrade the unresolved conversion-component scope identified by HUMANOID-RECON-X0. A fit result remains research evidence until that gate is reviewed.
`x0-registration-config.json` freezes the first deterministic fitting baseline. Raw qualification output belongs under `artifacts/local/humanoid-x0/`.
+
+`antonia-original.sidecar.json` admits the original author's Antonia 1.2.0 OBJ,
+independently of the unadmitted CharMorph conversion. The adjacent original
+license notice is preserved byte-for-byte. X1's source-pose and prepared
+surface candidates retain original polygon IDs and a fixed binding diagonal;
+neither is a promoted canonical runtime artifact. See
+`docs/release/HUMANOID-X1.md` and the current research-tool guide at
+`docs/public/humanoid-research.md`. Reproduce with
+`pwsh -File scripts/qualify-humanoid-x1.ps1`.
diff --git a/fixtures/Canonical/Humanoid/adult-standard-v1.fixture.json b/fixtures/Canonical/Humanoid/adult-standard-v1.fixture.json
index 798fbd2d..41ac02ca 100644
--- a/fixtures/Canonical/Humanoid/adult-standard-v1.fixture.json
+++ b/fixtures/Canonical/Humanoid/adult-standard-v1.fixture.json
@@ -1,5 +1,6 @@
{
"schema": "aetheris.humanoid.fixture.v1",
+ "status": "NONCANONICAL-SyntheticRegressionFixture",
"templateId": "aetheris.humanoid.adult.standard.v1",
"generator": "Aetheris.Humanoid.CanonicalAdultTemplate",
"generatorVersion": "aetheris-humanoid-implicit-tetra-v1",
@@ -9,5 +10,5 @@
"frame": "millimeters; right-handed; +X anatomical right; +Y forward; +Z up",
"restPose": "aetheris.humanoid.adult.apose.v1",
"reproduction": "dotnet run --project tools/Aetheris.Humanoid.X0 -- generate --out-dir artifacts/local/humanoid-x0",
- "note": "This compact descriptor is tracked authority. The full deterministic surface artifact is generated under ignored artifacts/local; no third-party geometry is stored here."
+ "note": "Failed X0 procedural surface retained for synthetic qualification, regression and registration stress tests. Historical topology ID is retained for replay only, not production promotion. Full output is ignored artifacts/local; no third-party geometry is stored here."
}
diff --git a/fixtures/Canonical/Humanoid/antonia-original-LICENSE.txt b/fixtures/Canonical/Humanoid/antonia-original-LICENSE.txt
new file mode 100644
index 00000000..832a8330
--- /dev/null
+++ b/fixtures/Canonical/Humanoid/antonia-original-LICENSE.txt
@@ -0,0 +1,106 @@
+=== ABOUT ANTONIA POLYGON ===
+
+Antonia is an original Poser figure by Olaf Delgado-Friedrichs
+([email protected] or odf at renderosity.com) with
+contributions from phantom3D, MikeJ and others.
+
+Antonia was created using Wings3D, Poser and DAZ Studio, as well as a
+number of home-made software tools. As of October 2008, the
+development of the figure has been documented and discussed in the
+Poser forum at Renderosity (http://www.renderosity.com), and the
+project owes a lot to the continuing feedback and support of the
+Renderosity community.
+
+Please note that Antonia is not a commercial figure and has been
+developed over several years on the various contributors' spare time.
+Because of this, you may not find everything you'd expect from a
+full-fledged Poser figure right in this package. Some extra content
+such as textures, clothing, pose sets and so on is available from
+BlueEcho's Antonia site (see below), and more may be found across the
+web.
+
+Please note that while Antonia itself is provided free of charge with
+very liberal licensing, this is not necessarily true for related
+content that is distributed separately. In particularly, the creation
+of commercial packages based on or related to Antonia is explicitly
+encouraged.
+
+Obviously, if you use Antonia for any published or commercial work, I
+would love to hear about it. If you redistribute Antonia or any
+derivative work, you must, according to the license (see below),
+acknowledge me as the original creator of the figure, but you do not
+have to ask for my permission.
+
+
+For further information and free content, visit these sites:
+
+Home page: http://sites.google.com/site/antoniapolygon
+Wiki: http://www.renderosity.com/mod/rrwiki/index.php/Antonia
+Free content: http://www.bluecho4u3d.com/Antonia
+Cutting edge: http://github.com/odf/Antonia.Polygon
+
+
+=== ABOUT THIS RELEASE (VERSION 1.2.0) ===
+
+This is the second stable release of Antonia Polygon. Please note that
+poses and full-body morphs made for version 1.0.0 and earlier may not
+work on this version, since the former 'hip2' actor has been renamed
+to 'hip' and the former 'hip' actor to 'waist'. The change became
+necessary in order to make Wardrobe Wizard support possible.
+
+In general, it should be very easy to update files using the old actor
+names: replace 'hip' with 'waist' everywhere in the file, and then
+replace 'waist2' with 'hip'. Be careful if your file contains 'hip' or
+'waist' as parts of longer words, though. For example, a brute-force
+replacement as described above would turn the word 'shipment' into
+'swaistment'.
+
+Currently, only Poser 6 and later are supported. The base figure
+should however work fine with Poser 4 and most software that can
+accept Poser 4 content.
+
+
+=== LICENSING ===
+
+This work is licensed under the Creative Commons Attribution 3.0
+Unported License. To view a copy of this license, visit
+http://creativecommons.org/licenses/by/3.0/ or send a letter to
+Creative Commons, 171 Second Street, Suite 300, San Francisco,
+California, 94105, USA.
+
+
+=== WHAT THE LICENSE MEANS ===
+
+(DISCLAIMER: The following is not a license and has no legal
+implications. It is simply a human-readable expression of the
+key-terms of the license. It is based on the license deed as provided
+by Creative Commons under the URL
+http://creativecommons.org/licenses/by/3.0, with a modification in the
+last sentence.)
+
+You are free:
+
+ * to Share — to copy, distribute and transmit the work
+ * to Remix — to adapt the work
+
+Under the following conditions:
+
+ * Attribution — You must attribute the work in the manner
+ specified by the author or licensor (but not in any way that
+ suggests that they endorse you or your use of the work).
+
+With the understanding that:
+
+ * Waiver — Any of the above conditions can be waived if you get
+ permission from the copyright holder.
+ * Other Rights — In no way are any of the following rights
+ affected by the license:
+ o Your fair dealing or fair use rights;
+ o The author's moral rights;
+ o Rights other persons may have either in the work itself or
+ in how the work is used, such as publicity or privacy
+ rights.
+ * Notice — For any reuse or distribution, you must make clear to
+ others the license terms of this work. The best way to do this
+ is by including a copy of this file or a link to Antonia's
+ homepage at http://sites.google.com/site/antoniapolygon/.
diff --git a/fixtures/Canonical/Humanoid/antonia-original.sidecar.json b/fixtures/Canonical/Humanoid/antonia-original.sidecar.json
new file mode 100644
index 00000000..8b91bda1
--- /dev/null
+++ b/fixtures/Canonical/Humanoid/antonia-original.sidecar.json
@@ -0,0 +1,21 @@
+{
+ "schema": "aetheris.humanoid.original-source-admission.v1",
+ "assetId": "antonia-polygon-original-1.2.0",
+ "source": "https://github.com/odf/Antonia.Polygon",
+ "revision": "08c9767691daad1382dfc6980ee83e31514b4879",
+ "files": [
+ { "path": "Runtime/geometries/Antonia/Antonia-1.2.obj", "localName": "Antonia-1.2.obj", "sha256": "0d9e918f19a497adebb51dc8f4ac921c41753b157c50809a1d760dd45ec01194" },
+ { "path": "Runtime/Docs/Antonia/README", "localName": "README", "sha256": "e9385525cf613450e8673703f7959cd869e2d9c1290d474a99ca4863d734f4ae" }
+ ],
+ "license": "CC-BY-3.0",
+ "licenseUrl": "https://creativecommons.org/licenses/by/3.0/",
+ "preservedNotice": "antonia-original-LICENSE.txt",
+ "author": "Olaf Delgado-Friedrichs",
+ "additionalCredits": "phantom3D, MikeJ and others credited in the original notice",
+ "admittedComponent": "Original Antonia 1.2.0 OBJ base figure: skin_ARMS, skin_BODY, skin_HEAD, skin_LEGS, lips, nailsFingers, nailsToes, bilateral sclera/iris/pupil/cornea polygons.",
+ "excluded": ["CharMorph conversion and code", "source rigs and skin weights", "morphs", "textures", "shared libraries", "mouth interior", "teeth", "tongue", "toeCap", "invisible", "brows", "lashes", "lacrimals", "separately distributed extras"],
+ "sourceAdmission": "Original base-figure geometry and connectivity admitted with attribution under its original notice; no inference about CharMorph conversion components.",
+ "runtimeAdmission": "NOT PROMOTED: numerical and visual deformation gates fail; candidate is not CanonicalHumanoid.",
+ "candidateTopologyId": "aetheris.humanoid.antonia.adoption-candidate.v1",
+ "attribution": "Based on Antonia Polygon by Olaf Delgado-Friedrichs, with phantom3D, MikeJ and others credited in the preserved original notice. Aetheris adapts the base figure by selecting body/eye components, converting its coordinate frame, freezing a binding triangulation, mapping semantic group/joint proxies, generating skin weights and experimenting with A-pose preparation. Source: https://github.com/odf/Antonia.Polygon/tree/08c9767691daad1382dfc6980ee83e31514b4879 . CC BY 3.0: https://creativecommons.org/licenses/by/3.0/ . No endorsement implied. No exclusive authorship claim over source topology."
+}
diff --git a/scripts/qualify-humanoid-x1.ps1 b/scripts/qualify-humanoid-x1.ps1
new file mode 100644
index 00000000..2fa4c99d
--- /dev/null
+++ b/scripts/qualify-humanoid-x1.ps1
@@ -0,0 +1,58 @@
+[CmdletBinding()]
+param(
+ [string]$Blender = "C:\Program Files\Blender Foundation\Blender 5.2\blender.exe",
+ [switch]$SkipFetch,
+ [switch]$SkipRender,
+ [switch]$SkipFullTests
+)
+$ErrorActionPreference = 'Stop'
+$repo = Split-Path -Parent $PSScriptRoot
+Push-Location $repo
+try {
+ $outDir = 'artifacts/local/humanoid-x1'
+ $sourceDir = Join-Path $outDir 'source'
+ New-Item -ItemType Directory -Force $sourceDir | Out-Null
+ $sidecar = Get-Content fixtures/Canonical/Humanoid/antonia-original.sidecar.json -Raw | ConvertFrom-Json
+ foreach ($file in $sidecar.files) {
+ $target = Join-Path $sourceDir $file.localName
+ if (-not (Test-Path -LiteralPath $target)) {
+ if ($SkipFetch) { throw "Missing pinned input: $target" }
+ $url = 'https://raw.githubusercontent.com/odf/Antonia.Polygon/' + $sidecar.revision + '/' + $file.path
+ Invoke-WebRequest $url -OutFile $target
+ }
+ if ((Get-FileHash -LiteralPath $target -Algorithm SHA256).Hash.ToLowerInvariant() -ne $file.sha256) {
+ throw "Pinned source hash mismatch: $target"
+ }
+ }
+ dotnet run --project tools/Aetheris.Humanoid.X0 -- adopt-antonia --source "$sourceDir/Antonia-1.2.obj" --notice "$sourceDir/README" --out-dir $outDir > "$outDir/run.log"
+ if ($LASTEXITCODE -ne 0) { throw "Antonia adoption command failed: $LASTEXITCODE" }
+ dotnet run --no-build --project tools/Aetheris.Humanoid.X0 -- adopt-antonia --source "$sourceDir/Antonia-1.2.obj" --notice "$sourceDir/README" --out-dir "$outDir/replay" > "$outDir/replay.log"
+ if ($LASTEXITCODE -ne 0) { throw "Antonia replay failed: $LASTEXITCODE" }
+ $replayFiles = @('antonia-adoption-candidate.json', 'adoption-evidence.json') + @(Get-ChildItem -LiteralPath $outDir -Filter '*.obj' -File | Select-Object -ExpandProperty Name)
+ foreach ($name in $replayFiles) {
+ if ((Get-FileHash "$outDir/$name").Hash -ne (Get-FileHash "$outDir/replay/$name").Hash) {
+ throw "Deterministic replay mismatch: $name"
+ }
+ }
+ $evidence = Get-Content "$outDir/adoption-evidence.json" -Raw | ConvertFrom-Json
+ if ($evidence.selectedVertices -ne 27193 -or $evidence.selectedQuads -ne 27112 -or $evidence.joints -ne 55 -or
+ $evidence.connectivityHash -ne '2e2f787499ba2da1f02bab14f352b86070938fbb5d7cae60e8bd7d59edb2b7a2' -or
+ $evidence.symmetryMaximumMm -gt .001 -or $evidence.preparedSymmetryMaximumMm -gt .001 -or $evidence.maximumWeightSumError -gt .00001 -or
+ $evidence.uncoveredVertices -ne 0 -or $evidence.preparationEvidence.bindReconstructionMaximumMm -gt .001) {
+ throw 'Admitted-source topology/skin/bind regression failed.'
+ }
+ if (-not $SkipRender) {
+ & $Blender --background --factory-startup --disable-autoexec --python-exit-code 1 --python scripts/render-humanoid-x1.py > "$outDir/render.log"
+ if ($LASTEXITCODE -ne 0) { throw "Evidence render failed: $LASTEXITCODE" }
+ }
+ dotnet test Aetheris.Humanoid.Tests/Aetheris.Humanoid.Tests.csproj --verbosity minimal > "$outDir/focused-tests.log"
+ if ($LASTEXITCODE -ne 0) { throw "Humanoid tests failed: $LASTEXITCODE" }
+ if (-not $SkipFullTests) {
+ dotnet build Aetheris.slnx -m:1 > "$outDir/build.log"
+ if ($LASTEXITCODE -ne 0) { throw "Solution build failed: $LASTEXITCODE" }
+ dotnet test Aetheris.slnx --no-build --filter 'Category!=SlowCorpus' --verbosity minimal > "$outDir/full-tests.log"
+ if ($LASTEXITCODE -ne 0) { throw "Solution tests failed: $LASTEXITCODE" }
+ }
+ Write-Host 'Reproduction passed. Canonical promotion is BLOCKED; inspect adoption-evidence.json and HUMANOID-X1.md. Successful reproduction does not mean deformation qualification passed.'
+}
+finally { Pop-Location }
diff --git a/scripts/qualify-humanoid-x2.ps1 b/scripts/qualify-humanoid-x2.ps1
new file mode 100644
index 00000000..8496c721
--- /dev/null
+++ b/scripts/qualify-humanoid-x2.ps1
@@ -0,0 +1,44 @@
+[CmdletBinding()]
+param(
+ [string]$Candidate = 'artifacts/local/humanoid-x1/antonia-adoption-candidate.json',
+ [string]$Blender = 'C:\Program Files\Blender Foundation\Blender 5.2\blender.exe',
+ [string[]]$Fbx = @(),
+ [switch]$SkipRender,
+ [switch]$SkipFullTests
+)
+$ErrorActionPreference = 'Stop'
+Push-Location (Split-Path -Parent $PSScriptRoot)
+try {
+ $outDir = 'artifacts/local/humanoid-x2'
+ if (-not (Test-Path -LiteralPath $Candidate)) { throw 'Generate the X1 Antonia candidate first using qualify-humanoid-x1.ps1.' }
+ New-Item -ItemType Directory -Force $outDir | Out-Null
+ dotnet build tools/Aetheris.Humanoid.X0/Aetheris.Humanoid.X0.csproj > "$outDir/tool-build.log"
+ if ($LASTEXITCODE -ne 0) { throw 'Humanoid research tool build failed.' }
+ foreach ($target in @($outDir, "$outDir/replay")) {
+ dotnet run --no-build --project tools/Aetheris.Humanoid.X0 -- constrained-antonia --input $Candidate --out-dir $target
+ if ($LASTEXITCODE -ne 0) { throw 'Constrained Antonia qualification failed.' }
+ }
+ $files = @('evidence.json') + @(Get-ChildItem -LiteralPath $outDir -File | Where-Object { $_.Name -like '*.obj' -or $_.Name -like '*.mechanism.json' } | Select-Object -ExpandProperty Name)
+ foreach ($file in $files) {
+ if ((Get-FileHash "$outDir/$file").Hash -ne (Get-FileHash "$outDir/replay/$file").Hash) { throw "Replay mismatch: $file" }
+ }
+ $evidence = Get-Content "$outDir/evidence.json" -Raw | ConvertFrom-Json
+ if ($evidence.cases.Count -ne 20 -or @($evidence.cases | Where-Object isSolved).Count -ne 17) { throw 'Unexpected constrained corpus outcomes.' }
+ if (@($evidence.cases | Where-Object { $_.isSolved -and -not $_.deterministic }).Count -ne 0) { throw 'Nondeterministic solve.' }
+ if (-not $SkipRender) {
+ $renderArgs = @('--background', '--factory-startup', '--disable-autoexec', '--python-exit-code', '1', '--python', 'scripts/render-humanoid-x2.py', '--')
+ foreach ($path in $Fbx) { $renderArgs += @('--fbx', $path) }
+ & $Blender @renderArgs > "$outDir/render.log"
+ if ($LASTEXITCODE -ne 0) { throw 'X2 diagnostic rendering failed.' }
+ }
+ dotnet test Aetheris.Humanoid.Tests/Aetheris.Humanoid.Tests.csproj --verbosity minimal > "$outDir/focused-tests.log"
+ if ($LASTEXITCODE -ne 0) { throw 'Humanoid tests failed.' }
+ if (-not $SkipFullTests) {
+ dotnet build Aetheris.slnx -m:1 > "$outDir/build.log"
+ if ($LASTEXITCODE -ne 0) { throw 'Solution build failed.' }
+ dotnet test Aetheris.slnx --no-build --filter 'Category!=SlowCorpus' --verbosity minimal > "$outDir/full-tests.log"
+ if ($LASTEXITCODE -ne 0) { throw 'Solution tests failed; inspect full-tests.log.' }
+ }
+ Write-Host 'Constrained progression reproduced. X2 is NOT Accepted; surface/shoulder/migration gates remain unmet.'
+}
+finally { Pop-Location }
diff --git a/scripts/render-humanoid-x1.py b/scripts/render-humanoid-x1.py
new file mode 100644
index 00000000..63f08f82
--- /dev/null
+++ b/scripts/render-humanoid-x1.py
@@ -0,0 +1,106 @@
+"""Render the X1 candidate and failed poses. Blender is evidence tooling only."""
+import argparse
+import json
+from pathlib import Path
+import sys
+
+import bpy
+from mathutils import Vector
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--out-dir', default='artifacts/local/humanoid-x1')
+ args = parser.parse_args(sys.argv[sys.argv.index('--') + 1:] if '--' in sys.argv else [])
+ out = Path(args.out_dir).resolve()
+ candidate = json.loads((out / 'antonia-adoption-candidate.json').read_text())
+ bpy.ops.object.select_all(action='SELECT')
+ bpy.ops.object.delete(use_global=False)
+ scene = bpy.context.scene
+ scene.render.engine = 'BLENDER_WORKBENCH'
+ scene.display.shading.light = 'STUDIO'
+ scene.display.shading.color_type = 'MATERIAL'
+ scene.display.shading.single_color = (.58, .63, .68)
+ scene.display.shading.show_shadows = True
+ scene.display.shading.show_cavity = True
+ scene.display.shading.cavity_type = 'BOTH'
+ scene.display.shading.background_type = 'WORLD'
+ scene.world.color = (.035, .035, .035)
+ scene.render.resolution_x = 1000
+ scene.render.resolution_y = 1200
+ scene.render.resolution_percentage = 100
+ scene.render.image_settings.file_format = 'PNG'
+ camera_data = bpy.data.cameras.new('Evidence camera')
+ camera = bpy.data.objects.new('Evidence camera', camera_data)
+ bpy.context.collection.objects.link(camera)
+ scene.camera = camera
+ camera_data.type = 'ORTHO'
+ camera_data.clip_end = 100
+
+ def load(name):
+ for obj in list(scene.objects):
+ if obj.type == 'MESH':
+ bpy.data.objects.remove(obj, do_unlink=True)
+ vertices, faces = [], []
+ for line in (out / name).read_text().splitlines():
+ fields = line.split()
+ if not fields:
+ continue
+ if fields[0] == 'v':
+ vertices.append(tuple(float(v) / 1000 for v in fields[1:4]))
+ elif fields[0] == 'f':
+ faces.append(tuple(int(v) - 1 for v in fields[1:]))
+ mesh = bpy.data.meshes.new(name)
+ mesh.from_pydata(vertices, [], faces)
+ mesh.update()
+ obj = bpy.data.objects.new(name, mesh)
+ bpy.context.collection.objects.link(obj)
+ for label, color in [('skin', (.58, .63, .68, 1)), ('wire', (.025, .025, .025, 1))]:
+ mat = bpy.data.materials.new(label)
+ mat.diffuse_color = color
+ mesh.materials.append(mat)
+ modifier = obj.modifiers.new('Binding triangles', 'WIREFRAME')
+ modifier.thickness = .00035
+ modifier.use_even_offset = False
+ modifier.use_replace = False
+ modifier.material_offset = 1
+ modifier.show_render = False
+ # Flat shading retains geometric defects instead of concealing them.
+ return obj
+
+ def render(name, eye, target=(0, 0, .875), scale=2.05, wire=False):
+ camera.location = eye
+ camera.rotation_euler = (Vector(target) - camera.location).to_track_quat('-Z', 'Y').to_euler()
+ camera_data.ortho_scale = scale
+ for obj in scene.objects:
+ if obj.type == 'MESH':
+ obj.modifiers['Binding triangles'].show_render = wire
+ scene.render.filepath = str(out / (name + '.png'))
+ bpy.ops.render.render(write_still=True)
+
+ load('source-pose.obj')
+ render('source-front', (0, 5, .875))
+ load('prepared-apose.obj')
+ for name, eye in [('front', (0, 5, .875)), ('back', (0, -5, .875)),
+ ('side', (5, 0, .875)), ('iso', (3, 4, 2.6))]:
+ render('neutral-' + name, eye)
+ render('wireframe-front', (0, 5, .875), wire=True)
+ hand_points = [p for p, v in zip(candidate['preparedPositions'], candidate['sourcePoseSurface']['vertices'])
+ if v['region'] in ('LeftHand', 'LeftThumb', 'LeftIndex', 'LeftMiddle', 'LeftRing', 'LeftLittle')]
+ hand_target = tuple((min(p[k] for p in hand_points) + max(p[k] for p in hand_points)) / 2000 for k in ('x', 'y', 'z'))
+ for name, target, scale in [('face', (0, .02, 1.61), .36),
+ ('shoulder', (-.25, 0, 1.39), .48),
+ ('pelvis', (0, 0, .96), .60),
+ ('hand', hand_target, .30),
+ ('feet', (0, .04, .08), .62)]:
+ render('wireframe-' + name, (target[0], 5, target[2]), target, scale, True)
+ for name in candidate['poseSweep']:
+ if not name.endswith('-70'):
+ continue
+ load(name + '.obj')
+ render('pose-' + name, (3, 4, 2.6))
+ print('X1 visual evidence rendered; human review remains required.')
+
+
+if __name__ == '__main__':
+ main()
diff --git a/scripts/render-humanoid-x2.py b/scripts/render-humanoid-x2.py
new file mode 100644
index 00000000..1f70c53b
--- /dev/null
+++ b/scripts/render-humanoid-x2.py
@@ -0,0 +1,177 @@
+"""Local X2 diagnostic renders and read-only FBX reference inspection; Blender is not runtime authority."""
+import argparse
+import hashlib
+import json
+import re
+from pathlib import Path
+import sys
+
+import bpy
+from mathutils import Vector
+
+
+def setup():
+ bpy.ops.object.select_all(action='SELECT')
+ bpy.ops.object.delete(use_global=False)
+ scene = bpy.context.scene
+ scene.render.engine = 'BLENDER_WORKBENCH'
+ scene.display.shading.light = 'STUDIO'
+ scene.display.shading.color_type = 'MATERIAL'
+ scene.display.shading.show_cavity = True
+ scene.display.shading.cavity_type = 'BOTH'
+ scene.world.color = (.035, .035, .035)
+ scene.render.resolution_x = 1100
+ scene.render.resolution_y = 1000
+ scene.render.resolution_percentage = 100
+ scene.render.image_settings.file_format = 'PNG'
+ data = bpy.data.cameras.new('Diagnostic camera')
+ camera = bpy.data.objects.new('Diagnostic camera', data)
+ scene.collection.objects.link(camera)
+ scene.camera = camera
+ data.type = 'ORTHO'
+ data.ortho_scale = 2.05
+ data.clip_end = 10000
+ camera.location = (3, 5, 2.3)
+ camera.rotation_euler = (Vector((0, 0, .9)) - camera.location).to_track_quat('-Z', 'Y').to_euler()
+ return scene
+
+
+def material(name, color):
+ mat = bpy.data.materials.new(name)
+ mat.diffuse_color = (*color, 1)
+ return mat
+
+
+def obj_mesh(path, shift=0):
+ vertices, faces = [], []
+ for line in path.read_text().splitlines():
+ f = line.split()
+ if f and f[0] == 'v':
+ vertices.append((float(f[1]) / 1000 + shift, float(f[2]) / 1000, float(f[3]) / 1000))
+ elif f and f[0] == 'f':
+ faces.append(tuple(int(v) - 1 for v in f[1:]))
+ mesh = bpy.data.meshes.new(path.stem)
+ mesh.from_pydata(vertices, [], faces)
+ mesh.update()
+ obj = bpy.data.objects.new(path.stem, mesh)
+ bpy.context.collection.objects.link(obj)
+ mesh.materials.append(material('Surface', (.58, .63, .68)))
+ return obj
+
+
+def mechanism(path):
+ data = json.loads(path.read_text())
+ joints = data['joints']
+ positions = [Vector(tuple(j['position'][k] / 1000 for k in ('x', 'y', 'z'))) for j in joints]
+ mat = material('Links', (.95, .45, .08))
+ for i, joint in enumerate(joints):
+ parent = joint['parentIndex']
+ if parent is None:
+ continue
+ a, b = positions[parent], positions[i]
+ length = (b - a).length
+ if length < .00001:
+ continue
+ bpy.ops.mesh.primitive_cylinder_add(vertices=8, radius=.006, depth=length, location=(a + b) / 2)
+ link = bpy.context.object
+ link.rotation_euler = (b - a).to_track_quat('Z', 'Y').to_euler()
+ link.data.materials.append(mat)
+ bpy.ops.mesh.primitive_uv_sphere_add(segments=8, ring_count=4, radius=.012, location=b)
+ bpy.context.object.data.materials.append(mat)
+
+
+def render(scene, path):
+ scene.render.filepath = str(path.resolve())
+ bpy.ops.render.render(write_still=True)
+
+
+def inspect_fbx(path, out):
+ raw = path.read_bytes()
+ if raw.startswith(b'; FBX'):
+ # Declaration inventory only. Do not interpret FBX transform conventions with a homegrown importer.
+ text = raw.decode('utf-8')
+ models = re.findall(r'^\s*Model:\s*(\d+),\s*"Model::([^"]+)",\s*"([^"]+)"', text, re.M)
+ names = {identifier: name for identifier, name, _ in models}
+ parents = {child: parent for child, parent in re.findall(r'^\s*C:\s*"OO",\s*(\d+),\s*(\d+)\s*$', text, re.M)
+ if child in names and parent in names}
+ evidence = {'file': path.name, 'sha256': hashlib.sha256(raw).hexdigest(),
+ 'format': 'ASCII FBX 7.7', 'status': 'DeclarationInventoryOnly',
+ 'limitation': 'Installed Blender FBX importer rejects ASCII. No pose, weight or deformation interpretation claimed.',
+ 'modelDeclarations': [{'name': name, 'type': kind, 'parent': names.get(parents.get(identifier))}
+ for identifier, name, kind in models],
+ 'geometryDeclarations': len(re.findall(r'^\s*Geometry:\s*\d+,', text, re.M)),
+ 'clusterDeclarations': len(re.findall(r'^\s*Deformer:\s*\d+,\s*"[^"]*",\s*"Cluster"', text, re.M)),
+ 'animationCurveDeclarations': len(re.findall(r'^\s*AnimationCurve:\s*\d+,', text, re.M))}
+ (out / (path.stem + '.reference.json')).write_text(json.dumps(evidence, indent=2))
+ return {k: v for k, v in evidence.items() if k != 'modelDeclarations'} | {'limbNodes': sum(kind == 'LimbNode' for _, _, kind in models)}
+ scene = setup()
+ bpy.ops.import_scene.fbx(filepath=str(path.resolve()), use_anim=True)
+ armatures = [o for o in scene.objects if o.type == 'ARMATURE']
+ meshes = [o for o in scene.objects if o.type == 'MESH']
+ evidence = {'file': path.name, 'sha256': hashlib.sha256(path.read_bytes()).hexdigest(),
+ 'armatures': [], 'meshes': [], 'frameStart': scene.frame_start, 'frameEnd': scene.frame_end}
+ for arm in armatures:
+ evidence['armatures'].append({'name': arm.name, 'bones': [
+ {'name': b.name, 'parent': b.parent.name if b.parent else None,
+ 'headLocal': list(b.head_local), 'tailLocal': list(b.tail_local), 'lengthLocal': b.length}
+ for b in arm.data.bones]})
+ for mesh in meshes:
+ evidence['meshes'].append({'name': mesh.name, 'vertices': len(mesh.data.vertices),
+ 'polygons': len(mesh.data.polygons), 'weightGroups': [g.name for g in mesh.vertex_groups],
+ 'unweightedVertices': sum(not v.groups for v in mesh.data.vertices)})
+ evidence['samples'] = []
+ for frame in sorted(set([scene.frame_start, (scene.frame_start + scene.frame_end) // 2, scene.frame_end])):
+ scene.frame_set(frame)
+ evidence['samples'].append({'frame': frame, 'armatures': [
+ {'name': arm.name, 'bones': [{'name': b.name, 'headWorld': list(arm.matrix_world @ b.head),
+ 'tailWorld': list(arm.matrix_world @ b.tail)} for b in arm.pose.bones]}
+ for arm in armatures]})
+ (out / (path.stem + '.reference.json')).write_text(json.dumps(evidence, indent=2))
+ if meshes:
+ scene.frame_set(scene.frame_start)
+ points = [o.matrix_world @ Vector(c) for o in meshes for c in o.bound_box]
+ lo = Vector(tuple(min(p[i] for p in points) for i in range(3)))
+ hi = Vector(tuple(max(p[i] for p in points) for i in range(3)))
+ center = (lo + hi) / 2
+ span = max(hi - lo)
+ scene.camera.data.ortho_scale = span * 1.3
+ scene.camera.location = center + Vector((span * 2, -span * 3, span * .7))
+ scene.camera.rotation_euler = (center - scene.camera.location).to_track_quat('-Z', 'Y').to_euler()
+ render(scene, out / (path.stem + '.reference.png'))
+ return {'file': path.name, 'sha256': evidence['sha256'], 'armatures': len(armatures),
+ 'bones': sum(len(a.data.bones) for a in armatures), 'meshes': len(meshes),
+ 'vertices': sum(len(o.data.vertices) for o in meshes), 'frameStart': scene.frame_start, 'frameEnd': scene.frame_end}
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--out-dir', default='artifacts/local/humanoid-x2')
+ parser.add_argument('--x1-dir', default='artifacts/local/humanoid-x1')
+ parser.add_argument('--fbx', action='append', default=[])
+ args = parser.parse_args(sys.argv[sys.argv.index('--') + 1:] if '--' in sys.argv else [])
+ out = Path(args.out_dir)
+ evidence = json.loads((out / 'evidence.json').read_text())
+ for case in evidence['cases']:
+ if not case.get('isSolved') or case['name'] not in ('neutral', 'hip-flexion-45', 'hip-flexion-70', 'hip-flexion-90', 'hip-abduction-45', 'elbow-flexion-90', 'knee-flexion-90', 'hip-knee-90'):
+ continue
+ scene = setup()
+ obj_mesh(out / case['diagnosticObj'])
+ render(scene, out / (case['name'] + '.png'))
+ if case['name'] in ('hip-flexion-90', 'hip-knee-90'):
+ scene = setup()
+ mechanism(out / (case['name'] + '.mechanism.json'))
+ render(scene, out / (case['name'] + '.mechanism.png'))
+ # Same angle / unchanged shape and skin: a causal witness, not a claimed improvement.
+ scene = setup()
+ obj_mesh(Path(args.x1_dir) / 'hip-flexion-70.obj', -.55)
+ obj_mesh(out / 'hip-flexion-70.failed-diagnostic.obj', .55)
+ scene.camera.location = (0, 6, 1.4)
+ scene.camera.rotation_euler = (Vector((0, 0, .9)) - scene.camera.location).to_track_quat('-Z', 'Y').to_euler()
+ scene.camera.data.ortho_scale = 2.4
+ render(scene, out / 'x1-left-x2-right-hip70.png')
+ references = [inspect_fbx(Path(p), out) for p in args.fbx]
+ (out / 'fbx-summary.json').write_text(json.dumps(references, indent=2))
+
+
+if __name__ == '__main__':
+ main()
diff --git a/tools/Aetheris.Humanoid.X0/ConstrainedQualification.cs b/tools/Aetheris.Humanoid.X0/ConstrainedQualification.cs
new file mode 100644
index 00000000..82f5ca67
--- /dev/null
+++ b/tools/Aetheris.Humanoid.X0/ConstrainedQualification.cs
@@ -0,0 +1,105 @@
+using System.Diagnostics;
+using System.Numerics;
+using System.Security.Cryptography;
+using System.Text.Json;
+using Aetheris.Humanoid;
+using Aetheris.Kernel.Core.Math;
+
+internal static class ConstrainedQualification
+{
+ public static int Run(string input, string output)
+ {
+ var candidate = JsonSerializer.Deserialize<AntoniaAdoptionCandidate>(File.ReadAllText(input), HumanoidArtifactIO.JsonOptions)
+ ?? throw new InvalidDataException("Missing Antonia candidate.");
+ if (candidate.SourcePoseSurface.TopologyId != AntoniaSurfaceAdoption.CandidateTopologyId)
+ throw new InvalidDataException("Expected the unpromoted Antonia X1 candidate.");
+ Directory.CreateDirectory(output);
+ var surface = candidate.SourcePoseSurface with { Vertices = candidate.SourcePoseSurface.Vertices
+ .Select((v, i) => v with { Position = candidate.PreparedPositions[i] }).ToArray() };
+ var skeleton = candidate.PreparedSkeleton;
+ var cases = new List<object>();
+ var timings = new List<object>();
+ foreach (var (name, joints, policy) in Corpus())
+ {
+ var request = new RequestedHumanoidPose(name, skeleton.SkeletonId, skeleton.RestPoseId, 0, joints);
+ var timer = Stopwatch.StartNew();
+ var result = HumanoidKinematicSolver.Solve(skeleton, request, policy: policy);
+ var solveMs = timer.Elapsed.TotalMilliseconds;
+ if (result.Pose is not { } solved)
+ {
+ cases.Add(new { name, request, policy, result.IsSolved, result.Diagnostics, result.Projections });
+ timings.Add(new { name, solveMs });
+ continue;
+ }
+ timer.Restart();
+ var evaluation = HumanoidConstrainedSurface.Evaluate(surface, skeleton, 0, solved);
+ var surfaceAndValidationMs = timer.Elapsed.TotalMilliseconds;
+ var replay = HumanoidKinematicSolver.Solve(skeleton, request, policy: policy).Pose!;
+ var deterministic = solved.GlobalTransforms.SequenceEqual(replay.GlobalTransforms) && solved.Joints.SequenceEqual(replay.Joints);
+ if (!deterministic) throw new InvalidOperationException("Solved state replay mismatch: " + name);
+ // Failed surfaces have diagnostic filenames. They are not admitted render/export products.
+ var obj = name + (evaluation.Evidence.IsAdmissible ? ".screened.obj" : ".failed-diagnostic.obj");
+ Export(Path.Combine(output, obj), surface, evaluation.Positions);
+ File.WriteAllText(Path.Combine(output, name + ".mechanism.json"), JsonSerializer.Serialize(new
+ {
+ joints = skeleton.Joints.Select((j, i) => new { j.Kind, j.ParentIndex, position = HumanoidKinematicSolverPosition(solved.GlobalTransforms[i]) }),
+ solved.Residuals
+ }, HumanoidArtifactIO.JsonOptions));
+ cases.Add(new { name, request, policy, result.IsSolved, result.Diagnostics, result.Projections,
+ solved.Joints, solved.Residuals, deterministic, evaluation.Evidence, diagnosticObj = obj });
+ timings.Add(new { name, solveMs, surfaceAndValidationMs });
+ }
+ var baseline = AntoniaSurfaceAdoption.QualificationPoses().Select(p =>
+ {
+ var globals = HumanoidPosing.GlobalPose(skeleton, p);
+ var positions = HumanoidPosing.EvaluateVertices(surface, skeleton, p);
+ var evidence = HumanoidConstrainedSurface.Inspect(surface, skeleton, globals, positions);
+ return new { p.PoseId, evidence };
+ }).ToArray();
+ File.WriteAllText(Path.Combine(output, "evidence.json"), JsonSerializer.Serialize(new
+ {
+ schema = "aetheris.humanoid.x2-constrained-progression.v1", verdict = "Meaningful progression",
+ solverVersion = HumanoidKinematicSolver.Version,
+ sourceCandidateSha256 = Convert.ToHexStringLower(SHA256.HashData(File.ReadAllBytes(input))),
+ surface.TopologyId, surface.ConnectivityHash,
+ links = HumanoidKinematicSolver.Links(skeleton), cases, baseline,
+ limitations = new[] { "Antonia remains an unpromoted candidate.", "Compound shoulder, collision, wrist/ankle/neck domains are not implemented.",
+ "Legacy quaternion API remains available for X0/X1 research; it is not a constrained solve.",
+ "Surface LBS and weights are unchanged to isolate kinematic and interpolation failures.",
+ "No migrated Antonia landmarks, attachment frames, morphs or measurements; no human signoff.",
+ "Orientation screen is a proxy; self-intersection count unavailable." }
+ }, HumanoidArtifactIO.JsonOptions));
+ File.WriteAllText(Path.Combine(output, "timings.json"), JsonSerializer.Serialize(timings, HumanoidArtifactIO.JsonOptions));
+ Console.WriteLine($"Meaningful progression evidence: {Path.Combine(output, "evidence.json")}. Successful execution does not mean X2 acceptance.");
+ return 0;
+ }
+
+ private static object HumanoidKinematicSolverPosition(Matrix4x4 m) => new { x = m.M41, y = m.M42, z = m.M43 };
+
+ public static IEnumerable<(string Name, AnatomicalJointRequest[] Joints, AnatomicalSolvePolicy Policy)> Corpus()
+ {
+ yield return ("neutral", [], AnatomicalSolvePolicy.Reject);
+ foreach (var degrees in new[] { 45d, 70, 90, 120 })
+ yield return ($"hip-flexion-{degrees}", [new(HumanoidJointKind.LeftHip, degrees)], AnatomicalSolvePolicy.Reject);
+ foreach (var degrees in new[] { 30d, 45, 70 })
+ yield return ($"hip-abduction-{degrees}", [new(HumanoidJointKind.LeftHip, AbductionDegrees: degrees)], AnatomicalSolvePolicy.Project);
+ foreach (var degrees in new[] { 45d, 90, 120 })
+ yield return ($"elbow-flexion-{degrees}", [new(HumanoidJointKind.LeftElbow, degrees)], AnatomicalSolvePolicy.Reject);
+ foreach (var degrees in new[] { 45d, 90, 140 })
+ yield return ($"knee-flexion-{degrees}", [new(HumanoidJointKind.LeftKnee, degrees)], AnatomicalSolvePolicy.Reject);
+ yield return ("hip-knee-90", [new(HumanoidJointKind.LeftHip, 90), new(HumanoidJointKind.LeftKnee, 90)], AnatomicalSolvePolicy.Reject);
+ yield return ("backward-elbow", [new(HumanoidJointKind.LeftElbow, -45)], AnatomicalSolvePolicy.Reject);
+ yield return ("knee-hyperextension", [new(HumanoidJointKind.LeftKnee, -30)], AnatomicalSolvePolicy.Project);
+ yield return ("extreme-hip-abduction", [new(HumanoidJointKind.LeftHip, AbductionDegrees: 160)], AnatomicalSolvePolicy.Reject);
+ yield return ("hip-corner", [new(HumanoidJointKind.LeftHip, 120, 45, 45)], AnatomicalSolvePolicy.Project);
+ yield return ("shoulder-90", [new(HumanoidJointKind.LeftShoulder, AbductionDegrees: 90)], AnatomicalSolvePolicy.Reject);
+ }
+
+ private static void Export(string path, HumanoidSurface surface, IReadOnlyList<Point3D> positions)
+ {
+ using var writer = new StreamWriter(path);
+ writer.WriteLine("# NONCANONICAL X2 diagnostic; Antonia Polygon CC-BY-3.0 Olaf Delgado-Friedrichs; no endorsement");
+ foreach (var p in positions) writer.WriteLine(FormattableString.Invariant($"v {p.X:R} {p.Y:R} {p.Z:R}"));
+ foreach (var f in surface.Faces) writer.WriteLine($"f {f.A + 1} {f.B + 1} {f.C + 1}");
+ }
+}
diff --git a/tools/Aetheris.Humanoid.X0/Program.cs b/tools/Aetheris.Humanoid.X0/Program.cs
index b31058d0..ab506828 100644
--- a/tools/Aetheris.Humanoid.X0/Program.cs
+++ b/tools/Aetheris.Humanoid.X0/Program.cs
@@ -13,6 +13,8 @@ static int Run(string[] args)
return args[0] switch
{
"generate"=>Generate(args[1..]),
+ "adopt-antonia"=>AdoptAntonia(args[1..]),
+ "constrained-antonia"=>ConstrainedQualification.Run(Required(args, "--input"), Value(args, "--out-dir") ?? Path.Combine("artifacts", "local", "humanoid-x2")),
"inspect"=>Inspect(args[1..]),
"morph"=>Morph(args[1..]),
"pose"=>Pose(args[1..]),
@@ -24,6 +26,57 @@ static int Run(string[] args)
catch(Exception ex){Console.Error.WriteLine(ex.Message);return 1;}
}
+static int AdoptAntonia(string[] args)
+{
+ var candidate = AntoniaSurfaceAdoption.Prepare(Required(args, "--source"), Required(args, "--notice"));
+ var directory = Value(args, "--out-dir") ?? Path.Combine("artifacts", "local", "humanoid-x1");
+ Directory.CreateDirectory(directory);
+ var artifact = Path.Combine(directory, "antonia-adoption-candidate.json");
+ File.WriteAllText(artifact, JsonSerializer.Serialize(candidate, HumanoidArtifactIO.JsonOptions));
+ Export("source-pose.obj", candidate.SourcePoseSurface.Vertices.Select(v => v.Position).ToArray());
+ Export("prepared-apose.obj", candidate.PreparedPositions);
+ var preparedSurface = candidate.SourcePoseSurface with { Vertices = candidate.SourcePoseSurface.Vertices.Select((v, i) => v with { Position = candidate.PreparedPositions[i] }).ToArray() };
+ foreach (var pose in AntoniaSurfaceAdoption.QualificationPoses())
+ Export(pose.PoseId + ".obj", HumanoidPosing.EvaluateVertices(preparedSurface, candidate.PreparedSkeleton, pose));
+ var evidence = new
+ {
+ schema = "aetheris.humanoid.x1-adoption-evidence.v1", candidate.Status,
+ sourceRevision = AntoniaSurfaceAdoption.Revision, sourceSha256 = AntoniaSurfaceAdoption.SourceSha256,
+ sourceVertices = 38822, sourceQuads = 38614,
+ selectedVertices = candidate.SourcePoseSurface.Vertices.Count, selectedQuads = candidate.SourcePolygons.Count,
+ bindingTriangles = candidate.SourcePoseSurface.Faces.Count,
+ candidate.SourcePoseSurface.TopologyId, candidate.SourcePoseSurface.ConnectivityHash,
+ components = candidate.SourcePoseSurface.Components.Select(c => new { c.Id, c.Kind, triangles = c.FaceIndices.Count }),
+ regions = candidate.SourcePoseSurface.Faces.GroupBy(f => f.Region).Select(g => new { region = g.Key, triangles = g.Count() }),
+ joints = candidate.SourcePoseSkeleton.Joints.Count, candidate.ScaleToMm, candidate.SourceSoleY, candidate.SourcePelvisZ,
+ candidate.SymmetryMaximumMm, candidate.PreparedSymmetryMaximumMm, candidate.PreparationEvidence, candidate.PoseSweep,
+ minimumWeight = candidate.SourcePoseSurface.SkinWeights.SelectMany(w => w.Weights).Min(w => w.Weight),
+ maximumWeightSumError = candidate.SourcePoseSurface.SkinWeights.Max(w => Math.Abs(w.Weights.Sum(x => x.Weight) - 1)),
+ uncoveredVertices = candidate.SourcePoseSurface.SkinWeights.Count(w => w.Weights.Count == 0),
+ artifactSha256 = Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(File.ReadAllBytes(artifact))),
+ sourcePoseObjSha256 = Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(File.ReadAllBytes(Path.Combine(directory, "source-pose.obj")))),
+ preparedObjSha256 = Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(File.ReadAllBytes(Path.Combine(directory, "prepared-apose.obj")))),
+ canonicalPromotion = false,
+ missingGates = new[] { "reviewed A-pose preparation", "canonical region and anatomical proxy review", "landmarks, measurements and attachment migration", "morph and pose qualification", "human visual review" }
+ };
+ File.WriteAllText(Path.Combine(directory, "adoption-evidence.json"), JsonSerializer.Serialize(evidence, HumanoidArtifactIO.JsonOptions));
+ Console.WriteLine(JsonSerializer.Serialize(evidence, HumanoidArtifactIO.JsonOptions));
+ // Candidate generation succeeded; this command never claims runtime qualification.
+ return 0;
+
+ void Export(string name, IReadOnlyList<Aetheris.Kernel.Core.Math.Point3D> positions)
+ {
+ using var writer = new StreamWriter(Path.Combine(directory, name), false, new System.Text.UTF8Encoding(false));
+ writer.WriteLine("# NONCANONICAL Antonia Polygon adoption candidate; CC-BY-3.0; Olaf Delgado-Friedrichs; no endorsement implied");
+ foreach (var p in positions) writer.WriteLine(FormattableString.Invariant($"v {p.X:R} {p.Y:R} {p.Z:R}"));
+ foreach (var group in candidate.SourcePoseSurface.Faces.GroupBy(f => f.Region))
+ {
+ writer.WriteLine("g " + group.Key);
+ foreach (var f in group) writer.WriteLine($"f {f.A + 1} {f.B + 1} {f.C + 1}");
+ }
+ }
+}
+
static int Generate(string[] args)
{
var outDir=Value(args,"--out-dir")??Path.Combine("artifacts","local","humanoid-x0");Directory.CreateDirectory(outDir);var sw=Stopwatch.StartNew();var h=CanonicalAdultTemplate.Create();sw.Stop();var validation=HumanoidValidator.Validate(h);var artifact=Path.Combine(outDir,"canonical-adult-standard-v1.json");var obj=Path.Combine(outDir,"canonical-adult-standard-v1.obj");HumanoidArtifactIO.Save(h,artifact);HumanoidArtifactIO.SaveObj(h,obj);WriteSummary(h,validation,Path.Combine(outDir,"canonical-summary.json"),sw.Elapsed.TotalMilliseconds);Console.WriteLine(JsonSerializer.Serialize(new{success=validation.IsValid,artifact,obj,vertices=h.Surface.Vertices.Count,faces=h.Surface.Faces.Count,h.Surface.ConnectivityHash,diagnosticCounts=validation.Diagnostics.GroupBy(x=>new{x.Code,x.Severity}).Select(g=>new{g.Key.Code,g.Key.Severity,count=g.Count(),sample=g.First().Message})},HumanoidArtifactIO.JsonOptions));return validation.IsValid?0:2;
@@ -51,10 +104,10 @@ static int Sweep(string[] args)
}
static void WriteSummary(CanonicalHumanoid h,HumanoidValidationResult validation,string path,double ms)
{
- var evidence=new{milestone="HUMANOID-X0",status=validation.IsValid?"AuthoredTemplateValid":"AuthoredTemplateInvalid",generatorMilliseconds=ms,authority="Aetheris-authored implicit semantic primitives and fixed tetrahedral lattice; no external connectivity",topology=new{h.Surface.TopologyId,h.Surface.BindingTriangulationId,h.Surface.ConnectivityHash,vertices=h.Surface.Vertices.Count,faces=h.Surface.Faces.Count,regions=h.Surface.Vertices.Select(x=>x.Region).Distinct().Count(),components=h.Surface.Components.Select(x=>new{x.Id,x.Kind,faces=x.FaceIndices.Count})},skeleton=new{h.Skeleton.SkeletonId,joints=h.Skeleton.Joints.Count,h.Skeleton.RestPoseId,h.Skeleton.SkinningConvention},landmarks=new{total=h.Landmarks.Count,surface=h.Landmarks.OfType<SurfaceLandmark>().Count(),joint=h.Landmarks.OfType<JointLandmark>().Count()},measurements=HumanoidMeasurements.Evaluate(h),morphs=h.MorphChannels,attachments=h.Attachments.Select(x=>x.Id),validation};File.WriteAllText(path,JsonSerializer.Serialize(evidence,HumanoidArtifactIO.JsonOptions));
+ var evidence=new{milestone="HUMANOID-X0",status=validation.IsValid?"NONCANONICAL-SyntheticRegressionFixtureValid":"NONCANONICAL-SyntheticRegressionFixtureInvalid",generatorMilliseconds=ms,authority="Aetheris-authored implicit semantic primitives and fixed tetrahedral lattice; no external connectivity",topology=new{h.Surface.TopologyId,h.Surface.BindingTriangulationId,h.Surface.ConnectivityHash,vertices=h.Surface.Vertices.Count,faces=h.Surface.Faces.Count,regions=h.Surface.Vertices.Select(x=>x.Region).Distinct().Count(),components=h.Surface.Components.Select(x=>new{x.Id,x.Kind,faces=x.FaceIndices.Count})},skeleton=new{h.Skeleton.SkeletonId,joints=h.Skeleton.Joints.Count,h.Skeleton.RestPoseId,h.Skeleton.SkinningConvention},landmarks=new{total=h.Landmarks.Count,surface=h.Landmarks.OfType<SurfaceLandmark>().Count(),joint=h.Landmarks.OfType<JointLandmark>().Count()},measurements=HumanoidMeasurements.Evaluate(h),morphs=h.MorphChannels,attachments=h.Attachments.Select(x=>x.Id),validation};File.WriteAllText(path,JsonSerializer.Serialize(evidence,HumanoidArtifactIO.JsonOptions));
}
static string? Value(string[] args,string name){var i=Array.IndexOf(args,name);return i>=0&&i+1<args.Length?args[i+1]:null;}
static string Required(string[] args,string name)=>Value(args,name)??throw new ArgumentException($"Missing {name}.");
static string Kebab(string s)=>string.Concat(s.Select((c,i)=>char.IsUpper(c)&&i>0?"-"+char.ToLowerInvariant(c):char.ToLowerInvariant(c).ToString()));
static int Fail(string message){Console.Error.WriteLine(message);Usage();return 1;}
-static void Usage()=>Console.WriteLine("Aetheris.Humanoid.X0\n generate [--out-dir <dir>]\n inspect --input <canonical.json>\n morph --input <canonical.json> --output <variant.json> [--height <mm>] [--arm-length <delta-mm>] [--leg-length <delta-mm>] [--shoulder-width <delta-mm>]\n pose --input <canonical.json> --output <posed.obj> [--left-elbow-deg <deg>] [--left-shoulder-deg <deg>] [--left-hip-deg <deg>] [--left-knee-deg <deg>]\n sweep --input <canonical.json> --output <evidence.json>");
+static void Usage()=>Console.WriteLine("Aetheris.Humanoid research tooling (X0 synthetic / X1 unpromoted / X2 constrained progression)\n constrained-antonia --input <candidate.json> [--out-dir <dir>]\n adopt-antonia --source <Antonia-1.2.obj> --notice <original-README> [--out-dir <dir>]\n generate [--out-dir <dir>]\n inspect --input <canonical.json>\n morph --input <canonical.json> --output <variant.json> [--height <mm>] [--arm-length <delta-mm>] [--leg-length <delta-mm>] [--shoulder-width <delta-mm>]\n pose --input <canonical.json> --output <posed.obj> [--left-elbow-deg <deg>] [--left-shoulder-deg <deg>] [--left-hip-deg <deg>] [--left-knee-deg <deg>]\n sweep --input <canonical.json> --output <evidence.json>");