Repository navigation
feat(elements): cut wall bodies back by their joins and join columns to their family type (#215) (RE-26) - #237
Merged
Conversation
…to their family type (#215) (RE-26) With #232's double translation gone the world-coordinate gap against Revit's own export was finally readable. Measured as a world bounding box rather than a vertex-mean centroid — the centroid is not comparable when one side emits a box and the other a 62-facet mesh — the column "1.58 ft in Z" of #236 is 0.0000 ft: all 256 columns already matched Revit's z extent at both ends. The wall gap was real, and it was two things. An element can be framed by more than one partition record, and the newest frame wins. 171 of 360 walls and 96 of 132 doors carry two frames that disagree about the plan box, because Revit rewrites an edited element into a higher-numbered Partitions stream and leaves the earlier copy in place. The instance selector's tie-break moves from the first (stream, offset) to the last: on the newest frame the box's thin plan extent equals the nominal thickness of the IfcWallType Revit assigns on 360 of 360 walls (201 of 360 on the oldest) and its type slot equals that IfcWallType.Tag on 356 of 360 (183 of 360). Global/ElemTable's u32 at +0x1c is a monotone version counter that ranks the same way over all 976 exported instances. No frame disagrees about the box's z, so nothing can move between storeys. The record box is the untrimmed wall. Every non-zero delta between it and Revit's Axis polyline, across all 720 wall ends, is exactly 0.25, 0.3333 or 0.75 ft — half of the 6", 8" and 18" thicknesses on the file. element_record_wall_joins cuts each end back by half the thickness of the perpendicular recovered wall whose centreline lands on it, spans this wall's centreline and overlaps it in elevation, and declines the element when candidates disagree. Every input is a recorded bounding box. Result, IfcOpenShell 0.8.5 in world coordinates at 1e-3 ft: 336 of 360 walls exact, up from 27; worst 0.75 -> 0.3333 ft, mean 0.2701 -> 0.0220 ft; 309 improve, 35 unchanged, 16 regress. The 31 ends the rule gets wrong are all over-trims inside feature classes that also produce a real trim 125 and 22 times — Revit stores that decision per wall pair, and it is in neither wall's box nor the 4 KiB after its record. #215 is closed. The last slot before a column record's own ElementId in the +0x88 list that is itself an OST_Columns type-symbol record is 5755 on 256 of 256 — the IfcColumnType.Tag Revit writes for every one — and the section that symbol carries is now the profile, behind a fail-closed check that it agrees with the instance envelope to 1e-6 ft. On this file it is the same 2 ft square the envelope had (worst 8.0e-15 ft), so no vertex moves; what changes is that ProfileResolved means the type said so. Entity counts, relations, storeys (15) and storey containment (801 of 872) are unchanged and the diagnostics sidecar is byte-identical. The two committed rvt-rs OctetProof observations were regenerated because the payload counts every emitted entity type and IFCPROPERTYSINGLEVALUE moved 5611 -> 8435 with the new provenance properties; the four bridge-witness observations and both verdict.json files are byte-identical and both verdicts stay PASS. tools/ci/ifc_schema_arity.py gains wall 20800 as a pinned ObjectPlacement x Position x profile-point probe — cut at both ends, so re-emitting the untrimmed box moves it by 0.1016 m, which the gate reports against the pre-change export. Report: reports/element-framing/RE-26-world-coordinate-residuals.md Closes #215 Refs #228 Claude-Session: https://claude.ai/code/session_01BaHKf1Rw5aJBGK5y3xmx7C
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_de19a102-126c-48b5-adfc-aa72380a4a2a) |
This was referenced Aug 30, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Aug 31, 2026
…to their family type (#215) (RE-26) (#237) With #232's double translation gone, the world-coordinate gap between rvt-rs and Revit's own export of the same project was finally small enough to read. #236's follow-up list said *"columns sit 0.125 ft off in plan and 1.58 ft off in Z, walls up to 2.53 ft."* This takes those two apart. One of them was not a geometry gap at all; the other was two real ones, and both are now closed on the majority of walls. Report: `reports/element-framing/RE-26-world-coordinate-residuals.md`. Corpus: `.rvt` sha256 `c805df445d613b408e37337765572021265e3f5dfdc7d1fa53b22ba1600b8014`, slim IFC sha256 `bfdf36ffb0bb768f3409d818403990e64d4c262c6780603be87f8077387ad86d`. ## The metric first #236 scored `max centroid delta`, where the centroid is the mean of the emitted mesh vertices. That is only comparable when both sides tessellate the same way, and they do not: rvt-rs emits a box while Revit emits an `IfcPolygonalFaceSet` for 62 of its 256 columns and 105 of its 360 walls. Everything below scores the **world axis-aligned bounding box**, `max(|Δmin|, |Δmax|)` in feet, matched by `Tag`, IfcOpenShell 0.8.5 geometry iterator with `use-world-coords`. Same geometry, same reader, tessellation-invariant summary. Under it, the column "1.583 ft in Z" is `0.0000 ft`: | IfcColumn 20375 | rvt-rs | Revit | Δ | |---|---|---|---| | world z min (ft) | 76.0000 | 76.0000 | **0.0000** | | world z max (ft) | 90.3333 | 90.3333 | **0.0000** | | vertex-mean z (ft) | 83.1667 | 81.5833 | 1.5833 | ## Hypotheses and what the file answered ### Columns | # | hypothesis | test | verdict | |---|---|---|---| | C1 | the bbox spans a base plate while Revit extrudes between bound levels | record box z vs Revit world z, 256 columns | **rejected** — exact on 256/256, both ends | | C2 | the placement should sit at the box base rather than its centroid | as above | **rejected** — the 1.5833 ft was the vertex-mean artifact | | C3 | the profile is the type symbol's real section, joined via the `+0x88` list | join, then compare sections | **adopted, join exact 256/256** — and it moves no vertex | | C4 | the plan residual is the section being wrong | record plan extents vs Revit's body plan extents | **rejected** — the envelope is 2 × 2 ft on all 256; Revit's *body* is cut inset on 80 | **C3 (#215).** The last slot before a column record's own ElementId in the counted list at `+0x88` that is itself an `OST_Columns` type-symbol record is `5755` (`Column_Sqaure:24" x 24"`) on **256 of 256** — the `IfcColumnType.Tag` Revit's export writes for every one of them. Slots *after* the own id are excluded by measurement, not preference: every column record also carries `75407` there. ```text 20375 refs1 = [3, 4258, 4546, 5755, 20307, 20308, 20375, 20843, 75407] ^^^^ ^^^^^ ^^^^^ type own id a symbol, after self ``` Symbol `5755`'s box is `(-1, -1, -0) → (1, 1, 9)` — and that is the honest result: the section it yields is the rectangle the envelope already had, agreeing to **8.0e-15 ft** on all 256, so **no vertex moves** and the pinned composition probe for 20375 is unchanged to 1e-10. What changes is authority: `ProfileResolved` now means the type said so, behind a fail-closed check that the section and the envelope agree to 1e-6 ft. A round or I-shape family fails that check and keeps the envelope. **C4.** Revit's own column body plan extents: 2.0 × 2.0 on 176, 1.6667 × 1.6667 on 38, 1.75 × 1.6667 on 20, 1.4167 × 1.6667 on 18, 2.0 × 1.6667 on 4. The record envelope is 2 × 2 on **all 256**. The 80 that miss have a body Revit *cuts*; no section produces an inset prism. ### Walls | # | hypothesis | test | verdict | |---|---|---|---| | W1 | one element is framed more than once and the tie-break picks the wrong frame | thickness / type-slot agreement per frame | **adopted** | | W2 | the box is the untrimmed location line and the joins cut it | box ends vs Revit's `Axis` polyline, 720 ends | **adopted** | | W3 | the trimmed endpoints are carried in the record | `f64` search of 4 KiB past all 638 wall records | **rejected** — no fixed carrier | **W1.** 171 of 360 walls carry two frames that disagree about the plan box, because Revit rewrites an edited element into a higher-numbered `Partitions/*` stream and leaves the earlier copy. `20796` in `Partitions/46` has thin extent 0.5000 and names type `17341`; in `Partitions/59` it has 0.6667 and names `17328`. Both are internally consistent — they are two *versions*. | test | oldest frame | newest frame | |---|---:|---:| | thin plan extent equals the nominal thickness of the `IfcWallType` Revit assigns | 201 / 360 | **360 / 360** | | `refs1[1]` equals that `IfcWallType.Tag` | 183 / 360 | **356 / 360** | | world bounding box equals Revit's | 27 / 360 | 39 / 360 | `Global/ElemTable` corroborates from a different stream: the `u32` at `+0x1c` is a monotone version counter that ranks with the newest partition holding a frame, over all 976 exported instances — 19–30 for the 344 framed only in `/46`, 33 for the 18 whose newest is `/51`, 35 for the 12 in `/55`, 36 for the 480 in `/59`. **No frame of any instance disagrees about the box's `z`**, so this cannot move an element between storeys. **W2.** With the right frame, box and body differ only along the run: ```text 20796 box x 47.7500 … 75.0000 Revit Axis x 47.7500 … 74.6667 20797 box y 57.6667 … 81.0000 Revit Axis y 57.6667 … 80.6667 20798 box x 48.0000 … 100.2500 Revit Axis x 48.2500 … 100.2500 20799 box y 58.0000 … 81.3333 Revit Axis y 58.3333 … 81.3333 ``` 20796 ends on 20799's *centreline* and is cut to its near face — half of 20799's 8". 20798's high end is 20806's *far face*, not a centreline, and is left alone. Across all 720 wall ends every non-zero delta is exactly 0.25, 0.3333 or 0.75 ft — half of the 6″, 8″ and 18″ thicknesses on the file — and zero elsewhere. The solver: for each end, find every perpendicular recovered wall whose centreline is exactly this end, whose run spans this wall's centreline and whose elevation overlaps. None → no trim. One thickness → half of it. Disagreeing thicknesses → decline the element. Every input is a recorded bounding box; nothing is fitted. Scored per end: **689 of 720**. The 31 misses are all over-trims, in two feature classes that also produce a real trim 125 and 22 times, so no byte in the record separates them — Revit stores the join decision per wall pair. Not in the box, and not in the 4 KiB after it (W3: the best fixed offset carries an `Axis` endpoint pair 29 times against 360 walls). Variants tried: | variant | bbox-exact | max | mean | |---|---:|---:|---:| | record box, oldest frame (`main`) | 27 / 360 | 0.7500 | 0.2701 | | record box, newest frame | 39 / 360 | 0.7500 | 0.2657 | | + trim, skipping corner candidates | 328 / 360 | 0.3333 | 0.0296 | | **+ trim at every junction (shipped)** | **336 / 360** | **0.3333** | **0.0220** | ## Residuals, before and after World AABB, `max(|Δmin|, |Δmax|)` in feet; "exact" is ≤ 1e-3 ft on both corners. | class | n | exact before | exact after | max before | max after | mean before | mean after | |---|---:|---:|---:|---:|---:|---:|---:| | `IfcWall` | 360 | 27 | **336** | 0.7500 | **0.3333** | 0.2701 | **0.0220** | | `IfcColumn` | 256 | 176 | 176 | 0.5833 | 0.5833 | 0.1217 | 0.1217 | | `IfcSlab` | 80 | 80 | 80 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | | `IfcShadingDevice` | 20 | 20 | 20 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | | `IfcDoor` | 132 | 0 | 0 | 3.0855 | 2.9208 | 2.8938 | 2.9190 | | `IfcWindow` | 6 | 0 | 0 | 4.8228 | 4.8228 | 4.8228 | 4.8228 | | `IfcOpeningElement` | 138 | 0 | 0 | 4.9213 | 4.9213 | 3.0604 | 3.0846 | Per wall: **309 improve, 35 unchanged, 16 regress**; the residual set after is `0.0000` × 336, `0.2500` × 1, `0.3333` × 23. The 16 regressions are the over-trims above, on walls that were accidentally exact untrimmed. They are named in the report and the follow-up, not hidden by a tolerance. **Doors, honestly.** 96 of 132 carry disagreeing frames, so W1 moves them: 24 improve, 72 worsen, 36 unchanged, **0 of 132 exact either way**. No measurement on this file adjudicates it, because a door's record box is not what Revit exports — its body is the panel, its opening is the wall cut, and scored against the export's own opening bodies the two frames are just as far apart (3.0604 vs 3.0846 ft mean, 0 of 138 exact). What *is* unchanged is what doors are gated on: **no door or window record has frames that disagree about the preceding reference**, both give 138 of 138 correct hosts, and the `IfcRelFillsElement` pair set is untouched. ## Nothing that is gated moved | | before | after | |---|---:|---:| | `IFCWALL` / `IFCDOOR` / `IFCWINDOW` / `IFCCOLUMN` / `IFCSLAB` / `IFCSHADINGDEVICE` | 360 / 132 / 6 / 256 / 80 / 20 | unchanged | | `IFCBUILDINGSTOREY` | 15 | 15 | | `storey_bound_elements` | 801 | 801 | | `IFCRELFILLSELEMENT` | 138 | 138 | | entity **types** | 43 | 43 | | `IFCPROPERTYSINGLEVALUE` | 5611 | 8435 | | total instances | 20105 | 22929 | | diagnostics sidecar | — | **byte-identical** | The 2824 new property rows are exactly the new provenance: 360 walls × 5 plus 256 columns × 4. Because the OctetProof observation payload counts every emitted entity type, that one row moves the observation hash, so **the two committed `rvt-rs` observations were regenerated** — `70f8df9d…` → `3c210a6f…`, one line different in each. The four bridge-witness observations and **both `verdict.json` files are byte-identical**; both verdicts stay `PASS` (element fixture 6 fields / 10 excluded, full project 13 fields / 3 excluded, 0 diffs, all three witnesses replaying). ## The gate `tools/ci/ifc_schema_arity.py` gains wall `20800` as a third pinned `ObjectPlacement × Position × profile-point` probe. It is cut at **both** ends, so its first profile point is a trimmed corner — Revit's own world corner for that wall, exactly. Run against the pre-change export the gate reports it: ``` before.ifc: #3076 IfcWall Tag 20800: ObjectPlacement x Position x profile-point = (26.060400, 24.612600, 23.164800), pinned (26.162000, 24.587200, 23.164800), delta 0.1016 > 1e-06 ``` Both halves fire on that one pin: the x is the join trim, the y is the frame's wrong thickness. ## Verification run | Gate | Result | |---|---| | `cargo fmt --all` | clean | | `cargo clippy --all-targets --all-features -- -D warnings` | clean | | `cargo +1.85.0 check --all-targets` | clean | | `cargo test --profile ci --workspace --all-targets`, corpus set | 153 result blocks, 0 failed | | Tier-two corpus + decoder gates, 10 targets, corpus set | 46 passed, 0 failed | | `tools/ci/ifc_schema_arity.py --witness-agreement` on a fresh export | pass — 22929 instances, 43 types, 992 solids, **3** pinned probes matched | | Same gate on the pre-change export | fails on the `20800` pin, delta 0.1016 | | OctetProof verdicts, both edges, `--compare-committed` | PASS, replay match on all six observations | | `tools/check-local.sh --ifcopenshell` | all requested gates passed | New corpus gates: `core_interior_2024_wall_join_trimmed_bodies` (360 of 360 walls resolve, 329 take a trim, wall 20800 walked explicitly) and `core_interior_2024_column_type_symbol_join` (256 of 256 join to 5755). Unit gates in `src/element_record_wall_joins.rs` and `src/partition_element_records.rs`. ## Follow-ups - **The 31 over-trimmed wall ends** (16 walls). Revit's per-pair join decision is not in the wall's box and not in the 4 KiB after its record; finding its carrier is the next question. - **The 80 cut columns.** A section cannot produce an inset prism; what cuts them has to be recovered. - **Doors and windows** still carry the record envelope where Revit exports a panel — 0 of 132 and 0 of 6 exact — and the opening bodies with them (#227). - **The `18" Basement` type slot** names `1851` where the export's `IfcWallType.Tag` is `3897` on all four walls. The thickness is right; the id space is not understood. Refs #228 Closes #215 https://claude.ai/code/session_01BaHKf1Rw5aJBGK5y3xmx7C <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes real-project wall/column IFC geometry and multi-frame instance selection; gated by corpus tests and CI pins, but 16 walls regress from over-trimming and door boxes can shift without a world-exact gate. > > **Overview** > Closes **#215** by improving Revit 2024 partition element-record geometry for walls and columns on the Core Interior corpus, without changing element counts, relations, or storey binding. > > **Partition framing:** When one ElementId appears in multiple partition records, instance selection now keeps the **newest** frame (greatest `(stream, offset)`), not the first — fixing stale wall (and some door) plan boxes after Revit rewrites into higher-numbered `Partitions/*` streams. > > **Walls:** New `element_record_wall_joins` trims each wall’s plan run by half the thickness of perpendicular walls whose centreline meets an end (fail-closed on ambiguous joins). IFC export emits join-trimmed extents, thickness, and provenance (`BodySource`, trim properties). > > **Columns:** Records keep the full `+0x88` reference list; `type_symbol_reference` joins each instance to the last same-category type symbol before its own id, and emission uses that symbol’s section when it matches the envelope within 1e-6 ft (`ProfileResolved` from the type, not a square bbox). > > **Verification:** Corpus/integration tests, support-matrix entries, RE-26 report, CI pin for wall `20800` in `ifc_schema_arity.py`, and regenerated OctetProof `rvt-rs` observations (more `IFCPROPERTYSINGLEVALUE` from provenance; verdicts still PASS). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2e9dc78ef775416584849bdd7bd0454fcc0a9a09. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
16 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Sep 19, 2026
#239) (#274) ## Summary The counted reference list at `+0x88` — the one RE-23 read for a door's host wall and RE-27 read for an element's Level — also names **what the element is joined to**. A wall record names the walls it joins; a column record names the walls that cut it. Reading that takes `IfcColumn` from 176 to **256 of 256** exact against Revit's own export and `IfcWall` from 336 to **351 of 360**, with **0 regressions** on either. Report: `reports/element-framing/RE-29-join-reference-list.md`. ## Motivation RE-26 (#237) closed on three open items and named a carrier for none of them: - **#239** — 80 of 256 columns have bodies inset from their 2 ft prism by 3", 4" or 7". "No section can produce an inset body — what is missing is the cutting element/relation." - **#238** — 31 over-trimmed wall ends on 24 walls. "Revit's per-pair join decision … is stored per wall pair, not in either wall's box", and not in 4 KiB past the record. - **#240** — the 18" Basement wall type slot reads `1851` where the export's `IfcWallType.Tag` is `3897`; "it looks like two id spaces for the same type". All three are about the same bytes. ### #239 — columns: 176 → 256 of 256, exact (Closes) The exported column body is the record prism minus the record prisms of the walls the column names: | | exact | max | mean | |---|---:|---:|---:| | record prism (RE-26) | 176 / 256 | 0.5833 ft | 0.1217 ft | | **prism − named walls** | **256 / 256** | **9.4e-13 ft** | **0.0000 ft** | Zero FP, zero FN, at a residual twelve orders of magnitude under the 1e-3 ft tolerance. The cutters are the walls' **untrimmed** record boxes — substituting the join-trimmed runs scores 190/256, so a wall runs its full recorded length into a column it cuts. `element_record_column_cuts::difference_box` is fail-closed: it answers only when the surviving material fills its own bounding box exactly, by volume. On this file that is true on every column whose box shrinks (80) and false on every column whose box does not (69 interior slots / Ls / crosses), so a decline never emits material Revit removed. The cut plan rectangles reproduce Revit's own body-extent histogram exactly — 176 × (2.0 × 2.0), 38 × (1.6667 × 1.6667), 20 × (1.75 × 1.6667), 18 × (1.4167 × 1.6667), 4 × (2.0 × 1.6667) ft. ### #238 — walls: 689 → 711 of 720 ends, 336 → 351 of 360 bodies (Refs) Two predicates on RE-26's solver, nothing else changed: | rule | ends correct | over-trims | |---|---:|---:| | RE-26 §4.1, geometry only | 689 / 720 | 31 | | + candidate named in the reference list | 703 / 720 | 17 | | **+ reach against the candidate's cut-back run** | **711 / 720** | **9** | The membership predicate removes 14 over-trims and makes none of the 689 wrong: 16 of the 360 walls name no other wall at all, and every one of them is a wall Revit leaves at full length. The reach predicate removes 8 more — a wall cut back at one end no longer covers a centreline past that cut, so it stops cutting there. **The remaining 9 are a measured negative, narrowed.** They are one side of a *true L corner* — two walls whose runs both stop at the other's centreline with nothing continuing past — where Revit cuts exactly one of the pair. Across the two such corners on this file the survivor is the thicker wall once and an equal-thickness wall once, the `x` wall once and the `y` wall once, the higher ElementId once and the lower once, the longer run once and the shorter once; the flag words do not order the two sides the same way either. The solver keeps cutting both rather than guessing, and the residual is pinned by `the_surviving_side_of_a_true_l_corner_is_still_over_trimmed` instead of being hidden. ### #240 — the id-space hypothesis is rejected; the question was answered next door (Refs) #273 (RE-28, wall type records) landed while this branch was in flight and answers #240 with a stronger rule — every exported wall names exactly one wall-**type** record in the same `+0x88` list, 360/360. This PR's §6 is therefore a pointer plus one correction to its own earlier draft: the brute scan behind "wall types are not framed as records at all" only accepts the *element* record shape, which needs the bbox marker at `+0x50`, and type records are bbox-less. What both sides agree on and what #240 asked about: the list is **ascending**, so RE-26's `references[1]` was an index artifact, both ids sit in the same list of the same record, and there is **no second id space and no `1851 -> 3897` indirection to follow**. The corpus gate this branch had added for the basement walls is dropped as redundant with `core_interior_2024_wall_type_record_join`. ## Changes - `src/element_record_column_cuts.rs` (new) — `difference_box` / `column_cut_boxes`, the fail-closed prism subtraction, with a bounded cell sweep and a cutter cap. - `src/element_record_wall_joins.rs` — `joined_walls` plus the membership and reach predicates in `join_trims`. - `src/partition_schema_mvp.rs` — `column_and_wall_records` reads both categories in one partition sweep (the column body now needs the wall boxes), and `column_instances_from_records` applies the cut. - `src/ifc/export_content.rs` — `BodySource` / `ProfileSource` become `partition_element_record_join_cut` on a cut column; `JoinCutWallCount` property. - `src/ifc/mod.rs` — `record_base_elevation_feet` accepts the new body source, so storey containment is unchanged at 853 of 872. - `src/lib.rs` — one module declaration. - `examples/probe_re29_join_carriers.rs` (new) — the probe behind every number. - `tools/re/ifc_world_aabb.py` (new) — dependency-free world-AABB evaluator for the reference side (see Testing). - `tests/iter_elements_typed.rs` — two new corpus gates, two updated. - `research/witness/*/observations/rvt-rs.json` — regenerated, one line each. - `reports/element-framing/RE-29-join-reference-list.md` (new), `ROADMAP.md`. ## Testing - [x] `cargo test --all` passes locally — `tools/check-local.sh` green (fmt, clippy `-D warnings`, rustdoc `-D warnings`, full workspace suite), plus the corpus-enabled run with `RVT_PROJECT_CORPUS_DIR` set: 155 green test binaries, 0 failures. - [x] `cargo clippy --all-targets --all-features -- -D warnings` passes - [x] `cargo fmt --check` passes - [x] New / changed code has unit tests — 13 in `element_record_wall_joins::tests` and 8 in `element_record_column_cuts::tests`, all on synthetic records and written before the rule. They include the two new predicates in isolation (`a_wall_that_names_no_join_partner_is_not_trimmed`, `naming_the_same_two_walls_restores_the_trim`, `a_candidate_cut_back_short_of_the_line_does_not_trim`, `a_cut_the_resolved_line_imposed_does_not_disqualify_the_candidate`), the declines (`a_cut_that_leaves_an_l_is_declined`, `an_interior_slot_leaves_the_prism_alone`, `a_wall_that_swallows_the_column_leaves_nothing_and_declines`) and the residual (`the_surviving_side_of_a_true_l_corner_is_still_over_trimmed`). - [x] `RVT_PROJECT_CORPUS_DIR=… cargo test --profile ci --test project_count_fixtures` passes (both manifests). No manifest number moves. - [x] IFC exporter touched — diff documented below. **Emitted-file diff.** Entity counts, relations, storeys and the diagnostics sidecar are unchanged; the sidecar is byte-identical. `IFCPROPERTYSINGLEVALUE` 9231 → 9311 and total instances 23726 → 23806: exactly the 80 new `JoinCutWallCount` rows, one per cut column. That count is in the OctetProof observation payload, so both committed `rvt-rs` observations were regenerated (`d7821c07…` → `e463f885…`, one line different in each). **The four bridge-witness observations and both `verdict.json` files are byte-identical**, and both verdicts still `PASS` — element fixture 6 fields / 10 excluded, full project 13 fields / 3 excluded, 0 diffs, all three witnesses replaying. All three pinned placement probes of `tools/ci/ifc_schema_arity.py` are unchanged to **0 ft** (`IfcColumn 20375` is a column whose cut is interior and keeps its prism; `IfcWall 20800`'s two trims both survive the new predicates); `--witness-agreement` could not be run locally because IfcOpenShell is not installable here, so CI is the gate for it. **Reference side without IfcOpenShell.** `tools/re/ifc_world_aabb.py` reads world AABBs out of an IFC4 STEP file with no dependencies, and raises rather than shrink a box it cannot evaluate. It is cross-checked against RE-26's published tables on the same export and reproduces all five exactly — the 176/38/20/18/4 column plan-extent histogram, 39/360 untrimmed and 336/360 trimmed wall exactness, 689/720 ends, and the 0.5833/0.1217 ft column residuals. The before/after numbers in this PR were measured by exporting from a pre-change build of this same branch and scoring both files with it. ## Audit-honesty checklist - [x] README / docs reflect the current state — nothing claims a feature not shipped here. - [x] Limitations resolved: RE-26 §9's column-cut item is closed; its wall-join item is narrowed from 31 ends / 24 walls to 9 ends / 9 walls and re-stated as a named feature class. - [x] New limitations documented: RE-29 §4 (the true-L-corner survivor) and §10 (Open). Both module `# Honesty` sections carry the same, including that `column_cut_boxes` answers with a box and declines when the difference is not one, and that "walls cut columns" is the measured direction on this file, not a decoded join priority. - [x] Commit messages describe what changed and why. - [x] No emojis. - [x] No private paths, personal emails, or internal jargon in committed files. - [x] Reverse-engineering finding: reproducible probe at `examples/probe_re29_join_carriers.rs` and a dated report at `reports/element-framing/RE-29-join-reference-list.md`. The `docs/rvt-moat-break-reconnaissance.md` addendum stream ended at 2026-04-19; every element-framing finding since RE-21 lands in `reports/element-framing/` instead, and this follows that precedent (as #273 did). ## Legal and contribution hygiene - [x] Apache-2.0. - [x] **Clean-room declaration:** the changes in this PR are based on §Accepted sources 1 (public byte observations of an MIT-licensed corpus file, `2024_Core_Interior.rvt`) and 4 (the IFC4 / buildingSMART specification, for reading Revit's own reference export). 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. - [x] No new test fixtures; no PII. ## Breaking changes None to the public API in shape: `partition_schema_mvp::column_instances_from_records` gains a `wall_records` parameter, and the `columns_from_records` back-compat alias passes an empty slice, so a caller with no wall records gets exactly today's behaviour. ## Screenshots or output samples World axis-aligned bounding box against Revit's own export, matched by `Tag`, 1e-3 ft: | class | n | exact before | exact after | max before | max after | mean before | mean after | |---|---:|---:|---:|---:|---:|---:|---:| | `IfcWall` | 360 | 336 | **351** | 0.3333 | 0.3333 | 0.0220 | **0.0081** | | `IfcColumn` | 256 | 176 | **256** | 0.5833 | **0.0000** | 0.1217 | **0.0000** | | `IfcSlab` | 80 | 80 | 80 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | | `IfcShadingDevice` | 20 | 20 | 20 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | Per element: 15 walls improve, 345 unchanged, **0 regress**; 80 columns improve, 176 unchanged, **0 regress**. ## Related issues Closes #239. Refs #238 #240 #228. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes core partition geometry for walls and columns and IFC body/provenance fields; behavior is gated by fail-closed box tests and corpus fixtures, but wrong join reads could still skew exported solids on other projects. > > **Overview** > Reads **join partners from the partition element record reference list at `+0x88`**: wall records name other walls that may trim them; column records name walls that subtract from the column prism. That drives tighter IFC geometry on the 2024 partition MVP path. > > **Columns (#239):** New `element_record_column_cuts` subtracts overlapping **untrimmed** wall record boxes from the column prism when the remainder is a full rectangular box (fail-closed for slots/L-shapes). Eighty columns get updated placement/extents; IFC export sets `BodySource` / `ProfileSource` to `partition_element_record_join_cut` and adds `JoinCutWallCount`. > > **Walls (#238):** `join_trims` now requires join candidates to appear in the wall’s reference list and tests candidate reach on each wall’s **cut-back** run (not the raw record span). Walls that name no join partner stay untrimmed. > > **Pipeline:** `partition_schema_mvp` loads `OST_Columns` and `OST_Walls` in one partition sweep so column cuts can use wall boxes. Corpus tests and witness observation hashes update for the extra property rows; RE-29 report, `probe_re29_join_carriers`, and `tools/re/ifc_world_aabb.py` support measurement without IfcOpenShell. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 9e3c175. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With #232's double translation gone, the world-coordinate gap between
rvt-rs and Revit's own export of the same project was finally small
enough to read. #236's follow-up list said "columns sit 0.125 ft off in
plan and 1.58 ft off in Z, walls up to 2.53 ft." This takes those two
apart. One of them was not a geometry gap at all; the other was two real
ones, and both are now closed on the majority of walls.
Report:
reports/element-framing/RE-26-world-coordinate-residuals.md.Corpus:
.rvtsha256c805df445d613b408e37337765572021265e3f5dfdc7d1fa53b22ba1600b8014,slim IFC sha256
bfdf36ffb0bb768f3409d818403990e64d4c262c6780603be87f8077387ad86d.The metric first
#236 scored
max centroid delta, where the centroid is the mean of theemitted mesh vertices. That is only comparable when both sides tessellate
the same way, and they do not: rvt-rs emits a box while Revit emits an
IfcPolygonalFaceSetfor 62 of its 256 columns and 105 of its 360 walls.Everything below scores the world axis-aligned bounding box,
max(|Δmin|, |Δmax|)in feet, matched byTag, IfcOpenShell 0.8.5geometry iterator with
use-world-coords. Same geometry, same reader,tessellation-invariant summary.
Under it, the column "1.583 ft in Z" is
0.0000 ft:Hypotheses and what the file answered
Columns
+0x88listC3 (#215). The last slot before a column record's own ElementId in
the counted list at
+0x88that is itself anOST_Columnstype-symbolrecord is
5755(Column_Sqaure:24" x 24") on 256 of 256 — theIfcColumnType.TagRevit's export writes for every one of them. Slotsafter the own id are excluded by measurement, not preference: every
column record also carries
75407there.Symbol
5755's box is(-1, -1, -0) → (1, 1, 9)— and that is thehonest result: the section it yields is the rectangle the envelope
already had, agreeing to 8.0e-15 ft on all 256, so no vertex
moves and the pinned composition probe for 20375 is unchanged to
1e-10. What changes is authority:
ProfileResolvednow means the typesaid so, behind a fail-closed check that the section and the envelope
agree to 1e-6 ft. A round or I-shape family fails that check and keeps
the envelope.
C4. Revit's own column body plan extents: 2.0 × 2.0 on 176,
1.6667 × 1.6667 on 38, 1.75 × 1.6667 on 20, 1.4167 × 1.6667 on 18,
2.0 × 1.6667 on 4. The record envelope is 2 × 2 on all 256. The 80
that miss have a body Revit cuts; no section produces an inset prism.
Walls
Axispolyline, 720 endsf64search of 4 KiB past all 638 wall recordsW1. 171 of 360 walls carry two frames that disagree about the plan
box, because Revit rewrites an edited element into a higher-numbered
Partitions/*stream and leaves the earlier copy.20796inPartitions/46has thin extent 0.5000 and names type17341; inPartitions/59it has 0.6667 and names17328. Both are internallyconsistent — they are two versions.
IfcWallTypeRevit assignsrefs1[1]equals thatIfcWallType.TagGlobal/ElemTablecorroborates from a different stream: theu32at+0x1cis a monotone version counter that ranks with the newestpartition holding a frame, over all 976 exported instances — 19–30 for
the 344 framed only in
/46, 33 for the 18 whose newest is/51, 35 forthe 12 in
/55, 36 for the 480 in/59. No frame of any instancedisagrees about the box's
z, so this cannot move an element betweenstoreys.
W2. With the right frame, box and body differ only along the run:
20796 ends on 20799's centreline and is cut to its near face — half of
20799's 8". 20798's high end is 20806's far face, not a centreline, and
is left alone. Across all 720 wall ends every non-zero delta is exactly
0.25, 0.3333 or 0.75 ft — half of the 6″, 8″ and 18″ thicknesses on the
file — and zero elsewhere.
The solver: for each end, find every perpendicular recovered wall whose
centreline is exactly this end, whose run spans this wall's centreline
and whose elevation overlaps. None → no trim. One thickness → half of it.
Disagreeing thicknesses → decline the element. Every input is a recorded
bounding box; nothing is fitted.
Scored per end: 689 of 720. The 31 misses are all over-trims, in two
feature classes that also produce a real trim 125 and 22 times, so no
byte in the record separates them — Revit stores the join decision per
wall pair. Not in the box, and not in the 4 KiB after it (W3: the best
fixed offset carries an
Axisendpoint pair 29 times against 360 walls).Variants tried:
main)Residuals, before and after
World AABB,
max(|Δmin|, |Δmax|)in feet; "exact" is ≤ 1e-3 ft on bothcorners.
IfcWallIfcColumnIfcSlabIfcShadingDeviceIfcDoorIfcWindowIfcOpeningElementPer wall: 309 improve, 35 unchanged, 16 regress; the residual set
after is
0.0000× 336,0.2500× 1,0.3333× 23. The 16 regressionsare the over-trims above, on walls that were accidentally exact
untrimmed. They are named in the report and the follow-up, not hidden by
a tolerance.
Doors, honestly. 96 of 132 carry disagreeing frames, so W1 moves
them: 24 improve, 72 worsen, 36 unchanged, 0 of 132 exact either way.
No measurement on this file adjudicates it, because a door's record box
is not what Revit exports — its body is the panel, its opening is the
wall cut, and scored against the export's own opening bodies the two
frames are just as far apart (3.0604 vs 3.0846 ft mean, 0 of 138 exact).
What is unchanged is what doors are gated on: no door or window
record has frames that disagree about the preceding reference, both
give 138 of 138 correct hosts, and the
IfcRelFillsElementpair set isuntouched.
Nothing that is gated moved
IFCWALL/IFCDOOR/IFCWINDOW/IFCCOLUMN/IFCSLAB/IFCSHADINGDEVICEIFCBUILDINGSTOREYstorey_bound_elementsIFCRELFILLSELEMENTIFCPROPERTYSINGLEVALUEThe 2824 new property rows are exactly the new provenance: 360 walls × 5
plus 256 columns × 4. Because the OctetProof observation payload counts
every emitted entity type, that one row moves the observation hash, so
the two committed
rvt-rsobservations were regenerated —70f8df9d…→3c210a6f…, one line different in each. The fourbridge-witness observations and both
verdict.jsonfiles arebyte-identical; both verdicts stay
PASS(element fixture 6 fields /10 excluded, full project 13 fields / 3 excluded, 0 diffs, all three
witnesses replaying).
The gate
tools/ci/ifc_schema_arity.pygains wall20800as a third pinnedObjectPlacement × Position × profile-pointprobe. It is cut at bothends, so its first profile point is a trimmed corner — Revit's own world
corner for that wall, exactly. Run against the pre-change export the gate
reports it:
Both halves fire on that one pin: the x is the join trim, the y is the
frame's wrong thickness.
Verification run
cargo fmt --allcargo clippy --all-targets --all-features -- -D warningscargo +1.85.0 check --all-targetscargo test --profile ci --workspace --all-targets, corpus settools/ci/ifc_schema_arity.py --witness-agreementon a fresh export20800pin, delta 0.1016--compare-committedtools/check-local.sh --ifcopenshellNew corpus gates:
core_interior_2024_wall_join_trimmed_bodies(360 of360 walls resolve, 329 take a trim, wall 20800 walked explicitly) and
core_interior_2024_column_type_symbol_join(256 of 256 join to 5755).Unit gates in
src/element_record_wall_joins.rsandsrc/partition_element_records.rs.Follow-ups
decision is not in the wall's box and not in the 4 KiB after its
record; finding its carrier is the next question.
cuts them has to be recovered.
exports a panel — 0 of 132 and 0 of 6 exact — and the opening bodies
with them (Opening geometry from the symbol's cut loop on releases other than 2024 and 2025: no Revit export of another release's openings is in CI #227).
18" Basementtype slot names1851where the export'sIfcWallType.Tagis3897on all four walls. The thickness is right;the id space is not understood.
Refs #228
Closes #215
https://claude.ai/code/session_01BaHKf1Rw5aJBGK5y3xmx7C
Note
Medium Risk
Changes real-project wall/column IFC geometry and multi-frame instance selection; gated by corpus tests and CI pins, but 16 walls regress from over-trimming and door boxes can shift without a world-exact gate.
Overview
Closes #215 by improving Revit 2024 partition element-record geometry for walls and columns on the Core Interior corpus, without changing element counts, relations, or storey binding.
Partition framing: When one ElementId appears in multiple partition records, instance selection now keeps the newest frame (greatest
(stream, offset)), not the first — fixing stale wall (and some door) plan boxes after Revit rewrites into higher-numberedPartitions/*streams.Walls: New
element_record_wall_joinstrims each wall’s plan run by half the thickness of perpendicular walls whose centreline meets an end (fail-closed on ambiguous joins). IFC export emits join-trimmed extents, thickness, and provenance (BodySource, trim properties).Columns: Records keep the full
+0x88reference list;type_symbol_referencejoins each instance to the last same-category type symbol before its own id, and emission uses that symbol’s section when it matches the envelope within 1e-6 ft (ProfileResolvedfrom the type, not a square bbox).Verification: Corpus/integration tests, support-matrix entries, RE-26 report, CI pin for wall
20800inifc_schema_arity.py, and regenerated OctetProofrvt-rsobservations (moreIFCPROPERTYSINGLEVALUEfrom provenance; verdicts still PASS).Reviewed by Cursor Bugbot for commit 7db12ff. Configure here.