Skip to content

Run the MATLAB re-open gate, and cover ValueType with it - #34

Merged
ww-mw merged 1 commit into
mainfrom
matlab-reopen-gate
Sep 17, 2026
Merged

ww-mw merged 1 commit into
mainfrom
matlab-reopen-gate

Conversation

@ww-mw

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

Copy link
Copy Markdown
Member

The one gap the schema-parity change left open (#33): the newly editable properties were
verified in-process only — serialize, re-parse with our own reader, agree with ourselves.

The gate infrastructure already existed (matlabAssertRoundTrip + verify_roundtrip.m,
gated on DEX_MATLAB_CMD). What was missing was that the bus-element enum cases had never
executed
, and Simulink.ValueType had no live case at all.

Result: 32/32 PASS

MATLAB R2027a Prerelease 27.1.0.3393633, both .sldd formats.

Case json binary
MyBus element Complexity = complex PASS PASS
MyBus element DimensionsMode = Variable PASS PASS
MyValueType Min = 0, Max = 100 PASS PASS
MyValueType Complexity = complex, DimensionsMode = Variable PASS PASS

Plus the 24 pre-existing value-corpus cases, run as a regression check rather than for
novelty: #33 moved _rejectUnknownEnumeral and the Min/Max normalizer up into DataNode,
which the Simulink.Parameter and Simulink.Signal write paths also go through, so a
regression would surface there and nowhere else.

What the gate settles that no in-process test could

  • The enum casing is MATLAB's own and it loads'complex' lower-case, 'Variable'
    capitalised. MATLAB refuses the other spelling of each, so a writer that normalised the
    case would have produced a file MATLAB cannot open, and our own parser would have read it
    back happily. This was the standing risk on the whole change.
  • A zero Min is written as a real 0, not dropped as falsy. Hence 0 in the case rather
    than a tidier number.

A timeout bug fell out of running it

MATLAB_TIMEOUT was 120s, measured against a local MATLAB (~21s a launch). On a network
sandbox: 276s genuinely cold, 160s for the first in-suite launch, 18–33s warm. At 120s the
first test of every run fails as a timeout and hides whatever MATLAB was about to say — the
exact failure the constant was introduced to prevent. Raised to 300s with both machines'
numbers in the comment.

Reviewing the file would not have found this; 120s is not wrong in general, only for a
network install.

Notes

  • No fixture added — the live gate writes to a temp dir, so test/parity/artifacts/ and its
    drift.mjs contract are untouched.
  • npm test unchanged at 4856 passing (the live file is env-gated and stays skipped).
  • No dist/ change: only a .md and two test files.

The gate infrastructure already existed - matlabAssertRoundTrip plus
verify_roundtrip.m, gated on DEX_MATLAB_CMD - but the bus-element enum cases had
never executed, and the Simulink.ValueType value properties had no live case at
all. So the newly editable properties were verified only in-process: serialize,
re-parse with our own reader, agree with ourselves.

Adds VALUE_TYPE_CASES (Min/Max, and Complexity/DimensionsMode) and records the
result of actually running the file against MATLAB R2027a Prerelease: 32/32 PASS,
both .sldd formats. Two things that no in-process test could establish:

- The enum casing is MATLAB's own and it loads: 'complex' lower-case, 'Variable'
  capitalised. MATLAB refuses the other spelling of each, so a writer that
  normalised the case would have produced a file MATLAB cannot open - and our own
  parser would have read it back happily.
- A zero Min is written as a real 0 rather than dropped as falsy, which is why the
  case uses 0 and not a tidier number.

Properties are grouped two per case because each `it` costs a MATLAB launch while
verify_roundtrip.m already reports PASS/FAIL per key, so grouping halves the wall
clock without losing attribution.

MATLAB_TIMEOUT goes from 120s to 300s. The old value was measured against a local
MATLAB (~21s a launch); on a network sandbox the cold launch takes 276s and the
first in-suite launch 160s, so the first test of every run would have failed as a
timeout and hidden whatever MATLAB was about to say - the exact failure the
constant exists to prevent. Both machines' measurements are now in the comment.

The full file was run unfiltered as a regression check, not just the eight new
cases: this branch's parent moved _rejectUnknownEnumeral and the Min/Max
normalizer up into DataNode, which the Parameter and Signal write paths also use,
and a regression there would surface in the pre-existing value-corpus cases.
@ww-mw
ww-mw merged commit 67a79da into main Sep 17, 2026
1 check passed
@ww-mw
ww-mw deleted the matlab-reopen-gate branch September 17, 2026 00:49
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