Skip to content

feat(ifc): a wall base covered in part is cut over the covered part, and a profile-edited wall's end follows the walls its record joins (#1409, #1410, #1411) (RE-348) (RE-349) - #1470

Merged
DrunkOnJava merged 17 commits into
mainfrom
fix/1410-wall-end-levels
Nov 5, 2026

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two readers for one set of walls, in one PR (it holds #1469's commits; #1469 is closed unmerged):

What changes in the diagnostics. Every export's diagnostics.json gains three counters, exported.wall_end_sources, exported.wall_base_sources and exported.wall_ends_order_dependent (zero or empty on all but the BIM4LCA office files). On the office as built, wall_base_refusals no_element_covers_the_wall_plan (2) and wall_end_refusals base_not_cut_over_the_extended_plan (2) go away, wall_base_sources is 4 level cuts, 10 sloped and 2 _in_part, wall_end_sources is 4 and wall_ends_order_dependent 4; at permit wall_end_refusals wall_beneath_not_one_rectangle (2) becomes joined_wall_face_inside_the_wall (2) and wall_end_sources is 4. The first unfiltered run (e5ff94f4) marked every refusal and put two on Autodesk's Snowdon Towers Architectural (joined_walls_do_not_reach_the_wall_height: 736143, which main already draws as Revit's export does, and 1996083, which it draws 1.03 ft short) and two on the office as built (end_join_curve_not_at_the_box_end: 2056705 and 2056770, the walls of #1474, whose bodies are centreline bodies with trims 0 so that no curve end lies at the end of the record box the rule starts from). A marker on a wall that already has Revit's end says the rule failed where nothing needed doing, so a wall now carries BodyEndRefusal only where the faces of the joined walls read before the refusal show its end short of or past them (joined_wall_face_inside_the_wall on the same two walls at permit qualifies); any other end the rule could not read is counted in exported.wall_end_reads_unmarked and the wall carries nothing. In the verdict run below (42119702779 on 2272c31c) the hash of the Snowdon file does not move and both of its walls are counted with no marker, 1996083 among them: main draws it 1.03 ft short of Revit's local export and the faces read before the refusal show no offset, so the rule leaves a known-wrong wall with a count and no marker.

Why one PR. Griffin's labelled approximation was approved for "this wall case only" (2057668 and 2057670). The base cut alone would carry RE-337's approximate end to 2058499 and 2058501 as well, four walls on the as-built office against two on main, until the order rule retired it. Landing them apart would extend that approval for no reason, and cost two unfiltered runs and two full CI rounds on stacked code. It is also one set of walls: 2058499 and 2058501 as built take Revit's end only with both.

The order rule rests on 4 walls in one project (8 ends), and only the 4 as-built ends depend on the order at all: they give 3 pairwise orderings, which the rule was fitted to after about four alternatives had been tried; the permit ends would pass under any order. It is fail-closed: a wall whose join list does not fit keeps the end its record gives, with a counted BodyEndRefusal (an end whose record lists no wall is not read and carries no marker; one the record trimmed is counted when its list is not read or no curve end lies at the box's end). The base cut rests on 2 walls in one file. The rule is on its own release list (Revit 2024).

#1410's volume done-when is not met and is not loosened. After this change the four walls' ends are Revit's at every height, and their volume is 0.209 ft3 over Revit's as built (0.207 at permit): all of it the far end's sloped top, which the profile line does not reach (#1473). The wedge is 0.2088 ft3 from the record's GLine and the box's top, and 0.2088 ft3 is what the scorer measures on each wall. So this PR is Refs #1410.

Motivation

#1411: the BIM4LCA office's Basement walls 2058499 and 2058501 as built stand past the edge of their footing (2058504); RE-337 kept their ends 0.31 ft short of Revit's because the longer plan would only have added uncut base. #1410: Revit steps the ends of 2057668 and 2057670 up the wall's height, and RE-337 omitted the second step. #1409: at building permit the wall beneath 2058499 and 2058501 (1347201) is drawn with a stepped profile, so RE-337 did not read its face.

Changes

  • src/ifc/export_content/wall_tops.rs: decide_base takes an element that covers the plan in part (covered_pieces) only where none that covers the whole is eligible, base_cut_piece splits each convex, counter-clockwise piece of the wall into the part inside the covered pieces, cut at the element's top, and the rest from the wall's base; read_end reads an end over every height band from the plans of the walls its record joins (followed_wall, including the pieces of a wall whose top a floor cut in steps), strips_of draws it as the wall's plan to its top and one column from the base for each distance the end reaches beyond the next.
  • src/research/native_walls.rs, src/research/partition_schema_mvp/walls.rs, fields.rs: each wall's location curve (VWallDriver.m_pCrv) and JoinEndGStep.m_realJoined of each end, as fields.
  • BodyBaseSource wall_base_cut_at_floor_covering_in_part and wall_base_sloped_at_floor_covering_in_part, BaseCoverRefusal partly_covered_plan_not_read and base_cut_solid_not_made (a cut that resolves and whose solid cannot be made no longer leaves a silent prism); BodyEndSource wall_end_stepped_to_joined_walls; nine new BodyEndRefusal reasons, three of RE-337's kept, two gone (docs and schema updated).
  • Diagnostics: exported.wall_end_sources, wall_base_sources and wall_ends_order_dependent (the ends only the order decides), and tools/re/wall_rule_counts.py, which Measure runs for every model and scrub-holdout-results.sh keeps as wall rules: count lines, so held-out models report per-model counts.
  • decide_base: a wall whose base join names any element that covers the whole plan takes no partial cut, so no wall main cut or refused over a whole cover changes; covered_pieces refuses overlapping pieces.
  • Fail closed: a joined wall whose base join names elements is not read as standing from its base.
  • tests/export_decisions_counts.rs: the office as built no longer witnesses wall_base_cut_refused and wall_end_extension_refused.
  • probes/examples/probe_1410_wall_end_steps.rs, reports RE-348 and RE-349, docs/format-reconnaissance.md addenda, changelog fragments (1410-..., 1411-...; 1396-... rewritten, the approximation is gone from it) and the support matrix.

Testing

Unit tests are banned; measured end to end on Revit's own exports.

  • Verified end to end on real Revit files (both BIM4LCA office files, CC BY-SA 4.0; scorers wall_heights_vs_ifc, wall_quantities_vs_ifc, wall_top_cover_vs_ifc, wall_layers_vs_ifc): the probe run 42096049754 at a24305af; Measure 42099826920 at c413f382 (the base cut alone) against main at 44c055db and 42101944733 at 006f5f98 (both) against main at fb486064. Reproduce: the commands in the reports. These runs predate the second reads' fixes (decide_base, covered_pieces, base_cut_piece, subtract_convex, the counters, the new reasons and the release list), which are meant to change nothing the four walls take; the unfiltered run on the final head is the verdict.
  • Office as built: of 607 walls, 4 bodies change (2057668, 2057670, 2058499, 2058501); at permit, those four are the only bodies that change, and 2056705 and 2056770 (same bodies) gain BodyEndRefusal joined_wall_face_inside_the_wall: Revit cuts their end back above 182.087 ft and the rule only adds, so this is an existing error of main's, named now (their as-built siblings, 15 of 100 points taller on main too with no marker, are Walls 2056705 and 2056770: Revit cuts their ends back above 182.087 ft and steps them, and neither office file draws that #1474).
  • The four walls have Revit's lowest point on both files (2058499 and 2058501 as built keep 174.2126 ft; at permit they go from 0.0439 ft above Revit's to Revit's; walls with Revit's base and top at permit 587 to 589 of 589), Revit's end at every height, and no point of their plan above Revit's top.
  • Unfiltered run 42111477633 on e5ff94f4 against main (base=main nordic=true r2025=true samples=true holdout=true, no other filter; 111 exports, 18 of them held-out): ifc.sha256 moved on 3 models only, the two office files and Autodesk's Snowdon Towers Architectural; Core Interior (wall 55840 included), Einhoven, RE1, the 24 R2025 models, the other 57 samples and all 18 held-out models are byte-identical. Only the two office files take either rule (wall_end_stepped_to_joined_walls 4 as built and 4 at permit, *_in_part 2 as built); no wall of the other 109 models does, so the green same-project gates (success on the head: 9 samples held to their earlier saves and the Areas on 4 saves) says nothing about these rules. Schema: validate and EXPRESS rules findings 0 on both office files and Core Interior, head and base (the new Compound bodies are in the as-built file). Corpus health (witness replay, project counts), IfcOpenShell validates exports and semver checks pass on the head. Export time summed over 93 exports 432 s head against 449 s base; 100 job-minutes. The marker policy above came after that run. Its verdict run, 42119702779 on 2272c31c (base=main nordic=true samples=true, no ifc_flags, 68 exports), moved ifc.sha256 on the two office files only (Snowdon's does not move), and its same-project gates check run is success (9 samples held to their earlier saves, and the Areas on 4 saves and on the 2021 save). exported.wall_end_reads_unmarked holds end_join_curve_not_at_the_box_end 2 on the office as built (2056705 and 2056770) and joined_walls_do_not_reach_the_wall_height 2 on Snowdon Towers Architectural, none on any other of the 68; the office at permit keeps its 2 marked joined_wall_face_inside_the_wall. No unfiltered repeat was run, and the Revit 2025 and held-out exports are not measured on this head: none had a refusal or a count at e5ff94f4, and the policy acts only on a refusal.
  • Not exercised by any measured wall: every BodyEndRefusal reason but joined_wall_face_inside_the_wall, the high end of a wall, walls along x, the level top of a partial cover, a partially covered wall with no end extension, a clockwise or concave ring.

Audit-honesty checklist

  • README / docs reflect the current state; wall_end_to_base_wall_upper_step_omitted no longer appears in the matrix, the diagnostics reference or schema, or the changelog's rule description (it is named in the retirement note and in the RE-337 and RE-349 reports as history)
  • User-visible changes have fragments under changelog.d/fixed/
  • New limitations are documented in the PR body, the reports and in code (the four walls' 0.209 ft3 is A profile-edited wall's sloped top stops at the profile's end: a 0.41 ft stub stays flat, 0.65 ft too high #1473)
  • No emojis, no private paths
  • Reverse-engineering finding: probe under probes/examples/, reports RE-348 and RE-349, addenda in docs/format-reconnaissance.md

Legal and contribution hygiene

  • Apache-2.0; no Autodesk proprietary source (clean-room: public bytes of the record and Revit's exported IFC bodies only)

Breaking changes

Against main only, not against any release: this removes the public constants WALL_END_AT_BASE_WALL_BODY_END_SOURCE and WALL_END_UPPER_STEP_OMITTED_BODY_END_SOURCE and replaces the BodyEndSource values they hold, and the BodyEndRefusal reasons wall_beneath_not_one_rectangle and walls_beneath_reach_the_end_at_different_faces. All of them came in with #1398 (b510ff3c), which no release contains (git tag --contains b510ff3c is empty; v0.15.0 predates it), so no released API or output changes. The semver checks job compares with main and accepts only an announcement, so the footer below is for it, not a break of a release:

BREAKING CHANGE: removes WALL_END_AT_BASE_WALL_BODY_END_SOURCE and WALL_END_UPPER_STEP_OMITTED_BODY_END_SOURCE, unreleased constants added by #1398; no release has them.

Related issues

Closes #1409. Closes #1411. Refs #1410 (volume done-when not met, #1473). Replaces #1469.

@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 20:36
@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 changed the title feat(ifc): a profile-edited wall's end is drawn at each height to the first wall its record joins there (#1410, #1409) (RE-348) feat(ifc): a wall base covered in part is cut over the covered part, and a profile-edited wall's end follows the walls its record joins (#1409, #1410, #1411) (RE-348) (RE-349) 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 0c6c6a8 into main Nov 5, 2026
45 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/1410-wall-end-levels branch November 5, 2026 23:10
DrunkOnJava added a commit that referenced this pull request Nov 6, 2026
…y read, and CI reads the current copy rule (#1368) (#1481)

## Summary

With `--element-provenance`, the table now names the records behind a
wall's layers (`wall_type_layers`), a beam or column drawn as its type's
I section (`type_i_section`), an Area's Levels (`area_levels`), a tread
landing (`native_landing_type`, `native_run_type`) and a spiral run
(`native_run_type`). CI's gate also reads the BIM4LCA office at building
permit, the one model of 92 with the `current` copy rule. The export is
unchanged; only the provenance table gains sources.

Closes #1368

## Motivation

#1368 left the profile copies and the landing thickness as "no source
yet", listed four more values with no reader, and said no CI model
exercises `current`. All three are answered below with the run and head
each figure was measured on.

## Measured

- Counts on main before this change: Measure run 42111951132 (main at
d2439b0; `-f samples=true -f nordic=true -f r2025=true -f
ifc_flags=--element-provenance -f scorers=none`, no `models` filter
because it is the one run that answers which model exercises `current`).
92 models: Core Interior, Einhoven, 4 RE1, 4 BIM4LCA office files, the
24 Revit 2025 models of puzzbobb's three pinned archives, 58 Autodesk
samples. The held-out models, BIMcollab and the `racadv` models were not
fetched.
- The same run shape on this head, after #1450 (run 42118489328,
ee449c3): `selected_frame_box` on 0 of 92 (the profile-copy gap is
empty; the doc row is now the stated fallback). `current` on 1 of 92,
the office at permit (`sketch_lines` 3, `sketch_list` 1); the 2021
`rac_advanced` has none, its 25 Areas read `area_plan_topology`;
`instance_transform`, `sketch_line_data` and `roof_line_data` have none
anywhere. New sources: `wall_type_layers` 1,973 elements on 29 models,
`area_levels` 483 Areas on 17, `type_i_section` 557 elements on 5
(Autodesk's `rstbasicsampleproject` 2024 to 2027 and Snowdon structural;
none on a CI gate model), `native_run_type` 84 on 17,
`native_landing_type` 82 on 8.
- The default export is unchanged: run 42118484766 (ee449c3, `-f
samples=true -f sample_years="2024 2027" -f
scorers=bodies_across_saves`, no `ifc_flags`, against main) has the
`ifc.sha256` of all 31 exports (Core Interior, Einhoven, 4 RE1,
Autodesk's samples 2024 to 2027) identical on both sides, and its
`same-project gates` check run on ee449c3 is a success (the neutral one
on that commit is the `ifc_flags` run's). The two MCP-text and doc
commits after it change no `src/`.
- Run 42115109274 (b4d34de, flag on both sides): hashes of Core
Interior and the office as built and at permit equal; `native_run_type`
0 to 2 and `native_landing_type` 21 to 22 on both office files.
- Corpus health, which runs `tests/value_sources_offsets.rs` on the
permit office and the new readers, passed on bd3466c. The second read's
fixes after it (d303289: the rule, the stricter test, the docs) have
not been through the full CI.
- On d303289, the final head: run 42128212880 (`-f base=main -f
samples=true -f sample_years="2024 2027" -f
scorers=bodies_across_saves`, no `ifc_flags`) has the `ifc.sha256` of
all 31 exports identical to `main`'s, and its `same-project gates` check
run on d303289 is a success.

## Second read (d303289)

- A Level's block (`level_block`) and an Area's Levels (`area_levels`)
are rule `frame`, not `agreeing`: `scan_partition_levels` keeps each
Level's newest partition and never compares older copies (RE-107); on
the office at permit Level 1338637 is `02a_P-talo 2` in Partitions/340
and `Level_02a_Parking` in Partitions/405. `docs/export-diagnostics.md`
says so.
- `tests/value_sources_offsets.rs`: `REQUIRED` makes the new readers
required per `BodySource` (not any-of); `CURRENT_PINS` pins at least 3
`sketch_lines` and 1 `sketch_list` on the permit office; a Level's block
decoded again at its offset must give the elevation of a storey the
export writes where it is a building story; a wall type's layers read
again must add up to the thickness of a layer set the export writes. Not
compared: the numbers of the other parts (an I section's dimensions, a
hollow section's, a pipe's points) and which Level an Area's base is; no
gate model has an I section, so that check would not run in CI.
- `wall_type_layers` is noted where the wall's thickness is set, not
only where its layers are, so a wall drawn at its type's thickness is
sourced even when its bands are empty.
- The fragment says "of the four values #1368 listed"; the docs name the
wall row's other unlisted inputs, the I-section row's 557 Measure
elements and the area-point row's `area_levels`.
- The CI cache is not changed: the permit file's entry in
`research/bim4lca-models.tsv` changes that key (the whole folder is
saved again, 293 MB to about 371 MB, and the first run downloads from
the VTT host); Measure's `bim4lca-measure-<hash>` entry is
path-versioned (`_bim4lca-measure`), so reuse means a restore-only step
and a hardlink, with a one-entry fetch as the fallback. Not done unless
asked.
- No `src/` outside the provenance path changed in this commit (the two
labels are inside `if recording`, the wall note is behind
`attribute_value_source`), so no new verdict run: the verdict on
ee449c3 stands, and the merge of main was clean.

## Residuals for the follow-up (not what #1368 listed)

Filed as #1498. Inputs of the bodies with no source, so none of them is
claimed as sourced:
- A rectangular column's two sides (a decision: they only gate whether
its box quantities are written).
- #1456's `PlacementAxesSource`: a door or window's rotation from
`instance_transform` is noted but filtered out, because `RECORD_BBOX`
lists only `selected_frame`; the wall's native line and the two flips
have no source.
- #1470's `m_realJoined` and its `Compound` pieces.
- A wall's top, base and end rules, its orientation and flip, a tapered
wall's face angle, the partner lists of its joins and the layers and
frames of the walls it joins; a beam's rotation; cut-loop sizes.
- The numbers of the parts the test does not compare (above).

## Changes

- `src/reader.rs`, `src/research/native_stairs.rs`:
`attribute_value_sources` builds one source from several records and
notes none if one is missing; tread landings and spiral runs use it for
their run types. All calls return at once when the handle records no
sources.
- `src/research/partition_schema_mvp/walls.rs`,
`src/ifc/element_provenance.rs`: a wall's type layers (the same
`type_layers` note a roof's use) go to the wall; `SectionShape` `I` lets
`type_i_section` list for a beam.
- `src/research/partition_level_records.rs`,
`src/research/partition_area_records.rs`: `scan_partition_levels` notes
each Level's newest block (`NameElevationBlock` gains an `offset`); an
Area lists the block of every Level its base and height compare.
- `rvt-mcp/src/schema.rs`: the description no longer says "Absent for a
body no reader notes yet"; `docs/mcp-tools.*` came from CI's artifact
(23fec52).
- `tests/value_sources_offsets.rs`: coverage and `MIN_READERS` for the
new readers; a part of `native_run_type`, `native_landing_type` or
`wall_type_layers` is read at its bytes; an Area's `area_levels` parts
must be all the file's Levels; the permit office is a gate model with
`CURRENT_PINS`.
- `research/bim4lca-models.tsv`, `corpus/tier2/README.md`,
`docs/reference-models.md`: CI fetches the permit office (78.3 MB, same
pin as `research/bim4lca-measure.tsv`).
- `docs/export-diagnostics.md`, changelog fragment: rows, counts, and
the one value without a source.

## Testing

- [ ] `tools/check-local.sh`: not run locally (no local builds); the
draft's fast jobs and the full CI are the gate.
- [x] Measured on real files: the runs above.

## Audit-honesty checklist

- [x] A rectangular column's two sides have no source, by decision: they
only gate whether its box quantities are written, no number of the
type's is written, and the docs say so.
- [x] Changelog fragment
`changelog.d/changed/1368-tread-landing-and-spiral-run-sources.md`
- [x] No emojis, no private paths

## Legal and contribution hygiene

- [x] Apache-2.0; no Autodesk source. The permit office is CC BY-SA 4.0
and fetched, never committed.

## Breaking changes

None to the export. `NameElevationBlock` (research API) gains a field.
DrunkOnJava added a commit that referenced this pull request Nov 6, 2026
…ead on selection (#35) (RE-207) (#1468)

## Summary

The viewer's info panel lists a selected element's saved parameters
(RE-207): instance, then type, named ones first, nameless ones behind a
fold grouped by why they have no name (#255), each row saying where its
parameter is defined. They are read for that element only, on selection,
by a new `savedParameters` binding in a worker of its own; the open and
every export are unchanged. File Status's Parameters row no longer says
the rest are "still to be decoded".

**Nothing is requested once the first file is open** (Griffin,
2026-11-05, "Keep the claim, no request"): selecting an element,
exporting IFC, plan or glTF, and opening the file again fetch nothing,
and a page taken offline after it loaded does all of them.

## Motivation

The last open acceptance item of #35 that is not blocked: "Viewer info
panel displays them in readable form". The CLI, Python and IFC
(`--revit-property-sets`) expose the saved parameters; the viewer showed
a count and a sentence that RE-207 had already made wrong.

## Changes

- `rvt-wasm/src/lib.rs`, `rvt-wasm/Cargo.toml`, `Cargo.lock`:
`savedParameters(bytes, ids, limits)` returns JSON text: each entry is
`serde_json::to_value` of the parameter
`native_element_parameters::read` gives, the call `rvt-elements` makes,
with the release and how far it is read. `rvt` gets `unstable-research`
here, which "adds paths and changes nothing else" (`src/research.rs`);
no file under `src/` changes, so no export can move, and `arm.sh`'s
`src/` gate path does not match `rvt-wasm/src/`. **The result's keys are
a 1.0-stable surface** (`RELEASE.md`): `release`, `release_read`,
`release_experimental`, `releases_read`, `releases_measured`,
`elements`, `unresolved_family_slots`,
`instance_parameters_without_value`. I chose them to say what they mean
(not the research module's "native"): the read range, the measured range
(Revit 2015 to 2022 are read experimentally, RE-281), and what could not
be listed. `ids` is a `Float64Array`.
- `viewer/src/parameters-worker.ts`, `viewer/src/saved-parameters.ts`,
`viewer/src/wasm-failure.ts` (new; the out-of-memory test both workers
use), `viewer/src/worker.ts`, `viewer/src/main.ts`,
`viewer/src/styles.css`, `viewer/index.html`, `viewer/src/env.d.ts`: the
panel group and its states (loading, ready, empty, release not read,
experimental release, no ElementId, error with Try again,
read-when-asked), the page's map of answers, focus and a live region,
the status row text, and the no-request mechanics below. The "Not
recovered" note for an element with no IFC property set now says "IFC
property sets".
- `viewer/tests/parameters-row.spec.ts`,
`viewer/tests/no-network.spec.ts`,
`viewer/tests/worker-failures.spec.ts` (now patches the inline worker's
blob where it routed a worker URL), `viewer/tests/folded-pieces.spec.ts`
(prints what a read does and what the page keeps on the BIM4LCA office,
and fails if the read errors).
- `.github/workflows/viewer-test.yml`,
`.github/workflows/deploy-viewer.yml`: after #1458, `--bin rvt-elements`
is built beside `gen-fixture` in the `build` job, copied into the
artifact and checked to run in each leg; Deploy viewer builds and
uploads its own artifact for `tests` and `measure`, so it carries the
binary the same way. A local `pnpm test:browser` needs `rvt-elements` on
PATH (`viewer/README.md`); the `parameters-row` specs skip without it
locally and fail in CI.
- Docs: `docs/viewer-api.md`, `docs/viewer-privacy-posture.md` (the CSP
change, below), `README.md` (13 bindings), `docs/status.md`,
`docs/support-matrix.json` (it also drops the "wall's or floor's type
parameters are not joined" caveat RE-256 made stale),
`docs/evidence.md`, `docs/export-diagnostics.md`, `docs/user-guide.md`,
`docs/viewer-build-pipeline.md`, `docs/maintaining.md`,
`viewer/README.md`, and
`changelog.d/added/35-viewer-saved-parameters.md`.

## Design

**A worker of its own, nothing resident.** `extract` is a pass over the
file, so the read is lazy, per selected element. The open's worker keeps
no `RevitFile` and no bytes: a held handle would keep the file's bytes
and every partition it inflates for the session, and its reads would
hold up the panel (Core Interior's take seconds). Instead the page opens
a worker for one element, which reads the `File` the page already holds,
calls the binding, answers and is terminated, or is terminated at once
when another element, a storey or a scaffold panel replaces the group.
wasm linear memory only grows, so ending the worker gives a read's
memory back. A worker the browser ends with no word (no event) is found
by a Web Lock it holds, so "Reading" cannot show for ever.

**No request once the file is open; the CSP change.** The page's
`worker-src` was `'self'`; it is now `'self' blob:`, and nothing else in
the policy moves (`docs/viewer-privacy-posture.md` says so and why).
Both workers (the open's and the reader) are bundled into the page
(`?worker&inline`) and start from blob URLs; the decoder's glue is a
static import (the main thread's exports used to `import()` it, and
fetch the wasm, at the first export click). The first open's worker
fetches the wasm once, compiles it and hands the module to the page,
which keeps it: the next open (another phase, the saved-mesh toggle, the
large-model retry), the readers (`initSync({ module })`) and the main
thread's exports (`default({ module_or_path })`; the main thread does
not allow `initSync` of a large module) start from it. The lazy loads in
`viewer/src` that could run after the open were:
`import('../pkg/rvt.js')` (static now), `new Worker(new
URL('./worker.ts', ...))` (inline now), the worker's `fetch(new
URL('../pkg/rvt_bg.wasm', ...))` (the page resolves the URL once, and
fetches only at the first open). Opening a gallery demo still fetches
the demo, which is an open.

**First page load.** The page's one script is 999.56 kB (271.47 kB
gzipped) against 959.29 kB (262.82 kB) in the build of `d1de8adf`: 40.27
kB, 8.65 kB gzipped, more, mostly the glue and the two workers it used
to fetch later; the built site holds one script, one stylesheet and the
wasm.

**When a selection is read on its own.** A read has taken 0.74 to 1.04
times the open's wasm memory, and the ratio rises with the file
(Einhoven 23 MiB, Core Interior 326, the office 910). Nothing above the
office has been measured, so a selection is read on its own only while
the wasm memory the page holds (the open's, plus the main thread's
instance if an export made one) is at most 1 GiB (a quarter of
`?memoryCeilingBytes=` where that lowers the 4 GiB ceiling), and above
that the panel asks first with a button whose copy says clicking may
close the tab: a renderer out of memory takes the tab and the model with
it, with no error. After a read that ran out of memory, or a worker that
went without a word, that file is read only when asked. This replaces
the rule that two instances stay inside the ceiling, which extrapolated
past what is measured.

**What the page keeps.** Each element's answer, in a map on the page: at
most 64 (`?parametersRemembered=` lowers it for the test), the least
recently selected going first, emptied when a file is opened. Selecting
an element again starts no worker. On the office after the test's
selections it held 2 answers, 4,654 characters of JSON (the entries are
small; the answers there have 8 entries).

## Testing

Unit tests are banned in this repository: none added. Measured in
**Viewer tests run 42125048710**, dispatched on head
`3146f14e6fcf221adc4f632ac1a5cfa31a3b885d` (the merge of main with
#1457's changes included), `release_wasm=false`, on a CI runner: success
in all three legs, `check-wasm-in-site.sh` finding the one wasm sha256
in the site in each. **Deploy viewer run 42125109395**, dispatched on
the same head, on the release (LTO) wasm: success. Its `tests` job
passed all 61 tests of the suite (the whole of it, on the wasm the site
publishes), its `measure` job 6, and `check-wasm-in-site.sh` found the
artifact's one sha256 (`d2b60a7e…`) in the built site in each of the
three jobs that build it; the page's one script is the same size as in
the viewer tests' build (999.56 kB, 271.47 kB gzipped). On the office
with that wasm a read took 3.3 s in 942 MiB beside the open's 910 MiB,
on selection, and the page kept 3 answers, 4,929 characters; the real
capped read ran out of memory as in the other run. (`deploy` is skipped
on a branch, by design.) This PR's head is `3146f14e` plus documentation
(the figures, in the changelog, `docs/status.md` and
`docs/viewer-api.md`) plus a merge of main as it stood at #1470, whose
export changes (#1456, #1470, `src/ifc`) were not part of either run;
the full CI of the ready PR runs the viewer tests on this head. Earlier
runs on earlier code are not counted; Deploy viewer 42122627698 and
viewer tests 42122623374, on `7663a4f3`, each failed once, in the test
of a worker ended with no word, which ended a worker that had already
answered (a read of Einhoven takes a fraction of a second); the test now
holds the file back first.

`viewer/tests/parameters-row.spec.ts`, in the viewer's leg 1/3 (no new
spec file). The oracle is the command line: the test runs `rvt-elements`
on the same file.

| | Einhoven (2023) | Core Interior (2024) | BIM4LCA office as built |
|---|---|---|---|
| Compared with `rvt-elements`, whole entries | 37 of 37 tree elements:
28 with parameters (369 entries: 332 instance, 37 type, 8 named) equal,
7 with none show the empty state, 2 have no ElementId in the export
(shown as such) | 4 elements, IFCSLAB 22756 (4 entries), IFCWALL 22771
(11), IFCCOLUMN 22798 (17), IFCDOOR 80750 (21), equal | **not compared**
|
| A read, time (a CI runner's) | median 153 ms, most 210 ms | 1.5 to 1.9
s | 3.9 s (8 entries, IFCCOVERING 2097832) |
| That read's wasm memory | 17 MiB | 275 MiB | 943 MiB |
| The open's worker | 23 MiB, 0.7 s in the open call | 326 MiB, 17.3 s |
910 MiB, 66.6 s |
| Read over open (memory) | 0.74 | 0.84 | 1.04 |
| How it was read | on selection | on selection | on selection (no
button) |
| Kept by the page | | | 2 answers, 4,654 characters of JSON |

Also in the spec (each passed in 42125048710):
- **A real out-of-memory read.** A Chromium whose V8 caps wasm memory at
927 MiB (`--wasm-max-mem-pages`, the pattern of
`memory-ceiling-capped.spec.ts`) opens the office (910 MiB) and the read
(943 MiB) really runs out: the page says "The tab ran out of memory
reading the file a second time (unreachable)... read only when asked
from now on", and the next element asks. A read of Einhoven cannot fail
after its open succeeds (17 MiB against 23), so the office is the only
file in CI where a cap separates the two.
- **No request, offline.** After the load the page is taken offline and
every request is recorded (workers included): three elements are read
and equal `rvt-elements`', an IFC, a plan and a glTF export are made,
the file is opened again (the saved-mesh toggle), an element is read
again, and no http(s) request was made. `no-network.spec.ts` runs the
same exports and re-open, and a selection, in phases that allow nothing,
and fails if the sample has no element to select, if the wasm is fetched
to boot the page or more than once.
- The gate at its edge (a limit 8 MiB over and 8 MiB under Einhoven's
measured open memory: read on selection, then asked); the
bare-`unreachable` branch and its copy, and the file read only when
asked afterwards; a worker ended with no word, with the file held back
four seconds so it is still reading; a read for an element no longer
shown ended (another element, a storey), and the shown element's read
not started over by selecting it again; an element selected again
starting no worker; a copy of the file opened under another name
emptying the map; the bound; a read that fails with a panic, with Try
again, and focus on the result; the empty state; the Parameters row
text; Revit 2013 (the worker's answer replaced) and Revit 2019
experimental (replaced).

Not verified:

- **The release-not-read and experimental-release states.** No file of a
release outside Revit 2015 to 2027, or of 2015 to 2022, is in the
viewer's job, so those two tests replace the worker's answer to the page
with the binding's shape for one (`release_read` false;
`release_experimental` true). They test the page's rendering only. The
Rust branches (`NATIVE_RELEASES.contains`, the measured range) are not
exercised by any file.
- `tools/check-local.sh`, clippy and `tools/ci/check-workflows.py` (no
local compute; PyYAML is not installed here); CI's fast jobs on this PR
are the check. The wasm network-import audit passed in the viewer legs.
- An ElementId above `u32::MAX`: the binding reads it, the command line
lists such elements as `id: null`, so nothing compares them.
- The office is not compared with `rvt-elements`; only that its read
does not error. The gate is held at its edge on Einhoven's open memory;
no file between 910 MiB and the 4 GiB ceiling is in the viewer's job,
which is why the limit is the measured 1 GiB.
- The CDP session of `no-network.spec.ts` may not see worker requests;
the offline test, which records every request and fails any, is what
covers them.
- Screen-reader announcements were not heard: the live region's text and
the focus move are asserted, not a screen reader's output.

## Breaking changes

None. A binding is added (`tools/ci/wasm-api.py compat` has nothing to
flag); no existing binding or output changes. The `worker-src` of the
page's Content-Security-Policy gains `blob:`.

## Related issues

Refs #35 (#255 and the family built-in slots stay open).
DrunkOnJava added a commit that referenced this pull request Nov 6, 2026
…alog's document build only the fields they read; the preamble does less (#1335) (#1483)

## Summary

One mechanism, three cuts, for #1335: a native pass that reads a few
fields of a graph now reads and checks the whole graph exactly as before
and builds only the fields it reads
(`native_parameters::decode_graph_projected`, `Options::graph_fields`).
It is used by the parameter definitions pass (its `Family` and
`FamilySymbol` records), the read of the wall records (`SWall` and
`ArcWall`) and the extensible storage catalog's document; the preamble's
element index and checksum hex also do less work. Folded from #1483,
#1485 and #1488; the phase read (#1487) is not changed and is recorded
below as a measured floor.

Measured at 4140b96 (`main` merged at df96767). The pushed head,
1811752, merges `main` at 8060ecc cleanly: no conflict in the files
this changes, and #1470's additions to `native_walls.rs` are in
`native_walls_and_top_joins_into`, which reads in full, not in
`WallReads::read`.

- **Peak memory falls on 58 of 68 files, is equal on 6 and rises on 4
(by 1, 1, 1 and 8 MiB).** The catalog's document, built whole, was the
peak of many files: 2024 Snowdon Towers HVAC 398 to 214 MiB (0.54),
Einhoven 37 to 30, 2015 to 2019 `rst_basic` 91 to 94 down to 79 to 80,
Core Interior 324 to 310, RE1 Plumbing 73 to 67, Snowdon Towers plumbing
513 to 462. The four rises: 2026 `racbasicsampleproject` 225 to 233 MiB
(1.03), and RE1 Electrical, 2015 `rac_advanced` and the BIM4LCA office
at building permit by 1 MiB each. Why the 8 MiB is not measured.
- **Time against `main` (the same unfiltered run, paired on one runner
per shard, median of three): 0.867 on the 2015 samples, 0.878 on 2016 to
2018, 0.862 on 2019 to 2022, 0.903 on 2023, 0.968 on 2024 to 2027, 0.972
on the reference models and offices;** 0.947 over the 58 samples (mean
of the per-file ratios 0.914, median 0.901) and 0.953 over all 68 files.
The table is below.
- **Against 0.11.0 and 0.15.0** (same-runner timing runs, 2015 to 2023
samples and the six reference models): 1.175 of 0.11.0's time over the
33 samples (mean of per-file ratios 1.199, median 1.254; 2015 to 2022
about 1.2, 2023 0.894, reference models 0.772) and 0.884 of 0.15.0's
(mean 0.890, median 0.894). Tables below.
- **No export moves:** `ifc.sha256` equal on all 111 exports of the
unfiltered run, `diagnostics.json` equal on the 93 that upload one, and
the 18 held-out models' `counts.txt` and `ifc.sha256` equal; of the
2,251 result files common to the two sides, 2,233 are byte-identical and
the 18 that differ are the runs' own `commit.txt`, `runner-*.txt`,
`vmstat-*.log` and `score-cache-*.log`. The semantic check says "no
semantic difference in 34 models".

## Motivation

#1335: the definitions pass is `FamilySymbol` 207 ms decode + 110 ms
freeing, `Family` 28 + 8, of its 403 ms on 2015 `rac_advanced` (profile
run 42111526405, scratch head cc7f9c1, one loaded runner; shares only).
Over the 33 samples of 2015 to 2023 that profile has the passes at:
definitions 9,843 of 63,116 ms (15.6%), wall records 2,227 (3.5%), phase
read 1,946 (3.1%), native preamble 2,499 (4.0%), record index 1,220
(1.9%). On a quiet runner the cuts are smaller than the shares: 8.1%,
2.4% and 1.2%.

"The shared preamble before the native passes, about 590 ms" is not the
native preamble. It is everything an export does before its first native
pass (the partition strings, the arc wall scan, the 2023 record scan,
the levels), which 0.11.0 does as well: profiled on both (run
42111526405 on an EPYC 9V74 and run 42112096504, scratch head 03aa8f6,
on an EPYC 7763: different runners, so shares only) those steps are
65.7% of the export of 2015 `rac_advanced` at 0.11.0 and 35.5% on
`main`, and among the steps both versions run each takes about the same
share on both (the partition strings 35% at 0.11.0 and 29% on `main`,
the 2023 record scan 17% and 18%, writing the file 15% and 18%). They
are a floor shared with 0.11.0. What the native passes added is
`read_preamble`: 68 ms on 2015 `rac_advanced`: schema parse 11 ms,
element index parse 18 ms, storage increments 4 ms, extensible storage
catalog 28 ms.

The issue's concern about the definitions pass: a root-only read could
ingest a record the full decode refuses today. This does not read less:
every byte is read and every check made, in the same order and with the
same errors, and only the values of the fields not kept are not built. A
record the full decode refuses is refused with the same message.

## Changes

- `src/research/native_parameters.rs`: the cursor's `pointer`,
`entity_pointer`, `class` and `field` take `const BUILD: bool`. With it
unset they read, check and note pointers exactly as with it set (one
body, so the checks cannot differ) and return `Null` in place of the
value. `decode_graph_projected(.., keep)` decodes a graph whose objects
keep only the fields named in `keep`. A repeated field key is found in
the built object where there is one, and by position
(`ClassPlan::duplicate`, found only when projecting) where the field is
not built. The full decode's path is the same statements as before.
- `src/research/native_document.rs`: `Options::graph_fields`, a function
from a record's root class to the fields to keep; a projected record has
no `saved_metadata`. The definitions pass sets its own, whatever the
caller's.
- Each field list is a `pub const` beside the one function that reads
the projected graph, so that a field the reader comes to read is added
where it is read: `native_parameter_definitions::{FAMILY_BINDING_FIELDS,
SYMBOL_BINDING_FIELDS}` and `Registry::ingest_binding_context`;
`native_walls::WALL_READ_FIELDS` (`m_id`, `m_WallAttributesId`,
`m_baseOrTop`) and `wall_facts`, which `WallReads::read` calls;
`native_es_catalog::CATALOG_FIELDS` and `from_graph`, which `decode`
calls. Doc lines at those readers and at `wall_type_id` and
`is_top_joined` say so, and `docs/maintaining.md` has a section on it.
- `src/research/native_index.rs`: `parse` searched the element table's
layout for the leaf of each of the 7 fields it takes, at each of the
file's rows (17,101 on `rac_advanced`), with a vector of candidates each
time. The leaf a prefix names is now found at the first row that asks
for it and kept in a named field of `IndexLeaves`, so a lookup that
fails fails at the same point with the same message and an eighth lookup
is a new field, not an index.
- `src/research/schema_registry.rs`,
`src/research/native_es_catalog.rs`, `src/research/native_document.rs`:
the checksums of the schema (one per class) and of the catalog's stream
are formatted with `lower_hex`, the same lowercase digits without a
string for each byte.
- `probes/examples/probe_1335_projected_graphs.rs`: imports the
constants, decodes every record both ways under each list and under two
that stress the mechanism (the identity alone, no field), and runs the
real readers on both graphs: `ingest_binding_context` (the registry and
the refusals), `wall_facts` (every `SWall` and `ArcWall`) and
`from_graph` (the catalog and its provenance JSON) on the
`Global/Latest` document in full and projected.
- `changelog.d/changed/1335-*.md`: three fragments.

## What is not cut (floors)

Shares of the exports' own time over the 33 samples of 2015 to 2023 at
the final head (profile run 42124471783, scratch head c85c73c, an EPYC
9V74, shares only), against `main` before in run 42111526405:
definitions 6.8% (15.6%), the named-parameter read 3.4% (2.9%), the
phase read 3.5% (3.1%), the record index 2.3% (1.9%), the wall records
1.8% (3.5%) and wall types 0.4%, the preamble 1.7% (4.0%), area regions
0.9% (0.8%); all native passes 22.8% (33.0%). If every one cost nothing,
the export would take about 0.92 of 0.11.0's time (an estimate: those
shares applied to the timing run's totals), so the 1.2 against 0.11.0 is
what these passes still cost.

- **The phase read:** 97 ms of 2015 `rac_advanced`'s 2,207 (4.4%, run
42111526405). Projecting its `RoomElem` graphs (38 ms of it) measured
0.993 of this PR's first head's time (run 42117002359, closed as #1487):
inside the run's noise, for a list kept by hand. The rest is the
per-record selection and routing of `extract_records` (about 26 ms) and
the Element base read of 16,981 other records (18 ms), which builds an
`ElementBase` and a `Record` for each so that the same closure sees what
it saw.
- **The record index:** one walk of every partition that includes the
first inflate of each, which 0.11.0 does as well.
- **The steps before the first native pass** (the paragraph above),
shared with 0.11.0.
- **Area regions** (`native_area_regions.rs`, new since 0.11.0): on 2015
`rac_advanced` the `LevelRoomPlan` graphs are 9.5 ms decoding and 5.0 ms
freeing and the `CurveElem` graphs 5.9 and 1.6, about 22 ms of 1,646
(1.3%) at the final head (run 42124471783), and only a file with Areas
pays it; over the 33 samples the pass is 0.9% of the exports' time in
all. Its reader, `plan()`, builds `m_segments`, `m_circuits`,
`m_components` and `m_rooms` of the `PlanTopology`, which is the bulk of
those graphs, so a projection would leave most of the 1.3%: not worth a
pull request. A floor.
- **Taken in follow-up pull requests, stacked on this one:** building
the class plans of a decode afresh for each record (3.1% of all export
time: 1,024,681 plans built over the 33 samples, 2,114 ms of 68,189, in
the plan-timing profile run 42127560399 on an EPYC 7763; 47 of the
definitions pass's 166 ms and 20 of the wall records' 61 ms on
`rac_advanced`), and the byte scan of the named-parameter read.

## Testing

Unit tests are banned here: none added. All runs are of 4140b96,
against `main` at df96767 or the clean tags; Autodesk's sample
projects, the reference models, the BIM4LCA offices, the Revit 2025
models and the held-out models are fetched for the runs and never stored
(held-out as counts).

- [x] The unfiltered Measure, run 42125670870 (`-f base=main -f
nordic=true -f r2025=true -f holdout=true -f samples=true -f
timing=true`, default scorers, no `ifc_flags`): byte identity of every
model and the timing against `main`, above. Its `same-project gates` job
wrote the check run 127599178067: `success`, "pass: 9 samples held to
their earlier saves, and the Areas on 4 saves and on the 2021 save". The
probe run below, dispatched on the same commit and finished 30 seconds
later, wrote a `neutral` "NOT MEASURED: the scorers asked for exclude
bodies_across_saves" (127599399222) that GitHub lists as the latest
check of that name; the success is listed with `filter=all`.
- [x] The projected decode against the full decode, run 42125686355 (`-f
probe=probe_1335_projected_graphs -f samples=true -f r2025=true -f
scorers=none`; every sample of 2015 to 2027, the reference models and
the Revit 2025 models, 88 files): 1,128,043 records, 6,768,258 projected
decodes under six lists, 0 mismatches; the 4,743 records the full decode
refuses are refused alike (`FamilyInstance` 3,403, `VarSketch` 1,125,
`ImageHolder` 105, `AppearanceAssetElem` 38, `RebarShape` 30, others
fewer). No `Family` or `FamilySymbol` is among them: the registry the
definitions pass builds is the same from both graphs on every file.
`wall_facts` is the same on all 7,900 `SWall` and `ArcWall` records. The
catalog's document gives the same catalog and provenance on 79 files and
is refused alike on 9. Not measured: the BIM4LCA offices and the
held-out models under the probe.
- [x] Time against 0.11.0 and 0.15.0, runs 42125703262 and 42125717387
(timing jobs, the 33 samples of 2015 to 2023 and the six reference
models, one runner per shard, an EPYC 9V74 for the samples in both and a
9V74 and a 9V45 for the models; median of three exports each; sum of
medians, mean and median of the per-file ratios; Revit 2024 to 2027
samples were not timed against the tags):

| class | files | 0.11.0 (s) | PR (s) | sum | mean | median | per file |
|---|---:|---:|---:|---:|---:|---:|---|
| samples 2015 | 6 | 6.2 | 7.7 | 1.236 | 1.237 | 1.260 | 1.07 to 1.31 |
| samples 2016 to 2018 | 9 | 6.6 | 8.0 | 1.213 | 1.230 | 1.282 | 1.07 to
1.33 |
| samples 2019 to 2022 | 15 | 13.7 | 16.6 | 1.216 | 1.222 | 1.254 | 1.06
to 1.33 |
| samples 2023 | 3 | 4.3 | 3.8 | 0.894 | 0.914 | 0.950 | 0.79 to 1.00 |
| 33 samples | 33 | 30.7 | 36.1 | 1.175 | 1.199 | 1.254 | 0.79 to 1.33 |
| reference models | 6 | 9.4 | 7.3 | 0.772 | 0.811 | 0.830 | 0.73 to
0.89 |

| class | files | 0.15.0 (s) | PR (s) | sum | mean | median | per file |
|---|---:|---:|---:|---:|---:|---:|---|
| samples 2015 | 6 | 9.0 | 7.8 | 0.870 | 0.870 | 0.868 | 0.85 to 0.89 |
| samples 2016 to 2018 | 9 | 9.0 | 8.0 | 0.890 | 0.895 | 0.900 | 0.86 to
0.92 |
| samples 2019 to 2022 | 15 | 19.0 | 16.7 | 0.882 | 0.889 | 0.894 | 0.86
to 0.92 |
| samples 2023 | 3 | 4.3 | 3.9 | 0.913 | 0.915 | 0.914 | 0.90 to 0.93 |
| 33 samples | 33 | 41.3 | 36.5 | 0.884 | 0.890 | 0.894 | 0.85 to 0.93 |
| reference models | 6 | 5.8 | 5.6 | 0.961 | 0.940 | 0.936 | 0.91 to
0.98 |

Peak memory against 0.11.0 is 0.61 to 0.96 on the samples (the models
0.73 to 1.03), against 0.15.0 0.86 to 1.00 on the samples (the models
0.82 to 1.00).

- [x] Time against `main`, the timing job of the unfiltered run (one
runner per shard; shard 1 an EPYC 7763 for the 2024 samples, shard 2 a
9V74 for the samples to 2023 and the reference models, shard 3 a 7763
for the offices and the 2027 samples, shard 4 a 9V45 for the 2025 and
2026 samples):

| class | files | `main` (s) | PR (s) | sum | mean | median | per file |
peak memory, PR / `main` |
|---|---:|---:|---:|---:|---:|---:|---|---|
| samples 2015 | 6 | 9.1 | 7.9 | 0.867 | 0.868 | 0.863 | 0.84 to 0.90 |
0.85 to 1.00 |
| samples 2016 to 2018 | 9 | 9.3 | 8.2 | 0.878 | 0.883 | 0.886 | 0.85 to
0.91 | 0.86 to 1.00 |
| samples 2019 to 2022 | 15 | 19.7 | 17.0 | 0.862 | 0.871 | 0.875 | 0.83
to 0.90 | 0.86 to 0.99 |
| samples 2023 | 3 | 4.3 | 3.9 | 0.903 | 0.906 | 0.905 | 0.89 to 0.92 |
0.89 to 1.00 |
| samples 2024 to 2027 | 25 | 160.9 | 155.7 | 0.968 | 0.963 | 0.964 |
0.89 to 1.00 | 0.54 to 1.03 |
| reference models and offices | 10 | 61.1 | 59.4 | 0.972 | 0.946 |
0.950 | 0.88 to 0.98 | 0.82 to 1.01 |
| 58 samples | 58 | 203.3 | 192.6 | 0.947 | 0.914 | 0.901 | 0.83 to 1.00
| 0.54 to 1.03 |
| all files | 68 | 264.4 | 252.0 | 0.953 | 0.919 | 0.914 | 0.83 to 1.00
| 0.54 to 1.03 |

Earlier heads of the three parts (the decoder is the same; each slice
measured against the one before it): the definitions part 0.919 of
`main` over the 33 samples (run 42115512932, head fa10c6d), the wall
records part 0.976 (run 42116989088, head 16527ce) and the preamble
part 0.988 (run 42117016111, head 76e98d7). The wall records part
raised the peak of 2019 and 2020 `rac_advanced` from 168 to 173 MiB
(1.03) in its run; the definitions part had taken them from 173 to 168,
so they are at what `main` peaks at.

- [ ] `tools/check-local.sh`: nothing is built on this Mac (no local
compute); CI's fast jobs pass on this head.

## Audit-honesty checklist

- [x] No capability changes; no export is meant to change, and none does
in the 111 exports of the unfiltered run. Nothing here is a claim about
Revit's own export.
- [x] A user-visible change has its entry as a fragment under
`changelog.d/changed/`.
- [x] No limitation resolved or added. #1335 stays open.
- [x] Opt-in costs nothing when off: the plan of a class has an empty
`kept` and no `duplicate` unless the decode is projected.
- [x] No emojis, no private paths.

## Breaking changes

None to the stable API, the CLIs or any export. `rvt::research`
(unstable): `native_document::Options` gains `graph_fields` (and
`GraphFields`); `native_parameters` gains `decode_graph_projected`;
`native_walls` gains `WALL_READ_FIELDS`, `WallFacts` and `wall_facts`;
`native_es_catalog` gains `CATALOG_FIELDS`, `document`,
`document_limits` and `from_graph`; `native_parameter_definitions` gains
`FAMILY_BINDING_FIELDS`, `SYMBOL_BINDING_FIELDS` and
`binding_context_fields`.

## Related issues

Refs #1335, which stays open.
DrunkOnJava added a commit that referenced this pull request Nov 9, 2026
… on, along its slope, to the wall's end (#1473) (RE-358) (#1501)

## Summary

A wall whose elevation profile was edited keeps its cut-out past the
profile, to the wall's end, where the wall goes on past the profile. The
opening that voids the wall (RE-151) stopped at the profile's end, so a
stretch of the wall that goes on past it stayed as the box had it while
Revit's body goes on along the profile (#1473, RE-358). Two shapes are
read: a sloped line, carried along its slope, and the cut-out of a notch
(both neighbours level), carried straight out and told from the wall's
own top or base by height, not by the order the outline lists its
vertices in.

## Motivation

#1470 (RE-348) made the ends of the BIM4LCA office's Basement walls
2057668, 2057670, 2058499 and 2058501 Revit's but left each 0.209 ft3
over Revit's volume as built (0.207 at permit): a 0.4101 ft stretch past
the profile's end, flat at 183.7343 ft where Revit's top reaches 183.085
ft. #1410's volume done-when rests on it.

## Changes

- `src/research/partition_schema_mvp/walls.rs`, `fields.rs`: the
profile's lowest and highest points along its own axis are kept with the
wall's openings (`m_profile_extent`), on the rule's own release list
(Revit 2024).
- `src/ifc/export_content/wall_profile.rs` (new), `export_content.rs`:
after the wall ends and base cuts, an opening that reaches an end of the
profile with one vertical edge is carried on to the wall's end, where
the wall goes on past the profile by more than 0.001 ft and the stretch
is at most the wall's thickness (a stated heuristic; the record lists no
joined wall at the office's stub ends, so none is asked for). Not read:
`ProfileStubRefusal`. `extended` is pure and has unit tests of its
failure modes next to it.
- `src/ifc/mod.rs`, `export_decisions.rs`, `rvt-mcp/src/*.rs`,
`docs/export-diagnostics.md`, `docs/mcp.md`,
`docs/schemas/export-diagnostics.schema.json`,
`tools/re/wall_rule_counts.py`, `tests/export_decisions_counts.rs`:
`exported.wall_profile_sources`, `exported.wall_profile_refusals` and
the decision `wall_profile_extension_refused`.
- Report RE-358 and a changelog fragment.

## Testing

Unit tests are banned; measured end to end on Revit's own exports.

- [x] **The landing code, `8c584d88`.** Measure 42524360776 against
`main` at `ab5f8e1c`, unfiltered (`nordic`, `r2025`, `samples`,
`holdout`, `bimcollab`, `racadv`): 114 of 118 exports are `main`'s; the
two office files, `rac_basic` 2024 and Snowdon Architectural move;
`same-project gates` passes and the semantic check passes. Measure
42522409171 on the same code with the wall scorers: the office's 8 walls
are carried on each file (6 high, 2 low, no refusal, none lower than
Revit's), six to Revit's volume within 1e-4 ft3, 2056705 and 2056770
still 0.770 ft3 over as built and 0.132 at permit, 0.206 closer than
before. Snowdon (local Revit IFC4, counts only): one wall of 1,078
moves, `plan` `equal 662 taller 10` to `equal 672 taller 0 lower 0`,
volume over Revit's 12.66 to 6.36 ft3. It now takes
`wall_profile_level_past_both_ends` with no refusal; `rac_basic` has two
refusals, `profile_cut_not_read_at_the_wall_end` and
`profile_level_cut_between_two_lines`. The head adds only RE-358.
- The bullets below are the earlier heads' runs, kept as the record of
how the rule was narrowed.
- [x] Verified end to end on real Revit files (the BIM4LCA office, CC
BY-SA 4.0): Measure 42130070528 at `3c461d02` against `main` at
`8060ecc8` (`nordic=true samples=true sample_years="2024 2024"`, models
`nordic-office-* core-interior sample-2024-*`, the four wall scorers).
Eight Basement walls take the rule on each office file
(`wall_profile_sloped_past_the_high_end` 6, `_low_end` 2, no refusal):
the four of #1473 go from 0.209 ft3 over Revit's (0.207 at permit) to
Revit's within 1.1e-5, with `plan` rows `equal 100 taller 0`; 2056705
and 2056770 (#1474) move 0.206 ft3 towards Revit's; 2070689 and 2070691,
which the prediction did not name, go from 0.249 over to Revit's within
4.1e-5. No `lower` anywhere. This meets #1410's volume done-when
(2057668 and 2057670 within 1e-5 ft3, no top above Revit's).
- Outside the office the same run moved two more 2024 files: Autodesk's
`rac_basic` (walls 198694 at both ends and 493612 at the low end, one
refusal `profile_cut_not_read_at_the_wall_end`; no Revit export to check
them) and Snowdon Towers Architectural (wall 1996082 at the low end, one
refusal `profile_slope_leaves_the_cut`; against the local Revit export
its `plan` rows go from `equal 662 taller 10` to `equal 672 taller 0` of
672 and it is the only wall of 1,078 that moves, its volume still 8.16
ft3 over Revit's from 12.59). Core Interior and every other 2024 file
are byte for byte `main`'s.
- Run 2, Measure 42138664887 at `337ca29c` against `main` at `c5bae9ed`
(`nordic=true samples=true sample_years="2024 2027"`, models
`nordic-office-* core-interior sample-*`, default scorers, `keep_ifc`;
30 exports): that head asked for a joined wall at the carried end, and
it carried nothing. `exported.wall_profile_sources` is empty and
`exported.wall_profile_refusals` is `profile_end_has_no_join_partner` 8
on each office file, 2 on `rac_basic` and 1 on Snowdon: every end run 1
carried was refused. `ifc.sha256` moved on those four files for the
markers alone (the scorer diff holds `wall_rules.txt` only). The
`same-project gates` check run is success (9 samples held to their
earlier saves, and the Areas on 4 saves), of a head that carried nothing
and a gate that does not compare these walls. The probe of run
42096049754 shows why: at all eight office stub ends the record's end
step lists no joined wall (`m_realJoined` and `m_geomJoined` empty) and
names one exposed neighbour, face 6, which 175 of 1,601 ends without a
joined wall also have. The requirement is dropped in the push after run
2; the level fix, the names and the release list are measured by no run
yet.
- Run 3, Measure 42143081343 at `8e351289` against `main` (`nordic=true
samples=true sample_years="2024 2027"`, models `nordic-office-*
core-interior sample-*`, default scorers, `keep_ifc`): the rule without
the join requirement, the level fix by height, the form names, the
release list, the same-project gate on a head that carries, and
`exported.wall_profile_height_checks`, a count of how a carried sloped
line stands against the record box's top (a rising line should equal it;
the office's falling ones cannot) that nothing is carried or kept by.
- Against Revit's own public IFC4 export of the Revit 2018 `rac_basic`
(local only, no licence): walls 198694 and 493612 are in it with the
same names and Tags, and neither matches before or after the rule
(`equal 0` of 425 and of 646 plan points); the rule moves their volumes
6.37 and 2.79 ft3 towards Revit's, and they stay 35.2 and 7.7 ft3 from
it for reasons the rule does not touch. They are unchecked; the
same-project gate does not compare them (the profile openings are read
on 2024 only).

- **The landing run**, Measure
[42544325206](https://github.com/DrunkOnJava/rvt-rs/actions/runs/42544325206):
`9e8dd7ca`, this change rebuilt on `main` at `228ab52a`, against that
`main`, unfiltered with samples, the held-out models, racadv and
BIMcollab (118 models). 114 exports are byte for byte `main`'s, and the
4 that move are the ones this 2024-only rule reaches: the BIM4LCA office
as built and at permit, `rac_basic` 2024 and Snowdon Towers
Architectural 2024. No held-out, R2025, racadv or 2015 to 2023 export
moves, no scorer output differs between the sides, and `same-project
gates` passes on `9e8dd7ca`.

## Audit-honesty checklist

- [x] Docs state the rule as it is: the line's slope is read from the
file, its going on to the wall's end is a rule that Revit's export shows
on 4 walls in one project, not a byte of the file.
- [x] A fragment under `changelog.d/fixed/`.
- [x] The release list is the profile openings' own (Revit 2024).

## Breaking changes

`IfcModel` gains a public field, `wall_profile_height_checks`.
`IfcModel` is not `#[non_exhaustive]`, so a struct literal that names
every field no longer compiles; one that ends in `..IfcModel::default()`
is unaffected. The rest are additions to the `exported` diagnostics,
which are `#[non_exhaustive]`, and one decision reason.

## Related issues

Closes #1410 (its volume done-when is met: 2057668 and 2057670 within
1e-5 ft3, no top above Revit's).

Refs #1473 (not closed here): its done-when says no other wall moves and
the stub is read from the bytes. Seven other walls move (2056705,
2056770, 2070689, 2070691 and three of `rac_basic` and Snowdon); the
slope is read from the profile's bytes and `rac_basic` 493612's record
box carries the line to the wall's end, while that Revit goes on along
it is shown against Revit's export on the office and one Snowdon wall.

Refs #1474 (stays open): walls 2056705 and 2056770 go from 0.339 ft3
over Revit's at permit to 0.132; what remains is the end step above
182.087 ft.
DrunkOnJava added a commit that referenced this pull request Nov 9, 2026
…RE-351) (#1476)

## Summary

#1471 asks whether the 16 `rac_basic` walls that its 2025 and 2026 saves
draw to different extents are a reader defect or an edit of the project.
They are a reader defect. The probe on all 13 saves (Measure run
42106436497, head b2b5716) shows the 16 walls' record boxes, base and
top Levels, joins and top-join element equal on every save, so the
project was not edited; what differs is the top. On the 2026 and 2027
saves each of the 16 is cut at 5.7265 m, the underside of roof 243274's
record box (15 of them on 2024, 428745 not), and on the 2025 save none
is cut, though the 2025 save's walls name the same roof as top cutter.
The roof is a roof by extrusion on every save that only the 2025 reader
reads (`SKETCH_SPLINE_SUPPORTED_REVIT_VERSIONS` is 2025 alone), so the
other readers draw it as its record box, 3.472 m deep, and the wall-top
pass (RE-267) takes a record box for a roof with a level underside.

The change: a roof is a cutter of a wall's top only where its record box
is exactly its type's layers (the proof its underside is level) and its
plan outline is read (an L-shaped plate roof drawn over its box's
rectangle would cover a wall it does not reach); slabs and footings are
as before.

**Smaller error, not the right body.** The second read finds Revit's
walls attach to the gable's sloped underside: for 13 of the 16 the
stored box top equals the roof underside's highest point over the wall's
plan to 0.0001 m. The prism this restores is not Revit's body either;
the read's rough estimate is about +5.1 m3 over across the 16, against
about -13.5 m3 under with the flat cut (not reproduced). Wall 506386
loses five values the roof's box let it carry (`Height`, net and gross
volume and side area) and keeps `Length` and `Width`, as on 2025.

**What exercises it.** Only roof 243274 exercises the roof-cover path
anywhere, and no wall is cut by a plate roof, so the retained
`plates.contains` branch is unmeasured.

**The same-project pins go.** #1454 pinned these 16 walls in the
same-project check (`PINNED_WALLS`, Griffin 2026-11-05) until this work
healed them. All 16 are now the 2025 save's, so this removes them:
`PINNED_WALLS` is empty and `PINNED_MOST` is 0 in
`tools/re/readers_across_saves.py` and
`tools/ci/check_same_project_projects.py`. The exception in
`docs/maintaining.md` now reads as closed.

**Held-out wall heights are now counted.** The held-out AA house (Revit
2026) is the only Revit export whose walls this rule changes. Its
scrubbed counts held no wall-height line, so
`tools/ci/scrub-holdout-results.sh` now keeps the `wall heights:` count
lines of `tools/re/wall_heights_vs_ifc.py`. These are numbers beside the
scorer's fixed words, never a Tag, a height or the files' offset.

## Motivation

#1471. Griffin, 2026-11-05: #1454's check pins these 16 walls to their
exact source and volume until this work shrinks the list; once this
lands they leave it.

## Changes

- `src/ifc/export_content/wall_tops.rs`, `src/ifc/export_content.rs`:
`level_underside` and the set of roofs whose box is exactly their layers
and whose outline is read (`plate_roofs`); `cut_wall_tops` skips any
other roof as a cutter.
- `tools/re/readers_across_saves.py`,
`tools/ci/check_same_project_projects.py`: the 16 pins removed,
`PINNED_MOST` 0.
- `tools/ci/scrub-holdout-results.sh`: the `wall heights:` count lines
kept for held-out models.
- `probes/examples/probe_re351_wall_top_covers.rs` (RE-351): the record
frames, decoded fields, native `SWall` records (for all 16 walls, `read`
false where the reader leaves one out) and written bodies of the 16
walls and of roof 243274, on every `rac_basic` save; and each wall's
`sets` and `profile_openings`.
- `reports/element-framing/RE-351-rac-basic-wall-tops-across-saves.md`,
an addendum to RE-346, a changelog fragment, `docs/maintaining.md`,
`docs/status.md`, `docs/supported-profile.md`, `docs/evidence.md`,
`docs/support-matrix.json` and `docs/format-reconnaissance.md`.

## Testing

Unit tests are banned in this repository: nothing is added.

- [ ] `tools/check-local.sh` passes: not run locally (no local builds);
CI is the build
- [x] Verified end to end on real Revit files.
- **Unfiltered Measure 42554270370** (head 584c8a89 against `main` at
fc29acb; the reference models, the BIM4LCA office as built and at
permit, R2025, Autodesk's samples of every year, the held-out models;
118 exports):
- 4 exports move: `rac_basic` 2024, 2026 and 2027, and the held-out AA
house (Revit 2026).
- The other 114 are byte for byte `main`'s, the office's among them (606
of 607 walls with Revit's base and top as built, on both sides).
- On the 2026 and 2027 saves all 16 walls are the 2025 save's bodies: of
441 bodies, 424 are the same and 1 differs, roof 243274, the record box
`ROOFS_LEFT_AS_BOXES` expects.
- The 11 cut-opening hosts are equal with their openings (5 on `main`),
and the 16 walls no longer carry the `BodyHeightSource`,
`TopCoverElementId` and 506386's five quantities that the 2025 save does
not write.
- The run's same-project check failed only because the 16 pins healed
("remove its pin" on each). This head removes them.
- **Measure 42556745265** (head 8ddb0ad2, the pins removed, against
`main` at 9c66e9b; samples 2024 to 2027 and the held-out models):
- `same-project gates` passes on 8ddb0ad2, with `pinned walls as pinned
0 of 0` and 440 of 441 bodies the 2025 save's on each of `rac_basic`'s
2026 and 2027 saves; the 441st is roof 243274, the expected record box.
- The held-out AA house (Revit 26.4, IFC4X3, counts only) now keeps its
`wall heights:` lines. Its walls with Revit's base and top go from 43 to
56 of 59, and those with Revit's base and not its top from 16 to 3, all
on Revit's storey. Nothing else in its counts moves.
- One more export moves than in 42554270370, the held-out Gdynia 2021.
That is the branch's base, which was older than `main` (#1509's beams),
and not this change: Gdynia's export on this head equals its export in
42554270370.
- Since then the branch is rebased on `main` (the release of 0.16.0).
The one conflict, in `docs/format-reconnaissance.md`, kept both addenda
(RE-362's and RE-351's). The figures are written into RE-351 section 4,
the fragment and `docs/status.md`. No source changed after 584c8a89.
- Not run: Snowdon Towers (local only), and the probe on the scoring
head.
- [ ] If this touches the IFC exporter: the witness verdicts replay:
Core Interior's export is byte for byte `main`'s in run 42554270370, so
they do not move.

## Audit-honesty checklist

- [x] README / docs reflect the state after this PR, with what is not
measured labelled "not yet measured on this head"
- [x] The change has its entry as a fragment under `changelog.d/fixed/`
- [x] A new limitation is documented: a roof that is not a level plate
cuts no wall's top, so a wall under such a roof is drawn to its record
box, which is not Revit's body (report sections 4 and 5); the base pass
has the same flaw for a wall standing on such a roof and is not changed
here (the second read files it, with #1470's `decide_base` as the place)
- [x] No emojis, no private paths
- [x] Reverse-engineering finding: a probe under `probes/examples/` and
a dated addendum to `docs/format-reconnaissance.md`

## Legal and contribution hygiene

- [x] I agree this work is licensable under Apache-2.0
- [x] No Autodesk proprietary source, decompiled internals or NDA'd SDK
content (the oracle is the same Autodesk sample saved by another
release, never stored)
- [x] No new fixtures

## Breaking changes

None.

## Related issues

Closes #1471
DrunkOnJava added a commit that referenced this pull request Nov 15, 2026
…r that height, as Revit cuts it (#1474) (#2029)

## Summary

The wall end rule (RE-348, `read_end` in `wall_tops.rs`) now reads an
end where a joined wall's face lies inside the wall's end over a stretch
of height. It used to refuse that end with
`joined_wall_face_inside_the_wall`. A band of height whose face lies
inside the end has a negative reach. `strips_of` first pulls the end in
to the least reach (`cut_back`, 0 or less), and builds the strips from
the reaches beyond that, measured from the box's end as before. The
stepped plan's own plan stops at the cut-back end, and the strip carries
it out to where it reaches below. An end pulled in over its full height
has no strips, and `move_ends` shortens it. A face inside the end by
more than the joined wall is thick is still refused, as one too far out
is. Part of #1474: the permit half.

## Motivation

#1474 (from #1470, RE-348): at building permit, BIM4LCA office walls
2056705 and 2056770 keep their record ends where Revit cuts them back by
0.0985 ft above 182.087 ft. They are 0.339 ft³ over Revit's volume.
#1473's far-end stub took 0.207 of that and none of the step. The
issue's as-built half (the same two walls taking the centreline path,
which the end rule never reaches) is not touched here.

## Changes

- `src/ifc/export_content/wall_tops.rs`: `read_end` accepts a negative
reach up to the joined wall's thickness. `strips_of` returns the strips
and the cut-back. `End` carries `cut_back`. The stepped plan's own plan
is pulled in by it.
- `changelog.d/fixed/1474-wall-end-cut-back.md`.

## Testing

**Unfiltered:** Measure
[43663221437](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43663221437),
`26b45a56` against `ac1ff346`, with samples, nordic, r2025 and holdout.
117 of 120 exports are identical, and the 3 that differ are the BIM4LCA
office at permit and the timber office as built and at permit.
`same-project gates` pass. **Filtered, scored:** Measure
[43665221220](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43665221220),
the same head and base on those three files, with
`wall_top_cover_vs_ifc`, `wall_quantities_vs_ifc` and `wall_rules`, IFCs
kept.

1. **Holds.** Office at permit, walls 2056705 and 2056770: `levels` goes
from rvt-rs 183.727 to 182.087 over the 0.0807 ft² strip, which is
Revit's 182.087. The area taller than Revit's goes from 0.0807 to 0 ft²,
and the volume from 27.3554 to 27.2229 ft³, Revit's 27.2229, on each.
`NetVolume` equal to the volume goes from 300 to 302 of 589.
`wall_rules`: end sources `wall_end_stepped_to_joined_walls` from 4 to
6, and end refusals `joined_wall_face_inside_the_wall` from 2 to none.
2. **Every other wall the rule refused:** 5 on each timber office file.
They are still refused, now as
`joined_wall_faces_overhang_the_lower_end`: with the face read, the
later strip check finds the end reaching further at a greater height.
The kept IFCs differ in those 5 walls' `BodyEndRefusal` text and nothing
else. No other model of the 120 has the case.
3. **Holds.** No wall equal to Revit's becomes different:
`wall_top_cover_vs_ifc` stays at 579 of 589 equal over the plan, and
every per-wall line but the two walls' is the same.
`wall_bodies_vs_ifc`, `wall_ends_cv_vs_ifc` and `wall_heights_vs_ifc`
are byte-identical on the permit office.

- [ ] `tools/check-local.sh`: CI runs it
- [x] End to end: Measure

## Audit-honesty checklist

- [x] Changelog fragment (its claim is checked against row 1)
- [x] No emojis, private paths or jargon

## Legal and contribution hygiene

- [x] Apache-2.0; no Autodesk proprietary source; no fixtures

## Breaking changes

None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant