Repository navigation
feat(elements): name every element's Revit class through the schema's definition ordinal (#154, #223) (RE-76) - #416
Merged
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_eb54a4c3-7d10-445c-9db5-cf6e5d5db676) |
… definition ordinal (#154, #223) (RE-76) The schema is read by its grammar, which gives each class its serialization tag: its definition ordinal in the file's own Formats/Latest. An element record names its class by that tag at +0x4a, so each record-backed element gets RevitClass (SWall, ArcWall, FaceWall, Floor, RoomElem, ProfileRoof, StairsElement, FamilyInstance, ...). Every exported element resolves on Core Interior, RE1 Architecture and Snowdon Towers, and Snowdon's 32 ArcWall records are exactly the 32 walls RE-75 found storing an arc. Credit: STE1200 and jakobhirn-bit (Discussion #112), rosejn (#255).
DrunkOnJava
enabled auto-merge (squash)
September 27, 2026 20:28
DrunkOnJava
force-pushed
the
feat/schema-definition-tags
branch
from
September 27, 2026 20:28
48bd650 to
7698ab8
Compare
5 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Sep 27, 2026
…gs in the file's own schema (#154) (RE-80) (#422) ## Summary Three numbers rvt-rs carries as per-release constants are serialization tags of classes in the file's own `Formats/Latest` (RE-80). Documentation, a probe and a report; the export is unchanged. ## Motivation jakobhirn-bit suggested in Discussion #112 that the record marker is a schema class tag, so a reader needs no version table. RE-76's grammar reader (#416) made that checkable. ## Changes - `examples/probe_re80_schema_tag_constants.rs`: for each file, the tags of `ElemTable`, `Outline`, `ElementParents` and `ElementHeader`, and how the partitions use them. - `reports/element-framing/RE-80-schema-tag-constants.md`, a dated addendum to `docs/rvt-moat-break-reconnaissance.md`, CHANGELOG. - Doc comments: `ElemTableHeader::element_count` is the `ElemTable` class tag; `BBOX_MARKER` is `[Outline][0xFF x 4][ElementParents]`. ## Testing Probe on the 11-release family corpus (2016 to 2026), Core Interior (2024), RE1 Architecture (2025) and Snowdon Towers (2024, local only): - The `Global/ElemTable` opening `u16` equals the `ElemTable` tag on all 14 files. - Every `[Outline tag][0xFF x 4]` prefix in every partition ends in the `ElementParents` tag and is followed by a well-formed box: 16 to 32 per family file, 23,815 on Core Interior, 1,562 on RE1, 33,611 on Snowdon. On 2024 and 2025 the derived markers equal `BBOX_MARKER` and `BBOX_MARKER_2025`. - RE-35's chain constant is the `ElementHeader` tag on 2024, 2025 and 2026; before 2024 no partition opens with a chain of that shape. - [x] fmt, clippy `-D warnings` (all targets, the probe included), rustdoc `-D warnings`, `cargo +1.85.0 check` - [x] No output change: no code path changed ## Audit-honesty checklist - [x] Nothing is claimed for releases other than 2024 and 2025; the follow-up is #421. - [x] No emojis, private paths or PII. ## Legal and contribution hygiene - [x] Apache-2.0; clean-room byte observations on the corpus's own schema streams. ## Breaking changes None. ## Related issues Refs #154, #223, #421. Credit: jakobhirn-bit (Discussion #112). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation, changelog, and a read-only probe only; no production parsing or IFC export paths were modified. > > **Overview** > Documents **RE-80**: three values rvt-rs has treated as release-specific constants are actually **serialization tags** from the file's own `Formats/Latest` schema (RE-76), not lookup-table entries. > > The opening `u16` of `Global/ElemTable` is the **`ElemTable`** class tag (not an element count). The 8-byte record marker before the bounding box is **`[Outline][0xFF×4][ElementParents]`** — matching how the record serializes box vs reference lists; the old "ElemTable + 40" rule is an accidental ordinal gap. Partition record-chain headers use the **`ElementHeader`** tag (2024+). > > **No decoder or export behavior changes** — `bbox_marker` still uses its release table; only rustdoc on `ElemTableHeader::element_count` and `BBOX_MARKER` is corrected. > > Adds `examples/probe_re80_schema_tag_constants.rs` (family corpus 2016–2026 plus sample projects), `reports/element-framing/RE-80-schema-tag-constants.md`, a reconnaissance addendum, and CHANGELOG credit to Discussion #112. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5062bb5. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This was referenced Sep 28, 2026
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.
Part of #154; answers #223. Report:
reports/element-framing/RE-76-schema-class-tags.md. Probe:examples/probe_re76_schema_class_tags.rs.What changes
formats::schema_classes/RevitFile::schema_classes: theFormats/Latestgrammar, reading the whole page-stripped stream (Formats/Latest is inflated without the page strip; the schema drifts after ~140 KB in every file and parsing stops at 64 KB to hide it #410) and giving every class its serialization tag, the definition ordinal (12 first, one more per top-level or inline definition; inline references repeat their tag, so a misread stops the parse). Bounded nesting, no panics on hostile input.PartitionElementRecord::class_tag: theu16at+0x4a.RevitClassinRvtElementRecordGeometry.Evidence
Every record of ten categories resolves, to the class a BIM user expects: walls
SWall/ArcWall/FaceWall, floorsFloor, roomsRoomElem, roofsProfileRoof, stairsStairsElement, ceilingsCeiling, familiesFamilyInstanceor, for type symbols,FamilySymbol. Independent check: Snowdon's 32ArcWallrecords are exactly the 32 walls RE-75 found storing an arc (24 exported).RevitClasson export: Core Interior 970 of 970, RE1 Architecture 85 of 85, Snowdon Towers 6,081 of 6,081. The only other IFC change is that property. Both Core Interior verdicts replay PASS with refreshed rvt-rs observations (+970IFCPROPERTYSINGLEVALUE).Not changed
SchemaTable.tag,class_tag_mapand theGlobal/Latestwalker still use theu16after each class name, which is the base-class reference; moving them changes the walker's input and stays in #154.Checks
tools/check-local.sh(205 suites) and all 48 corpus-gated integration test binaries before rebasing onto #412's squash; after it, fmt andsupport_matrix,field_type_coverage,json_schema_contracts,element_records_2025with the corpora.Legal and contribution hygiene
+0x4areading credited to STE1200 (Discussion Set of findings #112, public Apache-2.0 scripts),+0x46to jakobhirn-bit (same thread), ordinal numbering also in rosejn's feat(parser): add native model attributes and geometry extraction #255. Implemented independently in Rust; no Autodesk or ODA material.Note
Medium Risk
Touches core partition decode and IFC property emission; schema grammar parsing is new surface area but fail-closed on parse errors and does not alter geometry or GlobalId behavior.
Overview
Adds Revit-native class names to record-backed elements by parsing
Formats/Latestwith a grammar that assigns each class a serialization tag (definition ordinal from 12 upward), then resolving theu16at partition element record+0x4aagainst that table.New
formats::schema_classes/RevitFile::schema_classesexpose the class list;PartitionElementRecord::class_tagcarries the raw tag. During MVP decode,attach_revit_classesmaps tags to names likeSWall,ArcWall,FaceWall,Floor,FamilyInstance, andFamilySymbol. IFC export writes aRevitClasstext property on each element’s geometry property set (Core Interior +970IFCPROPERTYSINGLEVALUE; witness hashes refreshed).SchemaTable.tag,class_tag_map, and theGlobal/Latestwalker are unchanged—they still use theu16after each class name (base reference), not the definition ordinal.Docs: CHANGELOG, support-matrix row
element-record-revit-class, RE-76 report, andprobe_re76_schema_class_tagsexample.Reviewed by Cursor Bugbot for commit 48bd6505a45516c332d763d9d8f775a043894875. Configure here.