Repository navigation
test(corpus): construct-cover subset of examples/ behind OPENSYSML_CORPUS_SUBSET - #2163
Merged
Merged
Conversation
…RPUS_SUBSET A committed, regenerable subset of the models under examples/ that exhibits every syntactic feature the whole corpus does (95 of 880 files, 814 features), recorded by TestConstructCover -update-construct-cover and checked against the whole corpus on every run. OPENSYSML_CORPUS_SUBSET=construct-cover makes every examples/ sweep iterate it through tests/testutil/corpussubset; the per-file ratchets check only the visited files and every recorder refuses under it. 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)".
|
…BSET Its input is the training models that declare conditions, a semantic selection the syntactic construct cover does not preserve: none of the listed training files declares one, so under the subset the gate checked nothing. The whole run takes seconds, so it sweeps the whole corpus. Co-Authored-By: jason.han <hanhuijun@gmail.com>
CONTRIBUTING.md names the subset and points at docs/project/construct-cover-subset.md for the measured subset size and feature count, as the other gates' counts are kept. Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration
Bot
removed this pull request from the merge queue due to a manual request
Nov 12, 2026
2 of 6 tasks
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
The tests that walk every model under
examples/(the committed models and the downloaded training, pilot and specification-example roots, 880 files) are a third of the suite's-racetime, and each re-parses and re-exports the corpus on its own. Most check a property of the implementation on whatever syntax a model exhibits, so what they need is the corpus's variety of constructs, not its 880 files.This adds a committed, regenerable construct-cover subset and a switch that makes the sweeps iterate it:
tests/testutil/constructcoverparses a file withinternal/syntax/parserand derives its syntactic features by a reflective walk of the tree: source kind, diagnostics/clean, every concrete node type, every parent-field→child-type edge, every Kind-style enum value and keyword/operator string field value, every set bool flag.Coveris a deterministic greedy set cover (most uncovered features first; a committed file beats a downloaded one, then the lesser path).tests/corpus/testdata/construct_cover.txt: 95 of the 880 files covering all 814 features (19 committed, 6 training, 41 pilot, 29 spec-examples), oneexamples/-relative path per line, sorted, under a#header naming the recorder and the counts. Recorded bygo test ./tests/corpus -run TestConstructCover -update-construct-cover; two recordings are byte-identical.TestConstructCover(always on,tests/corpus, in thecorpusshard that every tier runs) re-derives the feature set over the whole corpus (parse only, ~0.5 s with the corpora present), fails naming each uncovered feature and a file that has it with the re-record command, fails when a listed file is gone, and skips/requires absent roots exactly asTestCorpusRoundTripdoes (it reusescorpusRoundTripFiles).tests/testutil/corpussubsetis the one helper every sweep calls. It readsOPENSYSML_CORPUS_SUBSET: unset → every file;construct-cover→ the committed list; any other value → the sweep fails. A file outsideexamples/(tests/testdata,docs/manual/examples, a package'stestdata) is always iterated.What the switch does to each sweep (
docs/project/construct-cover-subset.mdhas the full account):library_root_name_test.go,compile_differential_test.go,rounded_census_test.go,formatting_test.go,referenced_document_test.go,modelsync_test.go,shared_index_test.go,examples_test.go(each listed example still opened with all its directory siblings),find_errors_test.go,typecheck_expr_corpus_test.go,api_json_mapping_qualified_name_test.go(feedsTestExamplesCorpusInvariantsand the API JSON sweep),settled_collections_test.go,element_properties_agreement_test.go,incremental_test.go(the loose examples and each downloaded root as a per-file set; a committed demo directory replayed whole when any of its files is listed).TestParallelBatchValidationMatchesSerial,TestCommandLineLoadMatchesWorkspace, the "directory together" models ofTestSettledCollectionsAreWhatReconcilingWouldFind) iterate a directory when any of its files is listed and load the whole directory; loading a partial directory changed what they compare (the CLI resolves siblings, the workspace does not).TestCorpusRoundTrip,TestCorpusAPIJSONRoundTrip,TestPilotCorporaDiagnostics,TestSpecExamplesDiagnostics) compute verdicts for the visited files only and compare them against the expectation; an unvisited recorded line is left unchecked, a recorded file that is gone still fails, and the recorded root sizes are still checked against the whole corpus so a partial download fails as before. The pilot and spec gates still open each root whole (the files import across each other, so a file's counts depend on its siblings) and diagnose only the listed files.TestSymbolStructureMatchesGraphStructurerecords per-root totals, not per-file verdicts, so under the subset each root'sunmatchedand per-propertydifferent/symbol-missing/symbol-extracounts must not exceed the recorded ones (a property the block omits must not disagree at all); the exact comparison needs the whole corpus.-update-corpus-roundtrip,-update-api-json-roundtrip,-update-pilot-corpora,-update-spec-examples,-update-structure-differential,-update-construct-cover) fails withRecordingwhile the variable is set.TestTrainingExamplesSemanticErrorsignores the variable: it asserts the whole training corpus clean in one batch load, which is cheap, and an assertion over part of a corpus asserts nothing. Documented in its comment and indocs/project/training-examples.md. So doesTestDifferentialTrainingCorpus(internal/exec/solve): its input is the training models that declare conditions, a semantic selection the syntactic cover does not preserve (none of the six listed training files declare one, so the gate would have checked nothing), and the whole run takes ~2 s.Four of the 24 files named in the brief do not sweep
examples/per file and are unchanged:cmd/sysml/markup_tool_missing_test.gorenders one document fromexamples/self-modelas one model;tests/kpar/kpar_test.goandmeta_test.goread the OMG.kpararchives undertestdata/omg(theexamples/…strings are archive member names);tools/oracle/errata/errata_test.gomaterializes the errata overlay over a whole pilot corpus root and hashes the tree.Shared contract: kept as stated (variable, values, list path, one sorted
examples/-relative path per line). An empty value is unset, as #2162 relies on (pr.ymlsets the variable to the empty string outside the queue tier);TestUnsetIteratesEverythingpins it. One note: the list carries a#comment header (recorder command and counts), whichReadListskips; a consumer that reads the file directly should skip#lines.scripts/race-shard.sh --sweeps, CI tiers and workflows are untouched (PR 3).Measured corpus: 56 committed + 100 training + 213 pilot + 511 spec-examples = 880 files at the current pins (the brief's ~920 counted spec-examples at ~550).
Measured wall time of the five big sweeps, no
-race, 8-core VM, corpora present (go test -count=1 -run '^Test…$'package time):OPENSYSML_CORPUS_SUBSET=construct-coverTestSettledCollectionsAreWhatReconcilingWouldFind(tests/export)TestSymbolStructureMatchesGraphStructure(internal/translate/export)TestCorpusAPIJSONRoundTrip(tests/corpus)TestElementPropertiesAgreeWithTheAPIJSONExport(tests/grpc)TestCorpusRoundTrip(tests/corpus)The subset runs share a fixed cost (each indexes the standard library into an empty
XDG_CACHE_HOME, and the fixtures outsideexamples/are still swept), so the saving grows with the per-file cost, which-racemultiplies.How it was verified
go test -count=1 ./tests/corpus(all gates,OPENSYSML_REQUIRE_*set) with the variable unset and withconstruct-cover;OPENSYSML_CORPUS_SUBSET=bogusfails each sweep withunknown subset; every-update-*recorder refuses under the subset.construct-cover(packages above), plus the five timings above in both modes.tests/testutil/corpussubset(unset/listed/unknown/unsorted/empty list,FilterPaths,WantsAny),tests/testutil/constructcover(feature names, diagnostics, greedy order and committed preference,Uncovered).gofmt -l .,go vet ./...,make lint, the two-line comment gate,python3 scripts/check-doc-ids.py,python3 scripts/check-doc-links.py,python3 scripts/changelog.py check,go test -count=1 ./tests/hygiene,go test -C tools ./referee/apijson, andgo test -count=1 -timeout 60m ./...(whole suite, corpora present and required, no-race) on this head.Checklist
make testandmake lintpass locally (the suite without-race; the race tier runs in CI)changes/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 changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/1eb67d17eaf241cbbc3cbd4f500ff58a
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/1eb67d17eaf241cbbc3cbd4f500ff58a?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work