Skip to content

feat(ifc): a railing that belongs to a stair is aggregated under it, as Revit's export aggregates it (#1624) - #1626

Merged
DrunkOnJava merged 6 commits into
mainfrom
feat/stair-railings-aggregate
Nov 10, 2026
Merged

DrunkOnJava merged 6 commits into
mainfrom
feat/stair-railings-aggregate

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

A railing whose record names a stair (BaseRailing.m_stairsId) and no component of it (m_stairsComponentId) is aggregated under that stair on Revit 2024 to 2027, as Revit's export aggregates it (IfcRelAggregates, beside the stair's runs, landings and stringers). A railing that names a stair component stays a plain element of its storey, as Revit leaves it (RE-390). The aggregates scorer now also names a part rvt-rs aggregates where Revit does not.

Motivation

A stair has no body of its own and is the sum of its parts, so with its railings standalone it was short by them: 2.74 ft of height and 0.72 ft3 of volume on R2025 model 13 (#1624). Revit's export aggregates the railing under its stair on every stair railing measured but one; that one, Tag 2598405 of the BIM4LCA office, is told apart by a field of its own record (RE-390).

Changes

  • src/research/partition_schema_mvp/stairs.rs: attach_railing_lengths hands a railing's stair to the aggregate unless the railing is on a component of it.
  • src/research/native_stairs.rs: RailingRecords::on_components (the railings whose record names m_stairsComponentId).
  • tools/re/aggregates_vs_ifc.py: "aggregated by rvt-rs only" is counted, so a railing Revit leaves out cannot pass as agreement.
  • probes/examples/probe_re390_railing_stairs.rs: prints every field of each railing's BaseRailing and its stair's StairsElement.
  • reports/element-framing/RE-390-stair-railings-aggregated.md, changelog.d/changed/1624-stair-railings-aggregated.md.

Testing

No unit tests (banned); end to end on Revit's own exports.

  • Verified end to end on real Revit files: Measure 42688171578, unfiltered, head a43f517d against main (118 models). Probe run 42686643077 on the office. The command lines are in the report's section 6.
  • 0 census regressions in the property and quantity censuses; 20 exports moved.
  • Aggregates: office (as built and permit): 25 of 25 railings Revit aggregates are now "same whole" (on main none), 0 aggregated by rvt-rs only; R2025 models 13 to 17: 2 of 2 each. Snowdon Towers (local only): 65 of 65 that rvt-rs writes are Revit's.
  • Storeys: each office file's rows on a different storey from Revit's fall from 6 to 4 (the 4 IfcRamp stay).
  • tools/check-local.sh and the witness replay: run by CI's full jobs on this head.

Audit-honesty checklist

  • Changelog fragment under changelog.d/changed/.
  • A new limitation is documented here, in the report (sections 4 and 5) and in the fragment, below.
  • Reverse-engineering finding: probe under probes/examples/ and report RE-390.
  • Clean-room: only the public bytes of the files and Revit's own IFC export; no Autodesk source.

What this makes worse: the stair assembly's volume

The railings now inside the stair's sum are record boxes (RE-303), not Revit's thin bodies, so the stair's volume as the sum of its parts, read by stair_bodies_vs_ifc.py, is larger than Revit's where before it was short by the railings: office stair 2598347 100.9 ft3 on main, 707.6 with this change, Revit 101.6; the office's other 10 stairs that hold railings about 110 to 117 on main, 3613 to 4094 here, Revit about the same as main; R2025 model 13 8.06 to 25.9 ft3 against Revit's 8.78. The stair's extent now matches Revit's (model 13's every Revit vertex within 0.001 ft of rvt-rs's surface, where none was). Nothing exported reads the sum (no census moves), and a railing's body and quantities are the same standalone or aggregated; the boxes were always written, now inside the stair that owns them. The volume is exact only when the railings' bodies are (RE-303). Per-stair figures are in the report's section 4.

Not shown: railings on a ramp (Revit aggregates 4 of Snowdon's under their IfcRamp; rvt-rs does not), the component rule on a second model (it rests on one railing, which is one in each of two saves of one project), 11 of Snowdon's 76 stair railings that rvt-rs does not export at all.

Breaking changes

None.

Related issues

Refs #1624 (the stair's extent is fixed; its volume is not, see above).

@DrunkOnJava
DrunkOnJava force-pushed the feat/stair-railings-aggregate branch from aaf5ffe to 4ced317 Compare November 9, 2026 19:02
…as Revit's export aggregates it (#1624)

Revit's own IFC4 exports put each railing hosted on a stair among the parts
of its IfcStair beside its runs and stringers: 76 of Snowdon Towers' 142
railings, and all 10 of the R2025 stair models 13 to 17. rvt-rs wrote them
standalone, so the stair, which has no body of its own and is the sum of its
parts, was short by its railings: on R2025 model 13 Revit's stair is 8.7821
ft3 and 0 to 8.0880 ft (flight 4.4903, two stringers 1.7854 each, two
railings 0.3605 each) and rvt-rs's was 8.0611 and 0 to 5.3458. The saved-mesh
default made it show: the stringers were boxes 13.1234 ft tall before and hid
the missing railings.

native_stairs::railing_records returns the stair each railing names
(BaseRailing.m_stairsId, which RE-254 reads a stair railing's length from)
with the lengths, from the one pass over the railings' records that read the
lengths alone. attach_railing_lengths gives a railing that stair as its whole
on Revit 2024 to 2027 where a run, landing or stringer already makes it one:
a stair carried by its parts has no body of its own, and a railing alone must
not take the body of a stair none of its parts names.

aggregates_vs_ifc.py counts stair flights and railings beside the curtain
wall's parts, which is why it never listed this.
…s export does not (#1624)

The first Measure of #1624 counted one stair railing in each office file
that only rvt-rs aggregates, 25 equal to Revit's whole beside it. The scorer
listed the parts only Revit aggregates and those under another whole, with
-v, and never the parts only rvt-rs aggregates, which are the ones a rule
that is right on most parts and wrong on some shows. It now names them, and
the parts under another whole, in every run; the parts only Revit
aggregates, which can be many, stay behind -v.
… Revit's export leaves it out of its stair (#1624) (RE-390)
@DrunkOnJava
DrunkOnJava force-pushed the feat/stair-railings-aggregate branch from 4ced317 to ade6d7d Compare November 9, 2026 19:46
…of the stair's aggregate, as Revit's export leaves it (#1624) (RE-390)
…ng under its stair unless the railing sits on one of the stair's components (#1624)
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 10, 2026 16:42
…ce, record boxes where the saved mesh is not whole, and say a viewer draws the same boxes as before (#1624)
@DrunkOnJava
DrunkOnJava merged commit d735407 into main Nov 10, 2026
36 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/stair-railings-aggregate branch November 10, 2026 17:10
DrunkOnJava added a commit that referenced this pull request Nov 10, 2026
…he census (#1634)

## Summary

Measure's summary gains a section, "What the scorers show got worse
(advisory)", written by the new `tools/re/cmp_measure.py` from the base
and head directories the compare job already holds. It ends with two
counts, "census regressions" and "body scorer regressions", and lists
each model behind them.

## Motivation

The property and quantity census says "equal fell, different or missing
rose", and nothing else. On the stair-railing change (Measure
42688171578) it read "census regressions: 0" while the stair assembly's
volume on the office's 13 stairs holding railings had moved from within
1 percent of Revit's to 2 to 127 times it; that was found by reading the
scorer diffs by hand. The same comparator, on the wall-quantities change
(Measure 42690731323), reports "body scorer regressions: 0".

## Changes

- `tools/re/cmp_measure.py`: the models whose export moved
(`ifc.sha256`), the scorer files that differ, the census regressions,
and the body scorers' worsening: an element's volume that moved away
from Revit's by more than 5 percent of Revit's, an "N of M" coverage
count that fell (the nth line of a label against the nth, since a label
opens several groups), and rows on a different storey that rose.
- `.github/workflows/measure.yml`: the compare job's sparse checkout
takes the script; the summary runs it before the raw scorer diff, capped
at 60 KB, advisory (a failure prints a line, the job goes on).

## Testing

No unit tests (banned). The script ran on two real Measure runs'
artifacts: 42688171578 (stair railings: 7 body regressions, the office's
and the five R2025 stair models' stair volumes, nothing else) and
42690731323 (wall quantities: 0). A dispatched Measure on this branch
shows the section in the run summary (linked below once read).

- [x] Verified on real Measure artifacts, command: `python3 -I
tools/re/cmp_measure.py measure-base measure-head` in a directory
holding `gh run download <run> -n measure-base -n measure-head`.
- [x] `actionlint` and a YAML load of `measure.yml` pass; file modes
match the other scorers.

## Audit-honesty checklist

- [x] No user-visible change: no changelog fragment.
- Limits: it reads the text the scorers print, so a scorer that prints
no per-element volume or no "N of M" line is not covered, and a
worsening that moves a count the scorer does not print is invisible. The
5 percent threshold is a first choice, not measured against a corpus of
past changes.

## Breaking changes

None.

## Related issues

None. Follows the stair-railing aggregate (#1626), where the gap showed.
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