CR-2026-034: flagged in the C interpreter, and in the harness that measures it - #34
Merged
Conversation
…asures it The construct CR-2026-033 named as the largest remaining gap. Attempted vectors went 453 -> 488, all passing, and `flagged` is no longer a reason a corpus schema cannot be reached. The representation reuses what match and tlv already have: match_var holds the name of the field carrying the mask, and each group is a case_def_t whose match_value is its bit position and whose field_start/field_count point at a body placed above field_count - the invariant CR-2026-033 established, for the same reason. The mask field must declare var_name. This interpreter records a value in its variable table only where a field declares one, while a YAML `flagged` refers to a field by name, so no corpus schema carries `var:` for it and the harness patches it in when building. A builder that forgets gets SCHEMA_ERR_MATCH rather than a silent decode of nothing: var_get returns 0 for a miss, which for a bitmask is indistinguishable from "no bits set", so a new var_has() tells the two apart. The reference interpreter raises in the same case and this matches it. Six of the 34 flagged schemas are built now; the rest are blocked by `transform` (26), `bitfield_string` (24) or computed fields - not by `flagged`. A test asserts a flagged schema is genuinely built and its var_name patched, because "0 differ" proves nothing if no group ever fires. Also corrected a skip message that misattributed a harness limit to the interpreter: `no constructor for type 'u32le16'` read as a C gap when C has FIELD_TYPE_U32LE16 and decodes it correctly. The message now says which side each limit is on, which is the same care the tlv and flagged reasons already took. Three slips of mine, all in test scaffolding and all the same family. CR-2026-033's test anchored on "FIELD_TYPE_TLV\n} field_type_t;", pinning TLV as the last enum member - incidental, and broken the moment this appended FIELD_TYPE_FLAGGED after it. Then one assertion here read a doc comment through a byte-count window that captured its tail and missed its opening, and searched for a phrase the wrapped comment breaks across a line, so it failed twice on a header that says exactly what it asserts. Anchored on the comment block with whitespace normalised. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The construct #32 named as the largest remaining gap. Attempted vectors went 453 → 488, all passing, and
flaggedis no longer a reason a corpus schema cannot be reached.The representation
Reuses what
matchandtlvalready have:match_varholds the name of the field carrying the mask, and each group is acase_def_twhosematch_valueis its bit position and whose body is placed abovefield_count— the invariant #32 established, for the same reason.The mask field must declare
var_name. The interpreter records a value in its variable table only where a field declares one, while a YAMLflaggedrefers to a field by name — so no corpus schema carriesvar:for it, and the harness patches it in when building.A builder that forgets gets
SCHEMA_ERR_MATCH, not a silent decode of nothing:var_getreturns 0 for a miss, which for a bitmask is indistinguishable from "no bits set". A newvar_has()tells the two apart. The reference interpreter raises in the same case ("Flagged field reference not found"), which is what this matches.Coverage
Six of the 34 flagged schemas build now; the rest are blocked by
transform(26),bitfield_string(24) or computed fields — not byflagged. There's a test asserting a flagged schema is genuinely built and itsvar_namepatched, because "0 differ" proves nothing if no group ever fires — I checked one decodes withflags = 0x0003and both bits firing.A message that misattributed
no constructor for type 'u32le16'read as a C gap when C hasFIELD_TYPE_U32LE16and decodes it correctly — it's a harness limitation. The report now says which side each limit is on, the same care the tlv and flagged reasons already took. That distinction is load-bearing in a report whose whole purpose is telling C's gaps from the harness's.repeatis now the last construct C has no field type for, and at 3 schemas it's worth less than widening the harness fortransformandbitfield_string.Slips, all mine, all in scaffolding
tlvin the C interpreter, and in the harness that measures it #32's test anchored on"FIELD_TYPE_TLV\n} field_type_t;"— pinning TLV as the last enum member, incidental and broken the moment this appendedFIELD_TYPE_FLAGGED. Compares positions now.--amendthen committed unchanged content. Now I verify every anchor before writing any.Verification
make test-cmake selftestOnly the C header and the harness changed, so the other four implementations are untouched.
🤖 Generated with Claude Code