Skip to content

feat(ifc): a wall that embeds a curtain wall is drawn from its saved mesh where Revit raised its base (#1385) (RE-340) - #1401

Merged
DrunkOnJava merged 24 commits into
mainfrom
research/1385-embedded-wall-cut-signal
Nov 5, 2026
Merged

DrunkOnJava merged 24 commits into
mainfrom
research/1385-embedded-wall-cut-signal

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

A wall that embeds a curtain wall is drawn from the mesh Revit saved for it where that mesh starts at least 0.5 ft above the wall's base, which is where Revit has cut the wall's end stubs away and raised its base (RE-340), on Revit 2024 to 2027. Every other wall keeps its body, including the hosts that keep their stubs (2103576 as built, 2177158).

Commit subjects: 98262a3 names RE-336 and the commits up to 4750acc say RE-338; both mean RE-340, the report and the title of this PR (renumbered because #1398, #1400 and #1402 hold RE-337, RE-338 and RE-339; commit subjects cannot be changed).

Motivation

#1385, from RE-335. Six walls of the BIM4LCA office as built (eight at permit) are drawn 8.2021 or 9.514 ft taller at the base than Revit's body, because rvt-rs draws the wall whole where Revit draws it less the curtain wall's prism and less whatever cuts its end stubs. No record of the cut partners says which walls keep their stubs: every raised host's stubs lie inside its partners' boxes, and so do those of 2177158 (as built and at permit) and 2041479 (at permit), which Revit keeps (RE-340 section 2). The wall's own saved graphics do say: the lowest vertex of its saved mesh is Revit's lowest point on 113 of 113 host states (57 as built, 56 at permit), to within 0.001 ft.

Changes

Testing

Unit tests are banned in this repository; none added.

  • tools/check-local.sh is not run here (no local builds); cargo fmt, python3 tools/release/changelog.py check, tools/ci/api-doc-ids.py and tools/ci/render-mcp-tools.py --check pass locally and CI is the gate.
  • Verified end to end on real Revit files (the BIM4LCA office as built and at building permit, Revit 2024, CC BY-SA 4.0; Core Interior; RE1 Architecture) against Revit's own exports, on the merged head with feat(ifc)!: write the openings a cabinet and a door cut in a wall, and a curtain wall's where nothing trims it (#1165) (RE-338) #1400's openings written. Measure 41973316830 (head 3ad0762, this branch with main at 61f2080 merged, against main at 61f2080; the height, top, quantity, layer, property, mesh and opening scorers), figures in RE-340 section 5:
    • The 14 hosts Revit raises (6 as built, 8 at permit) have Revit's base again, with 6 of 42 and 8 of 41 considered hosts drawn from their mesh: walls with base and top Revit's 598 to 604 of 607 as built and 577 to 585 of 589 at permit; top Revit's, base not 8 to 2 and 12 to 4 (the rest are Basement walls on footings, not hosts);
    • feat(ifc)!: write the openings a cabinet and a door cut in a wall, and a curtain wall's where nothing trims it (#1165) (RE-338) #1400's void is present: 2098938 and 2105250 as built carry it over the raised strip (voids R1 U1, Revit's 1); every opening scorer (unfilled_openings_vs_ifc, openings_vs_ifc, opening_hosts_vs_ifc, opening_boxes_vs_ifc, opening_guids_vs_ifc) and the quantity and property census are identical to main's;
    • No other row moves against main: wall_heights_vs_ifc and wall_quantities_vs_ifc change 6 rows as built and 8 at permit, all hosts; 2103576 as built and 2177158 are unchanged; Core Interior and RE1 Architecture are identical, ifc.sha256 included;
    • Height from rvt-rs's body equals Revit's on 578 of 579 walls as built (572 on main) and 565 of 565 at permit (557); NetVolume on 331 of 607 (325) and 292 of 589 (284);
    • the 14 meshes against Revit's bodies (mesh_bodies_vs_ifc, run 41945943795 at 847c373): 12 within 0.01% in volume with every vertex on the other's surface; the other two are 2177212 (as built and at permit), volume ratio 0.990, the strip 0.114 ft shorter than Revit's IFC draws it. The mesh equals Revit's own NetVolume and GrossSideArea of the wall (14.590083 against 14.590085 ft³ as built), so the 1.0% is Revit's IFC tessellation against Revit's quantities; the wall stays in the rule and its follow-up is the main session's to file.
  • GLB layers (wall_layers_vs_ifc, same run, fix(ifc): a floor drawn along its shape-edited top keeps its slab quantities, and a one-layer wall cut at it its layer colour (#1384) #1405 in main): as built, walls drawn in layers fall 602 to 596 (the six hosts have two or more layers and are drawn in one material; layer centres within 0.001 ft 583 of 598 to 577 of 592, the same 15 misses; colours 710 to 704); at permit 519 to 519, the one-layer hosts keeping their layer's colour through one_layer_solid_meshes. The IFC keeps every host's layer set.
  • Held-out, Revit 2025 and Einhoven on the merged head (-f holdout=true -f r2025=true -f models="holdout-* spent-* r2025-* einhoven", Measure 41973319628, head 3ad0762 against main at 61f2080): 44 models, 193 files, every one identical to main's. Autodesk's samples (Measure 41973322205): 58 samples of Revit 2015 to 2027, 526 files, identical but the export time and the new note on 16 samples (0 of 1 to 15 hosts drawn from a mesh; Snowdon Towers architectural 0 of 15). Whether a held-out model holds an embed host is not known from what is kept.
  • Snowdon Towers architectural: Revit's own IFC4 export has one wall that starts 0.5 ft or more above its placement (1996153, a parapet cap, 1.9167 ft) and it is not one of the file's 17 walls that name an embed step (run 41952518382 at 4750acc), so none of its hosts is raised there.
  • Exporter change: the witness verdicts' drift is checked by CI's IfcOpenShell validates exports and Corpus health jobs. No unfiltered Measure with every scorer on every model was run; that is for the main session before arming.

Audit-honesty checklist

  • Docs reflect the state after this PR (RE-340, docs/support-matrix.json, docs/evidence.md, docs/compatibility.md, docs/python.md, docs/status.md, docs/release-1.0-criteria.md, README.md).
  • Changelog fragment under changelog.d/changed/.
  • The limits are in RE-340 sections 5 to 7 and here: the 0.5 ft threshold was fitted and checked on the same two office files (113 host states, 10 distinct raised walls) and nothing outside them has tested it; an embed host with a door, window or other opening hosted in it, a base cut at a floor, a Tag shared with another entity or an embedded wall that is not a curtain wall keeps its body; Revit 2023 and earlier are not touched (their wall records give no embed step); walls Revit raises for another reason (footings) are not touched; the glTF draws the six multi-layer hosts as built in one material; 2177212's mesh is 1.0% under Revit's IFC body in volume at both dates; and --no-saved-meshes keeps the records.
  • No emojis, no private paths.

Breaking changes

None. SavedMeshReport and ExportNote are #[non_exhaustive]; the first gains fields and the second its last two variants.

Related issues

Closes #1385. All three done-when items are met by this PR: a byte-level reading separates the two cases (the wall's saved mesh), the hosts Revit raises draw Revit's base, and 2103576 (as built) and 2177158 do not change.

…he end stubs of an embedded curtain wall (#1385) (RE-336)
…s that embed a curtain wall, in both exports (#1385)
…tepped top is the only one the mesh replaces (#1385) (RE-338)
@DrunkOnJava DrunkOnJava added the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 5, 2026
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 5, 2026 01:42
@DrunkOnJava DrunkOnJava removed the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 5, 2026
…ain wall's own void ignored, Revit 2024 to 2027, a reason when the records are not read (#1385)
@DrunkOnJava DrunkOnJava changed the title feat(ifc): a wall that embeds a curtain wall is drawn from its saved mesh where Revit raised its base (#1385) (RE-338) feat(ifc): a wall that embeds a curtain wall is drawn from its saved mesh where Revit raised its base (#1385) (RE-340) Nov 5, 2026
@DrunkOnJava DrunkOnJava added the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 5, 2026
@DrunkOnJava DrunkOnJava removed the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 5, 2026
@DrunkOnJava
DrunkOnJava merged commit b36477f into main Nov 5, 2026
33 checks passed
@DrunkOnJava
DrunkOnJava deleted the research/1385-embedded-wall-cut-signal branch November 5, 2026 06:22
DrunkOnJava added a commit that referenced this pull request Nov 5, 2026
DrunkOnJava added a commit that referenced this pull request Nov 5, 2026
… beneath it is drawn to that wall's face (#1396) (RE-337) (#1398)

## Summary

**This ships as a labelled approximation (Griffin, 2026-11-05 at about
12:30 AM EST, answering a question asked with the question tool: ship
it, labelled).** Revit steps the end up past the wall beneath, by a join
order that is not read, and the steps above the block are not drawn. A
wall whose block stops below its top carries `BodyEndSource`
`wall_end_to_base_wall_upper_step_omitted` (2 walls on each office file,
2057668 and 2057670, run 41980282001); `wall_end_extended_to_base_wall`
is kept for a block that reaches the wall's full height, which no
measured wall does.

A wall with an edited elevation profile that is a plain rectangle along
a model axis and is drawn from its record box now has an end drawn to
the face of the perpendicular wall beneath it that holds its base, where
the record box's end (before the join trim) lies inside that wall and
the cut of the wall's base still resolves over the longer plan. The
added end is a block drawn up to the lowest of the top of the wall it
reaches, the base of any other wall the pass reads that it would lie
inside, and the wall's own top; the wall's profile openings stay where
they were. Walls 2057668 and 2057670 of the BIM4LCA office have Revit's
lowest point as built and at building permit, and no wall has more
points above Revit's top in the plan rows than on `main`. No other wall
of either office file, Core Interior, RE1 Architecture, the 24 R2025
models, the 58 Autodesk sample projects or the 25 held-out models
changes. A wall that keeps an end the rule would have drawn carries
`BodyEndRefusal`, counted in `exported.wall_end_refusals`. Report:
RE-337.

## Motivation

#1396: after RE-336 the Basement walls 2057668 and 2057670 (and 2058499
and 2058501 at permit) were 0.123 ft (0.044 ft) off Revit's lowest point
because their plans end short of Revit's at the low end of the footing.
The record's join trims the end to the face of a Level_01 wall that
overlaps the wall by 0.66 ft of 9.5, while Revit's body at the base runs
on to the face of the Basement wall beneath
(`JoinEndGStep.m_geomJoined`), which the record box's end lies inside,
and steps up the height to the faces of the walls above. Each of these
walls has an edited elevation profile, which separates them from the
other ends a join trim moves: a rule on the join alone moved 25 Autodesk
sample projects, a held-out model and one more office wall.

## Changes

- `src/ifc/export_content/wall_tops.rs`: `extend_wall_ends`,
`decide_ends`, `axis_wall`, `stepped_top_wall`, `profiled_wall`,
`join_trims`, `SteppedPlan`, `finish_wall_ends` and helpers. The pass
runs after the tops are cut and before the bases are, returns early when
no wall has a profile opening, and reads the model once. It tries the
ends of each candidate on a copy, asks RE-336's `decide_base` again for
a wall whose base join names elements (and makes the solid with the
blocks, refusing if any piece is dropped or any piece has no height
above the base), and moves nothing if the base is no longer cut. It
moves the ends, moves the wall's profile openings back by the shift of
the origin, writes `BodyEndSource`
(`wall_end_to_base_wall_upper_step_omitted` where a block stops below
the wall's top, `wall_end_extended_to_base_wall` where every block
reaches it) and `EndCoverElementId`, or one `BodyEndRefusal`
(`walls_beneath_reach_the_end_at_different_faces`,
`base_cut_lost_on_extended_plan`, `base_not_cut_over_the_extended_plan`,
`wall_beneath_not_one_rectangle`, `wall_stands_in_the_added_end`). The
base pass takes the pieces (the wall's plan and a block for each end,
each to its own top); a wall with no base cut is made by
`finish_wall_ends`, whose first item is the whole plan so the glTF keeps
its layers.
- `src/ifc/export_content.rs`: the property names and values, the order
of the passes and `finish_wall_ends`. `src/ifc/wall_cut_openings.rs`:
`BodyEndSource` counts as a stepped body, so RE-321 openings still
attach (it applies alongside #1400's rewritten `host_of`).
- `src/ifc/mod.rs`, `src/ifc/export_decisions.rs`:
`exported.wall_end_refusals` and the decision
`wall_end_extension_refused` (stage `body_left_as_box`), as for
`wall_base_refusals`; `tests/export_decisions_counts.rs` counts them
against each other and names the reason for the as-built office.
- `docs/export-diagnostics.md`,
`docs/schemas/export-diagnostics.schema.json`, `docs/mcp.md`, and the
reason lists in the descriptions of `rvt-mcp/src/schema.rs` and
`rvt-mcp/src/server.rs` (the contract is synced on the branch).
- RE-337 report, `docs/support-matrix.json`, `docs/contribution-map.md`,
`docs/format-reconnaissance.md`, the RE-336 report, and a changelog
fragment for #1396 that also corrects 0.15.0's #1384 entry (its "other 2
(4) are off" sentence); the release deleted the #1384 fragment, so this
branch deletes it too.

## Testing

No unit tests (banned). Measure at head `1b3a6bd7` against `main` at
`b36477f1` (which includes #1401, RE-340), commands in RE-337 section 4:

-
[41980282001](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41980282001):
both offices, Core Interior, RE1 Architecture, `wall_heights_vs_ifc`,
`wall_top_cover_vs_ifc`, `wall_quantities_vs_ifc`, `wall_layers_vs_ifc`,
`qtos_vs_ifc`, `unfilled_openings_vs_ifc`, `keep_ifc`.
- The rule drew the ends of 2 walls as built (2057668, 2057670) and 2 at
permit (the same two). **Both office files carry the new label on 2
walls: `wall_end_to_base_wall_upper_step_omitted` on 2057668 and
2057670, as built and at permit; `wall_end_extended_to_base_wall` on
none.** It kept the ends of 2 as built (2058499, 2058501:
`base_not_cut_over_the_extended_plan`) and 2 at permit (the same:
`wall_beneath_not_one_rectangle`). `exported.wall_end_refusals` is
`{"base_not_cut_over_the_extended_plan": 2}` as built,
`{"wall_beneath_not_one_rectangle": 2}` at permit, empty on Core
Interior and RE1 Architecture, which are byte-identical (sha256).
- The scorer's own summary against `main` with #1401: walls with base
and top Revit's 604 to 606 of 607 as built and 585 to 587 of 589 at
permit; walls with the top Revit's and the base not 2 to 0 as built and
4 to 2 at permit; misses in the same storey 3 to 1 as built and 4 to 2
at permit. 2057668 and 2057670 go from 0.1230 ft (0.0439 ft at permit)
off Revit's lowest point to Revit's; no other wall's lowest or highest
point changes. Of the scorers run, only `wall_heights_vs_ifc`,
`wall_quantities_vs_ifc` and `wall_top_cover_vs_ifc` change.
- No wall has more `taller` points than on `main` in the plan rows of
`wall_top_cover_vs_ifc`, on either file. 2057668 as built: `equal 85
taller 10 lower 0` of 95 to `equal 85 taller 10 lower 5` of 100 (the
five are where Revit goes on to 182.087 ft and the block stops at
179.2979 ft); 2057670: to `equal 90 taller 10 lower 0` of 100 (Revit's
179.2979 ft); at permit both are `equal 80 taller 10 lower 0` of 90, as
on `main`. (The block to the top of the wall beneath, `1b417c45`, made
2057670 `taller 15`: Revit's end there follows the wall in front of it
from 179.2979 ft, which is the stop now.)
- Volume: 2057668 from 1.704 ft3 under Revit's to 0.593 under, 2057670
from 1.258 under to 0.147 under; at permit both from 0.374 under to
0.088 over, where the block itself is about 0.12 ft3 under Revit's end
(it stops at 180.610 ft, the wall beneath's lowest underside, where
Revit's step is at 182.087 ft) and the rest is about 0.21 ft3 of excess
in the body elsewhere that the short end of `main` masked.
- The area where a full-height top is higher than Revit's stays at
`main`'s 0.3363 ft2 on both walls and files; that metric counts only the
faces at the wall's full height, so it says nothing of the added end,
which is below it. The far-end tab is 0.4101 ft wide, as on `main`.
- `wall_layers_vs_ifc`, `qtos_vs_ifc` and `unfilled_openings_vs_ifc`
output is identical to `main`'s on all four models. 2058499 and 2058501
as built are what `main` writes (volume, height, plan, lowest point,
base). The IFC of each office differs from `main`'s (entity numbers and
timestamp taken out) in the bodies of the two walls that take the end,
the outlines of their profile openings and the property sets of the four
walls above, and nothing else. `decoded.parameter_value_count` equals
`main`'s (54,952 as built, 55,145 at permit): the markers are in
`RvtElementRecordGeometry`, not a `Pset_` set. The scorer's fit moves
the "taller" and "lower" areas of other walls by at most 0.0578 ft2 (54
walls as built) and 0.0188 ft2 (50 at permit), with the walls themselves
unchanged.
-
[41980285452](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41980285452)
(`-f r2025=true -f samples=true -f scorers=wall_heights_vs_ifc`, my own
run at `1b3a6bd7` against `main` at `b36477f1`): it exported and hashed
88 models (the 24 R2025 models, 58 Autodesk sample projects, Einhoven,
Core Interior and the four RE1 models), and the IFC sha256 is identical
to `main` on all 88. `wall_heights_vs_ifc` was scored on the 29 that
have a Revit IFC4 export (the 24 R2025 models, Core Interior and the
four RE1 models) and its output is identical to `main`'s on all 29; the
58 sample projects and Einhoven have no export to score against, so
their hash is the whole measurement.
-
[41980288900](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41980288900):
held-out, counts only, at `1b3a6bd7`: 25 models, identical to `main` on
all.
- The same two comparisons at `b47a9a00` before #1401 was merged,
[41978482673](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41978482673)
(88 models) and
[41978485557](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41978485557)
(25 held-out), are identical too.

-
[41982867204](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41982867204):
the final, unfiltered run, on this pull request's head `96baaafe`
against `main` at `40b86b80` (`-f base=main -f nordic=true -f r2025=true
-f holdout=true`, every default scorer): 53 models, 51 byte-identical,
all 18 held-out models among them; only the two office files differ.
`wall_heights_vs_ifc` reads as above (base and top Revit's 604 to 606 of
607 as built, 585 to 587 of 589 at permit). This run also scores the
wall ends, which the runs above did not: both ends within 0.001 ft go
from 512 to 514 of 607 as built and from 435 to 437 of 589 at permit, in
`wall_bodies_vs_ifc`, `wall_ends_cv_vs_ifc` and `wall_ends_list`, each
file one `start short` and one `end short` wall to `ok` and no wall
worse. No other scorer output moves. The MCP server's answers equal the
export: 900 consistency lines, 0 differ.

Head and merges: the measured head is `1b3a6bd7`, which merges `main`
(v0.15.0, #1400, #1412, #1416, #1401). The merge of `main` after it
(#1420, the 0.15.0 post-release docs) changes documents only: it
conflicted with this branch in `docs/contribution-map.md` alone,
resolved by keeping this branch's #1384 row and main's #1335 row (which
replaces the #1237 row), and changes no figure here. An earlier merge,
`8e0aa535`, touched three workflow files and no Rust. A final unfiltered
Measure of the pushed head `96baaafe` (`-f base=main -f nordic=true -f
r2025=true -f holdout=true`) is
[41982867204](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41982867204),
registered with the watcher and not read when this was written.

Measured limits, all in RE-337 section 5:

- Revit's end steps up and follows a wall at each height by a join order
that is not read, so the added end is a bound by the geometry the pass
reads, and "no wall is drawn above Revit's at an added end" is a
measured result on the four walls, not a derived one. The steps above
the block are not drawn; 2057668 as built goes five points under
Revit's.
- Walls 2058499 and 2058501 as built keep their ends 0.31 ft short of
Revit's: no footing covers the longer plan and their base is not cut
(before and after). A footing that covers a wall's plan in part is the
follow-up.
- Walls 2058499 and 2058501 at permit are not reached: the wall beneath
them is drawn with a stepped profile, so they stay 0.0439 ft off; the
skip is counted.
- No measured wall exercises: a stepped-top wall beneath whose lowest
underside is at or below the candidate's base (its higher pieces are not
checked against the block); two candidates at one corner; a candidate
with no base join; the `BodyEndSource` arm of `is_stepped` in
`wall_cut_openings.rs`, which only `finish_wall_ends` reaches; the
refusal reasons `base_cut_lost_on_extended_plan`,
`walls_beneath_reach_the_end_at_different_faces` and
`wall_stands_in_the_added_end`; `finish_wall_ends` (a wall with no base
cut); the Level branch of the blocks; the high end of a wall; walls
along x; an end reaching the wall's full height (and so the value
`wall_end_extended_to_base_wall`); the plane-offset term of the opening
shift. Nor does a beneath wall whose top a floor cut in steps over only
part of its plan (the block stops at the lowest underside, 180.6102 ft
for 1493966, where Revit's step at permit is 182.087 ft), a beneath wall
drawn as another kind of solid is neither reached nor refused (an
uncounted skip), and a wall standing in the added end that the pass does
not read (turned off a quarter turn, or a solid of another kind) does
not stop the block.
- A wall with one end drawn and the other kept carries `BodyEndSource`
and `BodyEndRefusal` both; `JoinTrimStart` and `JoinTrimEnd` stay the
record's once `BodyEndSource` is set (documented in
`docs/export-diagnostics.md`).
- Earlier heads are not evidence for the rule: the full prism with the
slid openings (`33529d0b`), the block to the wall beneath's top
(`1b417c45`, 2057670 over-drawn), the block stopped below walls in its
way with the pass moved after the tops (`74f5ee37`, Measure 41964576550,
which lost the permit refusals of 2058499 and 2058501 because a wall
beneath with a stepped top and a profile of its own was not read; fixed
in `0f80699b`), the rule without the join-trim condition (Measure
41944433297, which moved a Snowdon Towers soffit wall to 0.1016 m longer
than Revit's export, local only) and the rule that also drew 2058499 and
2058501 as built (Measure 41947542271, their volume 4.5 to 6.9 ft3 over
Revit's).

- [ ] `tools/check-local.sh` passes: not run locally (no local builds);
CI is the gate
- [x] Verified end to end on real Revit files: the BIM4LCA office as
built and at permit (Revit 24.0.5 IFC4 exports, CC BY-SA 4.0), against
Revit's own export, with the commands and the scorers in RE-337
- [x] IFC exporter touched: Core Interior's IFC is byte-identical to
`main`, so the witness observations do not move
- [ ] Performance change: N/A

## Audit-honesty checklist

- [x] Docs reflect the current state after this PR (support matrix,
contribution map, reconnaissance addendum, diagnostics reference and
schema, RE-336 pointer)
- [x] A changelog fragment under `changelog.d/fixed/`
- [x] A new limitation is documented here, in RE-337 section 5 and in
the `extend_wall_ends` doc comment
- [x] No emojis, private paths or personal addresses in committed files
- [x] Reverse-engineering finding: report RE-337 with the bytes, what
was tried and dropped, and reproduce commands; the probe is
`probe_1067_native_dump` (its `JoinEndGStep` and `GLine` lines)

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary source, decompiled internals or NDA
content: public byte observations and Revit's own IFC4 exports only
- [x] No new fixtures

## Breaking changes

None. Two new element-record properties on the two office walls above,
`BodyEndSource` with the new labelled value
`wall_end_to_base_wall_upper_step_omitted` (and
`wall_end_extended_to_base_wall`, which no measured wall carries) and
`EndCoverElementId`, and `BodyEndRefusal` on two more at each office
file; a new field `exported.wall_end_refusals` (default empty) and a new
decision reason `wall_end_extension_refused`; two MCP tool descriptions
list it (contract synced).

## Screenshots or output samples

RE-337 section 5.

## Related issues

Refs #1396. The done-when is met for 2057668 and 2057670 on both files
and for no other wall's length or base moving; it is not met for 2058499
and 2058501 at permit.
DrunkOnJava added a commit to puzzbobb/rvt-rs that referenced this pull request Nov 5, 2026
…nd renumber the report RE-341

RE-340 is DrunkOnJava#1401's embedded wall stubs on main, so this report and the lines that cite it become RE-341. The conflict in docs/format-reconnaissance.md keeps both addenda.
DrunkOnJava added a commit that referenced this pull request Nov 5, 2026
…dumps and Jev scores the diff (#1334) (#1419)

## Summary

The advisory semantic merge check of #1334. Measure diffs the two sides'
MCP dumps for each openly licensed model, and a `workflow_run` workflow
gives the diff to Jev `jev-1.13.0` beside the pull request's own `##
Summary` and `## Testing` and asks whether the export moves in a way
they do not state specifically (Griffin, 2026-11-05: a described,
intended change passes, an unexplained move fails; the main session,
2026-11-05: a move that only a general description such as "improves how
walls are exported" covers fails too). The verdict is the check run
`semantic diff (advisory)` on the commit Measure measured: not in the
ruleset, no pull request comment, and a `fail` is a red check. Only a
Measure run of every open model with a base on main writes it, it is
written on the commit Measure measured and no other, and it cannot be a
pass unless all 34 open models are compared in full and a
same-repository pull request has that commit as its head.

## Motivation

Measure is the byte-level oracle. A pull request that moves meaning
should say so, specifically, before it is armed, not only show that
bytes moved. The agent that makes a change also writes its Summary, so a
sweeping Summary must not cover a change. Refs #1334.

## Changes

- `tools/re/semantic_diff.py`: a pure function of two dumps. Elements
added, removed and changed with the value before and after; byte offsets
inside `provenance` dropped; order ignored; values compared to the
dump's six decimals; an empty object or list the same as no field;
identical changes collapsed by the whole (path, before, after) triple.
Its `measure` mode is what the compare job runs: it fails the job on a
dump in a model that is restricted or on neither list, and records in
the manifest the open models no diff covers (`OPEN_MODEL_NAMES`, 34),
each skipped model with its own reason, the groups dropped for size, and
whether the run was asked for every open model (`--requested-all`). The
measured commit and the base are the ones the compare job passes from
the plan job's resolved refs (`--head-sha`, `--base-sha`); the
`commit.txt` of a result folder is written by a shard job that runs the
measured code and is read only when none is passed.
- `tools/re/test_semantic_diff.py` and `tools/ci/test_jev_check.py`:
failure-first tests of pure helpers, run in the PII guard job. The diff:
0.35 vs 0.3500001, a reorder with moved offsets, a bulk collapse that
hides a different value, an uncovered model. The verdict logic: a model
with no dump, a diff that failed, a dropped group, an unscored chunk or
partial coverage never reads as a pass; an answer whose probabilities do
not add up is refused; a chunk of non-ASCII text is never sent over the
16,000-character cap; a head commit that is not a 40-character SHA, a
manifest with a non-string model, HTML and invisible characters in the
pull request's text, and control characters in printed text. Each was
checked to fail under the mutation it guards against.
- `.github/workflows/measure.yml`: the compare job checks out the
script, runs `measure` when there is a base, tells it whether the run
was dispatched with no `models` filter and the office and Revit 2025
models on, and uploads `semantic-diff`. The documented command is `-f
base=main -f nordic=true -f r2025=true` with no `models` filter.
- `tools/ci/jev_check.py`: merges findings across models, chunks them
(at most 8 findings, 16,000 characters as sent), reads the
same-repository pull request whose head is the measured commit through
the API, takes its `## Summary` and `## Testing` (HTML element tags and
invisible characters removed, each cut at 2,500 characters as sent, all
of it shown in the check's summary; text in angle brackets that is not
an HTML element, such as `<set>.<property>`, stays), and asks Jev blind
(labels A and B randomised per chunk; no model name, pull request
number, title or branch in the state). Per finding Jev chooses: stated
specifically / follows from a specific change they state / covered only
by a general description / unstated / only rounding, a reordering or a
spelling; "general" plus "unstated" is the finding's score, and the
probabilities must add up to 1. A finding at 0.85 or more is a fail in a
chunk rated 1.5 or more and a warn in one rated 1.0 or more. NOT
MEASURED, never a pass, for no key, no same-repository pull request
whose head is the measured commit (a fork's included, and an empty diff
does not excuse it: the lookup is first), a check asked for on a commit
other than the measured one (both commits in the title), a base that is
missing or could not be checked, a pull request with no `## Summary`
where the diff has findings, HTTP 402, a refused key, another model's
reply, a time-out, an error (named by its type), no model compared, any
open model not compared in full, a dropped group or a missing count,
sampled property sets that one of a model's dumps alone holds too often
(none held by both while either holds any, or more than a tenth of
them), or an unscored chunk. A run whose base is not main or an ancestor
of main writes no check, and names the base. The Jev call does not
follow a redirect. An empty diff passes without a call and needs no
Summary, but only on a complete run.
- `.github/workflows/semantic-check.yml`: `workflow_run` on Measure
(environment `jev`, main only), `workflow_dispatch` with a run id, and a
keyless run on a pull request that changes the check. It scores only a
Measure run whose event is `workflow_dispatch` and whose head repository
is this repository, from `measure.yml` at that path; any other run posts
nothing, with a notice. It writes the check on the commit the artifact
names as measured, not on a pull request's live head. actionlint reports
nothing on it and zizmor 1.32.0 reports nothing on it, `measure.yml` and
`ci.yml` (the one `dangerous-triggers` finding, on `workflow_run`, is
ignored inline with its reason).
- `docs/maintaining.md` (where to find the verdict: it is on the
measured commit, not necessarily the head, which the pull request page
does not show, so look it up with `gh api
repos/<repo>/commits/<sha>/check-runs?check_name=...`; a later commit
does not clear a fail, only a new score of the same pull request does; a
filtered Measure run writes no verdict, so a pull request that changes
output needs its final unfiltered run; the Summary must state each
change specifically: which classes, which property or geometry, how many
where measured; a fail is fixed by changing the code or by stating the
change in the Summary; a warn is answered in the body; the complete
command; what a pass means: the dumps agree, not that the exports are
identical, since the dump samples five elements per entity; what is
sent, including element names and values that can hold an ElementId), a
changelog fragment.

## Testing

No local build (the lane runs no cargo); the tests above are the
pure-helper exception and run in CI's PII guard job. End to end on real
dumps:

- [x] N/A for `tools/check-local.sh`: no Rust changed.
- [x] Verified end to end on real Measure runs: see "Output samples".
The keyed path (main's `workflow_run` job with the secret) is not yet
exercised.

## Audit-honesty checklist

- The keyed path cannot run before the workflow is on main:
`environment: jev` takes only main, and a `workflow_run` workflow runs
from the default branch. After the merge: `gh workflow run
semantic-check.yml --ref main -f run_id=<a complete Measure run with a
base>`.
- The keyless path is exercised by this pull request's own run of the
workflow, and it can only say NOT MEASURED: it writes on the pull
request's head, which is never the commit Measure measured. At c36b71f
(before the delta review) it did so with the wrong reason: Measure run
41987903774 (dispatched from this branch for #1425's head c8e55f5
against main 182ed21, `-f nordic=true -f r2025=true -f
scorers=mcp_answers_vs_ifc`, no `models` filter) compared all 34 open
models (0 skipped, 0 uncovered, `requested_all` true; findings only in
the two office files, 7 each), and this workflow's run 41987854258
(attempt 2) wrote check run 127117767677 on c36b71f through
`GITHUB_TOKEN` saying only "no Jev key", a check on a commit Measure had
not measured. At b4d1932 such a check says "this check is for <the
head>, but Measure measured <the other commit>" in its title (local
scenario below; the CI proof is Measure run 41993282068 on #1425's head
722244e against main a4044dc, and this workflow's pull-request run
after it: not yet measured on this head). Measure's own pull-request run
41987854320 covered 6 of 34 models and its compare step says "the
semantic check writes no check run (this run was not asked for every
open model)", the filtered path in a real run. An earlier pass of the
keyless path (run 41966963563, attempt 2, on fd90cdc: no semantic
difference in 6 models) predates the coverage rule and the commit check.
- A pass means the dumps agree, not that the exports are identical: the
dump samples five elements per entity, and a mesh vertex or a profile
point is not in it.
- The thresholds and the wording of the per-finding question were set on
the in-sample cases below, so those cases are in-sample for them. The
held-out round is the second table. Jev's answers move by about 0.02
between two calls with the same request (#1412's own Summary passes at
0.84 and fails at 0.86 on byte-identical requests, against a gate of
0.85), so a verdict within 0.05 of the gate is not stable.
- B3 (a fork's run) and the redirect behaviour are tested by reading the
code and the unit helpers, not by a fork's run: no fork pull request was
opened.

## Breaking changes

None.

## Output samples

Everything below was scored with `tools/ci/jev_check.py` and
`tools/re/semantic_diff.py` as committed at 49d5378, and the
delta-review block below as committed at b4d1932 (which changes who may
write a check, the gaps, and the stripping of HTML and invisible
characters in the pull request's text; no prompt, threshold or
chunking), and the key from the Keychain on this Mac, from the
`semantic-diff` and `measure-*` artifacts of the Measure runs named.
Nothing was scored with a threshold or a prompt other than the committed
ones.

**Ground truth is `ifc.sha256` per model**, not a pull request's title.
Of 13 pull requests in the in-sample set (Core Interior, Einhoven, RE1
and the Revit 2025 models in every run; 34 models with the BIM4LCA
office where `nordic` was on, 30 for #1402 and #1403 and 6 for #1398),
the IFC differs on the two office files for #1388, #1400, #1401 and
#1405 and on no model measured for the other nine. The semantic diff has
findings on exactly those two models in each of those four runs, and
none on any model whose IFC is identical, except the dump-only changes
of #1373, #1379 and #1412. The documented command (no `models` filter)
is what finds them: the earlier documented command, which filtered to
Core Interior, Einhoven and RE1, reads "pass" on all four.

**In-sample: the 7 pull requests whose diff is not empty** (runs
41972569847 #1388, 41972650013 #1400, 41972664107 #1401, 41972583508
#1405, 41972597118 #1373, 41972610208 #1379, 41972636527 #1412; each 34
models). "Own" is the pull request's real Summary and Testing.
"Sweeping" is a one-line Summary that names an area and no kind of
change ("Improves how walls and floors are exported." for #1388,
"Improves how openings are written in the export." #1400, "Improves how
walls are drawn in the export." #1401, "Improves how floors and walls
are exported." #1405, "Improves how rooms, profiles and pipes are
exported." #1373, "Improves how roofs are exported." #1379, "Improves
the MCP server's answers." #1412), alone and beside the pull request's
real Testing. "Wrong" is another pull request's full body: #1329 (a
memory change that states the output does not change) and one other. The
number in parentheses is the highest probability that Jev gave a finding
as not stated specifically.

| Pull request | Findings | Own | Sweeping alone | Sweeping + its
Testing | Wrong: #1329 | Wrong: other |
| --- | --- | --- | --- | --- | --- | --- |
| #1388 | 7 | pass (0.31) | fail (0.99) | pass (0.74) | fail (0.99) |
#1412: fail (0.95) |
| #1400 | 14 | **fail (0.94)** | fail (0.99) | fail (0.98) | fail (0.98)
| #1373: fail (1.00) |
| #1401 | 12 | pass (0.63) | fail (1.00) | pass (0.77) | fail (0.96) |
#1379: fail (1.00) |
| #1405 | 2 | pass (0.51) | warn (0.99) | warn (0.90) | warn (0.96) |
#1379: **pass (0.78)** |
| #1373 | 88 | pass (0.63) | fail (1.00) | fail (0.99) | warn (0.97) |
#1400: fail (1.00) |
| #1379 | 94 | pass (0.24) | fail (0.99) | warn (0.90) | fail (0.96) |
#1401: fail (1.00) |
| #1412 | 23 | pass (0.84) | fail (1.00) | fail (0.89) | fail (0.99) |
#1388: fail (1.00) |

- **No sweeping Summary alone passes (0 of 7): 6 fail, 1 warns.** Beside
the pull request's own Testing two pass (#1388 and #1401), because their
Testing states the figures: that is the rule working, since a measured
figure in Testing counts as stated.
- **False positives: 1 of 22 expected passes, a fail.** The 22 are the 7
own Summaries, 6 jitter controls, 6 reordered controls and 3 empty-diff
pull requests on complete runs (#1329, #1377, #1382: no finding on any
model, IFC identical, each a pass without a call to Jev). #1402 and
#1403 ran without the office, so under the new rule they write no check
and are not counted. #1400 is a diff of 14 counters of the diagnostics,
and the figure its Summary and Testing leave unstated is
`parameter_value_count` +188 (office as built) and +174 (permit); its
Motivation, which Jev is not given, gives 182. #1412's own Summary sits
at the gate: the same request scored 0.84 (pass) at 4e81a95, 0.86
(fail) in one rescoring on this head's code and 0.84 (pass) in the table
above, so it is a verdict the gate cannot hold; it could as well be
counted a second false positive.
- **False negatives: 1 of 21 expected non-passes** (7 sweeping alone, 7
with #1329's body, 7 with another's): #1405's whole diff is
`total_entities` +8 on each office file, which a roofs Summary does not
state (0.78, below the gate).
- **Controls, complete** (all 34 models on both sides, one model
changed; built from the dumps of run 41972569847): six jitter controls
pass, a move of 1e-6 in every measurement of the sampled elements, the
rooms' areas and the levels' elevations in Core Interior, RE1
architecture and mechanical, Einhoven, the office as built and a Revit
2025 model, scored beside #1329's body: highest probability 0.73 to
0.79, highest chunk rating 0.6 to 0.7, below the 1.0 rating gate; 412
findings in 65 chunks on the office. Six reordered controls (every row,
set and room in another order, every byte offset shifted) are empty
diffs.
- **Coverage, on #1401's stored diff** (run 41972664107, own Summary),
changing only the manifest: complete, **pass**; one model with no dump
on the head side, **NOT MEASURED** naming it; one model whose diff
failed, **NOT MEASURED** with that reason; a dropped group, **NOT
MEASURED**; the same missing model with a run not asked for every open
model, **no check run**; a manifest with a non-string model, an error
and no check run.
- **Unchanged by the review fixes:** 34 of 35 verdicts of the in-sample
matrix are as scored at 4e81a95 (the one that moved is #1373 with
#1329's body, fail to warn; both are non-passes), and #1401 and #1405
(the two the review asked for, runs 41972664107 and 41972583508) are
unchanged in all five bodies. 18 of the 35 requests are byte-identical
to the earlier scoring; the other 17 carry a Summary or Testing that is
now cut by its length as sent (a newline or a quote in the text counts
two, so a section over the cap is cut about 20 characters earlier),
which is the review's cap fix and not a change of method.

**Delta review (b4d1932).** Run on stored complete runs, with the key
from the Keychain and real GitHub lookups, nothing posted:

- Run 41972569847 (#1388's merge commit, base 240c7d7): the pull
request is found through the API from the measured commit, the base is
on main, Jev is asked with #1388's real Summary and Testing: **pass (7
findings in 34 models)**, as before. Run 41972583508 (#1405's merge
commit): **pass (2 findings)**, as before. Run 41972664107 (#1401's head
2a35ede, which has since moved): NOT MEASURED, "no pull request of this
repository has this commit as its head", the head-moved case in a real
run; scored offline with #1401's real body the verdict is **pass**, and
all five of its bodies give the verdicts of the table above (pass, fail,
pass, fail, fail). #1388's five bodies and #1405's five are the same
verdicts as the table, except #1405 with #1329's body, warn to fail (a
non-pass either way, at a rating of 1.5).
- Run 41987903774 (PR #1425's head c8e55f5 when measured): its head has
since moved to 722244e, so the real-lookup scenario reads NOT MEASURED,
"no pull request ... has this commit as its head". Asked to write on
another commit (c36b71f), the same run reads NOT MEASURED with "this
check is for c36b71f, but Measure measured c8e55f5". An empty diff
on a merged pull request's commit (run 41980023307, #1358) is a pass;
the same empty diff with a commit no pull request has is NOT MEASURED; a
base that is the pull request's own head writes no check and names the
base.
- **Property sets held by one dump only** (`details_one_side`) are a gap
per model only when none is held by both while either holds any, or when
more than a tenth of all of them are held by one dump only (exactly a
tenth is not a gap; main session, 2026-11-05). The dump samples the five
lowest ElementIds of each entity, so a change that adds or removes
elements of an entity moves the sample and a few are held by one dump
only: that is not a defect, and the literal rule (any non-zero count)
would have turned #1412's pass into NOT MEASURED. The defect it guards
against is a head that lost its details. The check's summary says how
many are held by one dump only, gap or not. On run 41972636527 (#1412, 1
of 115 sampled elements held by one dump only in each office file, no
gap), scored offline with #1412's body three times: pass (0.84), fail
(0.85), pass (0.83), all with no gap and the same chunk (a finding at
the 0.85 gate, in a chunk rated 3.6), so its own Summary is a pass
again, at the gate, and not a stable one. No other stored complete run
has a non-zero count.

**Held-out, thresholds and wording unchanged since they were set
above.** Ten merged pull requests that were not used to set them, run
with the same 34 models (`nordic` and `r2025` on):

- #1337, #1352, #1356, #1372, #1341 and #1344 (Measure runs 41973688732,
41973701739, 41973714367, 41973727101, 41973740400, 41973754042): the
IFC is identical on all 34 models and the dumps agree, so each has an
empty diff and passes without a call to Jev, with its own Summary, a
sweeping one, #1329's or another's alike. **They test the empty-diff
path and nothing else**: none of their changes lands on an open model.
- #1350, #1358, #1364 and #1370 (provenance and diagnostics additions;
the IFC is identical on all 34 models in each, so these are dump-only
changes), Measure runs 41980008692, 41980023307, 41980037727 and
41980053223, scored with the same four bodies per pull request (own
Summary and Testing, a sweeping one-liner written before the runs
finished, that line beside the real Testing, #1329's body, and another
pull request's body). Scored first with `jev_check.py` as it was at
4e81a95 and again with the code of this head; nothing was changed after
seeing a result, and the 20 verdicts are the same in both.

| Pull request (run) | Findings | Own | Sweeping alone | Sweeping + its
Testing | Wrong: #1329 | Wrong: other |
| --- | --- | --- | --- | --- | --- | --- |
| #1350 (41980008692) | 1034 in 142 chunks | **warn** (0.86, one chunk,
rated 1.13) | fail (1.00) | fail (0.88) | fail (0.99) | #1358: **pass
(0.84)** |
| #1358 (41980023307) | 0 | pass, empty diff | pass, empty diff | pass,
empty diff | pass, empty diff | pass, empty diff |
| #1364 (41980037727) | 159 in 37 chunks | pass (0.14) | fail (1.00) |
pass (0.60) | fail (0.97) | #1370: fail (0.92) |
| #1370 (41980053223) | 98 in 16 chunks | **warn** (0.90, one chunk,
rated 1.33) | fail (1.00) | fail (0.95) | fail (0.97) | #1350: **pass
(0.21)** |

The sweeping lines were "Improves what the export records about
elements." (#1350), "Improves the diagnostics of the export." (#1358),
"Improves what the export records about bodies." (#1364) and "Improves
what the export records about profiles and stairs." (#1370).

- **The held-out result is weaker than the in-sample one.** Real
Summaries: 1 of 3 non-empty pull requests passes, 2 warn and none fail.
Sweeping alone: 0 of 3 pass (all fail). #1329's body: 0 of 3 pass.
Another pull request's body: 2 of 3 pass. With the empty diff counted,
false positives are 2 warns (no fail) of 4 expected passes, and false
negatives 2 of 9 expected non-passes.
- **Why the two warns.** #1350 added fields to the dump's `summary.file`
block (`layout_release`, `omitted_entries`, `partition_count`), which
its Summary and Testing do not name: one chunk of 0.86 at a rating of
1.13, where a warn needs 0.85 and 1.0. #1370's warn is one chunk of
`value_sources` parts of Core Interior's shading devices at 0.90, rated
1.33; a fail needs 1.5. Both are near their gates.
- **The two cross-body passes are neighbours, not strangers.** #1350
(the provenance of every decoded element), #1358 (why an element was
left out) and #1370 (value sources for profiles, stair runs and
landings) all add provenance and diagnostics, so another's Summary
covers part of the diff. They are counted as false negatives as defined.
- **Run-to-run movement.** Jev's answers move by about 0.02 between two
calls with the same request, and by more in the maximum of very many
findings: with #1358's body on #1350 (1,034 findings) the highest scored
0.83, 0.97 and 0.84 in three scorings, only the middle one on a
different grouping of the chunks (since reverted: a chunk is packed at
full context). A verdict near a gate (0.85) is not stable.
- **What it says about the thresholds.** On provenance and diagnostics
additions Jev's probabilities for a change the pull request states sit
near 0.9 where in-sample they sat at 0.2 to 0.8, so the 0.85 gate is
close to the edge for real Summaries. A recalibration follow-up is
warranted.

#1314, #1316 and #1328 cannot be calibrated: their parents predate the
server crate (71c0677), so Measure builds no `rvt-rs-mcp` there.

## Related issues

Refs #1334
DrunkOnJava added a commit that referenced this pull request Nov 5, 2026
… lines (#421) (#1426)

## Summary

Revit 2026 and 2027 projects now draw beams along their axes, stair runs
and tread landings from their records, and floors, ceilings and slabs
from their sketch lines, as 2024 and 2025 projects do. Five readers'
release lists gain 2026 and 2027, and the Sketch curve list reader is
read there too. It's a first slice of #1190, held to the same Autodesk
samples saved by Revit 2024 and 2025. [Maintainer correction: the
contributor's text said "sloped roofs as their planes" and "six
readers"; sloped roofs are left out and the roof slope list is not
widened, and a monolithic landing stays its box. See the maintainer
sections below.]

## Motivation

#1190 asks for each capability 2024 and 2025 have on every release from
2015 to 2027, "one capability on one release" at a time. On `main`, 2026
and 2027 already read the 2025 records (RE-124, RE-179): walls with
their layers and joins, family boxes and saved meshes are the same as on
2025. Six readers were still limited to 2024 or 2025, so on 2026 and
2027 their elements were drawn as their record boxes.
`exported.body_sources` on `main`:

| body source | `rac_advanced` 2024 / 2025 / 2026 / 2027 | `rac_basic`
2025 / 2026 / 2027 | `rst_basic` 2024 / 2026 / 2027 |
|---|---|---|---|
| `partition_beam_axis` | 29 / 0 / 0 / 0 | | 345 / 0 / 0 |
| `partition_beam_box_along_axis` | 8 / 0 / 0 / 0 | | 9 / 0 / 0 |
| `partition_stair_run_sketch` | 5 / 10 / 0 / 0 | 2 / 0 / 0 | 1 / 0 / 0
|
| `native_landing_tread` | 5 / 0 / 0 / 0 | | |
| `partition_roof_slope` | 1 / 1 / 0 / 0 | | |

## Changes

- `src/research/partition_beam_axes.rs`:
`BEAM_AXIS_SUPPORTED_REVIT_VERSIONS` 2024 → 2024, 2026, 2027;
`SKETCH_LINE_SUPPORTED_REVIT_VERSIONS` gains 2026, 2027.
- `src/research/native_stairs.rs`: `NATIVE_RUN_REVIT_VERSIONS`,
`NATIVE_RUN_SHAPE_REVIT_VERSIONS` gain 2026, 2027;
`NATIVE_LANDING_REVIT_VERSIONS` 2024 → 2024, 2026, 2027.
- `src/research/partition_roof_slopes.rs`:
`ROOF_SLOPE_SUPPORTED_REVIT_VERSIONS` gained 2026, 2027 on the first
head; it is 2024, 2025 again (maintainer).
- `src/research/partition_schema_mvp/walls.rs`: a wall's profile
openings (RE-151) checked the beam reader's list, so they now have their
own, `WALL_PROFILE_OPENING_REVIT_VERSIONS` = 2024, the release they're
measured on.
- `tools/re/save_pair_bodies.py` (new): two rvt-rs exports of the same
project, element for element by `Tag`, world box (3 mm) and volume
(0.1%).
- `reports/element-framing/RE-341-2026-2027-beams-stairs-roofs.md`, an
addendum to `docs/format-reconnaissance.md`, `docs/status.md`,
`docs/supported-profile.md`,
`changelog.d/added/1190-2026-2027-beams-stairs-roofs.md`.

2025 isn't widened. Its beams and landings would change as well, and no
Revit 2025 export that holds them can be published here.

## Testing

Unit tests are banned in this repository: do not add them. Show the
change working end to end on real files instead.

- [x] `tools/check-local.sh` passes (fmt, clippy, rustdoc, build,
real-file / CLI / contract checks)
- `tools/check-local.sh --corpus` on the branch head, on `main`
77d71cb: passes (300 integration tests, 15 MCP).
- [ ] Verified end to end on real Revit files: the command, the files
(and their licence), and the measured result against Revit's own export
are in the PR body, with the script or probe that reproduces it
- **Not against Revit's own export:** Measured instead against the same
Autodesk samples saved by 2024 and 2025, whose exports are measured
against Revit's (RE-50, RE-56, #357, #824). The files are the pinned
samples in `research/autodesk-sample-projects.tsv` (fetched, never
stored).
  - Bodies these readers now draw:
- `rst_basic` 2026 and 2027: 355 of 355 are the 2024 save's (345 beams
by their axis, 9 along it, 1 stair run).
- `rac_advanced` 2026 and 2027: 43 of 43 are the 2024 save's (37 beams,
5 tread landings, the sloped roof); 10 of 10 stair runs are the 2025
save's. [Maintainer: the sloped roof is no longer drawn on 2026 and
2027, so 42 of 42; the contributor's local figures are not re-run, and
run 42016210686's check reads 42 beams and tread landings and 10 stair
runs equal.]
    - `rac_basic` 2026 and 2027: 2 of 2 stair runs are the 2025 save's.
- Every body in the file, differing from the reference save, `main` →
this branch:
- `rst_basic` 2026 and 2027 against 2024: 35 → 1 of 453 (the one left is
a column, as on `main`).
- `rac_advanced` 2026 and 2027 against 2025: 64 → 63 of 5,527. 10 stair
runs become 2025's. 9 stop being 2025's and become 2024's: 2 beams and 5
landings that 2025 still draws as boxes, and a ceiling and a floor the
sketch lines now draw as on 2024.
    - `rac_basic` 2026 and 2027 against 2025: 27 → 23 of 438.
- Byte identity: of 107 local files, 101 export IFC and diagnostics byte
for byte as on `main` (`SOURCE_DATE_EPOCH=1700000000`). That covers
every 2015 to 2025 file: Autodesk's samples, Core Interior, the RE1
models, Einhoven, the BIM4LCA office and terrain housing, and puzzbobb's
R2025 models. The 6 that change are the 2026 and 2027 saves of
`rac_advanced`, `rac_basic` and `rst_basic`.
- [x] If this touches the IFC exporter: the witness verdicts replay (see
CONTRIBUTING.md) or the changed observations are refreshed in this PR
- Core Interior (2024) exports byte for byte as on `main`, so its
observations are unchanged.
- [ ] If this is a performance change: reran `tools/bench.sh` and
attached the before / after
  - N/A.

```
tools/fetch-autodesk-samples.sh samples 2024 2027
for f in samples/*.rvt; do rvt-ifc "$f" -o "${f%.rvt}.ifc"; done
python3 tools/re/save_pair_bodies.py samples/2027-rstbasicsampleproject.ifc samples/2024-rstbasicsampleproject.ifc
python3 tools/re/save_pair_bodies.py samples/2026-racadvancedsampleproject.ifc samples/2024-racadvancedsampleproject.ifc \
    --sources partition_beam_axis,partition_beam_box_along_axis,native_landing_tread,partition_roof_slope
```

## Audit-honesty checklist

- [x] README / docs reflect the current state after this PR — no claims
of features that are not actually shipped in this PR
- [x] A user-visible change has its entry as a fragment under
`changelog.d/<section>/` (see `changelog.d/README.md`), not in
`CHANGELOG.md`
- [x] If a limitation was resolved, the "Known limitations" / "What
works today" section in the relevant docs is updated
- `docs/supported-profile.md` (the 2026 row; 2027 is "as on 2026") and
`docs/status.md`.
- [x] If a new limitation was introduced, it is documented in the PR
body and in-code
- None new. 2025's beams and landings, and a wall's profile openings
beyond 2024, are noted in the constants' docs and RE-341 §5.
- [x] Commit messages describe WHAT changed and WHY, not "fix things" or
"updates"
- [x] No emojis in code, docs, or commit messages
- [x] No private paths, personal email addresses, or internal jargon in
committed files
- [ ] If this is a reverse-engineering finding: a reproducible probe
under `probes/examples/` and a dated addendum to
`docs/format-reconnaissance.md` are included
- The addendum is included. No new byte layout is decoded (the records
are RE-124's and RE-179's), so there is no probe.
`tools/re/save_pair_bodies.py` reproduces the measurement.

## Legal and contribution hygiene

- [x] I agree this work is licensable under Apache-2.0 (see
`CONTRIBUTING.md`)
- [x] This PR contains no Autodesk proprietary source, decompiled
internals, or NDA'd SDK content (see `CLEANROOM.md`)
- [x] Any new test fixtures use synthetic values (`testuser`, `111111`,
`FY-20XX`, etc.) and contain no real-world PII
  - No fixtures.

## Breaking changes

None. Only release lists change; their public constants keep their names
and types.

## Screenshots or output samples

`tools/re/save_pair_bodies.py` on 2027 `rst_basic` against 2024, `main`
then this branch:

```
main:
same 418, differ 35, not in the reference 0
  IfcBeam: same 338, differ 32, not in the reference 0
  IfcColumn: same 29, differ 1, not in the reference 0
  IfcFooting: same 36, differ 0, not in the reference 0
  IfcMember: same 2, differ 0, not in the reference 0
  IfcSlab: same 4, differ 1, not in the reference 0
  IfcStairFlight: same 0, differ 1, not in the reference 0
  IfcWall: same 9, differ 0, not in the reference 0

this branch:
same 452, differ 1, not in the reference 0
  IfcBeam: same 370, differ 0, not in the reference 0
  IfcColumn: same 29, differ 1, not in the reference 0
  IfcFooting: same 36, differ 0, not in the reference 0
  IfcMember: same 2, differ 0, not in the reference 0
  IfcSlab: same 5, differ 0, not in the reference 0
  IfcStairFlight: same 1, differ 0, not in the reference 0
  IfcWall: same 9, differ 0, not in the reference 0
```

## Related issues

Refs #1190, #421


---
Maintainer note: main was merged in, and the report renumbered from
RE-340 to RE-341, since RE-340 on `main` is #1401's report. No reader
changed.

---
## Maintainer changes (2026-11-05)

The contributor's text above is kept as written. Where it is out of date
it is corrected here. Six signed commits sit on top of the PR's earlier
two (the contributor's 20bc9f2, untouched, and the earlier merge of
`main`): a merge of `main` (5f52be1), the code (d50d53b),
`tools/re/save_pair_bodies.py` (8e2a9e4), the docs (14952a4, f903515)
and a clippy range fix (f149e22).

**The title still says "and sloped roofs"; sloped roofs are no longer in
this PR.** It cannot be edited from the branch; retitle at the squash,
for example "feat(ifc): Revit 2026 and 2027 beams, stair runs, landings
and sketch lines".

**Sloped roofs are left out.** `ROOF_SLOPE_SUPPORTED_REVIT_VERSIONS` is
2024 and 2025 again, so the Summary's "sloped roofs as their planes" and
the Changes line for `partition_roof_slopes.rs` above no longer apply.
- The source comment said `rac_advanced`'s roof is its 2025 save's;
RE-341 section 3 had it right: it is its 2024 save's body (532
triangles, 5.33 m3), and the 2025 save's is 12 triangles and 6.88 m3. No
Revit export scores either.
- On 2026 and 2027 an edge takes the 2024 reading of its slope, and the
fascia, rafter cut and several-arrow readers are 2025 only, so a roof
whose eave cut cannot be told would be drawn as a plain sloped slab.
- The held-out digest has no roof-body scorer line: the third held-out
model's roof left the record-box set on the first head with nothing
scoring what replaced it.

**A Sketch's curve list (RE-97) is read on 2026 and 2027.** The beam and
sketch-line lists gate the readers floors, ceilings, slabs, footprint
roofs and shaft voids use, so those change on 2026 and 2027 too (named
in the docs and the changelog fragment now); but the list reader stayed
`2024 | 2025`, so the guard for an edited sketch could not fire there. A
list is taken only where it validates (RE-97).

**What the PR changes on 2026 and 2027:** beams along their axes, stair
runs and landings, the stair property sets and quantities (read from
native records), and the floors, ceilings, slabs, footprint roofs and
shaft voids drawn from sketch lines. Unread there: sloped roofs, spiral
runs, stair names, railing heights and lengths, a wall's profile
openings, IFC export overrides, the opening index.

**Measured (Measure run 41988011289, head 1d5bbf0, base `main`
182ed21; counts only for held-out models).** The Testing section above
says no Revit 2026 or 2027 export is available; five are held out in
Measure.
- Of 111 exports, 102 are byte for byte `main`'s and 9 differ, all 2026
or 2027: the six Autodesk samples and three held-out models.
- Held-out 2026 and 2027: one stair flight each leaves the record-box
set; property values equal Revit's go 209 to 224 of 352 (2026) and of
354 (2027), quantities 21 to 23 of 322 and 17 to 19 of 367; different
and values Revit does not write unchanged.
- The held-out 2026 and 2027 office models are identical, so no beam or
landing is scored against a Revit export.
- MCP consistency: 0 differ on every line of the three held-out models
that moved. IFC rule findings on the 2026 and 2027 samples are the
sloped-beam ones the 2024 saves have (#1432).

**Not yet measured: the current head** (roofs left out, Sketch lists on
2026 and 2027, the script's counts). Measure run 42004827803 is on
f903515; a later commit (f149e22) only rewrites an OR pattern of
releases as a range for clippy, so it measures the same behaviour, but
the figures above are not carried to it until it is read. The section 3
figures (355 of 355, 43 of 43, 10 of 10, 2 of 2) are the contributor's
local pairs; the script dropped unmeshed shapes and repeated Tags
silently, so they cannot say how many bodies were never paired, and it
now counts those and exits 1.

---
## Maintainer changes, round two (2026-11-05): roofs, and a check
against the earlier save

Head e56d31b (signed) is f149e22 plus four commits: roofs held to the
record-box solve (8f10a03), the check (85c7f01), docs (a57f4f5), a
style fix (e56d31b). **Measure run 42010304828** measures this head:
filtered (samples on, held-out models only), dispatched from branch
`fix/1426-bodies-across-saves`, because the scorers and the workflow
step come from the dispatch ref. **Not read yet**; nothing below is a
result of that run.

**The held-out house's roof is a guess, so roofs stay out of the widened
readers.** With the slope list reverted its `IfcRoof` still left the
record-box list (run 42004827803, head f903515: `box bodies` 45 to 44).
A roof whose slope is not read is drawn as its sketch outline at the
record box's full height, a level block at the highest point, and
Revit's roof volume there is 14.2% of its box, so it is very likely
sloped. 2024 and 2025 ship that body for such roofs (RE-50, RE-98,
#884's hips over a T or U footprint), with its slab quantities withheld
unless the layers fill the body, and measured it as a plan outline
against Revit's upward-face area, never as a volume. Nothing measures it
on 2026 or 2027. So on 2026 and 2027 a roof takes neither the Sketch
curve list nor the lines' exact ends and no shaft void is cut from it
(`roof_reads_exact_sketches`): it is read as on `main`. Floors, ceilings
and slabs keep the widened readers, with shaft voids cut from floors and
ceilings. The roof's state on this head is not measured, and the check
below does not reach held-out models.

**The check.** `tools/re/bodies_across_saves.py` holds each 2026 and
2027 save of `rac_advanced`, `rac_basic` and `rst_basic` to the same
project's earlier saves, matched by `Tag`: beams, landings and sketch
outlines (floors, ceilings, slabs and roofs with a recovered outline,
shaft voids included) to the **2024** save, stair runs to the **2025**
save. The 2025 save draws no beam or landing (its body sources hold
none: record boxes), so it cannot be their reference. The 2025 save
reads runs from native records as 2026 and 2027 do and draws all 10 of
`rac_advanced`'s and 2 of `rac_basic`'s runs; the 2024 save's
byte-anchor reader draws 5 and 1. It fails on a difference in IFC class,
GlobalId, storey, `BodySource`, representation types and solid kinds,
placement (0.001 ft), body volume or vertices (0.001 ft, both ways); on
an element with no counterpart, one the earlier save draws otherwise,
one of the earlier save's missing here, a missing export, fewer bodies
than the sample holds (29 axes, 8 along them, 5 landings and 10 runs on
`rac_advanced`; 345, 9 and 1 on `rst_basic`; 2 runs on `rac_basic`), the
ceiling 147534 or floor 139803 not compared equal, and a check that
compared nothing. It prints the number compared per class and the number
left as boxes (counted, not scored). Measure's sample shard keeps the
2024 to 2027 exports of the three projects until it has run, and
`tools/ci/check-bodies-across-saves.sh` fails the head side's shard
(after the results upload) on any failure or any sample whose file was
not written. The base side is not gated: its `bodies_across_saves.txt`
shows what the check says of `main`.

**It cannot catch** an error the earlier save shares with the 2026 or
2027 read. `RepresentationType` is compared as written: both saves come
from the same build, so #1432's change to it does not show. The
fragment, status, evidence, support matrix and RE-341 say all of this.

**Proof it can fail.** Not on Autodesk's files yet: that is run
42010304828. On synthetic IFC pairs made with IfcOpenShell (not
committed), the identical pair passes, and each of these exits 1: a
candidate beam 1 mm deeper (volume), a beam moved one metre (placement
and vertices), a different `BodySource`, a slab left out of the
candidate (missing element), a missing 2025 save. On `main` the 2026 and
2027 saves draw no beam, so the base side's output should fail.

**Differences.** If the check finds any on the real files, the reader
narrows until it is never wrong and what it leaves out stays a box,
counted; none is allowlisted.

**Run 42004827803 figures** (head f903515, the main session's reading):
102 of 111 exports identical, 9 move (the six samples, the held-out
house, the held-out 2026 and 2027 models); MCP 0 differ on 629 lines;
rule findings `rac_advanced` 2 and `rst_basic` 14 each (the
fixed-reference sweep, #1432); body sources base, head, 2024 save:
`rac_advanced` beam axis 0, 29, 29, beams along 0, 8, 8, landings 0, 5,
5, runs 0, 10, 5, record boxes 5,205, 5,153, 5,157; `rst_basic` 0, 345,
345 and 0, 9, 9, run 0, 1, 1, record boxes 428, 73, 73; `rac_basic` runs
0, 2, 1, landing slab 0, 0, 1, record boxes 330, 328, 328. The slab and
ceiling body source counts do not move on `rac_advanced` and equal the
2024 save's: a count match, not per element.

---
## Maintainer changes, round three (2026-11-05): the check's first
results

**Run 42010304828** (head e56d31b, filtered; the head side's check
turned it red). Held to the same project's 2024 save (beams, landings,
sketch outlines) and 2025 save (stair runs), every compared body equal
in every field:
- `rst_basic` 2026 and 2027, PASS: 354 `IfcBeam`, 1 stair run, 5
`IfcSlab` outlines.
- `rac_basic` 2026 and 2027, PASS: 2 stair runs, 12 outlines (2
`IfcCovering`, 10 `IfcSlab`). Left as boxes where the 2024 save draws
them: 1 `IfcSlab` (a landing slab) and 1 `IfcRoof`.
- `rac_advanced` 2026 and 2027, FAIL, one failure each: ceiling 147534
was required as a compared outline and was not compared. Everything else
was equal: 42 beams and landings (37 `IfcBeam`, 5 `IfcSlab`), 10 stair
runs, 82 outlines (64 `IfcCovering`, 1 `IfcRoof`, 17 `IfcSlab`), floor
139803 among them. Left as boxes: 4 `IfcRoof`.
- On the base side (`main`) the check fails as it should: 42 beams and
landings and 10 runs left as boxes, floor 139803 differs in volume
(440.512245 m3 against the 2024 save's 441.111228), and 147534 is drawn
as an outline where the 2024 save draws its record box.

**The ceiling 147534** is a record box in the 2024 save. At base the
2026 save drew an outline. On the head it is neither compared as an
outline nor left out, so the Sketch curve list now holds it to the
record box as 2024 does (inferred from the counts). The check now
compares it under whatever source each save gives it and prints class,
`BodySource`, `ProfileResolved` and volume in every save, so the next
run states it. Nothing was removed from the required list or
allowlisted.

**The held-out house's roof** is back in the box list: its export is
byte for byte `main`'s in that run. **rac_advanced's one compared
`IfcRoof` and 4 left as boxes** are the same on both sides, so roofs are
on `main`'s reader.

**Head fec4833** is e56d31b plus the named-element check, these counts
in the docs, a signed merge of `main` (with #1432 and #1431) and a
signed merge of puzzbobb's own merge of `main`. **Final unfiltered
Measure run 42016210686** (`base=main`, nordic, R2025, held-out,
samples) is on it, dispatched from `fix/1426-bodies-across-saves` (the
same head): it should read `rules:` findings 0 on the 2026 and 2027
samples now that #1432 is in. Not read yet; the docs carry run
42010304828's counts.

---
## Maintainer changes, round four (2026-11-05): the second read

**Run 42016210686** (head fec4833, unfiltered; the main session's
reading and mine of its artifacts): 103 of 111 exports identical, 8 move
(the six 2026 and 2027 samples and the held-out 2026 and 2027 models);
the EXPRESS `rules:` findings are 0 on 90 models and on 18 held-out ones
(#1432 cleared them); MCP 0 differ on 629 lines; the check reads PASS on
all six samples. Ceiling 147534: 2024 record box 5.14728698 m3, 2026
record box 5.14728698 m3, 2025 outline 4.15431293 m3. The semantic merge
check reads NOT MEASURED on this commit because a fork's pull request is
never scored there, which is by design.

**Head d3635bb** (final unfiltered Measure: run 42023546789, not read
yet):
- **Only tread landings are drawn on 2026 and 2027.** A monolithic
landing's outline lines go through `scan_landing_lines` and
`scan_run_data`, which read 2024 only, so it stays its box:
`rac_advanced`'s 5 landings are `native_landing_tread`, `rac_basic`'s
one landing slab is a box. The matrix name, `user_impact` and notes,
README, status, evidence, compatibility, supported-profile, the
changelog fragment and RE-341 say so.
- **The check is a job of its own** (`bodies-across-saves`, reading the
head results), so a failure turns the run red and Compare still reports.
A sample without its 2024 or 2025 save is SKIPPED, one with only some
PARTIAL, and neither is a pass: each prints a notice and a line in the
run summary, as does a run without `samples=true`, a `scorers` input
that excludes it, or `sample_years` with no 2026 or 2027 sample.
`sample_years="2026 2027"` no longer fails falsely. An unknown project
fails. `docs/maintaining.md` says a change to a reader of Revit 2024 to
2027 is measured with `samples=true`.
- **Outlines are compared with both earlier saves** (the 2025 one
without scoring), and floor 139803 is printed in every save with its
volume and vertex count. **Resolved in round five:** the floor is
441.111228 m3 with 170 vertices on the 2024, 2026 and 2027 saves and
440.512245 m3 with 24 on the 2025 save, which draws its arcs as chords
because the arc readers (RE-96, RE-100) are not enabled on 2025; the
2024 reading is the one measured against Revit. It stays an outline.
Enabling the arc readers on 2025 is #1440.
- **Public docs say a sloped roof on 2026 and 2027 can still be a level
block** (the record-box solve, as on `main`), that the check compares
bodies and not quantities or property sets, that it cannot catch an
error the earlier save shares, and that no 2026 or 2027 held-out model
holds an `IfcBeam`, so the beam reader has run only on two Autodesk
samples saved from earlier releases.
- The fragment and report are renamed `...-beams-stairs-sketches`.

---
## Maintainer changes, round five (2026-11-05): #1428 merged, and the
floor

**Run 42023546789** (head d3635bb, unfiltered; the main session's
reading): 103 of 111 exports identical, 8 move (the six 2026 and 2027
samples and two held-out models), `rules:` findings 0 on 90 models and
18 held-out, all six checks PASS, Compare green. **The floor is
resolved, not open:** floor 139803 has 170 vertices and 441.111228 m3 on
the 2024, 2026 and 2027 saves and 24 vertices and 440.512245 m3 on the
2025 save, so the 2025 save draws its arcs as chords (the arc readers
RE-96 and RE-100 are not enabled there) and the 2024 reading is the one
measured against Revit. Sketch outlines against the 2025 save: 81 equal,
1 differs (this floor), 0 drawn otherwise. Ceiling 147534 is a record
box on 2024, 2026 and 2027 (5.147 m3) and an outline on 2025 (4.154 m3),
because 2025 has no Sketch curve list reader. #1440 is the 2025 arc
readers.

**Head c8fb8d1** is d3635bb plus a signed merge of `main` (8f1c136,
#1428 and #1432 and #1431 among it) and one commit. Two conflicts, both
resolved by keeping both: `tools/ci/measure-reference-models.sh` (my
bodies check and #1428's `areas_across_saves` side by side; the Areas
call runs right after the exports and before any sample's IFC is
deleted, so the saves my check keeps change nothing for it) and
`docs/format-reconnaissance.md` (the RE-333 and RE-341 addenda).

**A red Areas gate skipped Compare.** #1428's gate was a step of the
measure job, so a failure there removed Compare's report, as my first
bodies check did before round four. Both gates are now steps of one job,
`same-project-gates` (`tools/ci/check-bodies-across-saves.sh` and
`tools/ci/check-areas-across-saves.sh`, the Areas step moved with its
logic unchanged: an `exit 0` and the scorer's own `passed: 25 Areas, 25
with a body, on each of 4 saves` line), each running whatever the other
did, reading the head shards one directory each (two shards write an
`areas_across_saves.txt`). Compare does not need that job, so a red gate
leaves its report. Each gate keeps its own notice on a skip, and the job
still needs `samples=true`. Tested with fake results: pass, skipped
shard beside a passed one, fail, no result, no samples.

**Final unfiltered Measure: run 42027058162** on c8fb8d1 (`base=main`,
nordic, R2025, held-out, samples), the first run with both gates and the
merged `rac_advanced` Areas. Expected: the same 8 exports against the
new `main`, all six bodies checks PASS, the Areas gate passing. Not read
yet; the docs carry run 42023546789's counts, labelled as that head.

---

**Final unfiltered Measure on the merged head, run 42027058162
(c8fb8d1), read by the maintainer:** 103 of 111 exports are identical
to main; 8 move, the six 2026 and 2027 samples of `rac_advanced`,
`rac_basic` and `rst_basic` and 2 held-out models. `rules:` findings 0
on 90 models and 18 held-out, MCP 0 differ on 629 lines. The new
`Same-project gates` job passes: all six bodies checks read PASS and the
Areas gate passes with 25 Areas and 25 bodies on each of 4 saves.
Compare is green. The semantic check reads NOT MEASURED because a fork's
pull request is never scored, by design.

Refs #1190, #421

---------

Co-authored-by: Griffin Long <[email protected]>
DrunkOnJava added a commit that referenced this pull request Nov 5, 2026
…so the walls that embed a curtain wall stop raising the export's peak (#1429) (#1441)

## Summary

The saved-graphics pass kept every owner's decoded graph until it
returned. #1401 added the 42 walls of the BIM4LCA office that embed a
curtain wall as owners, and their graphs, about 66 MiB, sat under every
later batch of door and window symbols. The pass now frees an owner's
graph with its batch, and meshes the owners that name no symbol of their
own before it reads any symbol. The elements it makes are the ones it
made; the batches of symbols are the ones they were except where an
owner names only other owners (see Changes).

## Motivation

#1429: the default export's peak memory on the BIM4LCA office rose 8%
with #1401 (917 to 993 MiB as built), time unchanged. The viewer's
wasm32 build has a 4 GiB ceiling.

The allocation, found with a peak profile on a runner (Measure
42026078557 at 999f4280 on f861227, and 42026084410 at de4bdfff on
f55a95a, the parent of #1401, office as built):

| | parent of #1401 | main | difference |
|---|---:|---:|---:|
| RSS peak of the `saved_meshes` stage (`probe_1075_memory_stages`) |
936,856 KiB | 1,014,664 KiB | +77,808 KiB (76.0 MiB) |
| RSS peak of the `export` stage | 809,028 KiB | 808,700 KiB | -328 KiB
|
| live heap after the owners are read (`probe_1075_heap_stages`, event
`saved-graphics`) | 681.3 MiB | 747.5 MiB | +66.2 MiB |
| live heap at the pass's peak (`probe_1075_heap_stages`) | 864.3 MiB |
932.2 MiB | +67.9 MiB |
| heap at the pass's peak, by dhat (`probe_1429_export_peak`, stage
`meshes`) | 191.7 MiB in 812,171 blocks | 259.6 MiB in 1,273,774 blocks
| +67.9 MiB |
| owners meshed | 538 | 580 | +42 |

At the pass's peak, dhat puts +58.6 MiB in the u64-keyed BTreeMap leaf
nodes of the decoded graphs (278,954 blocks against 181,290), +5.5 MiB
in `Cursor::field_as` and +4.2 MiB in the graph objects' vectors (595
blocks against 553: the 42 hosts), all under `extract_graphs` in
`extract_in_batches_with_control`. The mesh outputs are the same at both
refs. The growth of the live heap while meshing is the same too (+131.6
MiB against +129.9 MiB), so the peak is the same batch on a baseline 66
MiB higher. The issue's guess was half right: the cost is keeping the
graphs of all 42 hosts, drawn from their mesh (6) or not, not reading
them.

The head's whole-export dhat stage was cut at its 540 s limit on a
slower runner (inflate 812 ms against 597 ms); the stage probes and the
parent's completed export profile (859.8 MiB heap peak) carry the
pipeline-level claim.

## Changes

- `src/research/native_saved_scene.rs`,
`extract_in_batches_with_control`: the owners no other owner names are
removed from the owners' map once their batch is meshed, and dropped
with the batch's symbols on the thread that frees them; the owners that
name no symbol of their own (a wall's graph is its geometry) end a batch
of their own, so they are gone before the first symbol of their own is
read; only a batch of symbols sets the size of the next batch. The
invariant freeing rests on is now stated in the doc comment and kept in
code: a shared symbol that names an owner already freed (no owner names
it, so it was not kept) has that owner read again with the symbol, as a
shared record, which is where the mesh looks it up, as it finds it among
the owners in the one-shot read. Where it holds in the common case, the
symbol batches are the ones they were (same order, same sizes). Where an
owner names only other owners it does not: its set of symbols is empty,
so it sorts first and is meshed in the batch of owners that name no
symbol of their own, `add_references` reads the symbols of the owners it
names with it, and that batch does not size the next one, which the
first batch of symbols used to; and a batch of symbols none of which has
a record sizes the next as before (1,024 symbols). Output is unaffected
by either: sizes decide only which symbols share a batch. Among the
doors and windows alone no owner names another (`owners_naming_owners` 0
on both office files), so the first case does not occur there; whether
any file has a batch of symbols none of which has a record is not known.
- `probes/examples/probe_1429_export_peak.rs`: the dhat profile above,
with the real default pipeline (`ExportOptions::default()`, the STEP
text written to a sink) and the saved-graphics pass alone.
- `changelog.d/fixed/1429-embed-host-peak.md`.
- `.github/workflows/measure.yml`, the timing-merge step: a run whose
plan has one shard (a run with `models`, or with neither `nordic` nor
`samples`) failed with `timing shard 1 left no table`, although the
shard had timed its files. `actions/download-artifact` puts the one
artifact a pattern matches straight into `path`, with no directory of
its name, and the step looked in `shards/measure-timing-shard-1/`. With
one shard it now reads `shards/`. Measure 42033494804 and 42033498434
failed this way; the repeat with the fix is 42035065408 and 42035069785,
both with a table (one shard, Core Interior and the RE1 and Einhoven
models).

## Testing

Unit tests are banned in this repository: none added.

- [ ] `tools/check-local.sh` is not run here (no local builds); `cargo
fmt --all -- --check` passes locally and CI is the gate.
- [x] Peak resident memory, `rvt-ifc` default export, median of three,
base and head in turn on one runner, head f41eb75:
- against the parent of #1401 (f55a95a), Measure 42029771994: office as
built 916 to 914 MiB (1.00), at permit 979 to 971 MiB (0.99); time 1.02
and 1.00 (the 3-round median; runner noise is about that much); Core
Interior 323 to 323 MiB, RE1 and Einhoven 1.00;
- against `main` (aae3b77), Measure 42029769130, 68 files: office as
built 993 to 914 MiB (0.92), at permit 1,058 to 971 MiB (0.92), Snowdon
Towers architectural 1,108 to 1,062 MiB (0.96), time 0.98 to 1.02 across
the 68 files (0.99 and 1.00 on the two office files); every other file
1.00 or 0.99 but Core Interior (310 to 323 MiB, 1.04, see below), the
2026 racbasic sample (1.01) and the 2027 rmeadvanced sample (1.02).
- [x] Stage probes on the office as built, head f41eb75, Measure
42029765991: RSS peak of the `saved_meshes` stage 933,592 KiB (parent
936,856, main before this change 1,014,664); live heap at the pass's
peak 861.9 MiB (parent 864.3, main 932.2).
- [x] The batched read makes the elements the one-shot read makes
(`probe_1075_saved_batches`, Measure 42029765991): the doors and windows
(538 as built, 534 at permit) and, with their symbols as owners too (643
and 633; 538 and 534 owners named by another owner, which are kept), 0
elements different, the same progress events. The walls are not in that
probe's selections on the offices (the every-element selection is
skipped over 8,000 owners), so no symbol-free batch preceded the symbol
batches there: the new path is exercised by the run below.
- [x] Core Interior's resident peak takes one of two values on the same
code: about 310 MiB (317,228 to 321,064 KiB) or about 323 MiB (330,568
to 331,272 KiB), round to round and run to run, and `main` itself is in
both. `rvt-ifc` showed 310 MiB on `main` (aae3b77) and 323 MiB here in
Measure 42029769130; that pair was the low mode of `main` against the
high mode of this change, which is the mode `main` is usually in too.
Over 21 rounds of `main`'s code in the runs below, 16 are high and 5 are
low; this change has been high in all 12 of its rounds, as was the
parent of #1401 in its three. What decides the mode is not known. The
heap is the same either way: the stage probes on `main` and on f41eb75
(42032046664, 42032050573) give the same live heap (export peak 289.6
MiB, saved-graphics pass peak 288.8 MiB, both) and the same RSS peak of
the `saved_meshes` stage (330,608 against 330,660 KiB). The rounds, in
KiB:
- 42029769130 (aae3b77 against this code): `main` 317,228, 321,064,
317,580; this code 330,692, 330,720, 330,772;
- 42029771994 (f55a95a, the parent of #1401, against this code): the
parent 330,856, 330,900, 330,568; this code 331,040, 330,820, 330,896;
- 42033494804 (aae3b77 against itself): six rounds at 330,840 to
331,272;
- 42033498434 (4baac80 against this code): `main` 330,940, 331,152,
317,592; this code 330,788, 331,048, 331,084;
- 42035065408 (4baac80 against this code, with the timing fix below):
`main` 331,004, 330,948, 331,016; this code 331,008, 331,028, 331,100;
- 42035069785 (4baac80 against itself): 330,832, 331,020, 330,692 and
330,864, 317,564, 330,912.
- [x] The IFC does not move at 0bd31d7, Measure 42033631386 (`-f
base=4baac80c -f nordic=true -f r2025=true -f holdout=true -f
samples=true`, head 0bd31d7 against `main` at 4baac80): `ifc.sha256`
is identical on all 111 files, 0 different, none on one side only: 34
models (the reference models, the BIM4LCA office and the Revit 2025
models), 19 held-out and spent models (counts only) and 58 Autodesk
samples of Revit 2015 to 2027. The scorer diff of the run
(`compare-scorer-diff`) is one line, a file only the head side writes
(`areas_across_saves.txt`). The set did not include BIMcollab's example
or rac_advanced's IFC2X3 comparison (`bimcollab`, `racadv`), which the
recipe leaves out.
- [x] The IFC does not move at the final code, head 5808250, Measure
42037891871 (`-f base=a0639777 -f nordic=true -f r2025=true -f
holdout=true -f samples=true`, `main` at a063977 with #1439 on both
sides): `ifc.sha256` is identical on all 111 files, 0 different, none on
one side only (34 models, 19 held-out and spent models, counts only, 58
Autodesk samples). The scorer diff of the run is the one line `Only in
measure-head: areas_across_saves.txt`, as for 0bd31d7.
- [x] The batched read makes the elements the one-shot read makes at the
final code, `probe_1075_saved_batches`, Measure 42037895275 (head
5808250), 0 elements different in every selection of every model, the
same progress events:
- Core Interior (138 doors and windows): `owners_and_their_symbols` 149
owners (138 naming owners), `owners_and_every_other_symbol` 144 owners
(45 naming owners), `every_boxed_element` 970 owners, all identical;
- the office as built (538) and at permit (534):
`owners_and_their_symbols` 643 and 633 (538 and 534 naming owners),
`owners_and_every_other_symbol` 591 and 584 (272 and 250 naming owners),
identical; `every_boxed_element` skipped over 8,000 owners (12,974 and
13,020);
- RE1 Architecture: 5, 10, 8 and 85 owners, identical; RE1 Electrical,
Mechanical and Plumbing: 21 and 11 / 15 and 8 / 20 and 10 symbol
selections, 49 / 74 / 124 elements with a location, identical; their
doors-and-windows selection is empty, which the reader takes for every
record, so 10,266, 4,743 and 4,827 elements were compared, identical.
The every-element selections have the walls as owners, so a symbol-free
batch precedes the symbol batches there.
- [x] The re-read of a freed owner that a shared symbol names did not
run on any of these files, and is untested on real files. Measure
42040371054 times the same probe on a scratch branch (80d56115, since
deleted) that is this change without the re-read, on Core Interior, the
RE1 models and both office files: 0 elements different in every
selection of every model (the same counts as with it), so no symbol read
by a batch named an owner freed with an earlier batch in them, including
with every second symbol as an owner (`owners_and_every_other_symbol`,
45 owners naming owners on Core Interior, 272 and 250 on the office as
built and at permit). The re-read is the fail-closed answer to a shape
the one-shot read handles and these files do not have; it makes the
batched read equal the one-shot read where that shape occurs, and
nothing here shows it doing so.
- Merged since that run: `main` at afec5e3 (#1436: a probe, a report,
and `default_representation` in `native_graphics_traversal.rs`, which
reads an `InstanceInfo` of Revit 2015 to 2022 as the default
representation; the release gate keeps those files out of every export).
The merge, 1d7b12a, is clean and touches none of this change's files,
and the comparison above was not repeated on it.
- Not measured, stated as limits: the browser (wasm32, one thread, where
the freed owners drop inline) is inferred from the same code, not
measured: `viewer/tests/saved-meshes-measure.spec.ts` covers no model
with an embed host. Whether this change can land in Core Interior's low
resident-peak mode is untested (it has not in its 12 rounds). The 2027
`rmeadvanced` sample (559 to 568 MiB, 1.02) and the 2026 `racbasic`
sample (1.01) are in the same plus or minus 2 percent class as the mode
difference, and have no repeat.

## Audit-honesty checklist

- [x] No claim in the docs changes: no export byte is meant to move.
- [x] Changelog fragment `changelog.d/fixed/1429-embed-host-peak.md`;
its figures are the timing runs' and the unfiltered Measure's above.
- [x] No emojis, no private paths.

## Breaking changes

None.

## Related issues

Closes #1429. Its done-when is met: the allocation is found with a peak
profile on the office (above), the peak is within 1.02 of the parent of
#1401 on both office files (916 to 914 MiB as built, 979 to 971 MiB at
permit, Measure 42029771994), and the IFC is byte-identical on every
model of the unfiltered Measure (42033631386).
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.

Walls cut by an embedded curtain wall: a byte signal for which hosts keep their end stubs (RE-335)

1 participant