Repository navigation
feat(ifc): a duct takes the system family its type's shape names (B59) - #684
Merged
Merged
Conversation
…Revit's export names them (B59) Revit names a duct <system family>:<type>:<ElementId>, the system family following its type's shape. Revit's export of RE1 Mechanical writes its 25 ducts as Rectangular Duct:233113-DUCT-Tees:<id>, with that ObjectType and a type object named Rectangular Duct:233113-DUCT-Tees. tests/duct_names.rs requires rvt-rs to write the same Name, ObjectType and type name. Red on main (draft #682, run 37231946415, "Corpus health (tier 2)"): panicked at tests/duct_names.rs:142:5: ducts not named and typed as Revit's (Tag, Revit's, rvt-rs's), first 5: [("428274", Duct { name: "Rectangular Duct:233113-DUCT-Tees:428274", object_type: "Rectangular Duct:233113-DUCT-Tees", type_name: Some("Rectangular Duct:233113-DUCT-Tees") }, Some(Duct { name: "Duct-428274", object_type: "428274", type_name: None })), ...
A rigid duct type is an AbsDuctType native record whose objects include its sweep profile: AbsSysRectSweepProfile, AbsSysCircSweepProfile or AbsSysOvalSweepProfile (Measure run 37231078920: RE1 Mechanical's duct type 53292 rectangular, its other two round and oval). Revit names a duct's system family by that shape, Rectangular Duct, Round Duct or Oval Duct, and its export the duct <family>:<type>:<id>. native_duct_shapes::duct_type_shapes reads the shape through the native record path (2023 to 2027), and each typed duct takes the shape's system family, so it is named Family:Type:ElementId, given that ObjectType and typed by an IfcDuctSegmentType of that name, as the other system families are. A release the native path does not read leaves its ducts as before.
…it's export names them (B59) The maintainer approved this change to the pre-existing tests/element_names.rs. With B59 the 25 ducts are written Rectangular Duct:233113-DUCT-Tees:<id>, as Revit's export writes them; check() asserts each such name equals Revit's before counting it. Corpus health run 37232374692: re1_names_are_revits: RE1 Mechanical left 74, right 49
DrunkOnJava
enabled auto-merge (squash)
October 4, 2026 21:19
DrunkOnJava
added a commit
that referenced
this pull request
Oct 4, 2026
Measure appends `milliseconds <n>` to each model's and sample's rvt-ifc.log, so a slower export shows up in the base/head comparison like any other output change. Run 37237567160 used it to time main against 8cdfba1, the commit before #680: the native passes added by #680 and #684 cost about 1 to 4 s per MEP export and nothing on 2016 to 2022. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > CI-only timing instrumentation in the measure script; no runtime or export behavior changes. > > **Overview** > The Measure CI script now records **wall-clock time** for each `rvt-ifc` export on reference models and Autodesk sample projects. > > Before each export it captures a nanosecond timestamp; after the run it appends `milliseconds <n>` to that model's `rvt-ifc.log` (alongside the existing exit status). Base/head artifact diffs can then surface export slowdowns the same way as other log changes. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c951e05. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
DrunkOnJava
added a commit
that referenced
this pull request
Oct 4, 2026
…rameter-definition pass (B80) (#690) native_document::extract first decodes every parameter-definition owner in the file (for saved parameter values), then makes its selected pass. The export's two native consumers, family-instance ports (#680) and duct shapes (#684), read objects' fields only. They now call the new extract_graphs, which makes the selected pass alone. Measure run 37241187730 (samples, against main) shows the IFC byte-identical on all six models and 36 samples. Wall time across them falls from 288.8 s to 226.8 s: | file | main | this PR | |---|---:|---:| | 2025 rme_advanced | 44.9 s | 32.3 s | | 2025 rme_basic | 39.5 s | 28.7 s | | 2024 rme_advanced | 32.9 s | 23.8 s | | 2026 rme_advanced | 30.7 s | 22.6 s | | 2025 rac_advanced | 5.8 s | 4.5 s | <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Targeted performance path change with measured IFC parity; only affects native readers that do not rely on resolved parameter definitions. > > **Overview** > Adds **`native_document::extract_graphs`**, which runs the selected-record object-graph pass only—skipping **`extract`**'s upfront scan of every parameter-definition owner in the file. Callers that read native object fields (not saved parameter values) no longer pay that definition-ingest cost. > > **Family-instance port indices** (`symbol_port_indices`) and **duct type shapes** (`duct_type_shapes`) now use `extract_graphs` instead of `extract` for their FamilySymbol/Family and `AbsDuctType` passes. Saved metadata on those records is projected with an empty definition registry, which matches graph-only field reads. > > Export output stays byte-identical on measured models; wall time drops materially because the definition pass is avoided on these hot paths (B80). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4684b53. 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.
A rigid duct type's native record (AbsDuctType) holds its sweep profile: AbsSysRectSweepProfile, AbsSysCircSweepProfile or AbsSysOvalSweepProfile (Measure run 37231078920). Revit names a duct's system family by that shape and its export names the duct ::. rvt-rs named RE1 Mechanical's ducts Duct-, with no type object. Each typed duct now takes the shape's system family through the native record path (2023 to 2027): Rectangular Duct:233113-DUCT-Tees:, that ObjectType, and an IfcDuctSegmentType of that name.
Red on draft #682 (run 37231946415); the output is in the test commit. tests/element_names.rs pins RE1 Mechanical's Family:Type:Id names at 49, and the 25 ducts will raise that. The maintainer's approval comes before that test changes. Pset_DuctSegmentTypeCommon.Shape (B43) follows in its own PR.
Note
Medium Risk
Changes partition field attachment and IFC element naming for all typed ducts when native extraction succeeds; failures are silent (ducts keep prior naming), but successful reads alter exported names and types across supported Revit releases.
Overview
Duct IFC naming now follows Revit’s shape-based system family instead of generic
Duct-<id>when the native record path can read the type’s sweep profile (B59).A new
native_duct_shapesmodule mapsAbsDuctTypesweep profiles (AbsSysRectSweepProfile, etc.) to Rectangular / Round / Oval Duct system families. During partition decode,attach_duct_system_familiesfillsFamilyName(and source) on typed ducts that lack one, using locale-aware labels so export can emitFamily:Type:ElementIdnames and matching ObjectType / type objects like Revit’s RE1 Mechanical export.Adds corpus test
duct_names(vsRE1-Mechanical.ifc) and registers it in CI real targets. Export comment inexport_contentis updated to document the behavior;Pset_DuctSegmentTypeCommon.Shapeis explicitly out of scope here.Reviewed by Cursor Bugbot for commit d1fbadd. Configure here.