Commit a430842
Fix BAST deserialization bugs for LetStatement and MatchStatement
Two reader-side fixes that caused byte misalignment during BAST
deserialization, manifesting as failures on large models like
reactive-bbq (4428 nodes):
1. LetStatement: Added missing readU8() to consume the
NODE_PATH_IDENTIFIER tag before readPathIdentifierNode() when
reading the optional TypeRef added in 1.16.0. The writer uses
writePathIdentifier() which includes the tag byte, but the
reader was not consuming it — causing 1-byte drift.
2. MatchStatement: Changed reader to match the writer's byte
layout where all case headers (loc + pattern + count) are
written first, followed by all case items sequentially, then
default items. The reader was incorrectly interleaving each
case's header with its items.
Also removes pre-populated keywords from StringTable (90 entries
that were always serialized regardless of usage, ~5-85% size
reduction) and adds regression tests for epics and typed let
statements. Removes the reactive-bbq pending marker — all 187
riddl-models now pass round-trip testing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f56999e commit a430842
5 files changed
Lines changed: 67 additions & 66 deletions
File tree
- commands/jvm/src/test/scala/com/ossuminc/riddl/commands
- passes/jvm/src/test/scala/com/ossuminc/riddl/passes
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 82 | + | |
88 | 83 | | |
89 | 84 | | |
90 | 85 | | |
| |||
Lines changed: 27 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
| 827 | + | |
| 828 | + | |
827 | 829 | | |
828 | | - | |
| 830 | + | |
| 831 | + | |
829 | 832 | | |
830 | 833 | | |
831 | | - | |
832 | | - | |
| 834 | + | |
| 835 | + | |
833 | 836 | | |
834 | | - | |
835 | | - | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
836 | 857 | | |
837 | 858 | | |
838 | 859 | | |
839 | 860 | | |
840 | 861 | | |
| 862 | + | |
841 | 863 | | |
842 | 864 | | |
843 | 865 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
928 | 928 | | |
929 | 929 | | |
930 | 930 | | |
931 | | - | |
| 931 | + | |
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
938 | | - | |
| 938 | + | |
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
| |||
Lines changed: 6 additions & 53 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 21 | | |
59 | 22 | | |
60 | 23 | | |
| |||
119 | 82 | | |
120 | 83 | | |
121 | 84 | | |
122 | | - | |
| 85 | + | |
123 | 86 | | |
124 | 87 | | |
125 | 88 | | |
126 | | - | |
127 | 89 | | |
128 | 90 | | |
129 | 91 | | |
130 | 92 | | |
131 | 93 | | |
132 | 94 | | |
133 | | - | |
134 | | - | |
135 | 95 | | |
136 | 96 | | |
137 | 97 | | |
138 | 98 | | |
139 | | - | |
140 | | - | |
| 99 | + | |
141 | 100 | | |
142 | 101 | | |
143 | 102 | | |
| |||
147 | 106 | | |
148 | 107 | | |
149 | 108 | | |
150 | | - | |
151 | | - | |
| 109 | + | |
152 | 110 | | |
153 | 111 | | |
154 | 112 | | |
155 | 113 | | |
156 | | - | |
| 114 | + | |
157 | 115 | | |
158 | 116 | | |
159 | 117 | | |
| |||
163 | 121 | | |
164 | 122 | | |
165 | 123 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 124 | | |
172 | 125 | | |
173 | 126 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
477 | 508 | | |
478 | 509 | | |
479 | 510 | | |
| |||
0 commit comments