Repository navigation
feat(elements): join every wall to its IfcWallType through the wall type record (#88) (RE-28) - #273
Merged
Merged
Conversation
…ype record (#88) (RE-28) A Revit wall type has a partition record of the bbox-less shape RE-24 found for Levels: the element prologue, `ff ff ff ff ab 05` at +0x50 instead of a bounding box, and a counted u64 slot list at +0x56. Its placement-kind word at +0x42 takes a third value, 0xffff8080, beside the placed-instance and type-symbol values RE-21 recorded. Eight OST_Walls records carry that shape on 2024_Core_Interior.rvt; Revit exports four of them as IfcWallType and never places the other four. Every one of the 360 exported wall instance records names exactly one of the eight in its +0x88 reference list, and it is the IfcWallType.Tag Revit's own export assigns - 360 of 360, no wrong answer, no miss, against 356 of 360 for RE-26's positional references[1] read. That closes RE-26's open 18" Basement question: those walls carry 1851 (category -2009014) at references[1] and 3897 (a wall type record) one slot later, so a set test picks the right one where a position cannot. Measured negatives, reported as negatives: - Compound-layer thicknesses are not near the type record. A 128 KiB span centred on each of the four exported wall types carries 0 runs of consecutive f64 summing to that type's nominal width, and the only exact nominal hits are 0.6667 ft values tens of KiB away that both 6" types lack entirely. - The reference export cannot witness a layer set at all. It is a ReferenceView_V1.2 document with 0 IfcMaterialLayerSet, 0 IfcMaterialLayer and 0 IfcMaterialLayerSetUsage; all 360 IfcWall associate to a single IfcMaterial, and the only compound-layer widths in the file are three dangling IfcQuantityLength rows under IfcSlabType 'Floor:Basement Slab'. #88's thickness criterion has no oracle on this corpus, so no IfcMaterialLayerSet is emitted. - 86 records carry OST_Materials (-2000700) in the same shape - a closed byte-derived set against the string filter's 102 and the export's 10 - but they carry no name. The RE-24 name block resolves 0 of 86, and relaxing its elevation-marker requirement produces 165 blocks that are mostly garbage. The material name lives in a parameter table whose framing is recorded, not decoded. No emitted IFC entity, property or relation changes; tests/fixtures/synthetic-project.ifc is byte-identical and every committed OctetProof observation and verdict is untouched. Refs #88 #34
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_1129eed2-e0f5-4f07-91b9-4c1397bfd678) |
DrunkOnJava
enabled auto-merge (squash)
September 19, 2026 19:56
This was referenced Sep 19, 2026
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 -->
8 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Sep 19, 2026
## Summary Docs-only. PR #261 described the state at that moment; #266, #267/#268, #272, #273 and #274 landed after it and left several pages understating or contradicting what ships. Every number here is re-read from the linked report, the corpus gate, or the count manifest that backs it — nothing is carried over from the PR descriptions. ## Motivation Two pages disagreed with themselves. `docs/user-guide.md` gave both 853 of 872 and 801 of 872 storey containment in adjacent paragraphs, and quoted 336 of 360 walls, which #274 superseded. `docs/status.md` still said the wall-join decision "is in neither wall's box nor in 4 KiB past its record" — #274 found the carrier. Four pages still promised a ~28 second browser decode that #266 cut to about 3 seconds. The audit-honesty rule cuts both ways here: the same pass also had to avoid over-claiming #273, whose wall-type join is exact but emits nothing. ## Changes - **`docs/status.md`** — re-dated the RE-26 wall and column residuals as historical; added RE-29 (wall ends 689 → 711 of 720, bodies 336 → 351 of 360, 15 improved / 345 unchanged / 0 regressed, 9 residual ends at two true L corners; columns 176 → 256 of 256 at a worst residual of 9.4e-13 ft, `difference_box` fail-closed, `IFCPROPERTYSINGLEVALUE` 9231 → 9311) and RE-28 (the `0xffff8080` wall-type record, 360 of 360, distribution 129/127/100/4, #240 as an index artifact) with an explicit **library-side only, nothing emitted** paragraph; recorded #88's no-oracle finding and the 86-record `OST_Materials` bound; new `## Performance` section. - **`docs/user-guide.md`** — deleted the contradictory 801 of 872 paragraph; 336 → 351 of 360 plus the 256 of 256 column cut; added the #272 panel/schedule paragraph and a `### Performance` note; corrected the demo-gallery decode time. - **`README.md`** — the headline paragraph, the gaps table row and the demo-gallery line now carry the RE-27/RE-28/RE-29 state; new `### Performance on large projects`. - **`docs/contribution-map.md`** — the closed-issue list is now twelve issues, not six; the #33 / #219 row reads 853 of 872 and keeps the reference side marked `NOT MEASURED`; new rows for #238, #88, #227, #34 and #90; the closed #32 row is gone. - **`docs/support-matrix.json`** — `reviewed` to 2026-09-19; the walls and columns rows carry the RE-29 measurements and **stay `partial`**; a new `element-record-wall-type-join` row records RE-28 at `partial` with "None yet in the exported file" as its user impact; the instance-recovery and level-record rows no longer read 801 as current. - **`docs/supported-profile.md`** — IFC output and browser viewer rows; the compound-layer and family-profile bullets now name the no-oracle finding and the 9-end residual. - **`docs/ifc-compare.md`** — divergence table updated to the measured state, plus a plain statement that `catalogued_divergence_notes` in `src/ifc/compare.rs` still quotes the pre-#274 figures and still names #219 for slabs and windows. - **`docs/viewer-api.md` / `docs/viewer-build-pipeline.md`** — the #266 throughput and the `DECODE_BYTES_PER_SECOND` basis; the pre-#266 figures are kept but dated; the `build_gltf` `extras` fix and the panel / schedule contract from #272. ## Testing - N/A: docs-only PR — no Rust, viewer, workflow or test file is touched. - `docs/support-matrix.json` re-validated against `docs/schemas/support-matrix.schema.json` (required keys, `additionalProperties`, id pattern, status vocabulary, unique ids) and against the `honesty_invariants` that `tests/support_matrix.rs` enforces: `never_verified_capability_ids`, `max_status_by_capability_id`, and the COR-001 converter-grade rule. All pass; the new row is `partial`. - Every test and function name cited in the new prose was checked to exist: `the_surviving_side_of_a_true_l_corner_is_still_over_trimmed`, `core_interior_2024_column_join_cut_plan_extents`, `core_interior_2024_wall_joins_are_named_in_the_reference_list`, `core_interior_2024_wall_type_record_join`, `core_interior_2024_material_record_family`, `core_interior_2024_wall_join_trimmed_bodies`, `core_interior_2024_column_type_symbol_join`, plus `partition_type_records::{type_definition_ids, unique_type_reference}` and `element_record_column_cuts::{difference_box, column_cut_boxes}`. - `core_interior_2024_wall_join_trimmed_bodies` asserts `resolved == 360` and `trimmed == 322`, which is what the support-matrix evidence string now says. - Every relative link and repo path added resolves on disk. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR — no claims of features that are not actually shipped - [x] Resolved limitations updated: #239 (columns), #240 (the `18" Basement` slot), and the plate / window storey containment #219 tracked - [x] New limitations documented: the 9 true-L-corner ends, and #88 being unwitnessable on this corpus - [x] No emojis, no private paths, no personal email addresses - [x] N/A: no reverse-engineering finding is introduced here — the reports (RE-27, RE-28, RE-29) already shipped with their own PRs **Three claims deliberately not written:** 1. **Nothing about rooms.** `gh pr view 275` reported `OPEN` (checked twice, at the start and just before committing), so the existing space claims are untouched and `IFCSPACE` still reads "name-only, placeholder body" everywhere. 2. **The wall → `IfcWallType` join is never described as shipping in the export.** RE-28 §7 says "Library only. No emitted IFC entity, property or relation changes", and §8 says the join "is not yet a property on the emitted wall". Every mention says so explicitly. 3. **README's "419 MB of linear memory" is left alone.** That is a wasm32 figure from #256. #266 re-measured native peak RSS (490.1 MiB) and the browser decode time, but not wasm linear memory, so there is no measurement to replace it with. Also left as-is, and now flagged in `docs/ifc-compare.md` rather than silently papered over: the note constants in `src/ifc/compare.rs` still say "31 over-trimmed wall ends" and still name #219 for `IFCSLAB` and `IFCWINDOW`. Fixing those is a code change and out of scope for a docs-only PR. ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 - [x] No Autodesk proprietary source, decompiled internals, or NDA'd SDK content - [x] N/A: no new test fixtures ## Breaking changes None. ## Screenshots or output samples N/A: docs-only PR — no UI or IFC output changed. ## Related issues Refs #88, #219, #238, #239, #240, #266, #272, #273, #274. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation and support-matrix metadata only; no Rust, viewer, or export logic changes. > > **Overview** > **Docs-only refresh** so README, status, user guide, contribution map, supported profile, IFC compare notes, viewer docs, and `docs/support-matrix.json` match what landed after #266–#274 — without changing runtime behavior. > > **Capability numbers and gaps** are brought up to date: wall runs trimmed using the record **reference list** (351/360 world-exact, 9 L-corner ends still wrong), **column bodies** as prism minus named cutting walls (256/256), **storey binding** via record Level ids (853/872), and **wall→wall-type** join exact in the library but **not written to IFC** (#88 compound layers marked **no oracle** on the ReferenceView corpus). > > **Performance narrative** is added/updated everywhere it was still ~28s: partition inflate **memoized on `RevitFile`** (#266), Core Interior **~1.7s / ~490 MiB** native and **~3s** browser decode, byte-identical IFC aside from timestamps. > > **Viewer docs** now describe **glTF `extras`** for picking (#272), the typed info panel / schedule / host navigation, and **`DECODE_BYTES_PER_SECOND`** for loading hints. > > **Contribution map & matrix** list twelve closed issues, new remainder rows (#238, #88, #227, …), RE-29 evidence on wall/column rows, and a new **`element-record-wall-type-join`** row at `partial`. **`docs/ifc-compare.md`** documents the measured divergence table and explicitly notes that **`catalogued_divergence_notes` in `src/ifc/compare.rs` still lags** (separate code fix). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d5c32eb. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
14 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Sep 19, 2026
…mes, numbers, storeys and envelopes (#278) ## Summary Revit rooms are carried by the same partition element record every other category uses — `BuiltInCategory` `OST_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-only `IFCSPACE` rows 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 `IFCSPACE` as the largest remaining unbound set. Measured first, the shape on `main` was worse than #90 describes: 18 rows named `Room-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` (sha256 `bfdf36ff…`), Revit's own full-project export. **1. The carrier, measured not assumed.** `probe_re29_room_records` brute-scans every offset of every inflated `Partitions/*` stream, histograms every `BuiltInCategory` across all **23 470** decodable records, and scores each one's instance-rule selection against the 116 room ElementIds the export carries in `IfcSpaceType.Tag` (`IfcSpace` declares no `Tag`, so the id travels one hop through `IfcRelDefinesByType`): | category | records | ids | instance rule selects | TP | FP | FN | |---:|---:|---:|---:|---:|---:|---:| | `-2000160` `OST_Rooms` | 399 | 277 | **116** | **116** | **0** | **0** | | every other category | 23 071 | — | — | — | — | — | No 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: ```text +0x000 u64 owning room ElementId +0x03c u64 owning room ElementId (confirmation; must agree) +0x044 u64 host Level ElementId +0x1f5 u32 number length, UTF-16 units +0x1f9 2*n room Number, UTF-16LE +…+ 8 u32 name length (8 bytes past the number's end) +…+12 2*m room Name, UTF-16LE ``` 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. | | | |---|---:| | rooms accepting the framing | **116 / 116** | | rooms framed twice with no disagreement | **116 / 116** | | recovered name equals `IfcSpace.LongName` | **116 / 116** | | recovered number equals `IfcSpace.Name` | **116 / 116** | | **non-room declared ids accepting the framing** | **0 / 26 309** | Recovery 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: | record chosen per id | plan bbox exact | worst plan Δ | `z` base | `z` top | |---|---:|---:|---:|---:| | first by `(stream, offset)` | 5 / 116 | 0.166667 ft | 116 | 116 | | **newest, per RE-26** | **116 / 116** | **3.730e-12 ft** | **116** | **116** | 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), `z` range 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 base `z` against the storey elevation. ## What stayed negative, and why **The boundary polygon is not in the file.** Four independent tests: 1. **No ordered vertex run.** Every byte offset of every inflated partition, tested as the start of each of the 116 polygons' vertex sequences, cyclically from any vertex, at strides of **2, 3, 4 and 6** doubles, in **both** windings, quantised to 1e-6 ft → longest run **2**, complete **0 / 116**. A **translation-invariant** pass (anchored on an edge *delta*, so a local frame is still found) reaches longest run **3**, complete **0 / 116** — against polygons of 4 to 22 vertices. 2. **Rooms are not sketched.** The 126 distinct `OST_SketchLines` owners RE-25 recovers include **0** rooms. 3. **The record tail holds no coordinates** — 64 doubles of `0.0`, `NaN` sentinels and small words. 4. **The reference list is too short** — `[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. `ProfileResolved` stays `false`; 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.rvt` | | before | after | |---|---:|---:| | `IFCSPACE` | 18 (no id, no body, no storey) | **116** (exact id set) | | building elements | 872 | **970** | | with a recovered body | 854 | **970** | | `storey_bound_elements` | 853 | **969** | | by record Level reference | 372 | **488** | | on the `IfcBuilding` (storey unknown) | 19 | **1** | | `IFCPROPERTYSET` / `IFCRELDEFINESBYPROPERTIES` | 854 | 970 | | total instances | 23 726 | 26 358 | | `IFCWALL` / `IFCDOOR` / `IFCWINDOW` / `IFCCOLUMN` / `IFCSLAB` / `IFCSHADINGDEVICE` / `IFCBUILDINGSTOREY` / `IFCRELFILLSELEMENT` | 360 / 132 / 6 / 256 / 80 / 20 / 15 / 138 | unchanged | | `unsupported_features` | includes `partial_element_geometry` | **gone** | | geometry warnings | `curve=18, missing_level=19, missing_dimensions=18` | `missing_level=1` | `partial_element_geometry` disappearing 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.IFCSPACE` joins 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` / `RoomName` join the record property set. - `src/ifc/step_writer.rs` — `IfcSpace.LongName` is the recovered room name when there is one (the slot Revit uses for it); `Name` keeps the `Room-<ElementId>` identity, because `IfcSpace` declares no `Tag` and the STEP line would otherwise carry no source id. - `src/ifc/compare.rs` — the `IFCSPACE` divergence 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.rs` keeps its structure (two constants and one field read), and `step_writer`'s change is one private function signature with a single call site. ## Testing - [x] `cargo test --all` passes locally - [x] `cargo clippy --all-targets --all-features -- -D warnings` passes - [x] `cargo fmt --check` passes - [x] New / changed code has unit tests — 11 in `src/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) plus `space_long_name_comes_from_the_room_name_property` in `src/ifc/step_writer.rs` - [x] IFC exporter touched: `tests/fixtures/synthetic-project.ifc` is **byte-identical** — the synthetic fixtures emit no space with a `RoomName` property, so the `LongName` branch falls back to the element `Name`, which is what it wrote before - [x] N/A: no new element decoder in the `elements/` sense (the recovery is a record scan, gated by `src/partition_room_parameters.rs::tests` and the corpus gate) - [x] N/A: not a performance change. The room path costs one extra needle search in the existing category sweep plus one owner-anchored pass; end-to-end export on Core Interior is 2.0 s → 2.7 s Commands run: ```bash export PATH="$HOME/.cargo/bin:$PATH" tools/check-local.sh RVT_PROJECT_CORPUS_DIR=<abs>/_project_corpus/Revit \ cargo test --profile ci --test project_count_fixtures RVT_PROJECT_CORPUS_DIR=<abs>/_project_corpus/Revit \ cargo test --profile ci --workspace --all-targets --all-features ``` All green, re-run after `git merge origin/main`. ## Audit-honesty checklist - [x] README / docs reflect the current state — `docs/status.md`, `docs/user-guide.md`, `docs/ifc-compare.md`, `docs/contribution-map.md` and `docs/support-matrix.json` all carry the new numbers, and the stale 801-of-872 / 853-of-872 / "18 name-only spaces" claims are corrected - [x] Limitation resolved: `rooms_spaces` moves `known_gap` → `known` on the full-project manifest at 116 tolerance 0; `partial_element_geometry` is removed from `unsupported_features` because it genuinely no longer fires - [x] New limitation documented: the boundary polygon is a **measured negative**, recorded in RE-29 §4, in the manifest notes, in the support-matrix row and in the corpus gate (which asserts no room claims a plan profile) - [x] Commit messages describe what 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_room_records.rs` and a dated report at `reports/element-framing/RE-29-room-instance-and-envelope.md`. Following the convention of RE-21 through RE-28, the dated addendum lives in `reports/element-framing/` rather than in `docs/rvt-moat-break-reconnaissance.md` **Clean-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 documented `BuiltInCategory` constants, 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: - `IFCSPACE` goes 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.LongName` now carries the room's Revit name instead of repeating the element `Name`, for rooms that recovered one. ## Output samples Before (`main`): ```text #171=IFCSPACE('0rvtrs000000000000002h',#5,'Room-unnamed',$,$,#170,$,'Room-unnamed',.ELEMENT.,.SPACE.,$); ``` After: ```text #180=IFCSPACE('0rvtrs000000000000002q',#5,'Room-20822',$,$,#172,#179,'Stair 2',.ELEMENT.,.SPACE.,$); #191=IFCSPACE('0rvtrs000000000000002$',#5,'Room-20832',$,$,#183,#190,'Tennant Storage Suite 1',.ELEMENT.,.SPACE.,$); ``` Revit's own export of the same two rooms, for comparison — same `LongName`, same body: ```text #186=IFCSPACE('2vrSC4nbr48vzSSOTHS45q',#18,'66',$,$,#177,#185,'Stair 2',.ELEMENT.,.SPACE.,$); #198=IFCSPACE('2vrSC4nbr48vzSSOTHS452',#18,'68',$,$,#189,#197,'Tennant Storage Suite 1',.ELEMENT.,.SPACE.,$); ``` ## Note on the report number `RE-28` was 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 of `tests/iter_elements_typed.rs` — by keeping both. ## Related issues Refs #90 #219 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes real-project IFC export volume and spatial semantics (116 spaces, storey containment, LongName mapping) on a measured but single-file Revit 2024 edge; fail-closed parsing limits blast radius on other releases. > > **Overview** > Replaces **18 name-only `IFCSPACE` rows** (no ElementId, no body, no storey) with **116 record-backed rooms** on Revit 2024 when partition element records decode, matching Revit's export id set on the Core Interior corpus. > > **Decoder path:** Rooms are selected from **`OST_Rooms`** partition records under the existing #211 instance rule. **Number, name, and host Level** come from a new **`partition_room_parameters`** scan (owner-anchored parameter block, same family as RE-22). **Geometry** uses the record bounding box with the RE-26 newest-frame tie-break. **String-derived rooms** from `partition_name_candidates` are dropped whenever record rooms succeed (same pattern as record slabs vs plan-loop floors). > > **IFC output:** **`RoomNumber` / `RoomName`** land in the record property set; **`IfcSpace.LongName`** is the recovered Revit name when present (element **`Name`** stays `Room-<ElementId>`). Storey containment rises **853 → 969 of 970** as the 116 rooms bind via RE-27 Level references; **`partial_element_geometry`** is removed from diagnostics because every emitted building element now has a body. > > **Not in scope:** Room **boundary polygons** remain a documented measured negative (#90 stays open). Docs, witness/OctetProof fixtures, **`probe_re29_room_records`**, RE-29 report, and corpus gates (`core_interior_2024_room_instances_names_and_envelopes`) carry the evidence. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4acddc3. 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.
Summary
Finds the Revit wall type record in the partition streams and uses it to give every exported wall the
IfcWallTypeRevit's own export assigns — 360 of 360, exact, up from RE-26's 356 of 360. Then reports, with numbers, why #88's compound-layer thicknesses do not follow from it: they are not near the record, and this corpus's reference export cannot witness them at all. No layer set is emitted and none is invented.Motivation
#88 (RE-15-08) asks to decode
WallType.CompoundStructure, build oneIfcMaterialLayerSetper WallType, and emitIfcMaterialLayerSetUsage+IfcRelAssociatesMaterialper wall. #34 is the umbrella. Three prior passes on #88 were skipped for want of evidence. This pass goes and gets the evidence, and half of it comes back negative — so half of the issue's acceptance criteria are shown to be unmeetable against2024_Core_Interior.rvtrather than approximated.Report:
reports/element-framing/RE-28-wall-type-records.md.What was proven
A wall type has a partition record of the bbox-less shape RE-24 found for Levels — the element prologue,
ff ff ff ff ab 05at+0x50instead of a bounding box, then a countedu64slot list at+0x56. Its placement-kind word at+0x42takes a third value,0xffff8080, beside the placed-instance0xffffef7fand type-symbol0xffff8000RE-21 recorded.Eight
OST_Wallsrecords carry that shape on this file —1710 1711 3897 11356 17328 17337 17339 17341. Revit exports four of them asIfcWallTypeand never places the other four, so the set is a superset by construction and is not used as anIfcWallTyperecovery on its own. What it is used for is the join:references[1]referencesEvery one of the 360 exported wall instance records names exactly one distinct type-record id — never zero, never two — so the rule needs no tie-break and declines nothing. The recovered distribution equals the export's own
IfcRelDefinesByType: 129 / 127 / 100 / 4.That closes RE-26 §9's open
18" Basementid-space question. Those four walls carryrefs1 = [3, 1851, 3897, 20268, 20273, …]:1851is a record of category −2009014 and is not a wall type,3897is, and a set test picks the right one where a position cannot.What stayed negative, and why
1. The compound layers are not near the type record. A 128 KiB span (±64 KiB) centred on each of the four exported wall-type records, swept for every
f64in(0, 3]ft and every 8-byte-aligned run of consecutive plausiblef64:f64Not one run. And the nine exact-nominal hits are all
0.6666666666666666, the nearest 26301 bytes away, while the two 6" types have no0.5hit anywhere in their span — so they are not the types' own widths either.2. The reference export cannot witness a layer set at all.
2024_Core_Interior_slim.ifcis aViewDefinition [ReferenceView_V1.2]export: 0IFCMATERIALLAYERSET, 0IFCMATERIALLAYER, 0IFCMATERIALLAYERSETUSAGE, against 150IFCMATERIALCONSTITUENTSETand 309IFCMATERIALCONSTITUENT. All 360IFCWALLassociate to a singleIFCMATERIAL(Default Wall×356,Concrete×4), never to a constituent set, so the export does not even say how many layers a wall type has. The only compound-layer widths in the whole file are three danglingIFCQUANTITYLENGTHrows underIFCSLABTYPE 'Floor:Basement Slab'(4" + 14" = 18") that nothing references.So #88's criterion "layer thicknesses round-trip from Revit-bytes within tolerance" has no oracle on this artifact, and its "at least 5 distinct
IfcMaterialLayerSet" would be five entities this file's own author never wrote. Closing #88 needs a layer-set-carrying export of the same.rvt(DesignTransferView / fullQto_WallBaseQuantities) or an owner-supplied wall-type schedule. Until one exists, nothing emits a layer.3. Materials are bounded, not recovered.
OST_Materialsis −2000700, and 86 records carry it in the same bbox-less shape — a closed, byte-derived set against the display-name filter's 102 and the export's 10. But they carry no name: the RE-24 owner/sentinel/UTF-16 name block resolves 0 of 86, and relaxing its elevation-marker requirement produces 165 blocks that are mostly garbage ('ڱ','��ק�') — measured negative, the elevation marker was doing the fail-closed work. The name does live in a parameter table (the owner id appears twice, 58–60 bytes apart, at a variable distance before the string, with 12-byte entries carrying large negativei32parameter ids between), but that framing is recorded, not decoded. The manifest rows stayknown_gap.One material join the bytes do make, recorded as corroboration only: type
3897's slot list leads with3652, anOST_Materialsrecord, and the four walls of type3897are exactly the four Revit associates withConcrete. The other three exported wall types carry no material slot at all while their walls all export asDefault Wall, so there is no rule here yet and none ships.Changes
src/partition_type_records.rs(new) — the record shape, fail-closed at every step (undeclared id, wrong prologue magic, non-zero+0x10, category outside the published band, the element-record marker, a zero / absurd / overrunning slot count, and a slot list that does not name the record's own id all reject), plustype_definition_idsandunique_type_reference, which returnsNonerather than guessing when a list names two different types.src/lib.rs— one module declaration.examples/probe_re28_walltype_layers.rs(new) — the probe behind every number above, in three modes (ids,category,string), with the layer sweep built in so the negative is reproducible.tests/iter_elements_typed.rs— two corpus gates:core_interior_2024_wall_type_record_join(the eight-record set, the 360/360 join, the 129/127/100/4 histogram, and the four basement walls explicitly) andcore_interior_2024_material_record_family(86 records, own-id-in-slots on all 86, and the 3897 → 3652 slot).tests/fixtures/project-counts/2024-core-interior{,-slim}.json— thematerialsnotes record the 86 and the §5/§6 reasons; the slimwallsnote records the join. Statuses and every expected/decoder number are unchanged.reports/element-framing/RE-28-wall-type-records.md(new).Testing
cargo test --allpasses locally —tools/check-local.shgreen (fmt, clippy-D warnings, rustdoc-D warnings, full workspace suite); plus the corpus-enabled run withRVT_PROJECT_CORPUS_DIRset, 155 green test binaries, 0 failures.cargo clippy --all-targets --all-features -- -D warningspassescargo fmt --checkpassespartition_type_records::tests, written before the corpus gates, covering the happy path, the undeclared id, the element-record shape, a slot list missing the own id, an overrunning and an absurd slot count, the category scan skipping element records, and all fiveunique_type_referencebranches.RVT_PROJECT_CORPUS_DIR=… cargo test --profile ci --test project_count_fixturespasses (both manifests).tests/fixtures/synthetic-project.ifcis byte-identical (untouched since feat(ifc)!: bind storeys from the Level ElementId the element record names #267), and every committed OctetProof observation and bothverdict.jsonare byte-identical. Wiring the join onto the emitted wall would add 360IFCPROPERTYSINGLEVALUErows and move both committed witness observation hashes; that is deliberately left to a follow-up so this PR carries no observation churn.elements::class decoder), no performance change.Audit-honesty checklist
18" Basementtype-slot question is closed and the report says so.# Honestysection carries the same.examples/and a dated report atreports/element-framing/RE-28-wall-type-records.md. Thedocs/rvt-moat-break-reconnaissance.mdaddendum stream ended at 2026-04-19; every element-framing finding since RE-21 lands inreports/element-framing/instead, and this follows that precedent.Legal and contribution hygiene
BuiltInCategoryenumeration listings, forOST_Materials = -2000700and the-2009014/-2000576values that are recorded, not relied on), and 4 (the IFC4 / buildingSMART specification, for reading the 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.Breaking changes
None. Additive module plus two new corpus tests; no public API changed, no emitted output changed.
Screenshots or output samples
IFC output did not change. The probe's layer-sweep output is the §4 table above; reproduce with the commands in RE-28 §9.
Related issues
Refs #88 #34
Note
Low Risk
Additive decoder module, tests, and documentation; no export or public API breakage and no change to emitted IFC output.
Overview
Adds
rvt::partition_type_recordsto decode bbox-less partition type records (wall types, materials) with fail-closed validation, plusunique_type_referenceso each exported wall picks the single wall-type id in its reference list — 360/360 on2024_Core_Interior.rvt, fixing RE-26’s positionalreferences[1]misses for18" Basementwalls.Library and research only: no IFC entities, properties, or manifest count changes; the join is not yet emitted on walls. A new
probe_re28_walltype_layersexample and RE-28 report document measured negatives — no compound layer thicknesses near type records, ReferenceView export has no layer-set oracle, and 86OST_Materialsrecords without a name recovery path. Corpus gates and project-count notes capture the join and material bounds.Reviewed by Cursor Bugbot for commit c6aea23. Configure here.