Repository navigation
fix(ifc): every type object has a GlobalId of its own, so one type read for several symbols no longer repeats the writer's fallback (#1667) - #1668
Merged
Conversation
…ad for several symbols no longer repeats the writer's fallback (#1667)
9 of 10 tasks
DrunkOnJava
marked this pull request as ready for review
November 11, 2026 01:10
…llion types of one GlobalId, 6 of them repeats, not 6 (#1667) Measure 42934767155 read the count: the scorer's distinct GlobalIds went 1391 to 1397 with the objects unchanged, so 7 type objects shared one GlobalId and IfcOpenShell flagged the 6 repeats.
DrunkOnJava
added a commit
that referenced
this pull request
Nov 11, 2026
… says so too, so every box has a reason (#1645) (#1669) ## Summary An element drawn as a record box, a beam's box or a turned box that the saved-mesh pass did not take as a candidate now has a `SavedMeshRefusal` of its own: `not_a_candidate: ` and one of `whole_drawn_by_its_parts`, `no_location`, `no_element_id` or `class_not_in_scope`. `exported.saved_mesh_refusals` then counts every such box, not only the candidates whose saved graphics were read. The candidate set is the same, and no body is drawn differently. ## Motivation Refs #1645. After #1647, 153 of the BIM4LCA office's 168 box bodies carried a refusal; the other 15 (14 `IfcStair` and 1 `IfcCurtainWall`, wholes that their parts draw) said nothing, and the scorer of #1672 lists them as boxes with no reason. ## Changes - `src/ifc/saved_meshes.rs`: the candidate loop reads each element's type GUID and location, works out why an element is not a candidate (`whole_drawn_by_its_parts`, `no_location`, `no_element_id`, `class_not_in_scope`), and records that as its refusal; the refusals are applied on the early return too. The candidates are the same elements as before. - `src/ifc/export_content.rs`: `SAVED_MESH_NOT_CANDIDATE_PREFIX`. - `src/ifc/mod.rs`, `docs/export-diagnostics.md`, `docs/schemas/export-diagnostics.schema.json`: the new refusal text is documented. - `changelog.d/changed/1645-saved-mesh-not-candidate.md`. ## Testing No unit tests added. Measured end to end on Measure's models: the unfiltered run 42929175797 (every scorer, 100 models with results on each side, this head against main at 6e58c27). The rows were registered on #1645 before it (comment of 2026-11-11T00:09:50Z) and are judged as registered: 1. Holds. On the BIM4LCA office as built `exported.saved_mesh_refusals` sums to 168, its `bounding_box_bodies` (153 on main), and the 15 are `not_a_candidate: whole_drawn_by_its_parts`, which accounts for the whole difference. 2. Holds on the diagnostics, and a sum is not the whole proof. Every model of Revit 2023 to 2027 sums to at least its box count; the BIM4LCA, Revit 2025 and RE1 models sum to it exactly except the two terrain housing files (12 reasons against 11 boxes: the count of box bodies leaves out the turned boxes and a roof's level block, which the pass also reads). On the Autodesk samples a sum cannot decide (Snowdon architectural 518 against 394 boxes), so the per-element read, registered on #1645 before it ran, is Measure run 42936559329 (the box scorer of main, #1672, on the head): each model's line must read "N of N have one" with no `(none)` row. Result: it holds on every model with a Revit export I named (each reads "N of N have one", no `(none)` row: housing concrete as built 73 of 73, its terrain file 11 of 11, the four office files, Revit 2025 stairs 13 and 17, RE1 architecture and electrical), and it missed as registered on the three Autodesk samples, which have no Revit export here for the scorer to pair with, so for them only the sums above are read and nothing shows each box has its reason. The scorer's 73 against the diagnostics' 74 on the concrete as built is the boxes whose Tag Revit's export also holds. 3. Holds. The 29 exports that moved are exactly the 29 models whose counters gained `whole_drawn_by_its_parts` (the 10 BIM4LCA files, the 5 Revit 2025 stair models and 14 of Autodesk's samples); no body, quantity or property scorer line changed in any model. The only scorer files that differ are two validation texts of `nordic-office-timber-permit` (`ports_vs_ifc.txt` 10 lines, `schema.txt` 20), which are identical once instance numbers are normalised: the added properties shift the numbers inside its 24 existing `IfcRoot.UR1` findings (#1667, fixed by #1668). What the data do not exercise: only `whole_drawn_by_its_parts` occurs (15 on each office file, 7 on each large housing file, 1 on each terrain file, 1 on each Revit 2025 stair model, 1 to 26 on the Autodesk samples). `no_location`, `no_element_id` and `class_not_in_scope` occur in none of the 100 models, so those three branches are covered by reading the loop, not by a measurement. - [ ] `tools/check-local.sh` passes: not run locally (no local builds here); CI runs it - [x] Verified end to end on real Revit files: the runs above (BIM4LCA, Revit 2024, CC BY-SA 4.0; Autodesk's samples, counts only) - [x] If this touches the IFC exporter: the witness verdicts replay or the changed observations are refreshed: CI's replay decides; the Core Interior export does not move (it has no box with a new reason) - [x] If this is a performance change: N/A ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR: `docs/export-diagnostics.md` and its schema name the new text - [x] A user-visible change has its changelog fragment under `changelog.d/changed/` - [x] No emojis, private paths or personal addresses in committed files ## 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 - [x] No new test fixtures ## Breaking changes None. `exported.saved_mesh_refusals` has more keys (`not_a_candidate: ...`); the schema allows them.
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
Every type object now has a GlobalId of its own. In the type-object loop of
src/ifc/step_writer.rs, a type object that finds no Revit GlobalId left to take gets the writer's fallbackgid(&["type", entity_name, tag])only when no earlier object used it, and otherwise the same fallback with its index; the fallback is entered inused_gids, which it was not. The BIM4LCA office at permit (timber), where one mullion type was written as 7IfcMemberTypeobjects with one GlobalId (IfcOpenShell flags the 6 repeats), now writes 7 different ones, and its property sets and relationships, which derive theirs from the type's, follow.Motivation
Closes #1667. The timber permit office is the one Measure model whose export fails IfcOpenShell's validation:
validate: findings 24, allIfcRoot.UR1("The attribute GlobalId should be unique"): 6IfcMemberType+ 12IfcPropertySet+ 6IfcRelDefinesByTyperepeats of the typeRectangular Mullion:150 x 50 mm alumiini maalattu(Tag 1907093). A repeated GlobalId is invalid IFC4, and importers that key objects by GlobalId merge or drop the later ones. The same 24 findings are in every Measure run read since #1650 on both sides, so they are onmain.Changes
src/ifc/step_writer.rs: the type-object loop takes Revit's GlobalId when it is unused, else the writer's fallback when it is unused, else the fallback with the type object's index.changelog.d/fixed/1667-unique-type-global-ids.md.Testing
No unit tests added. Measured end to end on Measure's models (every scorer,
samples=true): run 42934767155, this head (main merged in, so the only difference between the two sides is this change) against main. The rows were registered on #1667 before the first run and are judged as registered:nordic-office-timber-permit:validatereads 0 findings (24 on main), and the sixIfcMemberTypeof Tag 1907093 have six different GlobalIds.ifc.sha256of the other models does not move), since no other model has a repeated type GlobalId.Result of run 42934767155 (100 models with results on each side), judged as registered:
nordic-office-timber-permit:validatereadsfindings 0(24 on main) andports_vs_ifc.txt"0 findings, 0 about the port entities". The run keeps no IFC, so "six different GlobalIds" is read as the validator'sIfcRoot.UR1finding no GlobalId repeated anywhere in the file.nordic-office-timber-permit; the other 99 are byte-identical (ifc.sha256), and no scorer line of any other model changed.by_ifc_typeand the whole diagnostics are identical, andglobal_ids_vs_ifc(10,511 equal, 9 not in Revit's export) andclass_sets_vs_ifcare identical.type_objects_vs_ifc.txtreads "type objects in ours: 1391" on main and 1397 here: it counts distinct GlobalIds, so the +6 is the repeats becoming six further distinct ids, not new objects. That also corrects the issue's count: 7IfcMemberTypeshared the GlobalId, and IfcOpenShell flags the 6 repeats. "The type objects' count the same" is true of the objects, not of that line.The first unfiltered run, 42928822492, compared this change, which then lacked #1647, against newer main, so its other differences were #1647's; this re-run, after merging main, is the one judged. The same-project gates passed on this head (check run of 2026-11-11T01:07:24Z, "pass: 15 samples held to their earlier saves"); the semantic check read NOT MEASURED on it (#1675: the timber office had no dump, fixed by #1677).
tools/check-local.shpasses: not run locally (no local builds here); CI runs itAudit-honesty checklist
changelog.d/fixed/Legal and contribution hygiene
Breaking changes
None. A type object that already had a unique GlobalId keeps it; only the repeats change.