Skip to content

feat(elements): recover 80/80 IFCSLAB and 20/20 IFCSHADINGDEVICE from Revit 2024 partition element records (#212) - #225

Merged
DrunkOnJava merged 1 commit into
mainfrom
feat/slab-instance-rule
Aug 30, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
feat/slab-instance-rule

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Aug 30, 2026 •

Copy link
Copy Markdown
Owner

Closes #212. Refs #31 #218 #219.

RE-21 recorded OST_Floors as the one category where the partition
element-record instance rule fails: 99 selected against 80 exported,
TP 79 / FP 20 / FN 1. Both numbers reproduce exactly. Neither is a decoder
error.

Full evidence, rejected candidates and reproduction commands:
reports/element-framing/RE-22-slab-instance-rule.md.

1. The set difference

The 20 "false positives" are exported. They are, id for id and in order,
the export's 20 IFCSHADINGDEVICE Tag values:

20953, 64160, 64227, 64292, 64358, 64423, 64488, 64553, 64618, 64683,
70366, 71171, 71231, 71291, 71351, 71411, 71471, 71531, 71591, 71651
#3468=IFCSHADINGDEVICE(…,'Floor:Arch Topping Slab - 2":20953',$,
                       'Floor:Arch Topping Slab - 2"',…,'20953',.NOTDEFINED.);

So the instance rule selects 99 ids on OST_Floors and all 99 are
exported
— 79 as IfcSlab, 20 as IfcShadingDevice. Precision was already
100 %; #212 measured a type-assignment gap wearing a precision gap's clothes.

The 1 "false negative" is a building pad. #3526=IFCSLAB(…,'Pad:Site Pad:21975',…,'21975',.FLOOR.). A brute scan of all 23 470 decodable element
records finds ElementId 21975 exactly once, with category = -2001263 —
Autodesk's published BuiltInCategory.OST_BuildingPad. Same prologue shape,
same instance rule, and Revit's exporter maps a building pad to IfcSlab
.FLOOR.. #212 guessed this outcome; the bytes confirm it.

stage count
distinct ids carrying OST_Floors 124
instance rule selects on OST_Floors 99
of those, exported by Revit 99 (79 IfcSlab + 20 IfcShadingDevice)
instance rule selects on OST_BuildingPad 1
exported IFCSLAB recovered 80 / 80
exported IFCSHADINGDEVICE recovered 20 / 20

2. The rule

The IfcSlab / IfcShadingDevice split is decided per instance, not per
type — the reference export carries IFCSLABTYPE and
IFCSHADINGDEVICETYPE rows with the same Tag (4166, 71848), so the same
Revit FloorType lands on both sides. That is Revit's IFC Export As
instance parameter, and its value is in the file as a UTF-16LE string:

-0x11e  u64  owning ElementId (confirmation slot)
-0x0dc  u64  owning ElementId
-0x004  u32  value length in UTF-16 code units (0x10)
+0x000  32B  "IfcShadingDevice", UTF-16LE
+0x020  u64  parameter-definition ElementId (17368, then 17493)

Over a 3 KB window around every one of the 62 hits, the owning ElementId
appears only at those two offsets, always as a u64, always identical in
both slots. Requiring the slots to agree and the id to be declared in
Global/ElemTable accepts 31 entries naming 21 ids; the second string of each
pair is rejected (sentinel owner slots), and so is the parameter definition
block. The 21st id (16925) is a container member the RE-21 rule already
excludes — its superseded twin, same 182.3333 x 121.6111 ft box as 20953.

The rule. A partition element record is an exported slab iff it is a
standalone placed instance (RE-21) in OST_Floors or OST_BuildingPad
and no accepted IFC Export As override names it. An override naming
IfcShadingDevice redirects the entity type rather than suppressing the
element.

The scan is general (any Ifc… value string); only IfcShadingDevice is
honoured as a target (ifc::category_map::EXPORT_OVERRIDE_TARGETS), because
it is the only value a reference export has demonstrated. An unrecognised
value leaves the element on its class mapping.

What was rejected

Two byte fields separate the two sides within OST_Floors on this file and
neither survives contact with the rest of the corpus — both are shipped as
not the rule:

candidate inside OST_Floors why rejected
prologue flags +0x08 0x0119 on all 30 shading records, none of the 91 slab records 32 exported IFCWALL records also carry 0x0119. The word is a count (0xe9 + 8k, tracking +0x88); the separation is a consequence of all 20 shading plates sharing one footprint.
record byte +0x88 8 on all 30 shading records 153 exported IFCWALL and 107 exported IFCCOLUMN records carry 8.
bbox shape all 20 shading plates are exactly 182.3333 x 121.6111 ft shape identity, not a byte test — the same objection #212 raised against #204's footprint key.

3. Measured before / after on 2024_Core_Interior.rvt

metric before after reference export
IFCSLAB 64 (plan-loop annotations, no ids) 80 (exact id set) 80
IFCSHADINGDEVICE 0 20 (exact id set) 20
IFCWALL / IFCDOOR / IFCWINDOW / IFCCOLUMN 360 / 132 / 6 / 256 360 / 132 / 6 / 256 same
building elements 836 872 —
with a recovered body 754 854 —
storey_bound_elements 743 794 —
IFCBUILDINGSTOREY 11 11 15
IFCPROPERTYSET 818 854 0

Exactness verified on the emitted IFC with IfcOpenShell 0.8.5 (Tag sets,
include_subtypes=False), the reference side independently with IFClite
7.1.1:

IfcSlab            export=  80 rvt-rs=  80  missing=0 extra=0 EXACT=YES
IfcShadingDevice   export=  20 rvt-rs=  20  missing=0 extra=0 EXACT=YES
IfcWall            export= 360 rvt-rs= 360  missing=0 extra=0 EXACT=YES
IfcDoor            export= 132 rvt-rs= 132  missing=0 extra=0 EXACT=YES
IfcWindow          export=   6 rvt-rs=   6  missing=0 extra=0 EXACT=YES
IfcColumn          export= 256 rvt-rs= 256  missing=0 extra=0 EXACT=YES

tools/ci/ifc_schema_arity.py on the fresh export: 16 674 instances across 37
entity types, IfcShadingDevice at its declared IFC4 arity of 9 with
PredefinedType written as $ rather than an invented .NOTDEFINED..

4. Thickness (#31)

The record's bbox z extent is the slab's extrusion depth, measured
against the export's IfcExtrudedAreaSolid.Depth:

thickness: exact match 79/80; matches the sum of stacked solids 1; other 0
  layered: 22756 thickness 1.5 vs export solids [0.333333333, 1.166666667] (sum 1.5)

Floor:Basement Slab 22756 is exported as two stacked solids that sum to
exactly the recorded 1.5 ft — agreement in substance on all 80. Record-backed
slabs now carry ThicknessResolved, ThicknessFeet and ThicknessSource,
and floor_slab_extrusion_thickness is raised per slab so the plan-loop path
(2023) still declares it. The slab profile stays the bbox rectangle —
ProfileResolved: false, #31's polygon-profile half is open.

Also changed: where one ElementId is framed more than once (22 of 100 slabs),
the record with the greatest z extent is kept. First-by-(stream, offset) agrees with the export on 67 of 80; greatest-extent on 79 of 80. The
change is uniform and perturbs nothing — 268 walls, 132 doors and 88 columns
also carry multiple records and every one agrees on the box.

5. Storey containment (#219)

The 64 plan-loop IFCSLAB annotations carried no ElementId, no bbox and no
storey. They stand down where records decode — exactly one IFCSLAB per
exported id
, no double emission.

Plates bind by their top face (Revit hangs a floor below its level):

join over the 100 record-backed plates bound agrees with the export wrong
base z equals a recovered storey elevation 0 0 0
top z equals a recovered storey elevation 51 51 0

Exact match, no tolerance, no proximity fallback. storey_bound_elements
743 → 794. #219's 82 unbound becomes 78: 49 plates (was 64), 18 spaces, 5
walls, 6 windows.

6. Storey elevations (#218): measured, and the answer is no

slab record face distinct values equal to a storey elevation not a storey elevation
base z 40 0 40
top z 26 13 13

Slab tops would add −40 ft and 185.5 ft, two of the four storeys #213
misses, at the price of 13 values that are not storeys (each 0.1667 ft
below a real one — the structural-slab / topping interface). Two for thirteen
is not a trade this project takes: ifc::STOREY_ELEVATION_SOURCE_TYPES stays
["IFCCOLUMN"] and the count stays 11. #218 keeps both halves open with the
numbers it asked for.

7. Verdicts

Both OctetProof verdicts PASS, replayed byte-for-byte:

magnetar-2024-core-interior: PASS — witnesses ifc-lite, ifcopenshell, rvt-rs
  surface: 4 fields, excluded: 9, diffs: 0
  replay ifc-lite: match / ifcopenshell: match / rvt-rs: match

magnetar-2024-core-interior-slim: PASS — witnesses ifc-lite, ifcopenshell, rvt-rs
  surface: 10 fields, excluded: 4, diffs: 0
  replay ifc-lite: match / ifcopenshell: match / rvt-rs: match

The full-project claimed surface goes 8 → 10 fields
(entity_counts.IFCSLAB and entity_counts.IFCSHADINGDEVICE join), excluded
5 → 4. floors moves known_gap → known at tolerance 0; a new
shading_devices row scores the 20 the manifest previously left unscored.

8. Gates run

cargo fmt --all, cargo clippy --all-targets -- -D warnings,
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps, cargo +1.85.0 check --all-targets (MSRV), tools/check-local.sh --ifcopenshell (all requested
gates passed), the full cargo test --profile ci suite with
RVT_PROJECT_CORPUS_DIR / RVT_CORPUS_TIER1_DIR set (55 test groups, 0
failures), and the seven tier-2 corpus targets from #209
(elem_table_corpus, arc_wall_corpus, partition_scanner,
iter_elements_typed, re15_geometry_invariants,
re19_door_window_wall_negative, walker_to_ifc_integration) — all green.

New coverage: tests/iter_elements_typed.rs::core_interior_2024_slab_instances_and_export_overrides
pins the 100-instance set, the single BuildingPad, the exact 20-id override
set and the plan-loop stand-down; nine unit tests in
src/partition_ifc_export_overrides.rs cover the framing's fail-closed paths;
plus selection, override-mapping, thickness and top-face-bind unit tests.

9. Docs

docs/status.md, docs/support-matrix.json (scope wording in the RE-21 row's
style — the verified row now names six categories and states the override
carrier, the record-selection rule and the plate bind explicitly),
docs/verification-protocol.md, docs/supported-profile.md,
docs/compatibility.md, docs/user-guide.md, README.md, ROADMAP.md,
TODO.md, CHANGELOG.md, and the viewer's typed-class row.
docs/octetproof-spec.md takes a 1.0.2 patch (non-semantic, §16.1): its
§6.2/§6.3 worked examples quote files this PR changes by design, so they are
now labelled dated snapshots rather than a live mirror of research/witness/.
No schema, diff-function or provenance change.


Note

Medium Risk
Changes partition MVP merge, IFC entity typing, storey binding, and gated witness artifacts on a narrow 2024 path; behaviour is fail-closed and corpus-tested but affects production export output counts and geometry metadata.

Overview
Revit 2024 slab export parity on the Core Interior corpus: 80/80 IFCSLAB and 20/20 IFCSHADINGDEVICE with exact ElementId sets vs Revit’s exporter, replacing 64 id-less plan-loop slab annotations when element records decode.

Recovery extends the RE-21 partition element-record instance rule to OST_Floors and OST_BuildingPad, adds partition_ifc_export_overrides to read per-instance “IFC Export As” strings (honouring only proven IfcShadingDevice redirects), and picks one record per id by greatest bounding-box z extent for thickness. IFC export maps BuildingPad → IFCSLAB, applies overrides in export_content, emits measured slab thickness from record bbox height, and binds slabs/shading devices to storeys by top face (record_top_elevation). Plan-loop floors are cleared when slabs is non-empty to avoid double-counting.

OctetProof / CI fixtures widen the slim verdict surface to IFCSLAB + IFCSHADINGDEVICE, refresh witness observations, and document OctetProof 1.0.2 snapshot wording. Docs, support matrix, viewer status classes, and a research probe_slab_instance_rule example are updated accordingly.

Reviewed by Cursor Bugbot for commit 1271c20. Configure here.

… Revit 2024 partition element records (#212)

RE-21 recorded OST_Floors as the one category where the partition
element-record instance rule fails: 99 selected against 80 exported,
TP 79 / FP 20 / FN 1. Both numbers reproduce; neither is a decoder error.

The 20 "false positives" are the export's 20 IFCSHADINGDEVICE Tag values —
exported elements under a different entity type, so precision was already
100 %. The "false negative" is Pad:Site Pad ElementId 21975, whose record
carries BuiltInCategory OST_BuildingPad (-2001263), not OST_Floors; Revit's
own exporter maps a building pad to IfcSlab .FLOOR.

The IfcSlab / IfcShadingDevice split is decided per instance, not per type —
the export carries IFCSLABTYPE and IFCSHADINGDEVICETYPE rows with the same
Tag (4166, 71848). The deciding value is in the file: a UTF-16LE string in
the element's parameter block with the owning ElementId as a u64 at -0x0dc
and again at -0x11e. Requiring both slots to agree and the id to be declared
in Global/ElemTable accepts 31 entries naming 21 ids; the 20 that are also
standalone placed instances are exactly the export's IFCSHADINGDEVICE set.

Measured on 2024_Core_Interior.rvt against Revit's full export: IFCSLAB
64 -> 80 and IFCSHADINGDEVICE 0 -> 20, both exact ElementId sets at
tolerance 0, verified with IfcOpenShell 0.8.5 and IFClite 7.1.1. The record
bbox z extent is the slab's real extrusion depth (79 of 80 exact against
IfcExtrudedAreaSolid.Depth; the 80th sums two stacked solids), which closes
floor_slab_extrusion_thickness for record-backed slabs. Plates bind to a
storey by their top face, so storey_bound_elements goes 743 -> 794. The 64
plan-loop boundary annotations stand down where records decode.

Slab record elevations are NOT admitted as a storey-elevation source: tops
would add -40 ft and 185.5 ft at the cost of 13 non-storey values, so
STOREY_ELEVATION_SOURCE_TYPES stays IFCCOLUMN and the count stays 11 (#218).

Closes #212. Refs #31 #218 #219.

Claude-Session: https://claude.ai/code/session_01BaHKf1Rw5aJBGK5y3xmx7C
@cursor

cursor Bot commented Aug 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_cbcbc423-889a-4ee5-9bd1-8b7d82a58615)

@DrunkOnJava
DrunkOnJava merged commit dfafbe4 into main Aug 30, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/slab-instance-rule branch August 30, 2026 16:50
DrunkOnJava added a commit that referenced this pull request Aug 30, 2026
…s from OST_SketchLines records (#31) (RE-25) (#231)

RE-22 (#225) recovered all 80 exported `IFCSLAB` by ElementId and closed
the
thickness half of #31, leaving one sentence open: *"The profile is still
the
bbox rectangle, not the recovered floor boundary polygon:
`ProfileResolved`
stays false."* This closes it, exactly, for all 80.

Report: `reports/element-framing/RE-25-slab-plan-profiles.md`.

## Where the profile is not

The plan-loop scanner is a measured dead end. Inventoried over all eight
inflated `Partitions/*` streams with the shipped constants (4–8 points,
span ≥ 5 ft, closure ≤ 0.05 ft): **2317** closed plan-polyline
candidates —
2310 of 4 points, 4 of 5, 3 of 6 — and **zero** with the plan bounds of
any
of the 100 record-backed plates. The perimeter profile needs 26
vertices.
Searching all 187 MiB of inflated partitions for the export's polygon as
a
packed run of `(x, y)` doubles — in the project frame, in the export's
own
profile frame, at strides of 2/3/4/5/6/8 doubles — finds no ordered
vertex
run at all. Revit does not store this boundary as a polyline.

## The join rule, and its evidence

**Each boundary line of a Revit sketch is its own partition element
record.**
`BuiltInCategory` `OST_SketchLines` = **-2000045** (Autodesk's published
constant; the bytes are `53 7b e1 ff ff ff ff ff` in the same signed
`i64`
slot at `+0x12` that RE-21 documented). These decode through the
*unmodified*
RE-21 header — declared ElementId at `+0x00`, `0x059f` at `+0x0c`, the
fixed
bbox marker at `+0x50`, the box at `+0x58` — and the box **is** the
segment:
the boundary line at `x = 136.5, y = 115 … 123` is recorded as
`136.5, 115 – 136.5, 123`, degenerate in `x`.

RE-23 read the *first* counted list at `+0x88`. A **second** list is
framed
identically right after it, and its last slot names the sketched
element:

```text
+0x88  u32    n1 = 5
+0x8c  5×u64  20309, 20310, 20312, 20313, 20315   (sibling sketch lines)
+0xb4  u32    n2 = 2
+0xb8  2×u64  20308, 20311                        ← 20311 is the slab
```

Measured over all 3688 `OST_SketchLines` records on
`2024_Core_Interior.rvt` (`Partitions/46` 3070, `/51` 570, `/55` 48;
3070 distinct ids; **0** frames of one id disagreeing on box or owner):

| owners named by the second list's last slot | count |
|---|---:|
| exported `IFCSLAB` ElementIds | **80 / 80** |
| exported `IFCSHADINGDEVICE` ElementIds | **20 / 20** |
| other elements (walls, the superseded container twin 16925, …) | 26 |
| **distinct owners** | **126** |

**The join is by ElementId only — no geometry, no proximity, no
containment.** A sketch line belongs to the element the byte names, or
to
nothing. Geometric containment was used once, as a check, and is not the
rule: the recovered profile's plan bounds are asserted equal to the
record's
own plan box in the corpus gate.

## Reconstruction: closure, not fitting

A box is not a segment when the segment is diagonal, and 37 of the 1454
plate
segments carry a box *looser* than the line (the top boundary of every
rectangular plate is recorded `20,113 – 167,115` for a line the export
puts
at `y = 114`). Both are resolved by the loop, never by the reference
export:

1. Every segment degenerate on exactly one axis contributes its
endpoints.
2. Every remaining segment is placed only when exactly **one** pair of
still-open vertices fits its box — corner pairs (the box's own
diagonals)
first, and only when no corner pair is open, a pair that spans the box
   lengthwise and is degenerate across it.
3. An ambiguous segment, a vertex that does not finish at degree 2, an
unused
edge, a zero-extent box or a loop under three vertices rejects the
**whole
   element**. There is no partial or best-effort profile.

Collinear vertices are then merged — Revit splits the ring's north-east
run
at `x = 167`, so the raw chain has 27 outer segments where the export
has 26
edges.

## Profile agreement

Recovered profile vs the reference export's `IfcExtrudedAreaSolid` swept
areas (`IFC Exports/2024_Core_Interior_slim.ifc`, sha256 `bfdf36ff…`,
read
with IfcOpenShell 0.8.5), both reduced to the project plan frame,
compared as
cyclic vertex sequences with orientation normalised, tolerance 1e-3 ft
per
vertex:

| slabs | recovered | export swept area | outer verts | voids | segments
| exact | near | miss |
|---:|---|---|---:|---:|---:|---:|---:|---:|
| 42 | outer ring + 1 void | `IfcArbitraryProfileDefWithVoids` | 26 | 1
(4 verts) | 31 | **42** | 0 | 0 |
| 38 | single loop | `IfcArbitraryClosedProfileDef` | 4 | 0 | 4 | **38**
| 0 | 0 |
| **80** | | | | | | **80** | **0** | **0** |

122 loops compared (80 outer + 42 inner). **Worst vertex deviation
1.563e-12 ft** — the recovered vertices are the same doubles as the
export's,
differing only in the floating dust of Revit's own transform
(`177.00000000000011` for a nominal 177 ft, which the record box and the
export's profile carry identically). Re-measured on the emitted IFC
after the
metre round-trip: 0 mismatches, worst deviation **2.842e-14 ft**. No
frame
alignment was needed — the 2024 project frame and the export frame
coincide.

Before this, all 80 were rectangles: accidentally exact on the 38 whose
profile *is* the box, and filling a courtyard on the 42 perimeter rings.

**The 20 exported `IFCSHADINGDEVICE` are declined, with the reason.**
The
same join names all 20; each carries 57 sketch lines — 1 with a
zero-extent
box, 35 axis-parallel, 21 diagonal. The first zero-extent box rejects
them
outright, and the export writes each as a 29-vertex rotated ring
(`0 … 182.3333` by `8.6936 … 130.3064`) with no axis-parallel anchor to
force
a first choice. They keep the record box rectangle and
`ProfileResolved: false`. Five further owners are declined the same way
(16925 — the container-member twin of 20953 already excluded by RE-21 —
plus
31636, 31637, 34362, 55840). Twenty-one non-plate owners do close and
are
recovered but not emitted; nothing here maps them to an IFC entity.

## Verdict outputs — unchanged

```text
magnetar-2024-core-interior: PASS — witnesses ifc-lite, ifcopenshell, rvt-rs
  surface: 6 fields, excluded: 10, diffs: 0
  replay ifc-lite: match / ifcopenshell: match / rvt-rs: match

magnetar-2024-core-interior-slim: PASS — witnesses ifc-lite, ifcopenshell, rvt-rs
  surface: 13 fields, excluded: 3, diffs: 0
  replay ifc-lite: match / ifcopenshell: match / rvt-rs: match
```

Both committed `verdict.json` files are **byte-identical**. The two
committed
`rvt-rs` observations were regenerated because the observation payload
counts
*every* emitted entity type; the four bridge-witness observations are
byte-identical. Building-element counts and the diagnostics sidecar are
unchanged, and the sidecar is byte-identical to `main` (a0044f4):

| entity | before | after |
|---|---:|---:|
| `IFCRECTANGLEPROFILEDEF` | 992 | 912 |
| `IFCARBITRARYCLOSEDPROFILEDEF` | 0 | 38 |
| `IFCARBITRARYPROFILEDEFWITHVOIDS` | 0 | 42 |
| `IFCPOLYLINE` | 0 | 122 |
| `IFCCARTESIANPOINT` | 1847 | 3381 |
| `IFCPROPERTYSINGLEVALUE` | 5371 | 5611 |
| total instances | 18209 | 20105 |
| `IFCSLAB` / `IFCSHADINGDEVICE` / `IFCWALL` / `IFCDOOR` / `IFCWINDOW` /
`IFCCOLUMN` | 80 / 20 / 360 / 132 / 6 / 256 | unchanged |
| `IFCBUILDINGSTOREY` | 15 | 15 |
| `storey_bound_elements` | 801 | 801 |

## Gates run

`cargo fmt --all -- --check`, `cargo clippy --workspace --all-targets
--all-features -- -D warnings`, `RUSTDOCFLAGS=-D warnings cargo doc
--no-deps --lib`, `cargo +1.85.0 check --all-targets` (MSRV, no
let-chains),
`cargo test --workspace --all-targets --all-features` with
`RVT_PROJECT_CORPUS_DIR` + `RVT_CORPUS_TIER1_DIR` (152 test binaries
ok),
the four named targets (`witness_verdict`, `witness_registry`,
`project_count_fixtures`, `support_matrix`), the seven #209 tier-2
targets,
`tools/ci/ifc_schema_arity.py` on a fresh export (20 105 instances
across 43
entity types; `IfcArbitraryClosedProfileDef` at its declared arity of 3,
`IfcArbitraryProfileDefWithVoids` at 4, `IfcPolyline` at 1), and
`tools/check-local.sh --ifcopenshell`.

New gates:
`tests/iter_elements_typed.rs::core_interior_2024_slab_plan_profiles`
(the 100 record-backed plates partition exactly — 80 resolve a profile,
and
the 20 that do not are exactly the export's `IFCSHADINGDEVICE` `Tag`
set;
42 × (26 outer, 1 void), 38 × (4 outer, 0 voids); each profile's plan
bounds
equal the record's own plan box) and 15 unit gates in
`src/element_record_plan_profiles.rs`.

## Support-matrix status

New row `element-record-slab-plan-profile` at **`partial`**, not
`verified`:
the agreement is measured and regression-gated, but profile geometry is
not a
field of either OctetProof claimed surface — no witness compares it — so
it
has not met the two-independent-witnesses bar in
`docs/verification-protocol.md`.

## Follow-ups

- **The 20 shading devices.** Sketch present and joined; only the
closure
declines. Resolving 21 mutually constraining diagonal boxes needs either
a
  second carrier for the segment endpoints or a global search with a
  uniqueness proof.
- **`IfcExtrudedAreaSolid.Position` is the element's own
`IfcAxis2Placement3D`**, which is also the `IfcLocalPlacement`'s
relative
placement, so a consumer composing both applies the element translation
  twice. This predates RE-25 and affects every emitted element on every
  release; the profile is expressed in the same element-local frame the
rectangle profile always used, so nothing regressed. Needs its own
issue.
- **Walls, doors, windows, columns** still carry the record box. Wall
sketches are not `OST_SketchLines`; the 26 non-plate owners here are a
hint
  of what else is sketched, not a claim.
- **#227** is untouched. Note that the perimeter ring's void is
*profile*
geometry, not an opening element, so the 42 slab penetrations #227 asks
for
  are a different set.

Refs #31 #227

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches partition decoding, geometry reconstruction, and IFC STEP
emission for all record-backed slabs; scope is gated to Revit 2024 and
fail-closed closure, but wrong profile logic would change exported solid
geometry without shifting entity counts.
> 
> **Overview**
> **Slab IFC geometry now uses recovered sketch boundaries instead of
bounding-box rectangles** for Revit 2024 partition-backed floors where
sketch lines close unambiguously (#31 / RE-25).
> 
> The change reads **`OST_SketchLines`** element records, joins each
segment to its owner slab via the **last slot of the second reference
list** at `+0x88` (`owner_reference`), and **chains segment bounding
boxes into closed loops** (fail-closed on ambiguity). Those polygons
flow through
**`partition_schema_mvp::slabs_from_partition_category_records`**
(single multi-category partition scan) into decoded fields, then
**`ifc::export_content`** emits **`IfcArbitraryClosedProfileDef`** or
**`IfcArbitraryProfileDefWithVoids`** with **`ProfileResolved: true`**
and related diagnostics. **`scan_category_records_multi`** avoids
re-inflating partitions when floors, pads, and sketch lines are needed
together.
> 
> On the Core Interior corpus this matches **80/80** reference slab
profiles (including courtyard voids); **20 shading devices** still use
the record box because closure rejects their diagonal sketch envelopes.
Docs, support matrix, changelog, corpus tests
(`core_interior_2024_slab_plan_profiles`), a research probe, and witness
**entity-count** observations reflect the richer IFC profile chain while
**building-element counts and OctetProof verdicts stay unchanged**.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
07e0a8a. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
DrunkOnJava added a commit that referenced this pull request Aug 31, 2026
… Revit 2024 partition element records (#212) (#225)

Closes #212. Refs #31 #218 #219.

RE-21 recorded `OST_Floors` as the one category where the partition
element-record instance rule fails: 99 selected against 80 exported,
`TP 79 / FP 20 / FN 1`. Both numbers reproduce exactly. **Neither is a
decoder
error.**

Full evidence, rejected candidates and reproduction commands:

[`reports/element-framing/RE-22-slab-instance-rule.md`](reports/element-framing/RE-22-slab-instance-rule.md).

## 1. The set difference

**The 20 "false positives" are exported.** They are, id for id and in
order,
the export's 20 `IFCSHADINGDEVICE` `Tag` values:

```
20953, 64160, 64227, 64292, 64358, 64423, 64488, 64553, 64618, 64683,
70366, 71171, 71231, 71291, 71351, 71411, 71471, 71531, 71591, 71651
```

```
#3468=IFCSHADINGDEVICE(…,'Floor:Arch Topping Slab - 2":20953',$,
                       'Floor:Arch Topping Slab - 2"',…,'20953',.NOTDEFINED.);
```

So the instance rule selects 99 ids on `OST_Floors` and **all 99 are
exported** — 79 as `IfcSlab`, 20 as `IfcShadingDevice`. Precision was
already
100 %; #212 measured a type-assignment gap wearing a precision gap's
clothes.

**The 1 "false negative" is a building pad.** `#3526=IFCSLAB(…,'Pad:Site
Pad:21975',…,'21975',.FLOOR.)`. A brute scan of all 23 470 decodable
element
records finds ElementId 21975 exactly once, with `category = -2001263` —
Autodesk's published `BuiltInCategory.OST_BuildingPad`. Same prologue
shape,
same instance rule, and Revit's exporter maps a building pad to
`IfcSlab`
`.FLOOR.`. #212 guessed this outcome; the bytes confirm it.

| stage | count |
|---|---:|
| distinct ids carrying `OST_Floors` | 124 |
| instance rule selects on `OST_Floors` | 99 |
| of those, exported by Revit | **99** (79 `IfcSlab` + 20
`IfcShadingDevice`) |
| instance rule selects on `OST_BuildingPad` | 1 |
| exported `IFCSLAB` recovered | **80 / 80** |
| exported `IFCSHADINGDEVICE` recovered | **20 / 20** |

## 2. The rule

The `IfcSlab` / `IfcShadingDevice` split is decided **per instance**,
not per
type — the reference export carries `IFCSLABTYPE` *and*
`IFCSHADINGDEVICETYPE` rows with the same `Tag` (`4166`, `71848`), so
the same
Revit `FloorType` lands on both sides. That is Revit's `IFC Export As`
instance parameter, and its value is in the file as a UTF-16LE string:

```
-0x11e  u64  owning ElementId (confirmation slot)
-0x0dc  u64  owning ElementId
-0x004  u32  value length in UTF-16 code units (0x10)
+0x000  32B  "IfcShadingDevice", UTF-16LE
+0x020  u64  parameter-definition ElementId (17368, then 17493)
```

Over a 3 KB window around every one of the 62 hits, the owning ElementId
appears **only** at those two offsets, always as a `u64`, always
identical in
both slots. Requiring the slots to agree and the id to be declared in
`Global/ElemTable` accepts 31 entries naming 21 ids; the second string
of each
pair is rejected (sentinel owner slots), and so is the parameter
*definition*
block. The 21st id (`16925`) is a container member the RE-21 rule
already
excludes — its superseded twin, same `182.3333 x 121.6111 ft` box as
`20953`.

> **The rule.** A partition element record is an exported slab iff it is
a
> standalone placed instance (RE-21) in `OST_Floors` or
`OST_BuildingPad`
> **and** no accepted `IFC Export As` override names it. An override
naming
> `IfcShadingDevice` redirects the entity type rather than suppressing
the
> element.

The scan is general (any `Ifc…` value string); only `IfcShadingDevice`
is
honoured as a target (`ifc::category_map::EXPORT_OVERRIDE_TARGETS`),
because
it is the only value a reference export has demonstrated. An
unrecognised
value leaves the element on its class mapping.

### What was rejected

Two byte fields separate the two sides *within* `OST_Floors` on this
file and
neither survives contact with the rest of the corpus — both are shipped
as
**not** the rule:

| candidate | inside `OST_Floors` | why rejected |
|---|---|---|
| prologue flags `+0x08` | `0x0119` on all 30 shading records, none of
the 91 slab records | 32 **exported** `IFCWALL` records also carry
`0x0119`. The word is a count (`0xe9 + 8k`, tracking `+0x88`); the
separation is a consequence of all 20 shading plates sharing one
footprint. |
| record byte `+0x88` | `8` on all 30 shading records | 153 exported
`IFCWALL` and 107 exported `IFCCOLUMN` records carry `8`. |
| bbox shape | all 20 shading plates are exactly `182.3333 x 121.6111
ft` | shape identity, not a byte test — the same objection #212 raised
against #204's footprint key. |

## 3. Measured before / after on `2024_Core_Interior.rvt`

| metric | before | after | reference export |
|---|---:|---:|---:|
| `IFCSLAB` | 64 (plan-loop annotations, no ids) | **80** (exact id set)
| 80 |
| `IFCSHADINGDEVICE` | 0 | **20** (exact id set) | 20 |
| `IFCWALL` / `IFCDOOR` / `IFCWINDOW` / `IFCCOLUMN` | 360 / 132 / 6 /
256 | 360 / 132 / 6 / 256 | same |
| building elements | 836 | 872 | — |
| with a recovered body | 754 | 854 | — |
| `storey_bound_elements` | 743 | 794 | — |
| `IFCBUILDINGSTOREY` | 11 | 11 | 15 |
| `IFCPROPERTYSET` | 818 | 854 | 0 |

Exactness verified on the emitted IFC with IfcOpenShell 0.8.5 (`Tag`
sets,
`include_subtypes=False`), the reference side independently with IFClite
7.1.1:

```
IfcSlab            export=  80 rvt-rs=  80  missing=0 extra=0 EXACT=YES
IfcShadingDevice   export=  20 rvt-rs=  20  missing=0 extra=0 EXACT=YES
IfcWall            export= 360 rvt-rs= 360  missing=0 extra=0 EXACT=YES
IfcDoor            export= 132 rvt-rs= 132  missing=0 extra=0 EXACT=YES
IfcWindow          export=   6 rvt-rs=   6  missing=0 extra=0 EXACT=YES
IfcColumn          export= 256 rvt-rs= 256  missing=0 extra=0 EXACT=YES
```

`tools/ci/ifc_schema_arity.py` on the fresh export: 16 674 instances
across 37
entity types, `IfcShadingDevice` at its declared IFC4 arity of 9 with
`PredefinedType` written as `$` rather than an invented `.NOTDEFINED.`.

## 4. Thickness (#31)

The record's bbox `z` extent **is** the slab's extrusion depth, measured
against the export's `IfcExtrudedAreaSolid.Depth`:

```
thickness: exact match 79/80; matches the sum of stacked solids 1; other 0
  layered: 22756 thickness 1.5 vs export solids [0.333333333, 1.166666667] (sum 1.5)
```

`Floor:Basement Slab` 22756 is exported as two stacked solids that sum
to
exactly the recorded 1.5 ft — agreement in substance on all 80.
Record-backed
slabs now carry `ThicknessResolved`, `ThicknessFeet` and
`ThicknessSource`,
and `floor_slab_extrusion_thickness` is raised per slab so the plan-loop
path
(2023) still declares it. The slab *profile* stays the bbox rectangle —
`ProfileResolved: false`, #31's polygon-profile half is open.

Also changed: where one ElementId is framed more than once (22 of 100
slabs),
the record with the **greatest `z` extent** is kept. First-by-`(stream,
offset)` agrees with the export on 67 of 80; greatest-extent on 79 of
80. The
change is uniform and perturbs nothing — 268 walls, 132 doors and 88
columns
also carry multiple records and every one agrees on the box.

## 5. Storey containment (#219)

The 64 plan-loop `IFCSLAB` annotations carried no ElementId, no bbox and
no
storey. They stand down where records decode — **exactly one `IFCSLAB`
per
exported id**, no double emission.

Plates bind by their **top** face (Revit hangs a floor below its level):

| join over the 100 record-backed plates | bound | agrees with the
export | wrong |
|---|---:|---:|---:|
| base `z` equals a recovered storey elevation | 0 | 0 | 0 |
| **top `z` equals a recovered storey elevation** | **51** | **51** |
**0** |

Exact match, no tolerance, no proximity fallback.
`storey_bound_elements`
743 → 794. #219's 82 unbound becomes 78: 49 plates (was 64), 18 spaces,
5
walls, 6 windows.

## 6. Storey elevations (#218): measured, and the answer is no

| slab record face | distinct values | equal to a storey elevation | not
a storey elevation |
|---|---:|---:|---:|
| base `z` | 40 | **0** | 40 |
| top `z` | 26 | 13 | 13 |

Slab tops would add **−40 ft and 185.5 ft**, two of the four storeys
#213
misses, at the price of **13** values that are not storeys (each 0.1667
ft
below a real one — the structural-slab / topping interface). Two for
thirteen
is not a trade this project takes: `ifc::STOREY_ELEVATION_SOURCE_TYPES`
stays
`["IFCCOLUMN"]` and the count stays 11. #218 keeps both halves open with
the
numbers it asked for.

## 7. Verdicts

Both OctetProof verdicts `PASS`, replayed byte-for-byte:

```
magnetar-2024-core-interior: PASS — witnesses ifc-lite, ifcopenshell, rvt-rs
  surface: 4 fields, excluded: 9, diffs: 0
  replay ifc-lite: match / ifcopenshell: match / rvt-rs: match

magnetar-2024-core-interior-slim: PASS — witnesses ifc-lite, ifcopenshell, rvt-rs
  surface: 10 fields, excluded: 4, diffs: 0
  replay ifc-lite: match / ifcopenshell: match / rvt-rs: match
```

The full-project claimed surface goes **8 → 10 fields**
(`entity_counts.IFCSLAB` and `entity_counts.IFCSHADINGDEVICE` join),
excluded
5 → 4. `floors` moves `known_gap` → `known` at tolerance 0; a new
`shading_devices` row scores the 20 the manifest previously left
unscored.

## 8. Gates run

`cargo fmt --all`, `cargo clippy --all-targets -- -D warnings`,
`RUSTDOCFLAGS="-D warnings" cargo doc --no-deps`, `cargo +1.85.0 check
--all-targets` (MSRV), `tools/check-local.sh --ifcopenshell` (all
requested
gates passed), the full `cargo test --profile ci` suite with
`RVT_PROJECT_CORPUS_DIR` / `RVT_CORPUS_TIER1_DIR` set (55 test groups, 0
failures), and the seven tier-2 corpus targets from #209
(`elem_table_corpus`, `arc_wall_corpus`, `partition_scanner`,
`iter_elements_typed`, `re15_geometry_invariants`,
`re19_door_window_wall_negative`, `walker_to_ifc_integration`) — all
green.

New coverage:
`tests/iter_elements_typed.rs::core_interior_2024_slab_instances_and_export_overrides`
pins the 100-instance set, the single `BuildingPad`, the exact 20-id
override
set and the plan-loop stand-down; nine unit tests in
`src/partition_ifc_export_overrides.rs` cover the framing's fail-closed
paths;
plus selection, override-mapping, thickness and top-face-bind unit
tests.

## 9. Docs

`docs/status.md`, `docs/support-matrix.json` (scope wording in the RE-21
row's
style — the `verified` row now names six categories and states the
override
carrier, the record-selection rule and the plate bind explicitly),
`docs/verification-protocol.md`, `docs/supported-profile.md`,
`docs/compatibility.md`, `docs/user-guide.md`, `README.md`,
`ROADMAP.md`,
`TODO.md`, `CHANGELOG.md`, and the viewer's typed-class row.
`docs/octetproof-spec.md` takes a **1.0.2 patch** (non-semantic, §16.1):
its
§6.2/§6.3 worked examples quote files this PR changes by design, so they
are
now labelled dated snapshots rather than a live mirror of
`research/witness/`.
No schema, diff-function or provenance change.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes partition MVP merge, IFC entity typing, storey binding, and
gated witness artifacts on a narrow 2024 path; behaviour is fail-closed
and corpus-tested but affects production export output counts and
geometry metadata.
> 
> **Overview**
> **Revit 2024 slab export parity** on the Core Interior corpus: **80/80
`IFCSLAB`** and **20/20 `IFCSHADINGDEVICE`** with exact ElementId sets
vs Revit’s exporter, replacing 64 id-less plan-loop slab annotations
when element records decode.
> 
> Recovery extends the RE-21 partition element-record instance rule to
**`OST_Floors` and `OST_BuildingPad`**, adds
**`partition_ifc_export_overrides`** to read per-instance **“IFC Export
As”** strings (honouring only proven **`IfcShadingDevice`** redirects),
and picks **one record per id by greatest bounding-box `z` extent** for
thickness. IFC export maps **`BuildingPad` → `IFCSLAB`**, applies
overrides in **`export_content`**, emits **measured slab thickness**
from record bbox height, and binds **slabs/shading devices to storeys by
top face** (`record_top_elevation`). Plan-loop floors are **cleared when
`slabs` is non-empty** to avoid double-counting.
> 
> **OctetProof / CI fixtures** widen the slim verdict surface to
**`IFCSLAB` + `IFCSHADINGDEVICE`**, refresh witness observations, and
document OctetProof **1.0.2** snapshot wording. Docs, support matrix,
viewer status classes, and a research **`probe_slab_instance_rule`**
example are updated accordingly.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5069cdde4f31b810325c5523c8d93cff819ee434. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
DrunkOnJava added a commit that referenced this pull request Aug 31, 2026
…s from OST_SketchLines records (#31) (RE-25) (#231)

RE-22 (#225) recovered all 80 exported `IFCSLAB` by ElementId and closed
the
thickness half of #31, leaving one sentence open: *"The profile is still
the
bbox rectangle, not the recovered floor boundary polygon:
`ProfileResolved`
stays false."* This closes it, exactly, for all 80.

Report: `reports/element-framing/RE-25-slab-plan-profiles.md`.

## Where the profile is not

The plan-loop scanner is a measured dead end. Inventoried over all eight
inflated `Partitions/*` streams with the shipped constants (4–8 points,
span ≥ 5 ft, closure ≤ 0.05 ft): **2317** closed plan-polyline
candidates —
2310 of 4 points, 4 of 5, 3 of 6 — and **zero** with the plan bounds of
any
of the 100 record-backed plates. The perimeter profile needs 26
vertices.
Searching all 187 MiB of inflated partitions for the export's polygon as
a
packed run of `(x, y)` doubles — in the project frame, in the export's
own
profile frame, at strides of 2/3/4/5/6/8 doubles — finds no ordered
vertex
run at all. Revit does not store this boundary as a polyline.

## The join rule, and its evidence

**Each boundary line of a Revit sketch is its own partition element
record.**
`BuiltInCategory` `OST_SketchLines` = **-2000045** (Autodesk's published
constant; the bytes are `53 7b e1 ff ff ff ff ff` in the same signed
`i64`
slot at `+0x12` that RE-21 documented). These decode through the
*unmodified*
RE-21 header — declared ElementId at `+0x00`, `0x059f` at `+0x0c`, the
fixed
bbox marker at `+0x50`, the box at `+0x58` — and the box **is** the
segment:
the boundary line at `x = 136.5, y = 115 … 123` is recorded as
`136.5, 115 – 136.5, 123`, degenerate in `x`.

RE-23 read the *first* counted list at `+0x88`. A **second** list is
framed
identically right after it, and its last slot names the sketched
element:

```text
+0x88  u32    n1 = 5
+0x8c  5×u64  20309, 20310, 20312, 20313, 20315   (sibling sketch lines)
+0xb4  u32    n2 = 2
+0xb8  2×u64  20308, 20311                        ← 20311 is the slab
```

Measured over all 3688 `OST_SketchLines` records on
`2024_Core_Interior.rvt` (`Partitions/46` 3070, `/51` 570, `/55` 48;
3070 distinct ids; **0** frames of one id disagreeing on box or owner):

| owners named by the second list's last slot | count |
|---|---:|
| exported `IFCSLAB` ElementIds | **80 / 80** |
| exported `IFCSHADINGDEVICE` ElementIds | **20 / 20** |
| other elements (walls, the superseded container twin 16925, …) | 26 |
| **distinct owners** | **126** |

**The join is by ElementId only — no geometry, no proximity, no
containment.** A sketch line belongs to the element the byte names, or
to
nothing. Geometric containment was used once, as a check, and is not the
rule: the recovered profile's plan bounds are asserted equal to the
record's
own plan box in the corpus gate.

## Reconstruction: closure, not fitting

A box is not a segment when the segment is diagonal, and 37 of the 1454
plate
segments carry a box *looser* than the line (the top boundary of every
rectangular plate is recorded `20,113 – 167,115` for a line the export
puts
at `y = 114`). Both are resolved by the loop, never by the reference
export:

1. Every segment degenerate on exactly one axis contributes its
endpoints.
2. Every remaining segment is placed only when exactly **one** pair of
still-open vertices fits its box — corner pairs (the box's own
diagonals)
first, and only when no corner pair is open, a pair that spans the box
   lengthwise and is degenerate across it.
3. An ambiguous segment, a vertex that does not finish at degree 2, an
unused
edge, a zero-extent box or a loop under three vertices rejects the
**whole
   element**. There is no partial or best-effort profile.

Collinear vertices are then merged — Revit splits the ring's north-east
run
at `x = 167`, so the raw chain has 27 outer segments where the export
has 26
edges.

## Profile agreement

Recovered profile vs the reference export's `IfcExtrudedAreaSolid` swept
areas (`IFC Exports/2024_Core_Interior_slim.ifc`, sha256 `bfdf36ff…`,
read
with IfcOpenShell 0.8.5), both reduced to the project plan frame,
compared as
cyclic vertex sequences with orientation normalised, tolerance 1e-3 ft
per
vertex:

| slabs | recovered | export swept area | outer verts | voids | segments
| exact | near | miss |
|---:|---|---|---:|---:|---:|---:|---:|---:|
| 42 | outer ring + 1 void | `IfcArbitraryProfileDefWithVoids` | 26 | 1
(4 verts) | 31 | **42** | 0 | 0 |
| 38 | single loop | `IfcArbitraryClosedProfileDef` | 4 | 0 | 4 | **38**
| 0 | 0 |
| **80** | | | | | | **80** | **0** | **0** |

122 loops compared (80 outer + 42 inner). **Worst vertex deviation
1.563e-12 ft** — the recovered vertices are the same doubles as the
export's,
differing only in the floating dust of Revit's own transform
(`177.00000000000011` for a nominal 177 ft, which the record box and the
export's profile carry identically). Re-measured on the emitted IFC
after the
metre round-trip: 0 mismatches, worst deviation **2.842e-14 ft**. No
frame
alignment was needed — the 2024 project frame and the export frame
coincide.

Before this, all 80 were rectangles: accidentally exact on the 38 whose
profile *is* the box, and filling a courtyard on the 42 perimeter rings.

**The 20 exported `IFCSHADINGDEVICE` are declined, with the reason.**
The
same join names all 20; each carries 57 sketch lines — 1 with a
zero-extent
box, 35 axis-parallel, 21 diagonal. The first zero-extent box rejects
them
outright, and the export writes each as a 29-vertex rotated ring
(`0 … 182.3333` by `8.6936 … 130.3064`) with no axis-parallel anchor to
force
a first choice. They keep the record box rectangle and
`ProfileResolved: false`. Five further owners are declined the same way
(16925 — the container-member twin of 20953 already excluded by RE-21 —
plus
31636, 31637, 34362, 55840). Twenty-one non-plate owners do close and
are
recovered but not emitted; nothing here maps them to an IFC entity.

## Verdict outputs — unchanged

```text
magnetar-2024-core-interior: PASS — witnesses ifc-lite, ifcopenshell, rvt-rs
  surface: 6 fields, excluded: 10, diffs: 0
  replay ifc-lite: match / ifcopenshell: match / rvt-rs: match

magnetar-2024-core-interior-slim: PASS — witnesses ifc-lite, ifcopenshell, rvt-rs
  surface: 13 fields, excluded: 3, diffs: 0
  replay ifc-lite: match / ifcopenshell: match / rvt-rs: match
```

Both committed `verdict.json` files are **byte-identical**. The two
committed
`rvt-rs` observations were regenerated because the observation payload
counts
*every* emitted entity type; the four bridge-witness observations are
byte-identical. Building-element counts and the diagnostics sidecar are
unchanged, and the sidecar is byte-identical to `main` (9ce43f7):

| entity | before | after |
|---|---:|---:|
| `IFCRECTANGLEPROFILEDEF` | 992 | 912 |
| `IFCARBITRARYCLOSEDPROFILEDEF` | 0 | 38 |
| `IFCARBITRARYPROFILEDEFWITHVOIDS` | 0 | 42 |
| `IFCPOLYLINE` | 0 | 122 |
| `IFCCARTESIANPOINT` | 1847 | 3381 |
| `IFCPROPERTYSINGLEVALUE` | 5371 | 5611 |
| total instances | 18209 | 20105 |
| `IFCSLAB` / `IFCSHADINGDEVICE` / `IFCWALL` / `IFCDOOR` / `IFCWINDOW` /
`IFCCOLUMN` | 80 / 20 / 360 / 132 / 6 / 256 | unchanged |
| `IFCBUILDINGSTOREY` | 15 | 15 |
| `storey_bound_elements` | 801 | 801 |

## Gates run

`cargo fmt --all -- --check`, `cargo clippy --workspace --all-targets
--all-features -- -D warnings`, `RUSTDOCFLAGS=-D warnings cargo doc
--no-deps --lib`, `cargo +1.85.0 check --all-targets` (MSRV, no
let-chains),
`cargo test --workspace --all-targets --all-features` with
`RVT_PROJECT_CORPUS_DIR` + `RVT_CORPUS_TIER1_DIR` (152 test binaries
ok),
the four named targets (`witness_verdict`, `witness_registry`,
`project_count_fixtures`, `support_matrix`), the seven #209 tier-2
targets,
`tools/ci/ifc_schema_arity.py` on a fresh export (20 105 instances
across 43
entity types; `IfcArbitraryClosedProfileDef` at its declared arity of 3,
`IfcArbitraryProfileDefWithVoids` at 4, `IfcPolyline` at 1), and
`tools/check-local.sh --ifcopenshell`.

New gates:
`tests/iter_elements_typed.rs::core_interior_2024_slab_plan_profiles`
(the 100 record-backed plates partition exactly — 80 resolve a profile,
and
the 20 that do not are exactly the export's `IFCSHADINGDEVICE` `Tag`
set;
42 × (26 outer, 1 void), 38 × (4 outer, 0 voids); each profile's plan
bounds
equal the record's own plan box) and 15 unit gates in
`src/element_record_plan_profiles.rs`.

## Support-matrix status

New row `element-record-slab-plan-profile` at **`partial`**, not
`verified`:
the agreement is measured and regression-gated, but profile geometry is
not a
field of either OctetProof claimed surface — no witness compares it — so
it
has not met the two-independent-witnesses bar in
`docs/verification-protocol.md`.

## Follow-ups

- **The 20 shading devices.** Sketch present and joined; only the
closure
declines. Resolving 21 mutually constraining diagonal boxes needs either
a
  second carrier for the segment endpoints or a global search with a
  uniqueness proof.
- **`IfcExtrudedAreaSolid.Position` is the element's own
`IfcAxis2Placement3D`**, which is also the `IfcLocalPlacement`'s
relative
placement, so a consumer composing both applies the element translation
  twice. This predates RE-25 and affects every emitted element on every
  release; the profile is expressed in the same element-local frame the
rectangle profile always used, so nothing regressed. Needs its own
issue.
- **Walls, doors, windows, columns** still carry the record box. Wall
sketches are not `OST_SketchLines`; the 26 non-plate owners here are a
hint
  of what else is sketched, not a claim.
- **#227** is untouched. Note that the perimeter ring's void is
*profile*
geometry, not an opening element, so the 42 slab penetrations #227 asks
for
  are a different set.

Refs #31 #227

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches partition decoding, geometry reconstruction, and IFC STEP
emission for all record-backed slabs; scope is gated to Revit 2024 and
fail-closed closure, but wrong profile logic would change exported solid
geometry without shifting entity counts.
> 
> **Overview**
> **Slab IFC geometry now uses recovered sketch boundaries instead of
bounding-box rectangles** for Revit 2024 partition-backed floors where
sketch lines close unambiguously (#31 / RE-25).
> 
> The change reads **`OST_SketchLines`** element records, joins each
segment to its owner slab via the **last slot of the second reference
list** at `+0x88` (`owner_reference`), and **chains segment bounding
boxes into closed loops** (fail-closed on ambiguity). Those polygons
flow through
**`partition_schema_mvp::slabs_from_partition_category_records`**
(single multi-category partition scan) into decoded fields, then
**`ifc::export_content`** emits **`IfcArbitraryClosedProfileDef`** or
**`IfcArbitraryProfileDefWithVoids`** with **`ProfileResolved: true`**
and related diagnostics. **`scan_category_records_multi`** avoids
re-inflating partitions when floors, pads, and sketch lines are needed
together.
> 
> On the Core Interior corpus this matches **80/80** reference slab
profiles (including courtyard voids); **20 shading devices** still use
the record box because closure rejects their diagonal sketch envelopes.
Docs, support matrix, changelog, corpus tests
(`core_interior_2024_slab_plan_profiles`), a research probe, and witness
**entity-count** observations reflect the richer IFC profile chain while
**building-element counts and OctetProof verdicts stay unchanged**.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d08c80c6aa7d4629b9538cda5a242ad8cfbb78b7. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slab instance selection from partition element records loses 37 of 80

1 participant