Skip to content

feat(elements): give railings their host's storey, and hosted elements their work plane's Level where their elevation agrees (#369) (RE-60) - #371

Merged
DrunkOnJava merged 1 commit into
mainfrom
feat/hosted-storeys
Sep 24, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
feat/hosted-storeys

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Most elements whose partition element record names no Level now get a storey (RE-60). There are two readings:

  • Railings take their host's storey. A railing's record names the stair or ramp it is hosted by, and Revit's own export contains the railing in that host's storey on 73 of 74 Snowdon railings.
  • Other elements need two readings to agree. Their records name objects laid out 01 00 00 00 · u64 id · u64 Level id: work planes and views, 6,435 of them on Snowdon. An element takes the Level those objects carry only where that is also the highest Level at or below its base. That is Revit's storey on 161 of 161 Snowdon elements: light fixtures, slab edges, generic models and wall sweeps. Either reading alone fails on dozens of light fixtures (38 and 8).

Per element, against Revit's own containment (tools/re/storeys_vs_ifc.py):

file in Revit's storey, before → after on no storey, before → after in a different storey, before → after
Snowdon Towers (local only) 5,612 → 5,805 294 → 102 45 → 44
2024_Core_Interior 854 → 854 (IFC byte-identical) 0 → 0 0 → 0
RE1 Architecture 34 → 34 0 → 0 0 → 0
the MIT tutorial house (local only) no oracle 1 → 0 no oracle
  • The host rule also fixes two railings that the elevation match had on the wrong storey.
  • Its one miss, 1646280, is the only new disagreement: it sits on Parking against Revit's L1 - Block 37.

Changes

  • src/element_record_level_refs.rs: REFERENCES_FIELD, level_at_or_below, HOST_SOURCE, LEVEL_OBJECT_SOURCE, and the module doc.
  • src/partition_level_records.rs: scan_level_objects.
  • src/partition_schema_mvp.rs:
    • records naming no Level keep their reference list;
    • the Level elevations are read once;
    • resolve_hosted_levels runs after RE-59's base constraints.
  • examples/probe_re60_hosted_levels.rs, reports/element-framing/RE-60-hosted-levels.md.
  • Docs: the support-matrix storey row, README, status, contribution-map, the reconnaissance addendum and CHANGELOG.

Testing

End to end, against real files. No tests were added.

  • The probe on Snowdon, joined with Revit's containment: 73 of 74 and 161 of 161.
  • rvt-ifc on Snowdon, Core Interior, RE1 and the MIT house, then tools/re/storeys_vs_ifc.py before and after. The report's §3 has the inputs' sha256 and the output.
  • Core Interior's IFC is byte-identical apart from its timestamp, so the witness observations don't change.
  • Local gates:
    • fmt, clippy -D warnings, rustdoc -D warnings;
    • the workspace suite;
    • the corpus tests under --profile ci;
    • cargo +1.85.0 check.

What this does not do

Snowdon still has 102 elements on no storey (#369):

  • 46 proxies;
  • 40 light fixtures whose readings disagree or are missing;
  • 11 railings;
  • 4 sanitary fixtures;
  • 1 stair support.

Audit-honesty checklist

  • Every count is measured against Revit's own export, and the one new disagreement is named.
  • RE finding: report, probe, reconnaissance addendum; the scorer is RE-59's.
  • No emojis, private paths or personal data.

Legal and contribution hygiene

  • Apache-2.0
  • Clean-room: byte observations, and Revit's own exports as oracles.
  • Snowdon and the MIT house stay local.

Related issues

Refs #369, #219, #33.


Note

Medium Risk
Changes IFC spatial containment for hundreds of elements, but rules are fail-closed and scoped to records with no Level; one new Snowdon disagreement is documented.

Overview
Extends storey containment for partition element records that still name no Level after RE-59, so more Snowdon elements land in Revit's IfcBuildingStorey instead of staying unplaced on the building.

Railings now inherit the Level of the single stair or ramp named in their reference list (partition_element_record_host). Other hosted types (light fixtures, generic models, slab edges, wall sweeps) bind only when two readings agree: the Level carried by referenced work-plane/view objects (scan_level_objects over 01 00 00 00 · id · Level id) and the highest Level at or below the element base (level_at_or_below). Records without a Level keep m_referenceIds; resolve_hosted_levels runs after base-constraint resolution and sets m_levelId plus m_levelBindSource.

Measured on Snowdon: 5,612 → 5,805 elements in Revit's storey and 294 → 102 with no storey; Core Interior IFC is unchanged apart from timestamp. Adds probe probe_re60_hosted_levels, report RE-60-hosted-levels.md, and doc/support-matrix updates.

Reviewed by Cursor Bugbot for commit a7d6483. Configure here.

…s their work plane's Level where their elevation agrees (#369) (RE-60)

A record naming no Level keeps its reference list. A railing takes the
Level of the one stair or ramp it names (Revit's storey on 73 of 74
Snowdon railings). Any other element takes the Level carried by the
objects it names (01 00 00 00 + u64 id + u64 Level id) only where that is
also the highest Level at or below its base (161 of 161).

Snowdon's elements on no storey fall from 294 to 102, and 5,805 are in
Revit's storey (5,612 before). Core Interior's IFC is unchanged.
@cursor

cursor Bot commented Sep 24, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_84cfcda0-a6cc-4e57-8aa5-f58edb8c8ef6)

@DrunkOnJava
DrunkOnJava merged commit 103e9b2 into main Sep 24, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/hosted-storeys branch September 24, 2026 04:27
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