Stop warning about an empty System Composer interface dictionary - #46
Merged
Merged
Conversation
Opening an ordinary .sldd could put a banner over the tab saying the part
"simulink/systemcomposer/interfaceDictionary.xml" holds nothing readable and
that architectural entries are therefore reported by their Simulink class. It
was a false positive on a file with nothing wrong with it, and it was raised
inconsistently: the compressed-binary reader warned where the uncompressed-text
reader stayed quiet, so one dictionary said two different things depending on
how it had been saved.
An empty catalog part is what MATLAB writes into any dictionary System Composer
has merely touched -- built-in value types and no definitions -- so the file is
complete and there is nothing to act on. Two measurements settle that the
fallback is not a degrade either:
- Only Simulink.Bus is ambiguous. Over 14,668 derived entries in four real
dictionaries every other class is 1:1 with its classification, so IsDerived
plus the class already yields the identical Kind. IsDerived also drives the
Architectural-vs-Design section split on its own.
- For Simulink.Bus the fallback IS MATLAB's answer. Remove the part from a
dictionary holding a StructType and a DataInterface, reopen it in MATLAB
R2027a, and both come back as Simulink.dictionary.archdata.DataInterface --
exactly DERIVED_KIND_BY_CLASS['Simulink.Bus'].
So both readers now stay silent on the same terms, whether the part is absent
(nearly every .sldd) or present and empty. Four tests pin it: the kinds either
reader falls back to, the kinds it produces when the catalog IS there, and the
equality of the two formats' silence.
test/dataModelSources.test.ts no longer had a .sldd reaching two layers once
this warning was gone, so the shared-sink test now proves the same contract
directly: the array the parser filled is the array the source carries, and the
node layer appends to it rather than replacing it.
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.
Opening an ordinary
.slddcould put a banner over the tab:It was a false positive on a complete file, and it was raised inconsistently —
the compressed-binary reader warned where the uncompressed-text reader stayed
quiet, so the same dictionary said two different things depending on how it had
been saved. That is the "one rule, two paths" shape
ScCatalogexists to close.An empty catalog part is what MATLAB writes into any dictionary System Composer
has merely touched: built-in value types, no definitions. Nothing is lost, and
two measurements settle that the catalog-less fallback is not a degrade:
Simulink.Busis ambiguous. Over 14,668 derived entries in four realdictionaries, every other class is 1:1 with its classification, so
IsDerivedplus the class already yields the identical Kind.
IsDerivedalso drives theArchitectural-vs-Design section split on its own.
Simulink.Bus, the fallback IS MATLAB's answer. Strip the part from adictionary holding a
StructTypeand aDataInterface, reopen it in MATLABR2027a, and both come back as
Simulink.dictionary.archdata.DataInterface—exactly
DERIVED_KIND_BY_CLASS['Simulink.Bus']. MATLAB does not regenerate thepart on save, and it ignores
simulink/ArchitecturePart.xml, which stillrecords the struct type under
DataTypes.So both readers now stay silent on the same terms, whether the part is absent
(nearly every
.sldd) or present and empty. With the part there, the file isstill the authority and classification is unchanged.
Tests
scCatalog.test.ts— the binary reader over a MATLAB-shaped empty member, andthe equality of the two formats' silence and kinds.
parseWarnings.test.ts— the kinds either reader falls back to (all eightclassifications), and the kinds with the catalog present.
dataModelSources.test.ts— no.slddreaches two layers once this warning isgone, so the shared-sink test now proves the contract directly: the array the
parser filled is the array the source carries, and the node layer appends to it
rather than replacing it.
npm run verify: 4941 passed, 26 skipped, 0 failed.