Skip to content

fix(ifc): a file whose Levels include no building story is written with no storey, as Revit's export writes it, instead of storeys made up from its elements' heights (#1842) - #1868

Merged
DrunkOnJava merged 6 commits into
mainfrom
fix/1842-no-building-story
Nov 13, 2026

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Stacked on #1867 (its commits are this branch's first). This PR's own change is 3aba96fd.

When the recovered Levels include no building story, rvt-rs now writes no storey and contains the elements in the building, as Revit's export does. Before, it fell back to storeys made up from walls or from its elements' record-box elevations.

Every one of the 9 Levels of Autodesk's rst_basic sample, saved by Revit 2016 to 2027, has its Building Story setting off (probe_1842_level_storeys, run 43344165070). With no Level storey, the export fell back to storeys named from element heights: "Elevation -1.949 ft" and "Elevation -1.148 ft" on 2024 to 2027, binding 14 of the elements. No Revit export has such a storey.

Revit's exporter makes no storey from a Level that is not a building story. It gives one below every building story none, so with no building story at all no element is on a storey and the elements are contained in the building (revit-ifc, CLEANROOM.md source 5: Exporter.BeginDocumentExportCommon, and the relatedElementSetForBuilding branch of its containment). rst_basic is the only file Measure holds with no building story; it has no Revit export there.

Changes

  • apply_partition_level_storeys returns whether Levels were recovered. With Levels recovered and no storey left, the ArcWall path and apply_element_record_storeys make up no storey.
  • Changelog fragment changelog.d/fixed/1842-no-building-story.md.

Testing

Rows, registered before the run. It runs against #1867's head fd57a047, so it shows only this change.

  1. What moves. The twelve rst_basic saves, 2016 to 2027, and nothing else. Every other ifc.sha256 and diagnostics.json is identical: every other file with recovered Levels has a building story among them.
  2. rst_basic. storey_count 0 (from 5 on 2016 to 2023 and 2 on 2024 to 2027), and storey_bound_elements 0 (from 36 and 14). No IfcBuildingStorey is written, and every element is in the IfcBuilding. storeys_vs_ifc without a Revit export counts every element as on no storey.
  3. same-project gates pass. Any comparison of storeys between saves is reported.
  4. Autodesk samples, 2025 against 2026 saves: 6 bodies, 1 profile and 12 level binds differ with no known cause #1864: the 12 rst_basic level binds that differ between its 2025 and 2026 saves are read again here.

The run: unfiltered Measure of this head against fd57a047, every scorer, with the samples, BIM4LCA, R2025, rac_advanced and the held-out models.

  • rustfmt --edition 2024 --check passes; CI runs the rest
  • Verified end to end on real Revit files: rows 1 to 4
  • Touches the IFC exporter: Core Interior has building stories (row 1)
  • Performance: n/a

Audit-honesty checklist

  • Docs: the sample's storeys are named in no doc
  • Changelog fragment
  • No limitation resolved or introduced in the docs. This rule has no Revit export to check it on, so the evidence is the exporter's source and RE-118's Building Story read, exact on Snowdon Towers' 37 Levels.
  • Commit message says what and why
  • No emojis
  • No private paths or personal details
  • revit-ifc is cited by file and method, nothing copied

Legal and contribution hygiene

  • Apache-2.0
  • No Autodesk proprietary source, decompiled internals or NDA material
  • No fixtures

Breaking changes

None.

Related issues

Part of #1842. Lands after #1867.

…ding Story setting, to tell why rst_basic's Levels give no storeys (#1842)
…here the others sit, with no names, so it runs on held-out models (#1842)
…the building story below that Level, as Revit's exporter places it (#1842)
…th no storey, as Revit's export writes it, instead of storeys made up from its elements' heights (#1842)
@DrunkOnJava DrunkOnJava added area:ifc Work in the ifc area. type:bug Correctness defect or regression. labels Nov 13, 2026
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Unfiltered Measure 43346353876 at 3aba96fd against #1867's head fd57a047, read against the rows above. Every row holds.

  1. What moves. Exactly the twelve rst_basic saves, 2016 to 2027, and their twelve diagnostics.json. The other 114 exports are identical.
  2. rst_basic:
    • storey_count goes to 0: on 2016 to 2023 from 5 (Elevation -3.937 ft … Elevation 9.514 ft), on 2024 to 2027 from 2.
    • storey_bound_elements goes to 0, from 36 and from 14.
    • Every element is now in the building: unsupported_geometry_missing_level 418 → 454 on 2016, and 441 → 455 on 2024 to 2027.
    • The only scorer lines that move are the schema check's set counts, which drop by the storeys' own sets: 1,291 on 463 objects → 1,285 on 457, and 1,332 on 502 → 1,329 on 499.
  3. same-project gates pass.
  4. Autodesk samples, 2025 against 2026 saves: 6 bodies, 1 profile and 12 level binds differ with no known cause #1864's 12 level binds can be read again only once this lands and feat(cli): rvt-diff --elements compares two saves of a model element by element, keyed by the GlobalId the IFC export writes (#1843) #1852's pair run reruns on it. They stay on Autodesk samples, 2025 against 2026 saves: 6 bodies, 1 profile and 12 level binds differ with no known cause #1864 until then.

@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 13, 2026 02:26
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Self-approved at 0d64b9e8 (review 5885477074), under Griffin's 2026-11-12 answer that rvtReview may approve its own pull requests when the second reader is not free. rvtDevelop read this head earlier and found nothing to change ("no_building_story is set only when Levels were read and none is a building story ... no storey is made up"), and said it would approve once CI was green or leave it to me. I waited the 30 minutes I told it, then re-read the diff as if someone else had written it: the closure that now returns levels_read, the three places no_building_story is read (the ArcWall fallback, the elevation-evidence replacement, the doc comment), and the empty storey list reaching unique_storey_index_for_elevation, which then binds nothing.

@DrunkOnJava
DrunkOnJava merged commit 58395b6 into main Nov 13, 2026
63 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/1842-no-building-story branch November 13, 2026 03:16
DrunkOnJava added a commit that referenced this pull request Nov 13, 2026
DrunkOnJava added a commit that referenced this pull request Nov 13, 2026
## Summary

Release metadata for v0.20.0 (RELEASE.md, steps 4 to 7), cut from `main`
at `925c482d` and merged with `main` up to `58395b62` (#1855, #1860,
#1861, #1863, #1866, #1867 and #1868 among it):
- every version file moves to 0.20.0 (`tools/release/bump_version.py`),
and `CITATION.cff` is dated 2026-11-12;
- the fragments under `changelog.d/` are assembled into a `[0.20.0]`
section, with its introduction and "Upgrading from 0.19" (the
work-budget bullet says a stop warns and the export is still written, as
#1855 settled);
- the README's release lines name v0.20.0;
- Core Interior's two witness observations and verdicts, and the two
synthetic IFC fixtures, are taken from CI's artifacts for `e10580d0`:
only `witness_version`, the verdict hashes, the retired "Unmapped Revit
unit identifiers" warning (RE-445) and an unset transparency (#1820)
differ.

Measured and rehearsed:
- the comparison with 0.19.0 is in the section, from Measure runs
[43357862138](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43357862138)
(unfiltered, `58395b62` against `v0.19.0`'s `09b18bd3`: 49 of 146
exports move, 0 census regressions, 0 body regressions) and
[43357979238](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43357979238)
(timing: no file more than 3% slower except one that reads 0.98 in the
earlier run of the same code, no peak higher by more than 2%, the
samples of 2023 to 2027 at a median 0.76 times the peak memory). The
release adds only notes, witness files, version strings and fixtures to
`58395b62`, so a run of `main` is the run of the release; a run of this
branch would move every export through the header's version string;
- `publish.yml` rehearsal on `d9946f4b`:
[43359414819](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43359414819)
passed. Only the changelog changed since.

**Why now.** `main` holds today's crafted-file and security fixes
(#1815, #1831, #1833, #1845), and neither GlobalId move. #1850 is back
in draft until the tag, and #1854's fix is #1859. Those two ship
together in 0.21.0 (#1854 comment 6841360704).

## Testing

- `python3 tools/release/changelog.py check` passes: no fragment is
left.
- `bump_version.py` checks the version files with the preflight's own
`check_versions`.
- The PII guard runs `release_preflight.py` on this PR.
- Timing against 0.19.0 is in the section, from run 43357979238 on
`58395b62`.

## Related issues

Release 0.20.0. Milestone `0.20.0`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ifc Work in the ifc area. type:bug Correctness defect or regression.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant