feat(runtime): evaluate the ShapeItems geometry the library determines - #505
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
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>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…iplicity Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
ShapeItemsdefines a shape's faces, edges and vertices throughbindconnectors with multiplicities. ABox's faces and edges already evaluated; every read through aCylinder's orCone's edges failed:The cause was in the general binding mechanism, not in the library:
binding [1] bind [0..*] base.edges = [0..*] bewas read as a whole binding because its[0..*]ends neither bound nor require a count, sobe [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 ofbeand determines neither end whole.lower.Bindingnow carries the connector's own multiplicity (Binding.Multiplicity, frombinding [n]).runtime/binding.gopartialBindingbounds 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 ofbefrom recursing into its other binding.binding [2]over two[2]ends andbind a = bwithout a connector multiplicity stay whole bindings with the existing count check.binding [1] bind [0..1] tf.edges = [0..1] tfe).wholeBindingCountschecks the identified value count against the connector's own range too (binding [2] bind a = bover one value isErrMultiplicityViolation), andbindingLinksNothingtreats a connector[0]as linking nothing.semantics.Model.RangeIn(scope, mult), so a bound naming a valued feature (binding [links]withattribute links = 1) evaluates in the binding's scope instead of coming back unknown.Per
ShapeItemsderived feature (library lines inDomain Libraries/Geometry/ShapeItems.sysml):Box::faces(6),tf.edges(4) withlength/width,edges(24),tf.vertices(8),tf.e1.vertices(2),height,isSolid,voids,shapeCuboid746,faces [6](752),edges [24](762);RectangularCuboid798,Rectangle/Quadrilateraledges 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 aCylindernested as aBox'svoids,isSolidfalseConeOrCylinder384–439faces [2..3],base : Disc [1];Disc237,edges : Ellipse [1] = shape(254);binding [1] bind [0..*] base.edges = [0..*] be(432) links one value, sobase.edgeskeeps its ownBox::tfe…urre,tflv…brrv, and soBox::verticesErrBindingEndnaming the bindingCuboidOrTriangularPrism562,binding [1] bind [0..1] tf.edges = [0..1] tfe(623) and its siblings pick one unspecified member each;Cuboid::verticessubsetstflv = tfe.vertices— recorded indocs/project/omg-issues.mdCylinder::be,aeErrBindingEnd("cf.edges": feature edges not found)cf : Surface [1](414);binding [1] bind [0..*] cf.edges = [0..*] be(433),… = [0..*] ae(497):Surface'sedgesis the KernelStructuredSpaceObject's, a frame feature, not an object featureCylinder::edges = faces.edges,vertices = faces.verticesErrNoSuchFeatureovercf(wasErrMultiplicityViolationthroughbe)ConeOrCylinder416, 428 readedges/verticesoncf : SurfacematingOccurrences,spaceBoundaryErrNoSuchFeature(unchanged)Occurrences.kermldeclares both onOccurrence;Objects.kermlStructuredSpaceObject::facesrestatesspaceBoundaryas a derived frame feature;Items::Item::shape :>> spaceBoundaryredefines it, soshapeanswers whilespaceBoundaryitself is the frame'sRow moved in⚠️ (what the dimensions determine evaluates; the
docs/project/spec-compliance.md: theShapeItemsrow ❌ →[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 ofbinding [1]over a[1]and a[2]feature areUndeterminedBindingErrornaming 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).instance_library_geometry_cylinder,instance_library_geometry_box_void(new),instance_library_geometry_box(extended);TestShapeItemsUnsupportedExpressionsAreTypedErrorsupdated intentionally —cyl.edgesmoves fromErrMultiplicityViolationtoErrNoSuchFeature,cyl.faces.edges/cyl.vertices/cyl.berows added,cyl.base.edges/cyl.af.edgesasserted to evaluate../scripts/download-pilot-evaluator.sh, artifact 0.62.0) over the same model, verbatim:cyl.faces→ItemUsage faces,cyl.base.edges→ReferenceUsage edges,cyl.af.edges→ReferenceUsage edges,cyl.be→ItemUsage be,cyl.edges→Feature edges,block.faces→ItemUsage faces,block.tf.vertices→ReferenceUsage vertices,block.voids.base.edges→ReferenceUsage edges,block.tfe→ItemUsage tfe,block.vertices→ItemUsage vertices,block.isSolid→LiteralBoolean false. The pilot leaves every item usage unevaluated (the usage node is its answer) and agrees onisSolid; it adjudicates none of the geometry either way.Gates:
go build ./...go vet ./...gofmt -l .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)okgo test -race -count=1 ./internal/exec/runtime ./internal/ir/...go test -C tools ./...make docs-checkpython3 scripts/changelog.py checktraining_examples_expected.txtChecklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelog