Skip to content

RE: Validate Global/ElemTable body as a versioned ownership tree #152

Closed

Description

@DrunkOnJava

Provenance and credit

This issue records a finding reported by @STE1200 and their team in Discussion #112, “Set of findings”. Thank you to Steffen and the team for sharing the cross-version observation and clean-room research context.

The technical statements below are reported claims, not yet independently reproduced by rvt-rs. Griffin will perform the repository-side probing, testing, integration, and documentation; this issue does not assign work to Steffen's team.

Reported finding

The body of Global/ElemTable is reportedly an ownership tree, with a versioned record layout:

  • Revit 2014: 28-byte records, with the owner encoded as the trailing u32.
  • Revit 2026: 40-byte records, with ownership represented as u64.

The report notes that current rvt-rs documentation describes this body as partial.

Reported evidence

The layouts were reportedly observed during clean-room analysis of a Revit 2014 manufacturer family and a Revit 2026 project. Discussion #112 does not include the raw offsets, sample records, endianness proof, owner/root sentinel semantics, or a full field map; those details must be derived or obtained and independently reproduced before implementation.

Why it matters

An ownership tree could provide structural relationships that are more reliable than heuristic partition scans. If confirmed, it may improve element hierarchy recovery, parent/child traversal, version-aware ElemTable parsing, and the interpretation of the existing ElementId-to-offset index.

This is related to, but not a duplicate of, closed issue #25. #25 delivered ElementId-to-partition-offset linkage; this issue is specifically about independently validating and representing the reported ownership semantics and versioned body records.

Independent verification still required

  • Locate record boundaries and reproduce the exact 28-byte and 40-byte strides.
  • Verify that the trailing values are owners rather than correlated identifiers.
  • Determine endianness, root/no-owner representation, duplicate-owner behavior, and whether every record participates in one tree.
  • Test releases between 2014 and 2026 to identify the actual format transition instead of assuming only two layouts.
  • Compare ownership edges against independent model or stream evidence.

The hypothesis would be falsified or narrowed if the trailing values do not form stable ownership relationships or if record stride/field width varies by factors other than Revit release.

Repository-side acceptance criteria

Status 2026-09-28 (RE-31 #294, RE-31 §6 #499):

  • A probe that prints the candidate element and owner with validation diagnostics, without private paths: examples/probe_re31_owner_frame.rs (owner pairing, self-ownership, and the element's own reference list as oracle). The older examples/probe_elem_table_ownership.rs still hardcodes /workspace paths.
  • Reproduce or refute the reported 2014 and 2026 layouts on provenance-safe fixtures. RE-147 (research(elements): RE-147 the ElemTable's invariants on a 2014 family and every file of 2016 to 2027 (#152) #568): the Stertil 2014 family STE1200 pointed to (pinned in research/public-families.tsv) has 28-byte records, 11,331 of them, every set owner declared (10,208), none self-owned or looping; the 2026 rac_basic project has 40-byte records with 3,884 of 3,884 owners declared. All 54 files of 2014 to 2027 measured hold the invariants.
  • Establish the version gate from corpus evidence. The record is 28 bytes on all eight Autodesk families of 2016 to 2023 and on Einhoven (2023), and 40 bytes on the 2024 to 2026 families, Core Interior and the four RE1 models: 17 files, no other length and no file with two (RE-136, research(elements): RE-136 older releases and the ElemTable lengths, RE-137 the Q4 reading (#152) (#153) (#154) (#548) #549). Project files before 2023 are not in the corpus.
  • Validate tree invariants. With the owner read as closing the record before the parsed frame (STE1200's frame), no record names itself and no owner chain loops, on Core Interior, Snowdon Towers, RE1 Architecture and Einhoven. The frame's own field gave 304, 1,342, 26 and 7 self-owned records. Every owner is a declared ElementId.
  • Expose an ownership representation without regressing the ElementId index: ElemRecord::owner_id (experimental), corrected in fix(elem-table): report each record's owner from the field that closes it (#152) (RE-31) #499.
  • Parse the table's first record, at 0x06, which the 0x1E frame skips. fix(elem_table): read the table's records from 0x06 (#152) #559 reads every record from 0x06: the first is records[0] with its own owner (17 on the 2016 to 2026 families), and tests/elem_table_frame.rs requires the stated count, rising ids and declared owners on every family and on Einhoven and Core Interior.
  • Synthetic byte-pattern tests: superseded by the repository's no-unit-test policy. The corpus test tests/elem_table_corpus.rs pins the invariants on real files instead.
  • Reconnaissance addendum: reports/element-framing/RE-31-elemtable-owner-field.md §6.

Evidence and fixtures should follow the repository's reverse-engineering contribution requirements.

Activity

  1. added
    needs-triage
    re-finding
    area:elements
    area:partitions
    priority:P0
    type:research
    and removed
    needs-triage
    on Aug 29, 2026
  2. DrunkOnJava commented on Aug 29, 2026

    @DrunkOnJava
    OwnerAuthor

    Audit hygiene (GOV-002 / §18 first-48h): removed stale needs-triage from this maintainer-filed research issue. Related SEC-001 security-reporting fix lands via cursor/audit-p0-security-67f9.

  3. DrunkOnJava commented on Aug 29, 2026

    @DrunkOnJava
    OwnerAuthor

    Independent reproduction (magnetar corpora) — trailing-owner claim not confirmed

    Credit: reported finding from @STE1200 / Discussion #112. This comment is repository-side evidence only on the redistributable magnetar project samples — not a contradiction of Steffen's 2014-family / 2026-project observations, which we do not have in-corpus.

    Method

    Parsed Global/ElemTable with the existing layout detector (28 B / FF×4 on 2023 Einhoven; 40 B / FF×8 on 2024 Core Interior) and inspected trailing words + every aligned payload u32 after the marker. Probe output saved under the Cloud session artifact issue152_elemtable_ownership_probe.txt.

    Results (fail-closed / negative on these two files)

    File Stride Parsed records Trailing u32 == 0 Trailing u32 ∈ declared id set Trailing u64 hi half nonzero
    Revit_IFC5_Einhoven.rvt (2023) 28 2614 100% 0% 0
    2024_Core_Interior.rvt (2024) 40 26424 100% 0% 0

    Sample early records are marker + id_primary + id_secondary + zero payload (matches docs/elem-table-record-layout-2026-04-21.md).

    On 2024, some interior payload words (not the trailing word) coincide with other declared ids at high rates (~88–92% at certain word indices). That is not the reported “trailing owner u32/u64” shape, and coincidence with the dense 1…N id space is expected without an independent oracle — do not treat as ownership-tree confirmation.

    What this does / does not close

    • Does not close this issue: Steffen's claim may still hold on 2014 manufacturer families / 2026 projects with non-zero ownership payloads.
    • Does narrow the hypothesis for magnetar 2023/2024 projects: trailing-word-as-owner is falsified here; any ownership encoding must live elsewhere (non-trailing payload, different stream, or release-specific layout).
    • Existing stride detection (28 vs 40) remains independently confirmed; that part of the report aligns with prior RE.

    Next evidence needed (still open)

    • A 2014 family and/or 2026 project with non-zero trailing ownership fields (Steffen samples or new corpus intake).
    • Independent parent/child oracle (UI hierarchy / another stream) before wiring an ownership-tree decoder.

    Leaving open. No decoder changes from this pass.

  4. 33 remaining items

  5. STE1200 commented on Oct 2, 2026

    @STE1200
    Contributor

    A data point on "the first record is id 1 on most projects", from the ten project files we have,
    read from 0x06 in the same frame (count at 0x02 equals the records that fit, 19/24-byte tail, ids
    rising on all ten):

    file Revit stride first id class of that id in the partition runs
    BIMcollab Example STR / ARC / MEP 2015 28 0 AllProjectPhases
    Revit_IFC5_Einhoven 2023 28 0 AllProjectPhases
    2024_Core_Interior 2024 40 0 AllProjectPhases
    rac_basic_sample_project 2017 28 1 AllProjectPhases
    racadvancedsampleproject 2020 / 2021 / 2022 2020–2022 28 1 AllProjectPhases (checked on 2021)
    house.rvt (Autodesk sample) 2026 40 1 AllProjectPhases

    So the first record is the same element on all of them, AllProjectPhases, and only its id differs:
    1 on Autodesk's own samples, 0 on the five files from other authors. In every file id 1 is either
    AllProjectPhases (if it is not 0) or the first ProjectPhase. We do not know what sets 0 or 1;
    the template the project started from would be our first guess, untested. A reader that
    assumes 1 would drop AllProjectPhases on these five.

  6. puzzbobb commented on Oct 3, 2026

    @puzzbobb
    Contributor

    Thanks, that's a useful check. It reproduces on my copies: Einhoven and Core Interior (the MIT files, same hashes as research/witness-registry.json) have AllProjectPhases at id 0 and ProjectPhase at 1, and Autodesk's rac_basic 2017 and 2024 have AllProjectPhases at 1.

    I did some more testing and on a wider set, though, the first record isn't always AllProjectPhases. It's whatever element has the lowest surviving id, and that depends on the file's history:

    file first record
    Einhoven, Core Interior, a project made from a blank template in Revit 2025 AllProjectPhases (0)
    Autodesk rac_basic 2016 to 2027, rac_advanced 2027, Autodesk's 2015 DefaultMetric.rte AllProjectPhases (1); id 0 unused
    Autodesk rst_advanced 2019 and 2027, Autodesk's 2015 Structural_Analysis-DefaultMetric.rte ProjectPhase (0)
    Autodesk families 2016 to 2027 DimensionStyle (0)

    Projects keep their template's low ids. rac_advanced 2027 matches DefaultMetric.rte on every id below 400, and rst_advanced matches the structural template. A project built from blank in current Revit gets AllProjectPhases at 0. When an early element is deleted, its id stays a gap in every later copy. I haven't seen a freed id reused. AllProjectPhases (its m_phaseIds lists the phase elements) is an element like any other.

    However does this matter? for a file reader I don't think so. The ids are where the file's history happened to put them, and nothing in the format depends on it. What a reader can rely on:

    • Global/ElemTable's records are unique and in ascending order. That's all their position means.
    • −1 is "no element". 0 is an ordinary id.
    • Find an element by its class, never by a fixed id or by being first.

    The one place this touches the code is the extra frame parse_records returns on 40-byte files, read from the tail bytes (my comment above). It has to be dropped by position, as the last frame. Filtering out id 0 instead would also drop Core Interior's real AllProjectPhases, which is element 0 there.

    So I'd read the first-record pattern as a fingerprint of the file's ancestry, not a format rule.

  7. STE1200 commented on Oct 3, 2026

    @STE1200
    Contributor

    On the open evidence item (a 2014 family and a 2026 project with set owners), both files are public:

    2014 family. Stertil's Stertil_Dock_Products_Closed Pit SP-XP-PP.rfa, from their architect library: https://stertil-dockproducts.co.uk/uploads/2016/07/closed_pit.zip (9,449,001 bytes, zip sha256 6e65aae1e2603252a44857e9b397f5e4d285e5ded31eb57a734c1a78a755eca2; the .rfa inside is 4,923,392 bytes, sha256 b3b46ded5fc26bfa9e554442f089b51e6331f2fe89c86188b5ed41ec5a98de0c, the file of our 2014 vectors). BasicFileInfo: Autodesk Revit 2014 (Build 20140709_2115). Read from 0x06: 28-byte records, count 11,331 equals the records that fit, 19-byte tail, ids rising; 10,208 records with a set owner, every owner an id of the table, 0 self-owned. Our two elemtable_record vectors are records 6,645 and 6,719 (7919 → 7920, 7993 → 7994, sketch → owning extrusion). One difference to the 2016+ families: the first record is id 1274 (the lowest surviving id, as puzzbobb describes) and its owner field is ff ff ff ff, not 17.

    2026 project. Autodesk's rac_basic 2026 is in RE-140 already. In addition, the flowbim.ee house.rvt (sha256 eeff78f3d07dc23397d276f870f42240cb453cfdd39d965531a9d0ccc7d0a654, in our 2026-09-28 pack): 40-byte records, 11,981 of them, 5,524 with a set owner.

    rvt_vectors_magnetar_261003.zip

  8. DrunkOnJava commented on Oct 3, 2026

    @DrunkOnJava
    OwnerAuthor

    Thank you both. This is now how rvt-rs reads the table.

    parse_records reads from 0x06 (#559). After the u16 tag and the u32 count at 0x02, it reads the stated number of records at 28 bytes (to 2023) or 40 (from 2024), each closing with its owner, as STE1200's frame has it.

    • It returns the first record, with its own owner: a family's first record is owned by element 17.
    • It no longer returns a last record read from the tail: (0, 0) on the 40-byte projects, id 18 after 7259 on the 2016 family.
    • It no longer returns one record too few on 28-byte projects (Einhoven: 2,615 now, 2,614 before).
    • The record size is the one at which the stated records fit with rising ids, so the 84-byte stride on puzzbobb's 2008 to 2012 files is gone too. We have no such file to confirm it.
    • As puzzbobb suggested, nothing filters id 0: Einhoven's and Core Interior's AllProjectPhases is element 0, and the tail frame is dropped by position. The new real-file target tests/elem_table_frame.rs requires these invariants on every family of 2016 to 2026 and on Einhoven and Core Interior; its red run on the old reader failed on both of the cases above.
    • No export changed: Measure against main is byte-identical on every model, family and sample. The one output that moved during the change, a type parameter on RE1 Architecture, came from the false id 0 and was fixed in the same PR.

    The 2014 and 2026 items (RE-147, #568).

    • STE1200's Stertil family (zip and .rfa pinned by sha256) is fetched for Measure runs.
    • On all 54 files measured (that family, the eleven Autodesk families, the 36 sample projects of 2016 to 2027 and the six reference models), the stated count is read, the ids rise, every set owner is declared, and no record is self-owned or in a loop.
    • The 2014 family has 28-byte records, 11,331 of them, first record 1274 with an unset owner, and 10,208 of 10,208 owners declared, as you reported.
    • The 2026 rac_basic project has 3,884 of 3,884 owners declared.
    • The record size changes once, between 2023 and 2024.

    The first record. Agreed with puzzbobb: it is the lowest surviving id, a fingerprint of the file's history (1 on Autodesk's samples and RE1 Architecture, 0 on Einhoven, Core Interior and the other RE1 models, 1274 on the 2014 family), and nothing in the reader depends on it.

    The checklist is updated.

  9. DrunkOnJava commented on Oct 19, 2026

    @DrunkOnJava
    OwnerAuthor

    Every repository-side criterion above is met, each with its probe, report or PR: the owner frame (RE-31, examples/probe_re31_owner_frame.rs), the 2014 and 2026 layouts on provenance-safe files (RE-147, #568), the 28- and 40-byte version gate, the tree invariants, ElemRecord::owner_id (#499), and the first record at 0x06 (#559). The synthetic-test item is superseded by the repository's no-unit-test policy, as its line says; tests/elem_table_corpus.rs pins the invariants on real files instead. Thank you, STE1200 and puzzbobb, whose reports this reproduces.

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

Metadata

Metadata

Assignees

Labels

area:elementsarea:partitionspriority:P1re-findingresearch-criticaltype:research

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions