Skip to content

feat(runtime): evaluate the ShapeItems geometry the library determines - #505

Open
devin-ai-integration[bot] wants to merge 5 commits into
developfrom
feature/shape-items-derived-geometry
Open

devin-ai-integration[bot] wants to merge 5 commits into
developfrom
feature/shape-items-derived-geometry

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What and why

ShapeItems defines a shape's faces, edges and vertices through bind connectors with multiplicities. A Box's faces and edges already evaluated; every read through a Cylinder's or Cone's edges failed:

cyl.base.edges → feature value cyl.be: multiplicity violation: 1 value(s) bound to a feature with multiplicity lower bound 2

The cause was in the general binding mechanism, not in the library: binding [1] bind [0..*] base.edges = [0..*] be was read as a whole binding because its [0..*] ends neither bound nor require a count, so be [2] was bound to the disc's one edge. A binding connector's own multiplicity is the number of links it declares, so that binding identifies one value of each end — it relates the disc's edge to some value of be and determines neither end whole.

  • lower.Binding now carries the connector's own multiplicity (Binding.Multiplicity, from binding [n]).
  • runtime/binding.go partialBinding bounds the links of each end by the smaller of the end's and the connector's finite upper bounds; an end whose declared lower bounds already exceed the links (be [2] against one link) is partial before its value is read (endpointRequiresMoreThan), since it can never be linked whole — which also stops a read of be from recursing into its other binding. binding [2] over two [2] ends and bind a = b without a connector multiplicity stay whole bindings with the existing count check.
  • Binding diagnostics quote the connector multiplicity (binding [1] bind [0..1] tf.edges = [0..1] tfe).
  • wholeBindingCounts checks the identified value count against the connector's own range too (binding [2] bind a = b over one value is ErrMultiplicityViolation), and bindingLinksNothing treats a connector [0] as linking nothing.
  • Binding multiplicities are read through the new semantics.Model.RangeIn(scope, mult), so a bound naming a valued feature (binding [links] with attribute links = 1) evaluates in the binding's scope instead of coming back unknown.

Per ShapeItems derived feature (library lines in Domain Libraries/Geometry/ShapeItems.sysml):

Feature Verdict Decided by
Box::faces (6), tf.edges (4) with length/width, edges (24), tf.vertices (8), tf.e1.vertices (2), height, isSolid, voids, shape evaluates Cuboid 746, faces [6] (752), edges [24] (762); RectangularCuboid 798, Rectangle/Quadrilateral edges and vertices (fixed counts, no [0..1] group)
Cylinder::faces (3), Cone::faces (2), base.edges, af.edges (one ellipse each), height; the same on a Cylinder nested as a Box's voids, isSolid false evaluates (new) ConeOrCylinder 384–439 faces [2..3], base : Disc [1]; Disc 237, edges : Ellipse [1] = shape (254); binding [1] bind [0..*] base.edges = [0..*] be (432) links one value, so base.edges keeps its own
Box::tfeurre, tflvbrrv, and so Box::vertices underdetermined, ErrBindingEnd naming the binding CuboidOrTriangularPrism 562, binding [1] bind [0..1] tf.edges = [0..1] tfe (623) and its siblings pick one unspecified member each; Cuboid::vertices subsets tflv = tfe.vertices — recorded in docs/project/omg-issues.md
Cylinder::be, ae ErrBindingEnd ("cf.edges": feature edges not found) cf : Surface [1] (414); binding [1] bind [0..*] cf.edges = [0..*] be (433), … = [0..*] ae (497): Surface's edges is the Kernel StructuredSpaceObject's, a frame feature, not an object feature
Cylinder::edges = faces.edges, vertices = faces.vertices ErrNoSuchFeature over cf (was ErrMultiplicityViolation through be) ConeOrCylinder 416, 428 read edges/vertices on cf : Surface
matingOccurrences, spaceBoundary frame feature, not an object feature — ErrNoSuchFeature (unchanged) Occurrences.kerml declares both on Occurrence; Objects.kerml StructuredSpaceObject::faces restates spaceBoundary as a derived frame feature; Items::Item::shape :>> spaceBoundary redefines it, so shape answers while spaceBoundary itself is the frame's

Row moved in docs/project/spec-compliance.md: the ShapeItems row ❌ → ⚠️ (what the dimensions determine evaluates; the [0..1] groups, the curved face's edge graph and the frame features are the typed errors named there); the binding-connector row gains the connector-multiplicity semantics; Known Limitations bullet, roadmap Track L (L8) and a changelog fragment updated.

Specification basis

KerML 1.0 §7.4.6.2 Connector Declaration (a connector's own multiplicity is the number of links), §7.4.6.3 Binding Connector Declaration, §7.4.9.2 binding-connector semantics; SysML v2 §8.2.2.6 BindingConnectorAsUsage.

How it was verified

  • binding_connector_multiplicity_test.go: TestConnectorMultiplicityBoundsLinks (both ends of binding [1] over a [1] and a [2] feature are UndeterminedBindingError naming the binding; an end with a value of its own keeps it), TestWholeBindingWithoutConnectorMultiplicityStillChecksCounts, TestConnectorMultiplicityWideEnoughIsWhole, TestConnectorMultiplicityDeclaresLinkCount, TestConnectorMultiplicityNamesFeature.
  • robustness_partial_binding_test.go: TestRuntimeRobustnessPartialBinding (underdetermined end, lower bound above the links, mutually partial bindings terminate, chain through the undetermined end).
  • Conformance: instance_library_geometry_cylinder, instance_library_geometry_box_void (new), instance_library_geometry_box (extended); TestShapeItemsUnsupportedExpressionsAreTypedErrors updated intentionally — cyl.edges moves from ErrMultiplicityViolation to ErrNoSuchFeature, cyl.faces.edges/cyl.vertices/cyl.be rows added, cyl.base.edges/cyl.af.edges asserted to evaluate.
  • Pinned pilot evaluator (./scripts/download-pilot-evaluator.sh, artifact 0.62.0) over the same model, verbatim: cyl.facesItemUsage faces, cyl.base.edgesReferenceUsage edges, cyl.af.edgesReferenceUsage edges, cyl.beItemUsage be, cyl.edgesFeature edges, block.facesItemUsage faces, block.tf.verticesReferenceUsage vertices, block.voids.base.edgesReferenceUsage edges, block.tfeItemUsage tfe, block.verticesItemUsage vertices, block.isSolidLiteralBoolean false. The pilot leaves every item usage unevaluated (the usage node is its answer) and agrees on isSolid; it adjudicates none of the geometry either way.

Gates:

Gate Result
go build ./... pass
go vet ./... pass
gofmt -l . empty
OPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1 OPENSYSML_REQUIRE_PILOT_LIBRARY_XMI=1 go test -count=1 ./... (after the three download scripts) pass, 79 packages ok
go test -race -count=1 ./internal/exec/runtime ./internal/ir/... pass
go test -C tools ./... pass
make docs-check pass
python3 scripts/changelog.py check pass
training_examples_expected.txt unchanged

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

devin-ai-integration Bot and others added 3 commits September 21, 2026 18:32
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
… stays typed

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review September 21, 2026 19:21
devin-ai-integration[bot]

This comment was marked as resolved.

…iplicity

Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Devin Review

Comment thread internal/exec/runtime/binding.go

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant