Skip to content

feat(ifc): a multistory stair is written once for each storey its group repeats it on, as Revit's export writes it (#1977) (RE-463) - #1995

Merged
DrunkOnJava merged 9 commits into
mainfrom
fix/1977-multistory-stair-copies
Nov 14, 2026
Merged

DrunkOnJava merged 9 commits into
mainfrom
fix/1977-multistory-stair-copies

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Revit's export writes each stair of a multistory group once on its own Level and again, with its parts, on each Level above that the group's sets leave uncovered. rvt-rs wrote it once (53 entities fewer on Snowdon Towers architectural, RE-463). The sets of a MultistoryStairs record say which Levels each stair spans; a span between two consecutive Levels of those stairs that no set covers now gets the copy of the stair that ends where it begins, when the span is as high as that stair, on Revit 2024. On Snowdon Towers architectural the 53 entities are written, equal to Revit's in name, storey and type object, and in place within 1 mm; no other export moves. Refs #1977, which stays open: the rule rests on one building (no other file has a Revit export of a multistory stair) and the copies' GlobalIds are not Revit's.

Motivation

#1977 asked what a copy is and where the file says how many there are. RE-463 (#1991) measured the copy against Revit's export of all three stairs: a vertical translation of one storey, the stair and each part but a railing named with :2, the originals' Tags, no type object on the stair, its flights and its landing, flights NOTDEFINED, and GlobalIds of their own (comment on #1977).

Changes

  • src/research/native_multistory_stairs.rs (new): multistory_groups reads each MultistoryStairs record's ElementIdIndexPairSet (sets of 14 indexes) and the base and top Level of each StairsElement, in one read of the file's records that keeps no record index on the handle.
  • src/research/native_document.rs: Options::index_records (on by default): whether a read that finds no record index for its channel builds one and keeps it. The saved-graphics pass wants it; a reader that reads a file once turns it off, as the index is 48 bytes for each record of the file held to the end of the export.
  • src/ifc/multistory_stairs.rs (new): read and attach. read takes the groups and the Levels; attach writes the copies. Per group it takes the Levels the sets' stairs start and end on, finds each span no set covers, and copies the set whose stair ends where the span starts when the span is as high as that stair (0.01 ft). A copy is the stair and its aggregated parts (railings included) with their property sets, shifted up by the Level difference, in the storey of the span, :2 appended to every name but a railing's, flights NOTDEFINED. Spans the rule does not reach, a stair repeated a second time and anything the pass cannot move are counted in the run's note, not copied.
  • src/ifc/export_pipeline.rs: read runs before the saved-graphics pass, while the handle still holds the partitions' inflated copies; attach runs after the body passes and before the base quantities are left out. A new ExportNote says how many copies, only for a file where something was copied or left out.
  • src/ifc/step_writer.rs: type_objects gives no type object to the copy of a stair, a flight, a landing or a railing (an element carrying MultistoryCopyOf); a stringer's copy keeps its original's, as in Revit's export (30 of 30).
  • tools/re/multistory_copies_vs_ifc.py: also reads a copy's PredefinedType and whether it has a type object, and skips a stair that has no body.
  • A copy shares its original's Tag, so the writer's rule for entities sharing a Tag (A layered floor's parts take new GlobalIds on every save of a Revit 2027 model (#1829) #1840) gives it a GlobalId derived from the original's: not Revit's, and the copy says so with the MultistoryCopyOf property of its record set.
  • docs/supported-profile.md, the RE-463 report (sections 5 to 7) and a changelog fragment.

Testing

Rows registered on #1977 (comment of 2026-11-14) and here before any run; Measure runs of the final code 48cbcd04: 43568153235 (Snowdon Towers and the other 2024 samples, exports kept), 43568156861 (timed) and 43568180058 (unfiltered, scored); the scoring against Revit's export of Snowdon Towers (local only) is tools/re/multistory_copies_vs_ifc.py and a by-GlobalId comparison with main's export (run 43565624655).

  1. Holds. Revit's beyond rvt-rs's by class: 53 before (3 IfcStair, 6 IfcStairFlight, 30 IfcMember, 3 IfcSlab, 11 IfcRailing), 0 after in every class; rvt-rs's beyond Revit's: 0 in every class.
  2. Holds, with the row's wording corrected. Of the 53 entities of the 3 copies, 53 of 53 equal Revit's in name, storey and type object; 42 of 53 in PredefinedType (the 11 railings carry none where Revit writes NOTDEFINED, as their 62 originals do, PredefinedType: Revit's export writes one that rvt-rs leaves none or NOTDEFINED on, on walls, railings, ramps, roofs, proxies, light fixtures, pipe segments and stairs (42 models with a Revit export) #1713); the shift of the 50 with a body of their own is within 1 mm, 50 of 50. The row said a copy has no type object: Revit's stringer copies keep theirs (30 of 30), which the first run showed, and the rule was narrowed.
  3. Holds. Main's 6,953 products of the Snowdon Towers architectural export are all in the change's with the same class, name, Tag, ObjectType, PredefinedType, storey, type object, aggregate whole and property sets; the change adds exactly the 53 and no other, and the export's 97,401 GlobalIds are distinct.
  4. Holds. Run 43568180058 (unfiltered, with nordic, r2025, samples and holdout, against main's merge-base 92326d1a): 119 of 120 exports and 101 of 102 diagnostics.json files are byte-identical, and the one that differs in each is Snowdon Towers architectural. The scorers' lines move only in that file's schema.txt, by the copies: 53 more objects (6,262 to 6,315), 79 more property sets, 30 more IfcMember and 3 more IfcSlab with a PredefinedType, and 9 more swept solids with a position of their own. The other four Snowdon files and rac_advanced (five groups of one set each) are byte-identical. The row said 146 models; the run compares 120 exports.
  5. Holds at the final code; the first version failed it. Snowdon Towers architectural 29,318 to 29,838 ms (1.02), peak 797 to 797 MiB (1.00); rac_advanced 2024 1.02 and 0.99; no file more than 3% slower. The one peak flag, Snowdon HVAC (1.06), holds no stair, its export is byte-identical, and its peak is two-valued from run to run. The first version read the groups after the saved-graphics pass in two reads that kept a record index, which inflated the whole file again: Snowdon Towers architectural 1.05 in time and 1.51 in peak (797 to 1,205 MiB), rac_advanced 1.05 and 1.35 (run 43566139741).
  • tools/check-local.sh: no local builds; rustfmt --check passes on every file touched, CI runs the rest.
  • Verified end to end on real Revit files: rows 1 to 5, as above.
  • IFC exporter: the witness is Core Interior's, which holds no multistory stair; its verdicts are unchanged by construction and CI replays them.
  • Performance: row 5.

Audit-honesty checklist

  • The report (RE-463 sections 5 to 7) and docs/supported-profile.md say what is written and what is not: the uncovered-span rule is inferred from three groups of one building, and nothing in the file states how far a stair repeats.
  • A changelog fragment.
  • Limitations in code: a span the rule does not reach, a second span above one stair, a Level that is no storey and a part the pass cannot move are counted (MultistoryStairs note), not guessed.
  • No private paths, emails or internal jargon in committed files.

Legal and contribution hygiene

  • Apache-2.0. Revit's export of the Snowdon Towers sample is read as an oracle (local only, never committed); no Autodesk source.
  • No new fixtures.

Breaking changes

None. A new ExportNote variant (the enum is non-exhaustive), a new Options field of a research type, and a new crate-private module; the export of a file with a multistory group changes as the rows say.

Related issues

Refs #1977.

…up repeats it on, as Revit's export writes it (#1977) (RE-463)

The sets of a MultistoryStairs group say which Levels each stair spans. A span
between two consecutive Levels of the sets' stairs that no set covers gets the
copy of the stair that ends where it begins, when the span is as high as that
stair: the stair and its parts shifted up, in the storey of the span, named
with :2 but for railings, flights NOTDEFINED, no type object, and the writer's
own GlobalIds for entities that share a Tag (#1840).
…nals' type object, as Revit's export has them, and the scorer skips a stair with no body (#1977) (RE-463)
…ng out gets no note, so its diagnostics stay as they were (#1977) (RE-463)
…e still holds the partitions' inflated copies, and the read keeps no record index, so the pass no longer inflates the file again after the saved-graphics pass (#1977) (RE-463)
…ultistory stair of Revit 2024 is written on each storey its group repeats it on, with the rows' results and the first version's timing (#1977) (RE-463)
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 14, 2026 07:16
…iling with no record set to carry its mark is refused as not movable, not written with a type object Revit gives it none (#1977) (RE-463)
@DrunkOnJava
DrunkOnJava merged commit dc6b472 into main Nov 14, 2026
38 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/1977-multistory-stair-copies branch November 14, 2026 07:47
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