Skip to content

feat(elements): name every element's Revit class through the schema's definition ordinal (#154, #223) (RE-76) - #416

Merged
DrunkOnJava merged 2 commits into
mainfrom
feat/schema-definition-tags
Sep 27, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
feat/schema-definition-tags

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

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

Evidence

classes stopped
2016 family 3,792 (tags 12..3803) end of stream
Core Interior, Snowdon (2024) 4,492 (12..4503) end of stream
RE1 Architecture (2025) 4,600 (12..4611) end of stream
2026 family 4,690 (12..4701) end of stream

Every record of ten categories resolves, to the class a BIM user expects: walls SWall / ArcWall / FaceWall, floors Floor, rooms RoomElem, roofs ProfileRoof, stairs StairsElement, ceilings Ceiling, families FamilyInstance or, for type symbols, FamilySymbol. Independent check: Snowdon's 32 ArcWall records are exactly the 32 walls RE-75 found storing an arc (24 exported).

RevitClass on 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 (+970 IFCPROPERTYSINGLEVALUE).

Not changed

SchemaTable.tag, class_tag_map and the Global/Latest walker still use the u16 after 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 and support_matrix, field_type_coverage, json_schema_contracts, element_records_2025 with the corpora.

Legal and contribution hygiene


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/Latest with a grammar that assigns each class a serialization tag (definition ordinal from 12 upward), then resolving the u16 at partition element record +0x4a against that table.

New formats::schema_classes / RevitFile::schema_classes expose the class list; PartitionElementRecord::class_tag carries the raw tag. During MVP decode, attach_revit_classes maps tags to names like SWall, ArcWall, FaceWall, Floor, FamilyInstance, and FamilySymbol. IFC export writes a RevitClass text property on each element’s geometry property set (Core Interior +970 IFCPROPERTYSINGLEVALUE; witness hashes refreshed).

SchemaTable.tag, class_tag_map, and the Global/Latest walker are unchanged—they still use the u16 after each class name (base reference), not the definition ordinal.

Docs: CHANGELOG, support-matrix row element-record-revit-class, RE-76 report, and probe_re76_schema_class_tags example.

Reviewed by Cursor Bugbot for commit 48bd6505a45516c332d763d9d8f775a043894875. Configure here.

@cursor

cursor Bot commented Sep 27, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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
DrunkOnJava enabled auto-merge (squash) September 27, 2026 20:28
@DrunkOnJava
DrunkOnJava force-pushed the feat/schema-definition-tags branch from 48bd650 to 7698ab8 Compare September 27, 2026 20:28
@DrunkOnJava
DrunkOnJava merged commit 20ce1ce into main Sep 27, 2026
21 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/schema-definition-tags branch September 27, 2026 20:40
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant