Skip to content

fix(ifc): an element's Reference is in IFC4's sets, and storeys and spaces lose IFC2X3's name sets (#822) - #825

Merged
DrunkOnJava merged 6 commits into
mainfrom
fix/822-ifc4-reference-sets
Oct 19, 2026
Merged

DrunkOnJava merged 6 commits into
mainfrom
fix/822-ifc4-reference-sets

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Parts 1 and 3 of #822. An element's Reference (its type's name) is now written in every IFC4 property set that applies to its entity and declares Reference, instead of in IFC2X3's Pset_QuantityTakeOff and Pset_DistributionFlowElementCommon, which IFC4 does not have. Storeys and spaces no longer carry IFC2X3's Pset_AirSideSystemInformation and Pset_ProductRequirements name sets.

Motivation

RE-154 listed the Reference sets by hand from Revit's exports of the RE1 models, and #35 added the storey and space name sets from the same exports. Those exports are IFC2X3 (Coordination View 2.0), not IFC4 as RE-154 recorded. rvt-rs writes IFC4, so every element with a type carried Pset_QuantityTakeOff, every MEP element Pset_DistributionFlowElementCommon, and every storey and room the two name sets: Pset_ sets that buildingSMART's IFC4 definitions either do not have or do not apply to storeys.

Revit's own IFC4 export of the BIM4LCA office writes the type name in Pset_EnvironmentalImpactIndicators, which IFC4 applies to every IfcElement, and in each set of the element's entity that declares Reference. IFC4's applicability, from #817's table, gives each class of the office exactly those sets, except for sets revit-ifc matches by a prefix of the entity's name (Pset_SpaceHeaterTypeCommon on spaces, Pset_StairFlightCommon on stairs), which IFC4 does not apply. That export writes neither name set.

