Repository navigation
feat(ifc): a wall whose base join names an element covering its plan in part is cut over the covered part (#1411) (RE-349) - #1469
Closed
DrunkOnJava wants to merge 3 commits into
Closed
DrunkOnJava wants to merge 3 commits into
DrunkOnJava wants to merge 3 commits into
Conversation
DrunkOnJava
marked this pull request as ready for review
November 5, 2026 20:21
DrunkOnJava
added a commit
that referenced
this pull request
Nov 5, 2026
…and a profile-edited wall's end follows the walls its record joins (#1409, #1410, #1411) (RE-348) (RE-349) (#1470) ## Summary Two readers for one set of walls, in one PR (it holds #1469's commits; #1469 is closed unmerged): - RE-349 (#1411): a wall whose base join names a floor or footing that covers only part of its plan is cut at that element's top over the covered part and stands from its own base over the rest. - RE-348 (#1409, #1410): a profile-edited wall's end is drawn, at each height, to the face of the first wall its record joins there (`JoinEndGStep.m_realJoined`, in the record's order) that stands at that height, instead of to the wall beneath up to that wall's top. The labelled approximation of #1398 (`wall_end_to_base_wall_upper_step_omitted`) is retired. **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. - [x] 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 #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 - [x] 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) - [x] User-visible changes have fragments under `changelog.d/fixed/` - [x] New limitations are documented in the PR body, the reports and in code (the four walls' 0.209 ft3 is #1473) - [x] No emojis, no private paths - [x] Reverse-engineering finding: probe under `probes/examples/`, reports RE-348 and RE-349, addenda in `docs/format-reconnaissance.md` ## Legal and contribution hygiene - [x] 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 b510ff3` 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A wall whose base join names a floor or footing that covers only part of the wall's plan is cut at that element's top over the covered part and stands from its own base over the rest, as Revit draws it. Draft until the unfiltered run and the second read.
Motivation
#1411: the BIM4LCA office's Basement walls 2058499 and 2058501 as built stand past the edge of their footing (2058504), which covers their plan only in part. RE-337 (#1398) kept their ends 0.31 ft short of Revit's because a base that is not cut would have grown their volume from 4.497 to 6.919 ft3 over Revit's.
Changes
src/ifc/export_content/wall_tops.rs:decide_basetakes an element that covers the plan in part (covered_pieces: the wall's convex pieces clipped by the element's outline),base_cut_solidsplits each piece into the part inside the covered pieces, cut at the element's top, and the rest from the wall's own base.BodyBaseSourcevalueswall_base_cut_at_floor_covering_in_partandwall_base_sloped_at_floor_covering_in_part; newBaseCoverRefusalreasonpartly_covered_plan_not_read(docs and schema updated).tests/export_decisions_counts.rs: the office as built no longer witnesseswall_base_cut_refusedandwall_end_extension_refused, so the table no longer requires them.reports/element-framing/RE-349-wall-base-covered-in-part.md, adocs/format-reconnaissance.mdaddendum, a changelog fragment and the support-matrix evidence line.Testing
Unit tests are banned; measured end to end on Revit's own exports.
wall_heights_vs_ifc,wall_quantities_vs_ifc,wall_top_cover_vs_ifc,wall_layers_vs_ifc) atc413f382againstmainat44c055db. Reproduce:gh workflow run measure.yml --ref main -f ref=c413f382e7615100170862e14bb50c7e431b582e -f base=main -f nordic=true -f models="nordic-office-as-built nordic-office-permit" -f scorers="wall_heights_vs_ifc wall_top_cover_vs_ifc wall_quantities_vs_ifc wall_layers_vs_ifc" -f keep_ifc=true.main's.Audit-honesty checklist
changelog.d/fixed/docs/format-reconnaissance.md; the measurement is reproducible from the office exports with the scorers aboveLegal and contribution hygiene
Breaking changes
None. New property values and one new refusal reason;
wall_base_refusalsandwall_end_refusalsof the office as built are empty instead of 2 each.Related issues
Closes #1411
Closed unmerged 2026-11-05: replaced by #1470, which holds these commits and the second read's fixes. Landed alone, this PR would have put the labelled approximation
wall_end_to_base_wall_upper_step_omittedon two more walls until #1470 retired it, and Griffin approved it for one wall case only.