You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
formats: an ElementIdRef's sub is the next field's name length on about 93% of references #1101
area:readerWork in the reader area.area:writerWork in the writer area.priority:P1High-impact work needed for the MVP or beta path.type:bugCorrectness defect or regression.
FieldType::ElementIdRef { referenced_tag, sub } reads a reference field's encoding as 0e 00 00 00, the referenced class's tag (u16), and a second u16 it documents as "secondary discriminator (meaning unknown; empirically varies per-field and per-version)". Measured over the whole page-stripped schema of the 2024, 2026 and 2027 sample families (Measure run 40949596730, examples/probe_re264_schema_field_encodings.rs, RE-264 §4): where the reference is followed by another field of the same class, sub equals the length of that next field's name on
Schema
sub == next name length
sub == 0
other
2024
1,819
124
1 (2)
2026
1,932
133
1 (2)
2027
1,966
135
1 (2)
So on most references sub is the low half of the next record's u32 name length: the encoding is six bytes, 0e 00 00 00 <tag>, and only some references carry two zero bytes after the tag. The same spill decides ElementId against ElementIdRef { referenced_tag: 0x14, .. }, which is why several fields flip between the two across releases when only their neighbour changes (ParamValueDouble::m_paramId, CurveAssocProp::m_assocId).
What would settle it: whether the six-byte and eight-byte forms differ in meaning (the two zero bytes on the 124 to 135), checked against the next-record boundary the parser already finds by name. If sub is the spill, ElementIdRef should drop it (a breaking change to the public variant, or a documented "not part of the encoding"), and encode should not write it back. No reader depends on sub today; the schema writer (encode) does.
Scope check (main 2713706): nothing in the library serializes a schema record from FieldType::encode. Its only callers are examples/probe_schema_roundtrip.rs and examples/probe_re264_schema_field_encodings.rs, and the writer (writer.rs) copies Formats/Latest byte for byte. So the spilled sub reaches no written file today; it is a reading and naming problem in ElementIdRef, plus a wrong round-trip promise in encode's doc comment for six-byte references.
area:readerWork in the reader area.area:writerWork in the writer area.priority:P1High-impact work needed for the MVP or beta path.type:bugCorrectness defect or regression.
Activity
docs: point RE-264's side finding at #1101
feat(formats)!: Revit 2027 in the family corpus, with the flagged fie…
DrunkOnJava commentedon Oct 29, 2026
Scope check (main 2713706): nothing in the library serializes a schema record from
FieldType::encode. Its only callers areexamples/probe_schema_roundtrip.rsandexamples/probe_re264_schema_field_encodings.rs, and the writer (writer.rs) copiesFormats/Latestbyte for byte. So the spilledsubreaches no written file today; it is a reading and naming problem inElementIdRef, plus a wrong round-trip promise inencode's doc comment for six-byte references.docs(changelog): #1101 changes no export, and the diagnostics count f…
fix(formats)!: ElementIdRef is the class reference alone, without the…