Skip to content

fix(partitions): frames holding the invalid ElementId take their record's id, and separate sketch loops are not voids (RE-43) - #332

Merged
DrunkOnJava merged 1 commit into
mainfrom
fix/invalid-id-second-prologue
Sep 23, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
fix/invalid-id-second-prologue

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two fixes found while checking Snowdon Towers' last missing element.

  1. Some element frames hold u32::MAX at +0x00, the 32-bit form of Revit's invalid ElementId −1, where RE-30's second prologue holds 0 or a value above u32::MAX. They carry no id of their own either, and now take their enclosing partition record's id (RE-35). On Snowdon this recovers stair run 1644693 and 99 sketch lines. Every element of Revit's export, in the entity types rvt-rs writes, is now exported.
  2. A sketch of separate pieces was read as an outer loop plus "voids" lying outside it, which is an invalid IfcArbitraryProfileDefWithVoids with near-zero area (five Snowdon slabs). A loop not inside the outer loop now gives no profile, and the slab keeps its record box.

Motivation

RE-39 left one Snowdon stair flight unexported. Its frame holds the invalid id.

Changes

  • src/partition_element_records.rs:
    • carries_no_element_id (0, u32::MAX or above), used by the first-prologue decode, is_second_prologue_instance and the unattributed counter;
    • a unit test with the Snowdon run's shape.
  • src/element_record_plan_profiles.rs: plan_profile_from_segments requires every inner loop to lie inside the outer one, and returns None otherwise (inside, even-odd rule), with a unit test for two separate rectangles.
  • examples/probe_re43_invalid_id_frames.rs (new), reports/element-framing/RE-43-invalid-element-id.md, the support-matrix row, README, status, CHANGELOG (Fixed) and a reconnaissance addendum.

Measurements (Snowdon Towers Architectural, local only)

before (main) after
exported elements 6,044 6,045
in Revit's export 5,944 5,945
Revit's elements of an exported entity that rvt-rs misses 1 0
IfcStairFlight 42 43 of 43

Placed frames holding u32::MAX, all inside a chain record: on Architectural, 99 sketch lines, 35 lines, 31 railing path extension lines, 7 room separation lines and the run; on Structural, 8 sketch lines; on every licensed file, none.

18 slabs gain their sketched plan profile. Per solid, 16 have exactly Revit's area, one lacks a 0.445 m² void Revit cuts, and one has a different loop (19% over Revit's area; its box was 53% over).

Five slabs sketched as separate pieces keep their record box with ProfileResolved false. Four of them had invalid near-zero-area profiles on main. Revit writes such a slab as one IfcSlab per piece; that is #331.

IfcOpenShell reports no issue on the export. Core Interior, RE1 Architecture and RE1 Electrical export byte-identically apart from timestamps.

Testing

  • tools/check-local.sh
  • Every integration test with the family corpus and the magnetar + RE1 project corpus
  • cargo +1.85.0 check --profile ci --all-targets, cargo +nightly check --manifest-path fuzz/Cargo.toml
  • python -m ifcopenshell.validate on the Snowdon export

Audit-honesty checklist

  • The two slabs whose profile is not Revit's, and the five that fall back to a box, are stated with their areas.
  • Why Revit writes −1 in these frames is stated as unknown.
  • No emojis, no private paths.

Legal and contribution hygiene

  • Apache-2.0
  • Clean-room: byte observations scored against Revit's own IFC export. No SDK source or decompiled material. Snowdon is measured locally and not committed.
  • No PII

Breaking changes

None. carries_no_element_id is a new public function.

Related issues

Refs #331, RE-35, RE-39, RE-25.


Note

Medium Risk
Changes core partition ElementId attribution and slab profile geometry on real exports; behavior is fail-closed with tests but affects which elements and solids are emitted.

Overview
RE-43 extends partition element framing so frames with u32::MAX at +0x00 (Revit's invalid ElementId −1) are treated like other id-less second-prologue frames and inherit the enclosing partition record's ElementId via new carries_no_element_id. That recovers the last missing Snowdon stair run and sketch-line–backed slab profiles; docs and a probe report the Snowdon export bump to 6,045 elements with full Revit-export coverage for written entity types.

Slab plan profiles: plan_profile_from_segments no longer treats disconnected loops as voids inside an outer boundary. Loops outside the largest loop return None, so multi-piece sketches fall back to the record box instead of invalid near-zero-area IfcArbitraryProfileDefWithVoids (#331).

Reviewed by Cursor Bugbot for commit 97f76ba. Configure here.

Edited 2026-11-15: absolute Snowdon Towers figures (positions, elevations, areas) are removed. The Snowdon files measured here have no licence, so only counts, lengths and differences from them are published.

…rd's id, and separate sketch loops are not voids (RE-43)
@cursor

cursor Bot commented Sep 23, 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_047e10e0-5b22-443b-902e-240935739499)

@DrunkOnJava
DrunkOnJava merged commit 0456637 into main Sep 23, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/invalid-id-second-prologue branch September 23, 2026 07:12
DrunkOnJava added a commit that referenced this pull request Nov 15, 2026
…nces, never as positions, elevations, areas or volumes (#2066)

## Summary

The Snowdon Towers files the reports measure on (the `.rvt` and Revit's
IFC4 export from bldrs-ai/test-models, and the VIM edition) carry no
licence, so only counts, lengths and differences from them are
published. A sweep of the tree found absolute Snowdon figures in 28
files. Each is rewritten to the difference or length it stood for, or
dropped. Griffin chose the full cleanup: the repository here, and the
GitHub posts and release notes alongside it.

## Changes

- **Site transform** (rotation, translation, vertical shift):
`docs/reference-models.md`, RE-30, RE-52, RE-78, RE-83, and the export
note in `research/witness-registry.json`.
- **Room areas** (830902; 2181757's floor and sections; a record box):
`CHANGELOG.md`, `docs/status.md`, `docs/rooms.md`,
`docs/format-reconnaissance.md`, RE-374, and the rustdoc of
`ROOM_PRISM_HEIGHT_FEET` and the `stored_solid_edges` source.
- **Elevations and positions**: RE-33, RE-48, RE-49, RE-51, RE-52,
RE-59, RE-100, RE-101 and `probe_re99_shaft_openings`'s module doc.
Where a length or difference carries the point, it is given instead:
76.75 ft tall, 87.7 ft above the floor, 0.754 ft lower, 2.0 ft above it,
180 by 228 ft.
- **Volumes and areas**: a flight's volume (RE-47), a beam's section
area (RE-423, now a ratio of 0.58), and the #331 slab pieces' areas
(`CHANGELOG.md`).
- **Second pass** (`1893090c`, `f4856542`): this one read each table and
paragraph whose heading or neighbour names Snowdon, not only the lines
that do. It found:
  - two rooms' areas (RE-101);
- a door's positions across its wall in internal feet (RE-121, now
measured from the wall's face);
- four roofs' volumes against Revit's (RE-401, now the percentage over);
  - wall 1996082's tops (RE-383, now differences);
  - beam 627866's direction (RE-49, dropped).
  RE-383 and RE-49 are from rvtReview's read.

## Testing

Docs and doc comments only; no output changes.
- `git grep` finds none of the figures left.
- `research/witness-registry.json` still parses, and nothing hashes its
text.
- `tools/ci/api-doc-ids.py` passes.
- The two `src/` files change in `///` comments only, so arm with
`--no-gates "src/ changes are doc comments only; no output moves"`.

Outside the tree, done the same day:
- Ten posts are rewritten the same way, each with a dated edit note: PR
#1587's, #297's, #332's and #336's bodies, issue #331's and #309's
bodies, and comments on #1589, #295, #1165 and #1732.
- Their earlier revisions are being deleted from GitHub's edit history.
- The v0.17.0 release notes are fixed (release notes keep no public
history).

What cannot be withdrawn:
- the git history of `main`, which is not rewritten;
- the rustdoc of crate versions already published to docs.rs;
- notification emails already sent;
- GH Archive's copy of each post as first written.

## Audit-honesty checklist

- [x] No figure that a claim rests on is lost: every agreement is kept
as its difference or tolerance.

## Legal and contribution hygiene

- [x] Apache-2.0. Removes figures measured on unlicensed third-party
files.

## Breaking changes

None.

https://claude.ai/code/session_01TFTgj3Ddfs7cFGMNAgVAut
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