Repository navigation
feat(elements): recover rooms from OST_Rooms element records, with their Revit name, number, storey and envelope (#90) (RE-29) - #275
DrunkOnJava wants to merge 4 commits into
Conversation
…eir Revit name, number, storey and envelope Revit rooms are carried by the same partition element record every other category uses: BuiltInCategory OST_Rooms (-2000160), under the unchanged #211 instance rule. The category was measured, not assumed — a brute scan of all 23470 decodable element records on 2024_Core_Interior.rvt histogrammed every BuiltInCategory present and scored each one's selection against the 116 room ElementIds Revit's own full-project export carries in IfcSpaceType.Tag. OST_Rooms selects 116 and they are exactly that set (FP 0, FN 0, tolerance 0); no other category intersects it at all. The number, the name and the host Level come from the room's own parameter block, anchored on the owning ElementId with a confirmation copy at +0x3c, the Level at +0x44, the number's UTF-16LE length prefix at +0x1f5 and the name's 8 bytes past the end of the number — the same owner-at-a-fixed-offset framing RE-22 found for the per-instance IFC Export As override, read forward instead of backward. It accepts 116 of the 26425 ids Global/ElemTable declares and they are exactly the rooms; every room is framed twice with no disagreement; recovery is all-or-nothing per room. Measured against the reference export: 116/116 names equal IfcSpace.LongName and 116/116 numbers equal IfcSpace.Name. The body is the record's bounding box, which is not a placeholder here. Scored on the emitted IFC against Revit's own swept areas in world coordinates: the plan envelope is exact on 116/116 (worst 1.640e-06 ft, the writer's six-decimal metre rounding) and the vertical extent is exact on 116/116 (worst 1.421e-14 ft). The RE-26 newest-frame tie-break is load-bearing: 111 of 116 rooms carry frames that disagree about the plan box and the first frame by (stream, offset) is exact on only 5 of 116. Storey containment is exact too: all 116 bind through the RE-27 Level reference, each of the ten Levels named maps to exactly one IfcBuildingStorey, and it is the storey that export aggregates the room into — the first part of RE-27's bind scored against Revit's own containment. IFCSPACE goes 18 -> 116, storey containment 853 -> 969 of 970, partial_element_geometry disappears (every emitted element now has a body), and entity_counts.IFCSPACE joins the full-project OctetProof claimed surface (13 -> 14 fields) where rvt-rs, IfcOpenShell and IFClite agree. The boundary polygon stays a measured negative and #90 stays open for it: searching every inflated partition byte for each of the 116 polygons as an ordered run of packed f64 at strides of 2, 3, 4 and 6 doubles, in both windings, absolutely and translation-invariantly, finds a longest run of 3 vertices against polygons of 4 to 22; none of the 126 OST_SketchLines owners is a room; the record tail holds no coordinates. A room's boundary is computed from its bounding elements, not stored. Refs #90 #219
Both lanes appended a corpus gate to the end of tests/iter_elements_typed.rs; both are kept. The RE-28 report number was taken by the wall-type lane (#273) while this branch was in flight, so the room work is renumbered RE-29 throughout. Manifest and witness observations regenerated on the merged tree: the slim verdict keeps entity_counts.IFCSPACE inside the claimed surface at 116, all three witnesses agreeing, and both verdicts stay PASS.
Bugbot couldn't run - usage limit reachedBugbot 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_c39f7234-47d7-4b27-88bf-a53da1882dbf) |
let-chains stabilised in Rust 1.88; this crate is edition 2024 with an MSRV of 1.85, so the seven `&& let` sites compiled locally and failed only in the `cargo test / ubuntu-latest / 1.85` job. Rewritten as nested `if` / `if let` with no behaviour change. Verified with cargo +1.85.0 check --profile ci --all-targets.
Bugbot couldn't run - usage limit reachedBugbot 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_6110454e-8189-4b37-9772-029d9fe4d5a8) |
The push that added the let-chain fix did not produce a workflow run (GitHub Actions reported operational; close/reopen did not fire one either). Empty commit to emit a pull_request synchronize event. The branch squash-merges, so this does not reach main.
|
Superseded by #278, which carries these exact commits plus the 1.85 MSRV fix. GitHub stopped emitting workflow events for this pull request: after the MSRV fix was pushed, neither a synchronize nor a close-and-reopen nor a second push produced a CI run, while every other branch pushed in the same window ran normally. Reopening from a fresh branch was the only way to get the suite to run. No review history here to preserve beyond the description, which #278 carries verbatim. |
… maintainer docs, grouped Dependabot, shorter artifact retention (#529) ## Summary Brings the repository's GitHub side up to the standard an open-source project should meet, and writes it down: rulesets kept as code, a support page and a maintainer guide, grouped Dependabot updates, forms that apply the project's own labels, and shorter retention for CI's throwaway artifacts. Repository configuration and documentation only; nothing in the crate, the CLIs or the viewer changes. ## Motivation An audit of the repository on 2026-09-30 (settings, rulesets, labels, milestones, issues, branches, Actions, security features) found these gaps, each fixed on GitHub first and recorded here: - `main-protection` had no pull-request rule; ADR-005 decided one and was still "Proposed" because the automation token had been refused. There was no protection for release tags. - Code scanning was not configured, and actions were pinned by SHA by convention but not by rule. - No `SUPPORT.md`, and nothing that says how issues are triaged, what the labels mean or how the repository is kept in order. - The bug and feature forms applied `bug` and `enhancement`, a second taxonomy beside the project's `type:*` labels; nine open issues had no labels at all. - The Actions cache was over its 10 GB limit (2.9 GB of it belonged to closed pull requests and deleted branches), and every pull request's CI run kept its smoke wheels and evidence bundle for 90 days. - The `0.4.0` milestone was still open after v0.4.0 shipped, with 12 open issues. ## Changes - `.github/rulesets/main-protection.json` (was `main-protection.proposed.json`) and `release-tags.json`: the live rulesets. `main-protection` gains the pull-request rule (0 approvals, threads resolved, squash only; the maintainer bypass is unchanged), and `release-tags` stops `v*` tags being created, moved or deleted by anyone but a maintainer. ADR-005 is marked accepted and applied. - `.github/SUPPORT.md` and `docs/maintaining.md`: where to ask what, and how issues are triaged and labelled, what a pull request has to pass, how releases and the security settings work, and the housekeeping checklist. `CONTRIBUTING.md` links the guide. - `.github/dependabot.yml`: minor and patch updates grouped per ecosystem; majors stay separate. - `.github/ISSUE_TEMPLATE/bug_report.yml` and `feature_request.yml`: `type:bug` and `type:feature`. - `.github/workflows/ci.yml`: smoke wheels kept 7 days; the evidence bundle 90 days on `main` and 14 on a pull request's run. - `ROADMAP.md`, `docs/contribution-map.md`: the geometry slices are the `0.4.x` milestone; the contribution map's remainders are regenerated from the tracker (25 open issues). - `CHANGELOG.md`. Done through the GitHub API in the same pass, with no file to change: CodeQL default setup for the workflows, JavaScript and TypeScript, and Python (Rust is not accepted by default setup); full-SHA pinning required for actions; the `0.4.0` milestone closed and its 12 open issues moved to a new `0.4.x` milestone; the 12 issues that lacked labels labelled; the labels `community`, `needs-split`, `rust`, `github-actions` and `viewer` created; 1,195 caches of closed pull requests and deleted branches deleted, and two superseded remote branches (their commits stay reachable from PR #275) removed. ## Testing N/A: no code path changes. What was checked instead: - `.github/workflows/ci.yml` and `.github/dependabot.yml` parse as YAML, the two ruleset files as JSON, and every workflow action reference is a full-SHA pin (so requiring pins breaks nothing). - The live rulesets were applied from these files' content; PR #527 merged under the tightened `main-protection` by the maintainer bypass, and this PR needs the five required checks. - Nothing reads `main-protection.proposed.json` but ADR-005, which now points at the new name; the retention change touches only the two upload steps that had no shorter setting, and no job downloads either artifact. ## Audit-honesty checklist - [x] Docs and configuration state what is in force today; nothing claims a setting that is not on - [x] The one setting that could not be enabled is stated: secret scanning's non-provider patterns and validity checks stay off (the API accepts the request and leaves them disabled) - [x] No emojis, private paths or PII ## Legal and contribution hygiene - [x] Apache-2.0 - [x] No Autodesk content - [x] No fixtures ## Breaking changes None. Direct pushes to `main` by anyone but a maintainer, and creating, moving or deleting `v*` tags by anyone but a maintainer, are now refused; none happened before. ## Related issues None.
Summary
Revit rooms are carried by the same partition element record every other category uses —
BuiltInCategoryOST_Rooms(-2000160), under the unchanged #211 instance rule — and their number, name and host Level sit in the room's own parameter block. Recovering both replaces the 18 name-onlyIFCSPACErows with 116 record-backed rooms whose id set, names, numbers, storeys, plan envelope and floor-to-ceiling extent all match Revit's own export exactly. The boundary polygon stays a measured negative, so #90 stays open for it.Motivation
#90 asks for real space boundaries in place of a "placeholder 10x10x8 ft bounding box". #219 records the 18 name-only
IFCSPACEas the largest remaining unbound set. Measured first, the shape onmainwas worse than #90 describes: 18 rows namedRoom-unnamed,Representation$, no body at all, and no storey.The winning pattern in this repo is RE-21 → RE-22 → RE-25: find the per-instance element record for the category, prove the instance set against the export's ElementId set, then recover geometry from the same record family. That is what this does.
What was proven, with numbers
All against
IFC Exports/2024_Core_Interior_slim.ifc(sha256bfdf36ff…), Revit's own full-project export.1. The carrier, measured not assumed.
probe_re29_room_recordsbrute-scans every offset of every inflatedPartitions/*stream, histograms everyBuiltInCategoryacross all 23 470 decodable records, and scores each one's instance-rule selection against the 116 room ElementIds the export carries inIfcSpaceType.Tag(IfcSpacedeclares noTag, so the id travels one hop throughIfcRelDefinesByType):-2000160OST_RoomsNo other category intersects the wanted set at all.
2. Number, name and Level, from the room's own parameter block. RE-22 found a parameter value at a fixed negative offset from two copies of the owning
ElementId; a room's strings are the same shape read forward from the owner:The name's offset is not fixed because the number's length is not, which is why the block is parsed forward rather than backward from either string.
IfcSpace.LongNameIfcSpace.NameRecovery is all-or-nothing per room: blocks that disagree drop the room rather than pick a side.
3. The body. The record bbox is the export's plan envelope and vertical extent — not an approximation:
zbaseztop(stream, offset)111 of 116 rooms carry frames that disagree about the plan box, so the RE-26 newest-frame tie-break is load-bearing here. Re-measured on the emitted IFC after the metre round-trip: plan envelope exact 116/116 (worst 1.640e-06 ft, the writer's six-decimal rounding),
zrange exact 116/116 (worst 1.421e-14 ft).4. Storey containment (#219). All 116 bind through the RE-27 Level reference — every room record names exactly one Level, unlike columns and walls which carry base and top constraints. The ten Level ElementIds map one-to-one onto ten
IfcBuildingStorey, and each is the storey the export aggregates the room into. This is the first part of RE-27's bind scored against Revit's own containment. The parameter block's own Level slot agrees 116/116 independently, as does the record basezagainst the storey elevation.What stayed negative, and why
The boundary polygon is not in the file. Four independent tests:
OST_SketchLinesowners RE-25 recovers include 0 rooms.0.0,NaNsentinels and small words.[3, <Level>, <wall>, <wall>, <own id>], length 5 on all 116, against a room with nine vertices.All 108 distinct reference coordinates and all 186 distinct vertices are in the file, as wall faces — what is absent is any place a room's own vertices sit in order. This matches Revit's model: a room's boundary is computed from its bounding elements, not stored.
ProfileResolvedstaysfalse; recovering the enclosure from the recovered wall set is a different problem and is not attempted.How good the box is, stated rather than glossed: 76 of 116 record boxes equal their room's polygon exactly in area, 40 over-state it (total 20 870.7 sq ft of box against 19 582.1 sq ft of polygon, ratio 1.0658, worst 2.037 on the 22-vertex room 25945).
Measured before / after on
2024_Core_Interior.rvtIFCSPACEstorey_bound_elementsIfcBuilding(storey unknown)IFCPROPERTYSET/IFCRELDEFINESBYPROPERTIESIFCWALL/IFCDOOR/IFCWINDOW/IFCCOLUMN/IFCSLAB/IFCSHADINGDEVICE/IFCBUILDINGSTOREY/IFCRELFILLSELEMENTunsupported_featurespartial_element_geometrycurve=18, missing_level=19, missing_dimensions=18missing_level=1partial_element_geometrydisappearing is the honest consequence of the last geometry-free elements gaining a body.Both OctetProof verdicts stay PASS, and the full-project claimed surface goes 13 → 14 fields (excluded 3 → 2):
entity_counts.IFCSPACEjoins it, with rvt-rs, IfcOpenShell 0.8.5 and IFClite 7.1.1 all at 116, 0 diffs.Changes
src/partition_room_parameters.rs(new) — the parameter-block framing, the confirmation test, the forward parse,resolve_unique.src/partition_element_records.rs—OST_ROOMS.src/partition_schema_mvp.rs—rooms_from_partition_category_records/room_instances_from_records; the string-derived rooms stand down where records decode, the same trade the plan-loop floors take against record-backed slabs.src/ifc/export_content.rs—RoomNumber/RoomNamejoin the record property set.src/ifc/step_writer.rs—IfcSpace.LongNameis the recovered room name when there is one (the slot Revit uses for it);Namekeeps theRoom-<ElementId>identity, becauseIfcSpacedeclares noTagand the STEP line would otherwise carry no source id.src/ifc/compare.rs— theIFCSPACEdivergence note.examples/probe_re29_room_records.rs(new) — the reproducible probe: category histogram, instance scoring, record dump, vertex-run search, name-carrier search, parameter-block scoring.reports/element-framing/RE-29-room-instance-and-envelope.md(new).tests/iter_elements_typed.rs—core_interior_2024_room_instances_names_and_envelopes, which re-reads the reference export and scores the id set, names, numbers and Level bindings directly.tests/fixtures/project-counts/*.json,research/witness/**,docs/{status,user-guide,ifc-compare,contribution-map,support-matrix},CHANGELOG.md— measured numbers only.Deliberately not touched beyond what the space path needs:
export_content.rskeeps its structure (two constants and one field read), andstep_writer's change is one private function signature with a single call site.Testing
cargo test --allpasses locallycargo clippy --all-targets --all-features -- -D warningspassescargo fmt --checkpassessrc/partition_room_parameters.rs(written against synthetic blocks before the implementation, covering the happy path, a longer number shifting the name, a disagreeing confirmation slot, a wrong anchor, implausible and zero lengths, a control character, truncation at three offsets, scan scoping, agreeing and disagreeing duplicate blocks, an unsupported release, and a Level slot outside the recovered set) plusspace_long_name_comes_from_the_room_name_propertyinsrc/ifc/step_writer.rstests/fixtures/synthetic-project.ifcis byte-identical — the synthetic fixtures emit no space with aRoomNameproperty, so theLongNamebranch falls back to the elementName, which is what it wrote beforeelements/sense (the recovery is a record scan, gated bysrc/partition_room_parameters.rs::testsand the corpus gate)Commands run:
All green, re-run after
git merge origin/main.Audit-honesty checklist
docs/status.md,docs/user-guide.md,docs/ifc-compare.md,docs/contribution-map.mdanddocs/support-matrix.jsonall carry the new numbers, and the stale 801-of-872 / 853-of-872 / "18 name-only spaces" claims are correctedrooms_spacesmovesknown_gap→knownon the full-project manifest at 116 tolerance 0;partial_element_geometryis removed fromunsupported_featuresbecause it genuinely no longer firesexamples/probe_re29_room_records.rsand a dated report atreports/element-framing/RE-29-room-instance-and-envelope.md. Following the convention of RE-21 through RE-28, the dated addendum lives inreports/element-framing/rather than indocs/rvt-moat-break-reconnaissance.mdClean-room declaration. The changes in this PR are based on public byte observations of
2024_Core_Interior.rvt(magnetar-io/revit-test-datasets, MIT), Autodesk's publicly documentedBuiltInCategoryconstants, and the buildingSMART IFC4 specification plus Revit's own publicly-exported IFC file. I have not used Autodesk SDK source, ODA SDK source, leaked internal documentation, NDA material, or decompiled internal Revit implementation code beyond public symbol exports.Breaking changes
None to the API. Two output changes a consumer may notice, both intended:
IFCSPACEgoes 18 → 116 on Revit 2024 project files where the records decode. Earlier releases and files with no decodable element record keep the string-derived rooms unchanged (verified on the 2023 Einhoven sample).IfcSpace.LongNamenow carries the room's Revit name instead of repeating the elementName, for rooms that recovered one.Output samples
Before (
main):After:
Revit's own export of the same two rooms, for comparison — same
LongName, same body:Note on the report number
RE-28was taken by the wall-type lane (#273) while this branch was in flight, so the room work is renumbered RE-29 throughout. The merge commit resolves one conflict — both lanes appended a corpus gate to the end oftests/iter_elements_typed.rs— by keeping both.Related issues
Refs #90 #219
Note
Medium Risk
Large IFC export semantic change (space count, LongName mapping, storey binding) driven by new Revit 2024–only binary parameter framing; scope is fail-closed and corpus-gated but affects consumers comparing exports.
Overview
Revit 2024 rooms are decoded from
OST_Roomspartition element records instead of partition string scans, raisingIFCSPACEfrom 18 to 116 on Core Interior with ids, names, numbers, storeys, and record bounding-box geometry aligned to Revit’s reference export.The PR adds
partition_room_parameters(owner-anchored parameter blocks for number, name, and Level), wiresrooms_from_partition_category_recordsinto partition MVP recovery (string-derived rooms only when records do not decode), and exportsRoomNumber/RoomNamewithIfcSpace.LongNameset from the recovered name. Room bodies use the element-record bbox (RE-26 newest-frame tie-break); boundary polygons remain unrecovered (ProfileResolvedfalse).Storey containment moves 853 → 969 of 970 building elements;
partial_element_geometryis removed from diagnostics because every emitted element now has a body. Manifests, witness OctetProof (entity_counts.IFCSPACEon claimed surface), docs, andcore_interior_2024_room_instances_names_and_envelopesgate the new behavior.Reviewed by Cursor Bugbot for commit 98d1982. Configure here.