Repository navigation
fix(elem-table): declare the ElemTable's second id where the two ids differ (RE-41) - #329
Merged
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_3b357f6c-73c8-4505-8026-c07f18e83434) |
10 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Sep 23, 2026
… (RE-42) (#330) ## Summary RE-38 names an element `Family:Type:ElementId` when its type's partition record holds exactly one other named id of the type's category. When the type's family nests other families of that category, the record names those too, and RE-38 left the element unnamed (#324). The family is the one candidate whose own partition record names every other candidate, and `partition_names::resolve_family` now picks it. Every name this adds is Revit's own. ## Motivation Closes #324. RE1 Electrical's 12 lighting fixtures had no names. Revit names them `265100-LIGHT-CAN:6":<id>` and so on. ## Changes - `src/partition_names.rs`: `resolve_family` keeps RE-38's single-candidate rule. With several candidates, it returns the one whose own record names all the others, and only when exactly one does. Doc states the sibling-type limit. There is a unit test for the rule, and the RE-38 test now uses two families that do not name each other. - `tests/element_names.rs`: checks RE1 Electrical (12). RE1 Mechanical's pin moves from 36 to 42: 6 "300x150" fittings are now named, all equal to Revit's. - `examples/probe_re42_nested_families.rs` (new). - `reports/element-framing/RE-42-nested-families.md`, the support-matrix row, README, status, CHANGELOG, a reconnaissance addendum, and a cross-reference in RE-38. ## Measurements | file | names written | equal to Revit's (or the VIM's) | new | |---|---:|---:|---:| | RE1 Electrical | 12 | 12 | 12 | | RE1 Mechanical | 42 | 42 | 6 | | RE1 Architecture, Plumbing, Core Interior | unchanged | unchanged | 0 | | Snowdon Architectural (local) | 3,902 | 3,831 (71 Revit omits) | 117 | | Snowdon Structural (VIM, local) | 1,184 | 1,132 of 1,156 in the VIM | 50, all equal | - The 24 structural differences are one type the VIM's later edition renamed (RE-38 §4). - Where a type with several candidates has an ElemTable owner among them, the owner is the family the rule picks in every case (24 types over five files). The owner is unset on most types, so it is not used. - Over the elements Revit's export also holds, 4,397 names now equal Revit's, with none that differ. ## Testing - [x] `tools/check-local.sh` - [x] Every integration test with the family corpus and the magnetar + RE1 project corpus, including `element_names` on RE1 Electrical - [x] `cargo +1.85.0 check --profile ci --all-targets`, `cargo +nightly check --manifest-path fuzz/Cargo.toml` - [x] Snowdon Architectural and Structural names scored against Revit's IFC4 export and the VIM ## Audit-honesty checklist - [x] The sibling-type limit is stated in the doc and the report; no measured file has such a record. - [x] System-family types are unchanged (#322). - [x] No emojis, no private paths. ## Legal and contribution hygiene - [x] Apache-2.0 - [x] Clean-room: byte observations scored against Revit's own IFC exports and the VIM export. No SDK source or decompiled material. Snowdon and the VIM are measured locally and not committed. - [x] No PII ## Breaking changes `resolve_family` now returns a family for some types that had several candidates and returned `None` before. IFC names change for those elements, from `Class-ElementId` to Revit's `Family:Type:ElementId`. ## Related issues Closes #324. Follows #329 (RE-41). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes IFC `Name`/`ObjectType` for elements that previously had no resolved family (breaking for consumers of those strings), though selection is fail-closed and corpus-gated against Revit exports. > > **Overview** > **RE-38** already produced Revit-matching `Family:Type:ElementId` IFC names when a type’s partition record listed a single same-category family id. Types whose family **nests** other families of that category list multiple candidates, so **`partition_names::resolve_family`** used to return **`None`** and those instances kept **`Class-ElementId`** names (#324). > > The resolver now keeps the single-candidate path unchanged. With several candidates, it returns the unique id whose **own** partition record names every other candidate (the nested families). Ambiguous cases still return **`None`**. > > **Impact:** newly named instances on corpus models—e.g. RE1 Electrical’s 12 lighting fixtures, six mechanical duct fittings, and many Snowdon elements—now match Revit’s IFC names; the documented cross-model count rises from 4,241 to **4,397** matching names. Integration coverage adds **RE1 Electrical** and bumps the mechanical name check to **42**. > > Also adds **`probe_re42_nested_families`**, the RE-42 report, and doc/support-matrix updates. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1192545. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
Summary
A 40-byte
Global/ElemTablerecord carries two ElementId-shapedu32s, at+16(id_primary) and+36(id_secondary), and rvt-rs declared only the first. Where the two differ, the second is the element's ElementId: the id of its partition record (RE-35) and theTagRevit's own IFC export writes.elem_table::declared_idsnow declares both, and every production path uses it. On Snowdon Towers Architectural the 37 element records that were left unattributed now export, all of them elements Revit's export holds.Motivation
Found while measuring RE-40 (#327): the 33 elements of the primary design option on Snowdon are in Revit's export but were counted as
element_record_without_element_id. Their chain records' ids were not declared, because the ElemTable holds them at+36, not+16.Changes
src/elem_table.rs:declared_ids(&[ElemRecord])returns everyid_primary, plusid_secondaryon 40-byte records when it is non-zero, so nothing declared before is dropped;RECORD_LEN_40;declared_element_idsuses it;id_secondarydoc and a unit test.map(|r| r.id_primary)now call it:partition_element_records(2),partition_schema_mvp(8),partition_level_records,partition_names,partition_design_options.rvt-elem-tableuses it for its owner statistics.examples/probe_re41_elem_table_secondary_ids.rs(new).probe_re40_design_optionsuses the new set.reports/element-framing/RE-41-elem-table-secondary-ids.md, a support-matrix row (experimental), README, status, CHANGELOG,docs/export-diagnostics.md, the ElemTable layout doc, a reconnaissance addendum, and cross-references in RE-35 and RE-40.Measurements
probe_re41_elem_table_secondary_ids:id_primaryid_secondaryteste_export_2025, Projeto1The 2016 to 2023 projects (28-byte layout) have no record whose ids differ. Each family file has exactly one, record 18, and a
0there is not added.Of the 84 architectural records whose ids differ, 39 have their
id_secondaryas aTagin Revit's IFC4 export (17 proxies, 16 walls, 4 columns, 2 column types), and none has itsid_primaryas one.Snowdon Architectural against Revit's IFC4 export:
element_record_without_element_idconfidence.unexported_element_records/ scoreSnowdon Structural gains one floor (670566), which the VIM export also holds. Core Interior, RE1 Architecture and RE1 Electrical export byte-identically apart from the header and owner-history timestamps, so the committed witness observations do not change.
Testing
tools/check-local.shcargo +1.85.0 check --profile ci --all-targets,cargo +nightly check --manifest-path fuzz/Cargo.tomlAudit-honesty checklist
experimental: the positive evidence is local. No licensed file has a differing record.id_primaryholds where the two differ is stated as unknown. The chain ids that neither id covers on Core Interior and RE1 Electrical are unchanged and stated.Legal and contribution hygiene
Breaking changes
elem_table::declared_element_idscan return more ids than before, on files where the two ids differ. No signature changes.Related issues
Follows RE-40 (#327). Refs #309, #295.
Note
Medium Risk
Widens the declared ElementId set used across all partition element export paths; behavior is unchanged on most files but can add elements on models where primary and secondary ids diverge.
Overview
RE-41 fixes element attribution when a 40-byte
Global/ElemTablerow’s twou32ids at+16and+36disagree: rvt-rs used onlyid_primary, but on Snowdon (and similar)id_secondaryis the partition ElementId / IFCTagRevit exports.The change adds
elem_table::declared_ids, which keeps everyid_primaryand also adds non-zeroid_secondaryon 40-byte records.declared_element_ids, partition scanning, design-option probes, andrvt-elem-tableall use that set instead of mappingid_primaryalone.On Snowdon Towers Architectural, 37 previously unattributed walls/columns/generic models now export (6,044 vs 6,007 elements;
element_record_without_element_idgone). Structural gains one floor. CI-licensed corpora with no differing ids stay byte-identical aside from timestamps.Docs add RE-41 report/probe, support-matrix row, and updated export-diagnostics and status counts.
Reviewed by Cursor Bugbot for commit 82d3ff4. Configure here.