Repository navigation
refactor(export): build a document's identity facts through per-symbol helpers - #1802
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…l helpers documentIdentity's loop over the identity table now delegates to newIdentityFacts, consumeAnnotated, noteScope, identityRoot and index, so the same facts are gathered with the same errors in the same order. The runtime's reused-execution release closure says why it is empty. The api-json baseline re-records the writer digest only. Co-Authored-By: jason.han <hanhuijun@gmail.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
benchstat for The wide sec/op intervals come from the machine, not the change: the api-json baseline re-record and the export suites of another branch were running at the same time, and the memory and allocation columns — which that contention cannot move — are flat. |
…entity-complexity Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/api-json-differential-baseline.json
|
benchstat for Ten rounds, |
What and why
SonarCloud's analysis of
developlists two open Go smells. This clears both with no change in behaviour; no suppression, no rule change, and no changelog fragment because nothing is user-visible.internal/translate/export/rdf_identity.go:137documentIdentitycarried the whole per-symbol loop body (annotation decoding, scope keys, root lookup, the three index maps) in nestedif/for/switchblocks → the loop callsfacts.consumeAnnotated,facts.noteScope,identityRootandfacts.index, withnewIdentityFactsbuilding the struct;gocognitreadsdocumentIdentityat 37 on develop, and after the split no function in the file is above 10 except the untouchedsubjectOf(24)internal/exec/runtime/context.go:1917release = func() {}for a reused execution → the closure says why it is empty: a reused execution is released by whoever first started it, so the caller that joins an execution in flight must release nothing — the no-op is the implementation, not a stubdocumentIdentitystill walkstable.Symbols()in order, decodes the same annotations with the same error (returned at the same symbol), notes the same scope keys and fills the same three maps; the helpers are methods on theidentityFactsit was already building, so no state moved and nothing is computed twice. Any edit underinternal/translate/exportmoves the api-json writer's source digest, so the differential baseline is re-recorded on this tree.The branch is merged with develop
5dfd33b8c(one merge commit). Develop'selement_ids.go— satisfy-subject, positional-name, implied-conjugate, FeatureValue, expression-parameter, invocation-argument and reference-membership ids — is taken as is; the refactor touchesrdf_identity.goonly, and the identical scorecard below shows that every id develop writes is still written.How it was verified
On the merged tree (develop
5dfd33b8c+ this branch):gofmt -l .empty,go build ./...,go vet ./...cleango test -count=1 ./internal/translate/export/... ./tests/export/... ./internal/semantic/...— okgo -C tools test -count=1 ./referee/apijson/... ./oracle/baseline/...— okOPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1 OPENSYSML_REQUIRE_SPEC_EXAMPLES=1 go test -count=1 ./tests/corpus -run '^TestCorpusRoundTrip$'— ok, no movementgo test -count=1 ./internal/exec/runtime/ -run 'TestExecutionConformance|TestExecutionTrace|TestRuntimeRobustness'— okgo run -C tools ./cmd/pilot-apijson-diff -updateon the merged tree, develop's baseline taken first — vs develop's baseline the diff is the writersourceDigestline only (bbc0d624…→ea941750…); 932 files and every count identical (92426 matched, 1144182 present-equal / 27977 present-different / 1054265 ours-missing / 69343 pilot-missing / 26127 indeterminate)WriteAPIJSON(develop5dfd33b8cvs branch, interleaved, n=6, plus n=10 on thethen_after_membersrows) posted as a comment: sec/op, B/op and allocs/op~, output bytes identicalChecklist
make testandmake lintpass locally (the gates above; the full race suite runs in CI)docs/project/api-json-differential-baseline.json, writer digest only, identical countsLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/33201010c187402c8fde446269d9a54c
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/33201010c187402c8fde446269d9a54c?variant=devin
Requested by: @HuiJun