Changes

  • src/ifc/export_content.rs: reference_set_kinds finds the IFC4 sets from the table that apply to the element's entity and predefined type and declare Reference, with the type each declares (IfcLabel in the reinforcement sets), worked out once per entity and predefined type. Spaces keep the Reference space_common_property_set writes. The space name sets are gone.
  • src/ifc/standard_property_sets.rs: StandardPropertySet::applies_to and property_kind, so a caller can walk the table.
  • src/ifc/entities.rs, step_writer.rs, mod.rs: PropertySet::name_sets is removed and storey_sets takes no name: a storey gets Pset_BuildingStoreyCommon only.
  • Tests (tests/common_reference.rs, reference_values.rs, duct_fields.rs, spatial_property_sets.rs) and tools/re/psets_vs_ifc.py compare RE1's IFC2X3 sets with the IFC4 sets that hold the same values: Pset_QuantityTakeOff.Reference with Pset_EnvironmentalImpactIndicators.Reference, and Pset_DistributionFlowElementCommon.Reference with the IFC4 type set of the entity rvt-rs writes the element as (Pset_DuctSegmentTypeCommon, Pset_PipeFittingTypeCommon and so on), as Revit's IFC4 export of the office writes them. An IFC4 set with no IFC2X3 counterpart on an element (an alarm's Pset_AlarmTypeCommon) must hold one of the Reference values Revit gives the element. spatial_property_sets checks that neither name set is written.
  • Core Interior's project-count fixtures and witness observations follow the export: 6,466 property sets (from 6,164), measured in CI run 39244133296; both witness verdicts replay PASS.
  • RE-154 and RE-196 record the RE1 exports' schema. CHANGELOG.

Testing

Measure A/B against #821's head (77c2e63), run 39243870744, both sides scored with this PR's psets_vs_ifc; run 39242260740 has part 1 alone, scored with main's.

values equal to Revit's values Revit does not write
BIM4LCA office, as built 18,502 → 32,053 13,257 → 621
BIM4LCA office, building permit 18,501 → 32,225 13,238 → 622
  • On the office every new value Revit's export holds is equal; none differs. Pset_EnvironmentalImpactIndicators.Reference: 12,349 of Revit's 12,693; the 344 others include the 220 curtain walls, whose type names rvt-rs does not read (their Pset_CurtainWallCommon.Reference is missing too). Also equal now: Pset_ColumnCommon and Pset_ReinforcementBarPitchOfColumn 279 each, Pset_WindowCommon 269, Pset_SanitaryTerminalTypeCommon 144, Pset_WasteTerminalTypeCommon 78, Pset_ElectricApplianceTypeCommon 51, Pset_LightFixtureTypeCommon 43, Pset_FireSuppressionTerminalTypeCommon 40, the beams' 8 and 8.
  • RE1 (IFC2X3 references): every Reference value is still Revit's, in the IFC4 set that holds it. The name sets IFC4 does not hold are now missing: 26 values on Architecture, 4 on each of the others. RE1 Electrical's 5 alarms gain Pset_AlarmTypeCommon.Reference, which the IFC2X3 export has no set for.
  • Core Interior's reference export has no property sets; its export's sets move as the fixture note records (columns, windows and shading devices +564, storeys and rooms −262).
  • 88 of 89 hashed exports change, as every typed element's sets do; IfcOpenShell's validation and the arity check find nothing on any of them.
  • One-runner timing against main, run 39248639494, at 4d698e5 (the sets holding Reference worked out once per entity and predefined type, instead of walking the 278 sets and the entity's supertypes for every element): head/base 0.98 to 1.01 on the eight reference models, the office 1.01. Separate-runner times move with the runner's CPU (0.62 to 1.31 across these A/Bs, feat(ifc): a parameter named for any IFC4 property set's property is written, from buildingSMART's definitions (#817) #821's included), so they are not evidence either way. The cache changes no export: every one of the 89 hashed exports at the cached head equals 541e492's (the reference models in the timing run, the samples and R2025 models in run 39250967645 at a0fbda0).

cargo fmt is clean. No unit tests, by the repository's rule.

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • Commit messages describe what changed and why
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content

Based on buildingSMART's IFC2X3 and IFC4 property set definitions (CLEANROOM.md source 4) and Revit's own IFC exports of the RE1 models and the BIM4LCA office.

Breaking changes

  • A consumer reading Pset_QuantityTakeOff.Reference or Pset_DistributionFlowElementCommon.Reference finds the same value in Pset_EnvironmentalImpactIndicators.Reference and the entity's IFC4 sets; one reading a storey's or space's name from the two name sets reads its Name.
  • ifc::entities::PropertySet::name_sets is removed and PropertySet::storey_sets takes no argument (both in 0.5.1).

Base automatically changed from feat/817-ifc4-pset-table to main October 19, 2026 11:21
…s entity and declare one, not IFC2X3's Pset_QuantityTakeOff (#822)

RE-154 listed the sets by hand from the RE1 models' exports, which are IFC2X3: Pset_QuantityTakeOff on every typed element and Pset_DistributionFlowElementCommon on MEP elements, neither an IFC4 set. The type's name now goes in every IFC4 set from #817's table that applies to the element's entity and predefined type and declares Reference, as the type it declares.
…s that hold them (#822)

Revit's IFC2X3 export of the RE1 models writes the type name in Pset_QuantityTakeOff and Pset_DistributionFlowElementCommon; its IFC4 export, like rvt-rs's, in Pset_EnvironmentalImpactIndicators and the distribution element's own type set. The three RE1 Reference tests and psets_vs_ifc compare each with its IFC4 set. RE-154 records the exports' schema.
Revit's IFC2X3 export of the RE1 models gives every storey and space Pset_AirSideSystemInformation and Pset_ProductRequirements holding its name. IFC4 has no Pset_ProductRequirements and applies Pset_AirSideSystemInformation, the air-side system's information, to spaces and zones only; Revit's IFC4 export of the BIM4LCA office writes neither. PropertySet::name_sets is removed and storey_sets takes no name.
@DrunkOnJava
DrunkOnJava force-pushed the fix/822-ifc4-reference-sets branch from 541e492 to 7af1f88 Compare October 19, 2026 11:22
… follow the IFC4 sets (#822)

Core Interior's export has 6,466 property sets (6,164 before): its columns, windows and shading devices gain IFC4's Reference sets, and its storeys and rooms lose the IFC2X3 name sets. The rvt-rs witness observations carry the new counts (CI run 39244133296's artifact; both verdicts replay PASS). An alarm's IFC4 Pset_AlarmTypeCommon.Reference, which Revit's IFC2X3 export has no counterpart for, must hold a Reference value Revit gives the element.
…and predefined type (#822)

Walking the 278 IFC4 sets and each entity's supertypes for every typed element costs about 29,000 string comparisons an element; the sets now come from a cache keyed by the entity and predefined type written.
@DrunkOnJava DrunkOnJava changed the title fix(ifc): an element's Reference is in the IFC4 sets that apply to its entity, not IFC2X3's Pset_QuantityTakeOff (#822) fix(ifc): an element's Reference is in IFC4's sets, and storeys and spaces lose IFC2X3's name sets (#822) Oct 19, 2026
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review October 19, 2026 12:05
@DrunkOnJava
DrunkOnJava merged commit 9a71500 into main Oct 19, 2026
29 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/822-ifc4-reference-sets branch October 19, 2026 12:37
DrunkOnJava added a commit that referenced this pull request Oct 19, 2026
…ire Rating in its IFC4 common set (RE-77, RE-194) (#830)

## Summary

An element whose own parameters give no `FireRating` for its IFC4 common
set now takes its type's Fire Rating (RE-77) there, as Revit's exporter
does: the parameter named for the property first (RE-194), the type's
Fire Rating after it.

## Motivation

RE-194 left `FireRating` missing on 26 walls of the BIM4LCA office that
carry no parameter named `Pset_WallCommon.FireRating`. A research run
(Measure 39246244063, `type_parameters_vs_ifc` with a fallback check)
showed what Revit's export writes there: on both office files, 26 of the
28 elements whose `FireRating` Revit's export writes without such a
parameter carry their type's Fire Rating (`EI60`), which RE-77 already
reads; the other 2 carry `-`, which RE-77 reads on neither type. Four
elements whose parameter (`EI90`) differs from their type's Fire Rating
(`EI60`) carry the parameter's in Revit's export, which gives the order.
rvt-rs wrote the type's Fire Rating only in its own
`RvtElementRecordGeometry` set.

## Changes

- `src/ifc/export_content.rs`: `named_parameter_properties` adds the
type's Fire Rating as `FireRating` (`IfcLabel`) for each standard set
declaring it that the element's own parameters leave without one;
`add_named_parameter_sets` writes it where the set applies to the entity
finally written, merged into the set the element already has.
- RE-77 and RE-194 record the measurement; the support matrix's RE-77
row and the CHANGELOG.
- Core Interior's rvt-rs witness observations carry the 227 new values
(IFCPROPERTYSINGLEVALUE 27,131 to 27,358, from CI run 39253843663 on
`main` with #825); both verdicts replay PASS.

## Testing

Measure A/B against `main` (19f26b9), run
[39249252264](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39249252264):

| | `Pset_WallCommon.FireRating` equal to Revit's | all values equal to
Revit's |
|---|---:|---:|
| BIM4LCA office, as built | 71 → 97 of 97 | 18,502 → 18,528 |
| BIM4LCA office, building permit | 71 → 97 of 97 | 18,501 → 18,527 |
| RE1 Architecture | 0 → 7 of 7 | 206 → 213 |

- No value differs and none is written that Revit's export does not hold
on the scored models; the office's 2 doors rated `-` stay missing.
- 9 hashed exports change: those four, Core Interior (227 rated walls;
its reference exports write no property sets) and Autodesk's advanced
samples 2024 to 2027 and Snowdon Towers' architectural sample, whose
IFC4 export RE-77 measured its type Fire Ratings against (696 of 696)
but which Measure does not hold. IfcOpenShell finds nothing on any
export.

`cargo fmt` is clean. No unit tests, by the repository's rule.

## Audit-honesty checklist

- [x] README / docs reflect the current state after this PR
- [x] Commit messages describe what changed and why
- [x] No emojis in code, docs, or commit messages
- [x] No private paths, personal email addresses, or internal jargon in
committed files

## Legal and contribution hygiene

- [x] I agree this work is licensable under Apache-2.0
- [x] This PR contains no Autodesk proprietary source, decompiled
internals, or NDA'd SDK content

Based on Revit's own IFC exports of the BIM4LCA office and RE1
Architecture and revit-ifc's property set entries (CLEANROOM.md source
5, read and cited).

## Breaking changes

None.
DrunkOnJava added a commit that referenced this pull request Oct 19, 2026
…'s definitions (#822) (#826)

## Summary

Part 4 of #822, report-only. Measure now checks every export's standard
property sets against IFC4's definitions, so a set or property IFC4 does
not have, or a set on an entity IFC4 does not apply it to, shows in each
export's `schema.txt` and in the base/head comparison.

## Motivation

#820 and #822 found, one at a time, sets and properties rvt-rs writes in
its IFC4 output that are IFC2X3's, taken from Revit's IFC2X3 exports of
the RE1 models. IFC reserves the `Pset_` prefix for the sets it defines,
and buildingSMART's validation service checks property sets against its
own list of IFC4's definitions (rule PSE001). Checking every export
against that list finds the whole class at once, and keeps it from
coming back.

## Changes

- `tools/ci/ifc4_property_sets.py`: for every `Pset_` set an IFC file
relates to an object (`IfcRelDefinesByProperties`) or gives a type
object (`HasPropertySets`), counts sets IFC4 does not define, properties
their IFC4 set does not have, sets on entities IFC4 does not apply them
to (with supertypes; a set scoped to a predefined type, such as
`IfcCovering/CEILING`, applies to an object with that predefined type,
its own or, where it gives none, its type's, or a user-defined one of
that name; on an entity with no `PredefinedType`, such as
`IfcAnnotation`, the scope is its `ObjectType`), properties of another
kind than declared, single, list and bounded values of another type, and
enumeration values the enumeration does not have. An
`IfcPropertySetDefinitionSet` is checked set by set. The definitions are
`features/resources/IFC4/pset_definitions.csv` of
buildingSMART/ifc-gherkin-rules, read through
`gen_standard_property_sets.py`'s pinned commit and sha256 (#817).
Quantity sets are not checked.
- `tools/ci/measure-reference-models.sh`: `schema()` appends the report
to every model's and sample's `schema.txt`, fetching the definitions
once per run.
- CHANGELOG.

## Testing

Measure on `main`'s code before #825 (19f26b9) with this tool, run
[39245178917](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39245178917):
reference models, BIM4LCA office, Autodesk's samples and the R2025
models, 89 exports, every one with a report. #825 has since landed and
removed the first four rows.

| Finding | Exports | Count | Fixed by |
|---|---:|---:|---|
| not an IFC4 set: `Pset_QuantityTakeOff` | 88 | 123,206 | #825 |
| not an IFC4 set: `Pset_DistributionFlowElementCommon` | 48 | 36,597 |
#825 |
| not an IFC4 set: `Pset_ProductRequirements` | 87 | 3,385 | #825 |
| `Pset_AirSideSystemInformation` on `IfcBuildingStorey` | 87 | 447 |
#825 |
| not an IFC4 set: `Pset_FlowSegmentPipeSegment`,
`Pset_FlowSegmentDuctSegment` | 4 | 2,421 each | part 2 of #822 |
| not a property of its IFC4 set: `Pset_DuctSegmentTypeCommon.Length` |
3 | 1,441 | part 2 of #822 |
| not a property of its IFC4 set:
`Pset_PipeFittingTypeCommon.NominalDiameter` | 11 | 5,469 | to follow
(#822) |
| not a property of its IFC4 set:
`Pset_PrecastConcreteElementGeneral.SerialNumber` | 1 | 19 | part 2 of
#822 |

No export has a value of another type than IFC4 declares, or an
enumeration value IFC4 does not list.

On `main` with #825 and #830 (this PR's Measure run
[39255349556](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39255349556),
the six reference models), Core Interior, Einhoven and RE1 Architecture
have no finding; RE1 Mechanical and Plumbing keep the flow-segment sets
(94 each), `Pset_DuctSegmentTypeCommon.Length` (25) and the fittings'
`NominalDiameter` (49), and RE1 Electrical the precast `SerialNumber`
(19). On `tests/fixtures/synthetic-project.ifc` the tool also reports 7
properties `from_decoded`'s builders put in `Pset_WallCommon` and
`Pset_WindowCommon`, a path no production export takes (none of the 89
has them).

The check reports and does not fail. It can gate CI's production exports
once the list is empty.

## Audit-honesty checklist

- [x] README / docs reflect the current state after this PR
- [x] Commit messages describe what changed and why
- [x] No emojis in code, docs, or commit messages
- [x] No private paths, personal email addresses, or internal jargon in
committed files

## Legal and contribution hygiene

- [x] I agree this work is licensable under Apache-2.0
- [x] This PR contains no Autodesk proprietary source, decompiled
internals, or NDA'd SDK content

Based on buildingSMART's IFC4 property set definitions (CLEANROOM.md
source 4, MIT).

## Breaking changes

None.
@DrunkOnJava DrunkOnJava mentioned this pull request Oct 19, 2026
6 tasks done
DrunkOnJava added a commit that referenced this pull request Oct 19, 2026
## Summary

Prepare v0.6.0. Merging this is not the release: the release is the signed `v0.6.0` tag on the merged commit, after the maintainer's go-ahead. This stays a draft until then.

## Motivation

Since 0.5.1, `main` has:

- **IFC4's own property sets (#822):** the IFC2X3 sets 0.5 took from Revit's exports of the RE1 models are gone or moved to where IFC4 and Revit's own IFC4 export put them (#825, #829, #833), and Measure checks every export's standard property sets against buildingSMART's published IFC4 property set definitions (#826). That is rvt-rs's own check: buildingSMART's Validation Service has not been run on the exports, and quantity sets are not checked.
- **More of what Revit's exporter writes:** parameters named for an IFC4 property set's property (RE-194, #815, #817/#821), each element's `IsExternal` (RE-193, #814), a type's Fire Rating (#830), a door's overall size (#788), Revit 2024 Areas as spaces (#811), port types and electrical flow directions (#832), rooms with no number (#818), pieces' property sets (#819), a room's floor finish in IFC4's set (#820).
- **Older and newer releases, experimentally:** Revit 2015 to 2022 (#742) and 2027 (#740) element records.
- **Fixes:** Export to IFC As on fixtures, stairs, doors, curtain walls and wall sweeps (#796, #804, #812, #813), the latest copy of an element's or type's data (#803, #809), declared ElementIds (#797), diagnostics naming the file, not its folders (#785), the browser viewer's wasm32 string-length panic (#835), and `rvt-inspect`, `rvt-corpus doctor` and the viewer's File Status taking Revit 2015 and 2027 as releases rvt-rs reads (#838).
- **CI and release:** IfcOpenShell 0.9.0.post1 (#795), Rust installed with rustup (#793), a tag publishes nothing until the maintainer approves it (#786, #787), and Measure's office, R2025, paired-probe and per-sample hashing (#790, #799, #805, #806).

## Changes

- **Versions 0.5.1 → 0.6.0** in the nine files that carry them: `rvt`, `rvt-py` and its pin, `rvt-wasm`, the `stream_evidence` pin, `CITATION.cff` (with `date-released`), `.release-please-manifest.json`, `viewer/package.json` and both lockfiles' workspace entries.
- **CHANGELOG:** `[0.6.0] — 2026-10-19`, with an introduction, **Upgrading from 0.5** (the property sets that moved, the public API changes, the releases that now export elements) and the outside contributors credited: puzzbobb (#740, #742, #798), Erry91 (#788) and MadsHolten (#835). The section's headings were already single; its 41 entries are all kept, with #835's and #838's added. Its introduction says the property sets match buildingSMART's published IFC4 definitions by rvt-rs's own check, as does the README's release summary.
- **README:** "Release 0.6.0 and main" names v0.6.0 and summarises what it added. The lines that said `main` reads Revit 2015 to 2022 and 2027 now say experimental (since 0.6.0). The opening and "Not yet" lines name those releases, and so does the capability table. The bullet list of what 0.5.0 added is gone; #832 had put 0.6.0's port types in it. As Codex found, the IFC4 export row, the viewer paragraph and the decoder-work paragraph also said 2022 and earlier export only the scaffold, and the by-input table skipped 2014; they name 2015 to 2022, 2026 and 2027 now.
- **Witnesses:** the IFC header carries the version, so both Core Interior `rvt-rs.json` observations and their verdicts are refreshed from this pull request's CI run.

## Testing

- CI on this pull request, the witness replays included.
- Measure on `main` at 23a9d76, which is everything in this release but #835's wasm32-only fix and #838's CLI and viewer version range, neither of which changes an export: run [39273188597](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39273188597). All 89 exports (the reference models, both BIM4LCA office files, Autodesk's 58 sample projects and the 23 R2025 models) have no finding in Measure's IFC4 property set check (#826, against buildingSMART's published definitions), and IfcOpenShell's schema validation finds nothing on any of the 89; none was too large to validate.
- Witnesses: both Core Interior observations and verdicts are taken from this pull request's CI run 39275014518; only `witness_version` and the verdict hashes differ, and CI's replay on b82c0c3 passes.

## Audit-honesty checklist

- [x] README / docs reflect the current state after this PR
- [x] Commit messages describe what changed and why
- [x] No emojis in code, docs, or commit messages
- [x] No private paths, personal email addresses, or internal jargon in committed files

## Legal and contribution hygiene

- [x] I agree this work is licensable under Apache-2.0
- [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content

## Breaking changes

See **Upgrading from 0.5** in the CHANGELOG: standard property sets moved to IFC4's, and five public API changes.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Version and documentation-only release prep with no runtime code changes in this PR.
> 
> **Overview**
> **Bumps the workspace from 0.5.1 to 0.6.0** across `Cargo.toml`, `rvt-py` / `rvt-wasm` / `stream_evidence` pins, lockfiles, `viewer/package.json`, `.release-please-manifest.json`, and `CITATION.cff` (release date 2026-10-19).
> 
> **Documents the release:** adds the `[0.6.0]` section to `CHANGELOG.md` (IFC4 property sets, broader Revit export parity, experimental 2015–2022/2027 element export, wasm viewer fix, and **Upgrading from 0.5** breaking notes). **README** now treats v0.6.0 as the current release—updates the support matrix and “Release 0.6.0 and main” to describe shipped capabilities instead of the old 0.5.1 bullet list.
> 
> No application or library source changes in this diff; it packages and narrates work already on `main`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c8826b82982270fd4f47b8da656f2e3e6021c76b. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
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