Skip to content

RE: Locate the ElementId of the second element-record prologue (Snowdon Towers, RE-30) #295

Closed

Description

@DrunkOnJava

Finding (RE-30, #290)

On Autodesk's Snowdon Towers 2024 sample projects, most partition element records in every recovered category use a second prologue. The frame is in place, byte-identical in shape to an RE-21 record from the BuiltInCategory at +0x12 through the bounding-box marker at +0x50, but +0x00 holds no ElementId. The fail-closed decode therefore rejects them.

file recovered-category frames decode second prologue undeclared id
Snowdon Towers architectural 2,171 7 2,043 121
Snowdon Towers structural 106 26 75 5
2024_Core_Interior.rvt (recorded edge) 2,875 2,857 0 18

Since #293, exports count these frames per class as skipped reason element_record_without_element_id and put an incomplete-model warning first.

What is ruled out

  1. +0x00: holds 0xFF runs and 16-bit words (0x03c1, 0x07eb, 0x04fe, 0x066f).
  2. The last reference slot: on decodable records it is the record's own id. On 1,216 second-prologue walls it takes only 605 distinct values.
  3. A fixed offset before the record: every even offset from −512 to +0x12 across 1,989 frames; the best holds a declared id on 128.
  4. Save increments for the 16-bit words: the files report 71 and 22.

What would unblock it

An oracle: a Revit 2024+ project that uses this prologue, together with Revit's own IFC export of it with element Tags on. Matching bounding boxes to Tags would give the id each frame should carry. The bytes can then be searched for it.

Possibly useful without an oracle:

References

  • reports/element-framing/RE-30-snowdon-generalisation.md
  • reports/element-framing/RE-31-elemtable-owner-field.md
  • Sample hashes are in RE-30. The files are Autodesk's, kept local and never committed.

Activity

  1. added
    re-finding
    area:elements
    area:partitions
    priority:P1
    type:research
    on Sep 22, 2026
  2. DrunkOnJava commented on Sep 22, 2026

    @DrunkOnJava
    OwnerAuthor

    An oracle was found, and it narrows the problem (#297, RE-30 §7).

    bldrs-ai/test-models has the architectural .rvt, byte-identical to ours (sha256 33271010…), plus Revit 2024's own IFC4 export of it (sha256 ecfcb04e…), with an ElementId Tag on every element. It is used locally only, because that repository has no licence.

    • Transform: fitting internal to shared coordinates gives a rotation plus a translation.
    • Matching: 1,077 of 1,216 second-prologue wall frames match exactly one IfcWall by box.
    • Location: in 1,044 of those 1,077 the matched ElementId is one slot of the frame's own ascending reference list at +0x88, and nowhere else nearby.

    So the id isn't missing. What's missing is the rule for which slot is the element itself. On decodable records it's the last slot only because the element is the newest id in its list.

    Ruled out as the selector so far:

    • a frame word equal to a Global/ElemTable row field (best 388 of 1,028);
    • 16-bit words as ElemTable row indices (0 hits);
    • "first slot that isn't a frequently shared context id" (at most 196 of 1,044).

    Next candidates: the second prologue's own 16-bit words (+0x0c, +0x0e, and the words before +0x00) read as a slot index or count into the list, and per-category differences once doors, windows and floors are matched the same way.

    Edited 2026-11-15: absolute Snowdon Towers figures (positions, elevations, areas) are removed. The Snowdon files measured here have no licence, so only counts, lengths and differences from them are published.

  3. DrunkOnJava commented on Sep 23, 2026

    @DrunkOnJava
    OwnerAuthor

    #313 (RE-34) resolves this for every category except sketch-owning elements.

    The rule: take the longest rising chain of ids through a partition twice, with ties resolved toward smaller and toward larger ids, and keep an id only when both agree. It considers placed instances only, and never takes context ids named by 56 or more frames. Hidden-id hold-outs make 0 wrong picks: 3,458 correct on Core Interior, 445 on Snowdon, and 41, 7 and 36 on the RE1 models. Snowdon Architectural exports 4,245 elements instead of 80.

    Still open here: floors, building pads and ceilings. Their lists name the sketch at id − 1, and the order rule cannot tell the two apart. One idea measured on Snowdon's 190 second-prologue floors: take the candidate that some sketch-line record names as its owner (the RE-25 second-list slot). That gives 71 correct and 10 wrong, and 96 frames have several owned candidates, so it is not a rule yet.

  4. DrunkOnJava commented on Sep 23, 2026

    @DrunkOnJava
    OwnerAuthor

    Floors and ceilings in the second layout, measured 2026-09-22. Still no rule; recording what fails and why.

    Owner-restricted, decoupled second pass. RE-34's chain runs unchanged. Then each floor, pad or ceiling frame gets an id only if exactly one candidate lies strictly between its neighbours' final ids and is named as owner by some sketch-line record (RE-25's second-list slot).

    • Hold-outs: 0 wrong. Core 101 floors + 1 pad correct (20 unassigned), RE1 Architecture 2 floors + 6 ceilings, Snowdon 1 floor. The main chain is untouched (Core 3,458 / 0).
    • Snowdon, real second-prologue frames: all 68 ceiling picks are the one exported IfcCovering Tag in their list. Of the floor picks, 162 are exported slab Tags, 86 of them the only one in their list. 14 are wrong: the pick is the sketch (F − 1) beside an exported slab F, e.g. 1394725 / 1394726. On Snowdon some sketch-line records name the sketch itself as owner, not the sketched element, so the owner filter lets the sketch through.

    The hold-outs could not catch it: Snowdon's real floors are all second-prologue, and on Core the owner slot always names the floor.

    Next: something that separates a sketch from its sketched element on Snowdon, before any floor or ceiling is assigned. A rule that only happens to be clean for ceilings on one file is not shipped.

  5. DrunkOnJava commented on Sep 23, 2026

    @DrunkOnJava
    OwnerAuthor

    Solved.

    On Snowdon Towers Architectural, element_record_without_element_id is now absent. rvt-rs exports 6,045 elements, 5,945 of them in Revit's own IFC4 export: every element Revit exports in the entities rvt-rs writes. The other 100 are Revit's own omissions (#309).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:elementsarea:partitionspriority:P1re-findingtype:research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions