Repository navigation
docs: point the protocol, status page, and spec (1.0.1) at the octetproof umbrella repository - #207
Merged
Merged
Conversation
…roof umbrella repository
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_cb99d183-6f1c-488e-b91a-8059142ee1ae) |
DrunkOnJava
added a commit
that referenced
this pull request
Aug 30, 2026
…on PredefinedType (#236) Two conformance fixes to the IFC4 writer, both measured against Revit's own export of the same project. Corpus: `.rvt` sha256 `c805df445d613b408e37337765572021265e3f5dfdc7d1fa53b22ba1600b8014`, slim IFC sha256 `bfdf36ffb0bb768f3409d818403990e64d4c262c6780603be87f8077387ad86d`. ## #232 — every element was placed twice The writer emitted the element's own `IfcAxis2Placement3D` in **both** the `IfcLocalPlacement`'s `RelativePlacement` and the swept solid's `Position`. IFC4 has a conforming consumer compose `ObjectPlacement × Position`, so the element translation was applied twice. Viewers that ignore `Position` drew the file correctly, which is exactly why it shipped on every release: two tools could disagree about the same bytes with neither of them misreading. ### The Position decision, and the export's evidence Read with IfcOpenShell 0.8.5 on `2024_Core_Interior_slim.ifc`, Revit's own exporter is consistent about one thing — **the element translation appears exactly once** — and splits it two different ways depending on the frame the profile is authored in: | Revit entity | `ObjectPlacement.RelativePlacement.Location` | `IfcExtrudedAreaSolid.Position.Location` | |---|---|---| | `IfcWall` #2240 (`SweptSolid` body) | `(48.0, 57.667, 0.0)` | `(0.0, 0.0, 0.0)` — identity | | `IfcSlab` #1590 | `(0.0, 0.0, 0.0)` — identity | `(90.444, 71.185, -0.167)` | | `IfcSlab` #1619 | `(0.0, 0.0, 0.0)` — identity | `(93.5, 69.5, 0.0)` | | `IfcSpace` #186 | `(0.0, 0.0, 0.0)` — identity | `(51.694, 69.556, 0.0)` | Never both. Revit's walls put the location in the placement and leave `Position` at identity because the wall profile is authored in the element-local frame; its slabs and spaces do the mirror image because those profiles are authored in storey coordinates. rvt-rs authors **every** profile in the element-local frame — the rectangle always did, and the plan profile recovered in #231 uses the same frame — and it already carries the location on the element's own `IfcLocalPlacement`. So the correct half of Revit's own convention is the `IfcWall` row: **`Position` becomes the project-level identity placement**, and the placement carries the translation once. That is what this PR does. No entity is added or removed — the per-element axis is still emitted, the solid just stops pointing at it. The representation-map path is deliberately left alone, with a comment saying why: a mapped item resolves as `MappingTarget × MappingOrigin⁻¹ × geometry`, so a `Position` equal to the `MappingOrigin` cancels against the inverse instead of compounding, and `origin_feet` is `[0,0,0]` on every map rvt-rs builds today anyway. ### World-coordinate verification IfcOpenShell geometry iterator, `use-world-coords`, matched by `Tag` against the Revit export, deltas in feet. **BEFORE** | Class | shared Tags | max centroid delta | max min-vertex delta | Tags within 1e-3 ft | |---|---:|---:|---:|---:| | IfcColumn | 256 | 166.0000 ft | 166.0000 ft | 0/256 | | IfcSlab | 80 | 185.3333 ft | 185.3333 ft | 0/80 | | IfcWall | 360 | 170.2500 ft | 166.2500 ft | 0/360 | | IfcDoor | 132 | 166.0748 ft | 166.0000 ft | 0/132 | | IfcWindow | 6 | 157.1805 ft | 155.7300 ft | 0/6 | | Class | Tag | rvt-rs world centroid (ft) | Revit world centroid (ft) | delta (ft) | |---|---|---|---|---| | IfcColumn | 20375 | (48.0000, 220.0000, 159.1667) | (23.8750, 110.0000, 81.5833) | (24.1250, 110.0000, 77.5833) | | IfcColumn | 20376 | (98.0000, 220.0000, 159.1667) | (49.1250, 110.0000, 81.5833) | (48.8750, 110.0000, 77.5833) | | IfcSlab | 20311 | (181.3000, 139.0000, 151.7500) | (88.3000, 69.5000, 75.9167) | (93.0000, 69.5000, 75.8333) | | IfcSlab | 20345 | (187.0000, 139.0000, 151.7500) | (93.5000, 69.5000, 75.9167) | (93.5000, 69.5000, 75.8333) | | IfcWall | 20796 | (122.7500, 162.0000, 159.5000) | (60.1042, 81.0000, 81.7500) | (62.6458, 81.0000, 77.7500) | | IfcWall | 20797 | (96.0000, 138.7500, 159.5000) | (48.0000, 69.1667, 83.5000) | (48.0000, 69.5833, 76.0000) | | IfcDoor | 20810 | (194.0874, 118.9189, 156.1247) | (97.0437, 58.0499, 80.0499) | (97.0437, 60.8689, 76.0748) | | IfcWindow | 20898 | (65.4902, 172.2757, 165.9056) | (30.8441, 86.1378, 83.7251) | (34.6460, 86.1378, 82.1805) | The doubling reads straight off the table: the rvt-rs value is 2× Revit's wherever the element's own frame is the whole story — slab 20345 at `(187.0, 139.0)` against `(93.5, 69.5)`, column 20375 at `220.0` against `110.0`. **AFTER** | Class | shared Tags | max centroid delta | max min-vertex delta | Tags within 1e-3 ft | |---|---:|---:|---:|---:| | IfcColumn | 256 | 1.5833 ft | 0.3333 ft | 107/256 | | IfcSlab | 80 | 0.2083 ft | **0.0000 ft** | 79/80 | | IfcWall | 360 | 2.5336 ft | 0.7500 ft | 78/360 | | IfcDoor | 132 | 1.5095 ft | 3.0022 ft | 0/132 | | IfcWindow | 6 | 1.9010 ft | 0.8012 ft | 0/6 | | Class | Tag | rvt-rs world centroid (ft) | Revit world centroid (ft) | delta (ft) | |---|---|---|---|---| | IfcColumn | 20375 | (24.0000, 110.0000, 83.1667) | (23.8750, 110.0000, 81.5833) | (0.1250, -0.0000, 1.5833) | | IfcColumn | 20376 | (49.0000, 110.0000, 83.1667) | (49.1250, 110.0000, 81.5833) | (-0.1250, 0.0000, 1.5833) | | IfcSlab | 20311 | (88.3000, 69.5000, 75.9167) | (88.3000, 69.5000, 75.9167) | (-0.0000, 0.0000, 0.0000) | | IfcSlab | 20345 | (93.5000, 69.5000, 75.9167) | (93.5000, 69.5000, 75.9167) | (-0.0000, 0.0000, 0.0000) | | IfcWall | 20796 | (60.1875, 81.0000, 81.8123) | (60.1042, 81.0000, 81.7500) | (0.0833, 0.0000, 0.0623) | | IfcWall | 20797 | (48.0000, 69.3750, 83.5000) | (48.0000, 69.1667, 83.5000) | (0.0000, 0.2083, 0.0000) | | IfcDoor | 20810 | (97.0437, 59.4594, 80.1247) | (97.0437, 58.0499, 80.0499) | (-0.0000, 1.4095, 0.0748) | | IfcWindow | 20898 | (32.7451, 86.1378, 85.1756) | (30.8441, 86.1378, 83.7251) | (1.9010, -0.0000, 1.4505) | **All 80 slabs now agree with Revit's export on every world-space vertex to 0.0000 ft.** That is the class where rvt-rs recovers a real plan profile (#231), so it is the class where a placement fix can be checked at full precision, and it is exact. The residuals that remain elsewhere are **geometry recovery fidelity, not placement composition**, and each is an existing tracked gap: columns sit 0.125 ft off in plan and 1.58 ft off in Z (insertion point and base elevation), walls up to 2.53 ft on location-curve-derived bodies, and doors and windows carry the record's bounding-box envelope rather than a panel (#86, #82). None of them scales with the element's distance from the origin any more, which is the signature the doubling had. ### The gate `tools/ci/ifc_schema_arity.py` closes the class two ways, both fail-closed: 1. **Structural invariant, every file, every product** — a swept solid's `Position` may not be the very `IfcAxis2Placement3D` instance its product's `IfcLocalPlacement` already uses as `RelativePlacement`. Run against the pre-fix export it produces 992 findings, first one: `#216 IfcColumn reuses #207 as both its ObjectPlacement's RelativePlacement and its IfcExtrudedAreaSolid.Position`. 2. **Pinned composition** — for five elements the gate computes `ObjectPlacement × Position × first-profile-point` explicitly (`ifcopenshell.util.placement`, no geometry kernel) and compares against a pinned coordinate at 1e-6. Two are in `synthetic-project.ifc`, one in `synthetic-structural.ifc` and two are the recorded artifact's column `20375` and slab `20345`, so the probe fires in the fixture-only CI step *and* on the real export. A file that does not hold the Tag skips the probe rather than failing. ## #220 — PredefinedType follows the authoring witness The issue's suggested rule is adopted: where a recorded edge shows the witness's choice, take it. Agreement with the export is what the OctetProof verdicts score, and a value the witness demonstrably wrote is a recorded observation, not an invention. ### Per-type agreement, measured with IfcOpenShell | Entity | Revit's export writes | rvt-rs before | rvt-rs after | rvt-rs count | agreement | |---|---|---|---|---:|---| | IfcWall | `.NOTDEFINED.` ×360 | `.STANDARD.` | `.NOTDEFINED.` | 360 | 360/360 exact | | IfcSpace | `.SPACE.` ×116 | `.INTERNAL.` | `.SPACE.` | 18 | 18/18 exact (recall gap tracked separately) | | IfcDoor | `.DOOR.` ×132 | `$` | `.DOOR.` | 132 | 132/132 exact | | IfcWindow | `.WINDOW.` ×6 | `$` | `.WINDOW.` | 6 | 6/6 exact | | IfcColumn | `.COLUMN.` ×256 | `.COLUMN.` | `.COLUMN.` | 256 | 256/256 exact (unchanged) | | IfcSlab | `.FLOOR.` ×78, `.ROOF.` ×2 | `.FLOOR.` | `.FLOOR.` | 80 | inside the witness's value set (unchanged) | | IfcShadingDevice | `.NOTDEFINED.` ×20 | `$` | `$` | 20 | **not changed — see #235** | `Area`, `Space` and `GenericModel` keep `$`: no recorded edge shows what the witness does with those Revit classes, and inventing a value is the thing this table exists to avoid. `IfcSlab` keeps `.FLOOR.` for all 80 because splitting floors from roofs is a per-element decode, not a mapping default; the gate accepts `{FLOOR, ROOF}` for that type. `IfcShadingDevice` is the one row the witness rule reaches that this PR does not change — `category_map.rs` carries an explicit prior decision for it ("`$`, not an invented `.NOTDEFINED.`"), and flipping a written-down decision deserves its own verdict rather than riding along here. Filed as **#235**. ### No new observation surface class `PredefinedType` is an attribute value; the observation payload counts entity **type names** plus relations and storeys. Both changes are therefore invisible to the observation hash, which was confirmed rather than assumed — see below. So instead of widening the surface, the agreement check went into the arity gate as `--witness-agreement`, run on the recorded artifact in CI: ``` PredefinedType agrees with the witness: IfcColumn.COLUMN=256, IfcDoor.DOOR=132, IfcSlab.FLOOR=80, IfcSpace.SPACE=18, IfcWall.NOTDEFINED=360, IfcWindow.WINDOW=6 ``` `IfcDoor` and `IfcWindow` also joined `PREDEFINED_TYPE_REQUIRED`, since every `category_map` row for them now supplies a value. ## Observations did not move Regenerated all three witnesses on both recorded edges and diffed against the committed files: | Edge | rvt-rs | ifcopenshell | ifc-lite | verdict | |---|---|---|---|---| | `magnetar-2024-core-interior` | byte-identical | byte-identical | byte-identical | PASS, 6 fields, 0 diffs, replay match ×3 | | `magnetar-2024-core-interior-slim` | byte-identical | byte-identical | byte-identical | PASS, 13 fields, 0 diffs, replay match ×3 | **Nothing under `research/witness/` was regenerated, because nothing moved.** Entity counts, relations and storeys are unchanged. ## Fixtures Both committed fixture IFCs are regenerated with their test pins, since the writer change alters them: - `synthetic-project.ifc` — 7 `IFCEXTRUDEDAREASOLID` rows repoint from the element axis to `#14` (the project identity placement), 4 `IFCWALL` move to `.NOTDEFINED.`, the door and two windows gain `.DOOR.` / `.WINDOW.`. - `synthetic-structural.ifc` — 4 `IFCEXTRUDEDAREASOLID` rows repoint to `#14`. Its `predefined_type` values are hardcoded in the test model, not looked up, so they are untouched. `synthetic-project.ifc` also picks up a change it should have carried since #222: it was last dumped at `f4b88df` (#217), before `08f7858` gave `IfcOpeningElement` the `Tag` of the element that fills it, so its one opening still wrote `$` there. Fixtures only regenerate behind `DUMP_IFC=1`, which is how it drifted a commit behind the writer with no test noticing. Two Rust tests moved with the mappings: `lookup_known_class` now expects `.NOTDEFINED.`, and `door_and_window_have_no_predefined_type_by_default` — which asserted the old decision — is rewritten as `door_and_window_follow_the_witness_predefined_type`, with a comment recording why the old reading (type variance belongs on `IfcDoorType`) is defensible and still wrong here: Revit populates both. A new `witness_following_predefined_types` covers all five changed rows. ## Verification run | Gate | Result | |---|---| | `cargo fmt --all` | clean | | `cargo clippy --all-targets -- -D warnings` | clean | | `cargo +1.85.0 check --all-targets` | clean | | `cargo test --profile ci` × 6 named targets, corpus set | 16 passed, 0 failed | | Tier-two decoder gates (#209), 7 targets, corpus set | 40 passed, 0 failed | | `cargo test --profile ci --workspace --all-targets`, corpus set | 152 result blocks, 0 failed | | `tools/ci/ifc_schema_arity.py --witness-agreement` on a fresh export | pass — 20105 instances, 992 solids, 2 pinned probes matched | | Same gate on the pre-fix export | fails, 992 composition findings | | `tools/ci/validate-real-ifc.py` (Einhoven) | pass | | `tools/check-local.sh --ifcopenshell` | all requested gates passed | | OctetProof verdicts, both edges, `--compare-committed` | PASS, replay match on all six observations | ## Follow-ups - **#235** (filed) — `IFCSHADINGDEVICE` emits `$` where Revit writes `.NOTDEFINED.` on all 20; the #220 rule reaches it but a documented prior decision guards it. - Column Z is 1.58 ft off and plan position 0.125 ft off against the export; wall bodies up to 2.53 ft. Both are geometry recovery, now measurable for the first time because the placement no longer swamps them. - Revit splits 80 slabs into 78 `.FLOOR.` + 2 `.ROOF.`; rvt-rs writes `.FLOOR.` for all 80. Closes #232 Closes #220 https://claude.ai/code/session_01BaHKf1Rw5aJBGK5y3xmx7C <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes core IFC geometry placement and attribute emission for all extruded products; mitigated by new fail-closed CI gates and unchanged OctetProof observation hashes per the PR description. > > **Overview** > Fixes two IFC4 writer conformance issues measured against Revit's export of the 2024 Core Interior project. > > **Placement (#232).** Swept solids no longer reuse the element's `IfcAxis2Placement3D` as both `IfcLocalPlacement.RelativePlacement` and `IfcExtrudedAreaSolid.Position`. Translation lives only on the local placement; solid `Position` is the project identity frame so `ObjectPlacement × Position` is not applied twice. The same rule applies to extrusions, openings, and the generic `emit_solid_shape` path (mapped-item geometry is documented as a separate composition case). > > **PredefinedType (#220).** `category_map` now emits witness-aligned values where a recorded edge exists: walls `.NOTDEFINED.`, rooms `.SPACE.`, doors `.DOOR.`, windows `.WINDOW.` (replacing `.STANDARD.`, `.INTERNAL.`, and `$`). Tests and docs/compatibility tables are updated accordingly. > > **CI and gates.** `tools/ci/ifc_schema_arity.py` adds placement-composition checks on every file (no shared placement instance; pinned Tag probes) and optional `--witness-agreement` for the real-project export in CI. Synthetic IFC fixtures are regenerated (solid positions, enum values, opening `Tag` catch-up from #222). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1e78616. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
DrunkOnJava
added a commit
that referenced
this pull request
Aug 31, 2026
…roof umbrella repository (#207)
DrunkOnJava
added a commit
that referenced
this pull request
Aug 31, 2026
…on PredefinedType (#236) Two conformance fixes to the IFC4 writer, both measured against Revit's own export of the same project. Corpus: `.rvt` sha256 `c805df445d613b408e37337765572021265e3f5dfdc7d1fa53b22ba1600b8014`, slim IFC sha256 `bfdf36ffb0bb768f3409d818403990e64d4c262c6780603be87f8077387ad86d`. ## #232 — every element was placed twice The writer emitted the element's own `IfcAxis2Placement3D` in **both** the `IfcLocalPlacement`'s `RelativePlacement` and the swept solid's `Position`. IFC4 has a conforming consumer compose `ObjectPlacement × Position`, so the element translation was applied twice. Viewers that ignore `Position` drew the file correctly, which is exactly why it shipped on every release: two tools could disagree about the same bytes with neither of them misreading. ### The Position decision, and the export's evidence Read with IfcOpenShell 0.8.5 on `2024_Core_Interior_slim.ifc`, Revit's own exporter is consistent about one thing — **the element translation appears exactly once** — and splits it two different ways depending on the frame the profile is authored in: | Revit entity | `ObjectPlacement.RelativePlacement.Location` | `IfcExtrudedAreaSolid.Position.Location` | |---|---|---| | `IfcWall` #2240 (`SweptSolid` body) | `(48.0, 57.667, 0.0)` | `(0.0, 0.0, 0.0)` — identity | | `IfcSlab` #1590 | `(0.0, 0.0, 0.0)` — identity | `(90.444, 71.185, -0.167)` | | `IfcSlab` #1619 | `(0.0, 0.0, 0.0)` — identity | `(93.5, 69.5, 0.0)` | | `IfcSpace` #186 | `(0.0, 0.0, 0.0)` — identity | `(51.694, 69.556, 0.0)` | Never both. Revit's walls put the location in the placement and leave `Position` at identity because the wall profile is authored in the element-local frame; its slabs and spaces do the mirror image because those profiles are authored in storey coordinates. rvt-rs authors **every** profile in the element-local frame — the rectangle always did, and the plan profile recovered in #231 uses the same frame — and it already carries the location on the element's own `IfcLocalPlacement`. So the correct half of Revit's own convention is the `IfcWall` row: **`Position` becomes the project-level identity placement**, and the placement carries the translation once. That is what this PR does. No entity is added or removed — the per-element axis is still emitted, the solid just stops pointing at it. The representation-map path is deliberately left alone, with a comment saying why: a mapped item resolves as `MappingTarget × MappingOrigin⁻¹ × geometry`, so a `Position` equal to the `MappingOrigin` cancels against the inverse instead of compounding, and `origin_feet` is `[0,0,0]` on every map rvt-rs builds today anyway. ### World-coordinate verification IfcOpenShell geometry iterator, `use-world-coords`, matched by `Tag` against the Revit export, deltas in feet. **BEFORE** | Class | shared Tags | max centroid delta | max min-vertex delta | Tags within 1e-3 ft | |---|---:|---:|---:|---:| | IfcColumn | 256 | 166.0000 ft | 166.0000 ft | 0/256 | | IfcSlab | 80 | 185.3333 ft | 185.3333 ft | 0/80 | | IfcWall | 360 | 170.2500 ft | 166.2500 ft | 0/360 | | IfcDoor | 132 | 166.0748 ft | 166.0000 ft | 0/132 | | IfcWindow | 6 | 157.1805 ft | 155.7300 ft | 0/6 | | Class | Tag | rvt-rs world centroid (ft) | Revit world centroid (ft) | delta (ft) | |---|---|---|---|---| | IfcColumn | 20375 | (48.0000, 220.0000, 159.1667) | (23.8750, 110.0000, 81.5833) | (24.1250, 110.0000, 77.5833) | | IfcColumn | 20376 | (98.0000, 220.0000, 159.1667) | (49.1250, 110.0000, 81.5833) | (48.8750, 110.0000, 77.5833) | | IfcSlab | 20311 | (181.3000, 139.0000, 151.7500) | (88.3000, 69.5000, 75.9167) | (93.0000, 69.5000, 75.8333) | | IfcSlab | 20345 | (187.0000, 139.0000, 151.7500) | (93.5000, 69.5000, 75.9167) | (93.5000, 69.5000, 75.8333) | | IfcWall | 20796 | (122.7500, 162.0000, 159.5000) | (60.1042, 81.0000, 81.7500) | (62.6458, 81.0000, 77.7500) | | IfcWall | 20797 | (96.0000, 138.7500, 159.5000) | (48.0000, 69.1667, 83.5000) | (48.0000, 69.5833, 76.0000) | | IfcDoor | 20810 | (194.0874, 118.9189, 156.1247) | (97.0437, 58.0499, 80.0499) | (97.0437, 60.8689, 76.0748) | | IfcWindow | 20898 | (65.4902, 172.2757, 165.9056) | (30.8441, 86.1378, 83.7251) | (34.6460, 86.1378, 82.1805) | The doubling reads straight off the table: the rvt-rs value is 2× Revit's wherever the element's own frame is the whole story — slab 20345 at `(187.0, 139.0)` against `(93.5, 69.5)`, column 20375 at `220.0` against `110.0`. **AFTER** | Class | shared Tags | max centroid delta | max min-vertex delta | Tags within 1e-3 ft | |---|---:|---:|---:|---:| | IfcColumn | 256 | 1.5833 ft | 0.3333 ft | 107/256 | | IfcSlab | 80 | 0.2083 ft | **0.0000 ft** | 79/80 | | IfcWall | 360 | 2.5336 ft | 0.7500 ft | 78/360 | | IfcDoor | 132 | 1.5095 ft | 3.0022 ft | 0/132 | | IfcWindow | 6 | 1.9010 ft | 0.8012 ft | 0/6 | | Class | Tag | rvt-rs world centroid (ft) | Revit world centroid (ft) | delta (ft) | |---|---|---|---|---| | IfcColumn | 20375 | (24.0000, 110.0000, 83.1667) | (23.8750, 110.0000, 81.5833) | (0.1250, -0.0000, 1.5833) | | IfcColumn | 20376 | (49.0000, 110.0000, 83.1667) | (49.1250, 110.0000, 81.5833) | (-0.1250, 0.0000, 1.5833) | | IfcSlab | 20311 | (88.3000, 69.5000, 75.9167) | (88.3000, 69.5000, 75.9167) | (-0.0000, 0.0000, 0.0000) | | IfcSlab | 20345 | (93.5000, 69.5000, 75.9167) | (93.5000, 69.5000, 75.9167) | (-0.0000, 0.0000, 0.0000) | | IfcWall | 20796 | (60.1875, 81.0000, 81.8123) | (60.1042, 81.0000, 81.7500) | (0.0833, 0.0000, 0.0623) | | IfcWall | 20797 | (48.0000, 69.3750, 83.5000) | (48.0000, 69.1667, 83.5000) | (0.0000, 0.2083, 0.0000) | | IfcDoor | 20810 | (97.0437, 59.4594, 80.1247) | (97.0437, 58.0499, 80.0499) | (-0.0000, 1.4095, 0.0748) | | IfcWindow | 20898 | (32.7451, 86.1378, 85.1756) | (30.8441, 86.1378, 83.7251) | (1.9010, -0.0000, 1.4505) | **All 80 slabs now agree with Revit's export on every world-space vertex to 0.0000 ft.** That is the class where rvt-rs recovers a real plan profile (#231), so it is the class where a placement fix can be checked at full precision, and it is exact. The residuals that remain elsewhere are **geometry recovery fidelity, not placement composition**, and each is an existing tracked gap: columns sit 0.125 ft off in plan and 1.58 ft off in Z (insertion point and base elevation), walls up to 2.53 ft on location-curve-derived bodies, and doors and windows carry the record's bounding-box envelope rather than a panel (#86, #82). None of them scales with the element's distance from the origin any more, which is the signature the doubling had. ### The gate `tools/ci/ifc_schema_arity.py` closes the class two ways, both fail-closed: 1. **Structural invariant, every file, every product** — a swept solid's `Position` may not be the very `IfcAxis2Placement3D` instance its product's `IfcLocalPlacement` already uses as `RelativePlacement`. Run against the pre-fix export it produces 992 findings, first one: `#216 IfcColumn reuses #207 as both its ObjectPlacement's RelativePlacement and its IfcExtrudedAreaSolid.Position`. 2. **Pinned composition** — for five elements the gate computes `ObjectPlacement × Position × first-profile-point` explicitly (`ifcopenshell.util.placement`, no geometry kernel) and compares against a pinned coordinate at 1e-6. Two are in `synthetic-project.ifc`, one in `synthetic-structural.ifc` and two are the recorded artifact's column `20375` and slab `20345`, so the probe fires in the fixture-only CI step *and* on the real export. A file that does not hold the Tag skips the probe rather than failing. ## #220 — PredefinedType follows the authoring witness The issue's suggested rule is adopted: where a recorded edge shows the witness's choice, take it. Agreement with the export is what the OctetProof verdicts score, and a value the witness demonstrably wrote is a recorded observation, not an invention. ### Per-type agreement, measured with IfcOpenShell | Entity | Revit's export writes | rvt-rs before | rvt-rs after | rvt-rs count | agreement | |---|---|---|---|---:|---| | IfcWall | `.NOTDEFINED.` ×360 | `.STANDARD.` | `.NOTDEFINED.` | 360 | 360/360 exact | | IfcSpace | `.SPACE.` ×116 | `.INTERNAL.` | `.SPACE.` | 18 | 18/18 exact (recall gap tracked separately) | | IfcDoor | `.DOOR.` ×132 | `$` | `.DOOR.` | 132 | 132/132 exact | | IfcWindow | `.WINDOW.` ×6 | `$` | `.WINDOW.` | 6 | 6/6 exact | | IfcColumn | `.COLUMN.` ×256 | `.COLUMN.` | `.COLUMN.` | 256 | 256/256 exact (unchanged) | | IfcSlab | `.FLOOR.` ×78, `.ROOF.` ×2 | `.FLOOR.` | `.FLOOR.` | 80 | inside the witness's value set (unchanged) | | IfcShadingDevice | `.NOTDEFINED.` ×20 | `$` | `$` | 20 | **not changed — see #235** | `Area`, `Space` and `GenericModel` keep `$`: no recorded edge shows what the witness does with those Revit classes, and inventing a value is the thing this table exists to avoid. `IfcSlab` keeps `.FLOOR.` for all 80 because splitting floors from roofs is a per-element decode, not a mapping default; the gate accepts `{FLOOR, ROOF}` for that type. `IfcShadingDevice` is the one row the witness rule reaches that this PR does not change — `category_map.rs` carries an explicit prior decision for it ("`$`, not an invented `.NOTDEFINED.`"), and flipping a written-down decision deserves its own verdict rather than riding along here. Filed as **#235**. ### No new observation surface class `PredefinedType` is an attribute value; the observation payload counts entity **type names** plus relations and storeys. Both changes are therefore invisible to the observation hash, which was confirmed rather than assumed — see below. So instead of widening the surface, the agreement check went into the arity gate as `--witness-agreement`, run on the recorded artifact in CI: ``` PredefinedType agrees with the witness: IfcColumn.COLUMN=256, IfcDoor.DOOR=132, IfcSlab.FLOOR=80, IfcSpace.SPACE=18, IfcWall.NOTDEFINED=360, IfcWindow.WINDOW=6 ``` `IfcDoor` and `IfcWindow` also joined `PREDEFINED_TYPE_REQUIRED`, since every `category_map` row for them now supplies a value. ## Observations did not move Regenerated all three witnesses on both recorded edges and diffed against the committed files: | Edge | rvt-rs | ifcopenshell | ifc-lite | verdict | |---|---|---|---|---| | `magnetar-2024-core-interior` | byte-identical | byte-identical | byte-identical | PASS, 6 fields, 0 diffs, replay match ×3 | | `magnetar-2024-core-interior-slim` | byte-identical | byte-identical | byte-identical | PASS, 13 fields, 0 diffs, replay match ×3 | **Nothing under `research/witness/` was regenerated, because nothing moved.** Entity counts, relations and storeys are unchanged. ## Fixtures Both committed fixture IFCs are regenerated with their test pins, since the writer change alters them: - `synthetic-project.ifc` — 7 `IFCEXTRUDEDAREASOLID` rows repoint from the element axis to `#14` (the project identity placement), 4 `IFCWALL` move to `.NOTDEFINED.`, the door and two windows gain `.DOOR.` / `.WINDOW.`. - `synthetic-structural.ifc` — 4 `IFCEXTRUDEDAREASOLID` rows repoint to `#14`. Its `predefined_type` values are hardcoded in the test model, not looked up, so they are untouched. `synthetic-project.ifc` also picks up a change it should have carried since #222: it was last dumped at `55491d7` (#217), before `7f00dce` gave `IfcOpeningElement` the `Tag` of the element that fills it, so its one opening still wrote `$` there. Fixtures only regenerate behind `DUMP_IFC=1`, which is how it drifted a commit behind the writer with no test noticing. Two Rust tests moved with the mappings: `lookup_known_class` now expects `.NOTDEFINED.`, and `door_and_window_have_no_predefined_type_by_default` — which asserted the old decision — is rewritten as `door_and_window_follow_the_witness_predefined_type`, with a comment recording why the old reading (type variance belongs on `IfcDoorType`) is defensible and still wrong here: Revit populates both. A new `witness_following_predefined_types` covers all five changed rows. ## Verification run | Gate | Result | |---|---| | `cargo fmt --all` | clean | | `cargo clippy --all-targets -- -D warnings` | clean | | `cargo +1.85.0 check --all-targets` | clean | | `cargo test --profile ci` × 6 named targets, corpus set | 16 passed, 0 failed | | Tier-two decoder gates (#209), 7 targets, corpus set | 40 passed, 0 failed | | `cargo test --profile ci --workspace --all-targets`, corpus set | 152 result blocks, 0 failed | | `tools/ci/ifc_schema_arity.py --witness-agreement` on a fresh export | pass — 20105 instances, 992 solids, 2 pinned probes matched | | Same gate on the pre-fix export | fails, 992 composition findings | | `tools/ci/validate-real-ifc.py` (Einhoven) | pass | | `tools/check-local.sh --ifcopenshell` | all requested gates passed | | OctetProof verdicts, both edges, `--compare-committed` | PASS, replay match on all six observations | ## Follow-ups - **#235** (filed) — `IFCSHADINGDEVICE` emits `$` where Revit writes `.NOTDEFINED.` on all 20; the #220 rule reaches it but a documented prior decision guards it. - Column Z is 1.58 ft off and plan position 0.125 ft off against the export; wall bodies up to 2.53 ft. Both are geometry recovery, now measurable for the first time because the placement no longer swamps them. - Revit splits 80 slabs into 78 `.FLOOR.` + 2 `.ROOF.`; rvt-rs writes `.FLOOR.` for all 80. Closes #232 Closes #220 https://claude.ai/code/session_01BaHKf1Rw5aJBGK5y3xmx7C <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes core IFC geometry placement and attribute emission for all extruded products; mitigated by new fail-closed CI gates and unchanged OctetProof observation hashes per the PR description. > > **Overview** > Fixes two IFC4 writer conformance issues measured against Revit's export of the 2024 Core Interior project. > > **Placement (#232).** Swept solids no longer reuse the element's `IfcAxis2Placement3D` as both `IfcLocalPlacement.RelativePlacement` and `IfcExtrudedAreaSolid.Position`. Translation lives only on the local placement; solid `Position` is the project identity frame so `ObjectPlacement × Position` is not applied twice. The same rule applies to extrusions, openings, and the generic `emit_solid_shape` path (mapped-item geometry is documented as a separate composition case). > > **PredefinedType (#220).** `category_map` now emits witness-aligned values where a recorded edge exists: walls `.NOTDEFINED.`, rooms `.SPACE.`, doors `.DOOR.`, windows `.WINDOW.` (replacing `.STANDARD.`, `.INTERNAL.`, and `$`). Tests and docs/compatibility tables are updated accordingly. > > **CI and gates.** `tools/ci/ifc_schema_arity.py` adds placement-composition checks on every file (no shared placement instance; pinned Tag probes) and optional `--witness-agreement` for the real-project export in CI. Synthetic IFC fixtures are regenerated (solid positions, enum values, opening `Tag` catch-up from #222). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit dff9f2eccb02b3ffe3008181ebbca89253db4970. 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.
Note
Low Risk
Documentation-only clarifications with no schema, gate, or runtime changes.
Overview
Bumps OctetProof to 1.0.1 as a non-semantic patch and updates protocol docs to reflect that the umbrella repo now exists at
DrunkOnJava/octetproof, instead of describing it as planned.docs/octetproof-spec.mdadds the GitHub link in the header and §16.3, documents what the umbrella mirrors (registry, committed observations) and that bridge witnesses run there as separate processes, and adds §19a recording the 1.0.1 rationale.docs/status.mdanddocs/verification-protocol.mdreplace “umbrella not created yet / waits for second edge” with the live repo and clarify division of labor: rvt-rs stays the working copy for decoder-side observations; the umbrella holds the fail-closed gate, corpus layout, and enforcement of registry fields (ci_eligible, coverage, determinism, exact pins) that were previously labeled umbrella-scope pending the second edge. The RVT → DWG edge remains unrecorded, pending a Revit export session.Reviewed by Cursor Bugbot for commit b3cfc32. Configure here.