Skip to content

feat(ifc): a family instance's type object takes its original symbol's GlobalId (B60) - #663

Merged
DrunkOnJava merged 9 commits into
mainfrom
feat/b60-type-global-ids
Oct 4, 2026
Merged

DrunkOnJava merged 9 commits into
mainfrom
feat/b60-type-global-ids

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

RE-167: Revit gives a family instance's type the GlobalId of its original symbol (ExporterIFCUtils.GetOriginalSymbol), which the instance's GElement data object holds 20 bytes before its end (FamilySymbol, SysMullionFamSym or SysPanelFamSym), and writes one type object per original symbol with the symbol's Tag. Where an instance's copies disagree, the highest-numbered partition's copy decides (Core Interior's doors). An instance that uses its own geometry (0xffffffff) takes a sub-element GlobalId of itself (revit-ifc InstanceAsType). B73: a type Revit writes under several entities keeps its own GlobalId on the group holding its lowest ElementId; the others hash the entity and predefined type. Doors and windows (a hash with the door's flip) are B72.

Red on draft #662 (run 37219969064); the output is in the test commit. Green: Corpus health on 90cb85f (run 37224351714), type_objects_take_revits_global_ids ok on RE1 x4 and Core Interior. The witness observation for Core Interior is refreshed from CI's own artifact (IFCCOLUMNTYPE 1 -> 175, IFCSLABTYPE 5 -> 7); IfcOpenShell validates the export with no issues.

… (B60)

tests/type_global_ids.rs compares, for every element both exports relate
to a type, the type's GlobalId with Revit's, on the four RE1 models and Core
Interior. Door and window types are left out (B72).

Red on main (draft #662, run 37219969064, "Corpus health (tier 2)"):

  RE1-Architecture.rvt: 67 elements typed in both, 31 types' GlobalIds not Revit's; 5 doors and windows left out
  RE1-Mechanical.rvt: 49 elements typed in both, 37 types' GlobalIds not Revit's
  RE1-Plumbing.rvt: 123 elements typed in both, 54 types' GlobalIds not Revit's
  RE1-Electrical.rvt: 49 elements typed in both, 2 types' GlobalIds not Revit's
  2024_Core_Interior.rvt: 716 elements typed in both, 278 types' GlobalIds not Revit's; 138 doors and windows left out
  panicked at tests/type_global_ids.rs:166:5:
  RE1-Architecture.rvt: 31 of 67 typed elements' types have another GlobalId than Revit's; first: ["351456 (IFCFURNITURETYPE): Revit 3144CP5Ub2qhBtGD1R3koT, rvt-rs 3144CP5Ub2qhBtGD1R3koW", ...]
…s GlobalId, one type object per original symbol (B60)

RE-167 (Measure runs 37218947202 and 37219379143): Revit's exporter writes a
family instance's type with the GlobalId of the instance's original symbol
(ExporterIFCUtils.GetOriginalSymbol) and the Tag of its symbol. The instance's
GElement data object holds that FamilySymbol's ElementId 20 bytes before its
end. On the RE1 models that gives Revit's type GlobalId for every family
instance outside doors and windows: 162 of them, the symbol itself for most
and another FamilySymbol (often the instance's id plus one) for furniture,
fittings, mullions and panels. Doors and windows take a hash of it with the
door's flip (B72), not read yet, and keep their symbol's.

The schema pass records each family instance's original symbol (one value
across its GElement objects, naming a FamilySymbol); RevitGlobalIds gains
element_types, an element's type GlobalId where it is not its symbol's; and
the writer writes one type object per symbol, entity and GlobalId, as Revit
does: RE1's 10 mullions share Tag 446539 across 9 type objects.
…ype GlobalId, as Revit writes it (B60)

Corpus health on #663 left 186 of Core Interior's 716 typed elements with
another type GlobalId than Revit's, 164 of them columns. RE-167 (Measure runs
37221105534, 37221466107): those columns' GElement objects hold 0xffffffff
where an original symbol would be (Revit's invalid id: the instance uses its
own geometry), and each one's type GlobalId is the column's own with bytes
10 and 11 of the GUID XORed with 2048, revit-ifc's legacy instance-as-type
GUID (GUIDUtil.CreateInternal, ExporterIFCUtils.CreateSubElementGUID with
IFCFamilyInstanceSubElements.InstanceAsType = 2048). The schema pass keeps
that marker (INSTANCE_GEOMETRY), revit_global_ids gains expand_ifc_guid and
sub_element_global_id, and such an instance's type takes it.
…rst by entity, as Revit's exporter does (B60, B73)

Corpus health on #663 left 22 of Core Interior's typed elements: floor types
4166 and 71848, each written by Revit as an IfcSlabType, a second
IfcSlabType of predefined type ROOF and an IfcShadingDeviceType. RE-167
(Measure run 37223026163): the type object holding the type's lowest
ElementId has the type's own GlobalId; the others have revit-ifc's
conflict key (GUIDUtil.CreateInternal with useEntityType), MD5 of
"<type GlobalId>Sub-element: Entity: IfcSlabType:ROOF" and
"...: Entity: IfcShadingDeviceType:NOTDEFINED", with " InAssembly: False"
appended from revit-ifc 25.4 on (a 2025 or later file).

The writer now writes a type object per type, entity, predefined type and
GlobalId; the one with the lowest ElementId takes the type's GlobalId and
the others the entity key. revit_global_ids gains hashed_global_id
(md-5 joins the dependencies beside sha2), and RevitGlobalIds carries the
file's release.
…umbered partition's copy names its original symbol (B60)

RE-167's door probe (Measure run 37223323115): 105 of Core Interior's doors hold two GElement copies with different values, in Partitions/46 (or 51) and Partitions/59; Revit's export goes by the Partitions/59 copy on every one.
…and roof slab types B60 and B73 write

IFCCOLUMNTYPE 1 -> 175 (columns with their own geometry take a type each,
revit-ifc InstanceAsType), IFCSLABTYPE 5 -> 7 (B73's roof slab types),
IFCRELDEFINESBYTYPE 16 -> 192. Taken from CI run 37223765193's
octetproof-core-interior artifact, where IfcOpenShell validated the export
with no issues and both bridge witnesses replayed as committed.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 4, 2026 18:34
@DrunkOnJava
DrunkOnJava merged commit fa5508d into main Oct 4, 2026
28 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/b60-type-global-ids branch October 4, 2026 18:38
DrunkOnJava added a commit that referenced this pull request Oct 23, 2026
…om their pull requests' measurements (#895)

## Summary

Four findings shipped and are cited in the code (RE-149 in
`partition_type_materials`, RE-165 in `partition_fitting_sizes`, RE-166
in `partition_curtain_materials`, RE-167 in `partition_schema_mvp`) but
never got their report under `reports/element-framing/`, so a reader
following a citation found nothing. This adds the four reports, written
from the pull requests that shipped each finding.

## Motivation

The 2026-10-23 style audit found these four as the only RE ids cited in
rustdoc with no report (145 of 149 resolve). The docs pass that follows
adds a CI check that every cited RE id has a report; this lets it pass
without exemptions.

## Changes

- `RE-149-unset-material-maps.md` (from #580),
`RE-165-fitting-nominal-diameter.md` (#651),
`RE-166-curtain-type-materials.md` (#657), `RE-167-type-global-ids.md`
(#663, #666). Each says it was written after the fact, cites the
Measure, red and green runs and the real-file targets those PRs
recorded, and gives the files by their `research/witness-registry.json`
ids and hashes.

## Testing

Docs only. Every number in the reports is copied from the PR it cites;
nothing was re-measured, and each report says so.

## Audit-honesty checklist

- [x] No new claim: each report restates its PR's recorded evidence
- [x] No emojis, private paths or internal jargon beyond the backlog ids
the PRs used

## Legal and contribution hygiene

- [x] Apache-2.0; clean-room sources only (byte observations,
`RevitAPI.dll` names, revit-ifc as CLEANROOM.md allows)

## Breaking changes

None.

## Screenshots or output samples

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant