Skip to content

Surface eleven properties MATLAB models, and pin the rule that hid them - #33

Merged
ww-mw merged 1 commit into
mainfrom
schema-parity
Sep 17, 2026
Merged

ww-mw merged 1 commit into
mainfrom
schema-parity

Conversation

@ww-mw

@ww-mw ww-mw commented Sep 17, 2026

Copy link
Copy Markdown
Member

A parity pass against the MATLAB Data Explorer app found eleven properties MATLAB
models that this package either dropped on the floor or never declared. Full parity is
not the goal — the app is a different product — so this is scoped to the schema and
data model only. No UI change, and the Min>Max warning channel is deliberately out.

What was unreachable, and why

Three of the gaps turned out to be the same defect, not three bugs:

schemaBridge.resolvePropForKey prefers a layout atom over the class's own schema
descriptor. The atoms read node fields, not the descriptor's sourcePath, and nothing
checked that the node class actually declares the field. When it does not, the value is
lost twice: the row renders blank, and BaseNode.toPIObject still adds the key to
shownKeys, so buildOtherRows suppresses the raw source property from "Other" as well.
Silent — the row is present and merely empty.

Changes

  • Simulink.ValueTypeMin, Max, Unit reachable in both panes, including the
    serialized-key asymmetry MATLAB has: ValueType writes Unit, while Simulink.Parameter
    and Simulink.Signal write DocUnits.
  • Simulink.BusElement — the real / Fixed display defaults MATLAB shows. A silent
    element still gains no key on save.
  • Simulink.EnumTypeIsTunableInCode, last in Code Generation.
  • Simulink.LookupTable / Simulink.Breakpoint — the flat properties MATLAB models.
    The 17-value StorageClass override replaces the shared 6 rather than widening it,
    so Custom is refused on a LookupTable while still accepted on a Simulink.Parameter.
  • Simulink.ConfigSet / Simulink.ConfigSetRefDescription, and SourceName on
    the ref.
  • _rejectUnknownEnumeral and the Min/Max normalizer move up to DataNode; a duplicate
    copy in ParameterNode is gone.

The guard

test/schemaLayoutResolvable.test.ts pins the rule between the two paths a layout key
resolves through, rather than re-testing each class. It enumerates every (class, layout key)
pair, probes each with two sentinels so the row must change rather than merely contain
text, and fails any row that reads a node field the built instance does not have. Coverage
is asserted, not assumed — 20+ classes, 182+ pairs, 100+ probe cases, and the atom table is
compared by object identity so it cannot go stale in either direction.

It was verified by reintroducing the bug in production code (commenting the Description
assignment out of ConfigSetNode's constructor), not only by its own self-check: 3 of its
14 tests fail, each naming the class, the key, and the mechanism.

Test results

4741 → 4856 passing, 26 pre-existing skips. No test deleted; no assertion loosened.
Three existing tests updated for real consequences of the new layout keys, one of them made
stricter. Typecheck, check:leak and build clean. dist/ is rebuilt and committed, as
this package ships prebuilt output for git-dependency consumers.

Not verified

The MATLAB re-open gate has not been run: the newly editable ValueType properties and
the two BusElement enums are verified in-process only (serialize → re-parse in this suite).
There is no recorded PASS that MATLAB itself loads a file written here and reads those
values back. The enums carry the risk — MATLAB writes real lower-case and Fixed
capitalized and refuses the other spelling of each. Recorded as open in the fidelity docs.

A parity pass against the MATLAB Data Explorer app found eleven properties MATLAB
models that this package either dropped or never declared. Scoped to the schema and
data model: no UI change.

Three of the gaps were the same defect. schemaBridge.resolvePropForKey prefers a
layout atom over the class's own schema descriptor; the atoms read node fields rather
than the descriptor's sourcePath, and nothing checked that the node class declares the
field. When it does not, the value is lost twice - the row renders blank, and
toPIObject still adds the key to shownKeys, so buildOtherRows suppresses the raw
property from "Other" too.

- Simulink.ValueType: Min, Max and Unit reachable in both panes, including the
  serialized-key asymmetry MATLAB has (ValueType writes Unit; Parameter and Signal
  write DocUnits).
- Simulink.BusElement: the real / Fixed display defaults MATLAB shows, with a silent
  element still gaining no key on save.
- Simulink.EnumType: IsTunableInCode.
- Simulink.LookupTable and Simulink.Breakpoint: the flat properties MATLAB models.
  The 17-value StorageClass override replaces the shared 6 rather than widening it, so
  Custom is refused on a LookupTable while still accepted on a Simulink.Parameter.
- Simulink.ConfigSet and Simulink.ConfigSetRef: Description, and SourceName on the ref.
- _rejectUnknownEnumeral and the Min/Max normalizer move up to DataNode, removing a
  duplicate copy in ParameterNode.

test/schemaLayoutResolvable.test.ts pins the rule between the two paths a layout key
resolves through, rather than re-testing each class: it enumerates every (class, layout
key) pair, probes each with two sentinels so the row must change rather than merely
contain text, and fails any row reading a node field the built instance lacks. Verified
by reintroducing the bug in production code, not only by its own self-check.

4741 to 4856 tests passing. No test deleted and no assertion loosened; three updated
for real consequences of the new layout keys, one made stricter. dist/ rebuilt, as this
package ships prebuilt output for git-dependency consumers.

The MATLAB re-open gate is not yet run: the newly editable properties are verified
in-process only. Recorded as open in the fidelity docs.
@ww-mw
ww-mw merged commit fcb3872 into main Sep 17, 2026
1 check passed
@ww-mw
ww-mw deleted the schema-parity branch September 17, 2026 00:11
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