Repository navigation
MATLAB reopens S2's merged saves (M9), with the truth committed - #149
Merged
Merged
Conversation
…t read M9, the last MATLAB read-back of the 2026-10-13 save-fidelity plan: does MATLAB R2027a open the saves S2 makes of an edited binary dictionary entry, the entry's bytes with only the edited parts written from the model, and read every entry as it should? m9_merged_saves.mjs makes the saves through core's API. In every compressed-binary .sldd under test/fixtures and test/parity/artifacts, and in a copy of each as an earlier core save left it (1x1 cells spelled Dimension="1*1", so that the merge differs from writing the entry whole), one entry of each kind is renamed, has its Description set, and where it is cheap has a bus element's Description or a struct field edited. Each edit goes through session.editProperty and is saved by serializeSource into a file of its own. probe_m9_merged_reopen.m had MATLAB open each save and a copy of its original. Every unedited entry must read as in the original (class, isequaln, fullsig), and the edited one as the original with the same edit made in MATLAB, with no error or warning. Of 265 saves (31 fixtures and 11 earlier-save copies, 220 entries), every save whose original MATLAB can open reads as that original does: 212 with no warning, and 43 with only the warnings the original gives too (params.sldd names a common.sldd that is not in the tree, and two of object_props_binary.sldd's classes are missing). In 41 of them the merge differs from writing the entry whole. MATLAB cannot open the three fixtures make-fixtures.mjs writes by hand, so their 10 saves are not held to anything. MATLAB's own rename also writes the new name into a VariantBank's or MyGadget's Name property. Core's rename does not; M9 holds a rename to the original value. m9MergedSaves.truth.test.ts makes the same saves from source and asks that each is still the one MATLAB was asked about, and that MATLAB's answers are as above.
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.
M9 is the last MATLAB read-back of the 2026-10-13 save-fidelity plan. The question: since S2 (#143), an edited entry of a binary dictionary is saved as its original bytes, with only the parts the edit changed written from the model. Does MATLAB R2027a (27.1.0.3409468 Prerelease) open those saves and read every entry as it should?
What was asked
test/parity/matlab/m9_merged_saves.mjsmakes the saves through core's public API, as a host does: it makes the node active, callssession.editProperty, and saves withsession.serializeSource, one file per edit. The saves cover every compressed-binary.slddundertest/fixturesandtest/parity/artifacts(31 files), plus a copy of 11 of them as an earlier core save left them. In those copies, 1x1 cells are spelledDimension="1*1", which MATLAB reads as the same value, so the merge writes something different from writing the entry whole. In each file it takes one entry of each kind (the class, plus complex, sparse, empty or N-D for plain values), preferring one whose merge differs from a whole write, and makes these edits:probe_m9_merged_reopen.mopens only files in$M9_OUT: the saves and copies of the fixtures. Nothing is saved; every dictionary is closed withdiscardChangesandcloseAll('-discard'). Each save is checked three ways:isequaln, and the samefullsig(wbcompare.m's leaf-by-leaf signature).What MATLAB read
There are 266 cases. Core refuses one edit itself (the Description of
pTall, an encoded value it can show but not write), so MATLAB was asked about 265 saves covering 220 entries.params.slddreferences acommon.slddthat is not in the tree;FleetandVehicleclasses ofobject_props_binary.slddare not in the tree.arch_binary.sldd,compressed.slddorobject_array_binary.sldd, whichmake-fixtures.mjswrites by hand, so their 10 saves are not checked against anything. Their saves do not open in MATLAB either.entry.Name = new) also writes the new name into the value'sNameproperty, for aSimulink.VariantBankand for the fixtures'MyGadget(5 cases). Core's rename leaves the value unchanged. M9 compares a rename with the original value, and every save matches it; the difference is recorded assameAsMatlabEdit.hexobj_binary.sldd'sanonAlias, holds an anonymous function handle, which is never equal to another (not even when the same file is read twice). It is checked on class andfullsigonly, and the truth says so.No case was read wrongly, and there is no source change.
The test
test/parity/m9MergedSaves.truth.test.tsremakes every save from source and checks that each is still the one MATLAB was asked about: the SHA-256 of the chunk (with the edited entry's LastMod masked) and of the other parts. It also checks that MATLAB's answers are as above. It fails when a binary fixture appears that the truth does not name. A fixture the truth names that is missing from the tree is skipped, and the skip is reported. To refresh the truth, re-run the two halves as the probe's header says. A README row has been added.rm -rf dist && npm run buildleavesdistunchanged.npm run verifyis green: 295 test files passed, 1 skipped; 10175 tests passed, 27 skipped.