Skip to content

IFC export: the office at permit (timber) writes one mullion type as 6 type objects with one GlobalId (24 IfcRoot.UR1 findings) #1667

Closed

Description

@DrunkOnJava

What

The BIM4LCA office at permit (timber) is the one Measure model whose export fails IfcOpenShell's validation: schema.txt reads validate: findings 24, all IfcRoot.UR1 ("The attribute GlobalId should be unique"). One mullion type, Rectangular Mullion:150 x 50 mm alumiini maalattu (Tag 1907093), is written as 6 IfcMemberType objects with the same GlobalId; the 12 IfcPropertySets and 6 IfcRelDefinesByType that take their GlobalIds from it repeat too (6 + 12 + 6 = 24). Every other model of the Measure set validates with 0 findings.

It is not new: the same 24 findings are in every Measure run read since #1650 (the base and the head of each), so it is on main and nothing a recent change did.

Why

A duplicated GlobalId is invalid IFC4 (IfcRoot.UR1), and importers that key objects by GlobalId merge or drop the later ones. Revit's own export has one GlobalId per object.

Where it comes from

src/ifc/step_writer.rs, in the type-object loop: a type object takes Revit's GlobalId when it has one that no earlier object used (used_gids.insert), and otherwise the writer's own gid(&["type", entity_name, tag]). That fallback is not entered in used_gids and does not depend on which group it is, so two groups of the same type and entity (RE-167 writes a type object per original symbol; type_objects keys a group by type, entity, predefined type and the symbol's GlobalId) that both fall back get one GlobalId. The sets and relationships derive theirs from the type's, so they repeat with it.

Done when

  • Every type object has a GlobalId of its own: validate reads 0 findings on every Measure model, the timber permit office included.
  • The exports of the other models are byte-identical (a type object that already had a unique GlobalId keeps it).
  • If Revit's export holds fewer type objects for this type than rvt-rs writes (6 here), the report says how many and why, and type_objects is narrowed only where Revit's export shows the grouping is wrong.

Activity

  1. added
    area:ifc
    priority:P2
    type:bug
    on Nov 11, 2026
  2. DrunkOnJava commented on Nov 11, 2026

    @DrunkOnJava
    OwnerAuthor

    The change and its rows, registered before it is run on anything.

    The change (fix/1667-unique-type-global-ids, src/ifc/step_writer.rs): in the type-object loop, a type object with no Revit GlobalId left to take gets the writer's fallback gid(&["type", entity_name, tag]) only if no earlier object used it; a later one takes gid(&["type", entity_name, tag, <its index>]). The fallback is entered in used_gids, which it was not.

    Rows, on the unfiltered Measure of the change against main (107 models, every scorer):

    1. nordic-office-timber-permit: validate reads 0 findings (24 on main), and the six IfcMemberType of Tag 1907093 have six different GlobalIds.
    2. Every other export is byte-identical (ifc.sha256 of the other 106 does not move), since no other model has a repeated type GlobalId (their validate reads 0 on main).
    3. The timber permit office keeps every object it wrote: its entity counts by class are unchanged, only GlobalIds differ (global_ids_vs_ifc equal on every element, and the type objects' count the same).

    If 1 fails, the repeat comes from a second place and the report names it; if 2 or 3 fails, the guard changes something it should not and is narrowed.

  3. DrunkOnJava commented on Nov 11, 2026

    @DrunkOnJava
    OwnerAuthor

    Result of Measure 42934767155 (fix/1667-unique-type-global-ids at 0ef5551 against main; 100 models with results on each side), against the rows registered above:

    1. Held. nordic-office-timber-permit: validate reads findings 0 (24 on main). The run keeps no IFC, so "six different GlobalIds" is read as the validator finding no repeated GlobalId anywhere in the file.
    2. Held. One export moved, the timber permit office; the other 99 are byte-identical, and no scorer line of any other model changed.
    3. Held on its substance, with one scorer line I did not foresee. Total entities (76,041), by_ifc_type, the whole diagnostics, global_ids_vs_ifc and class_sets_vs_ifc are identical. type_objects_vs_ifc.txt counts distinct GlobalIds and reads 1391 on main and 1397 here: the +6 is the repeats becoming distinct, not new objects. "The type objects' count the same" holds for the objects and not for that line.

    A correction to the issue text: 7 IfcMemberType shared the GlobalId, not 6; IfcOpenShell flags each repeat after the first, which is why 6 + 12 + 6 findings (the sets and relationships repeat with their type).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ifcpriority:P2type:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions