Skip to content

feat(elements): a housing railing's type takes its name from the latest copy of its type object, which gives it Reference and Height (#1193) (RE-431) - #1738

Merged
DrunkOnJava merged 7 commits into
mainfrom
feat/1193-railing-type-names
Nov 11, 2026
Merged

DrunkOnJava merged 7 commits into
mainfrom
feat/1193-railing-type-names

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

A railing now gets its type, and with it Pset_RailingCommon.Reference and Height and Pset_EnvironmentalImpactIndicators.Reference, because the name of its railing type is taken from the latest partition's copy of the type object, not from the copies that agree. Every railing type of the BIM4LCA housing has an older copy with a Finnish name (KD-5) and a newer one with the English name Revit's export carries (KAI-5), so the names never agreed and no type was attached to any of the 198 railings of the four large housing files; the timber office at permit (37 railings) and the two terrain office files (1 each) are the same. The newer copy's name is Revit's type name on 198 of 198, and the 237 railings now read equal to Revit's on Reference and Height (4 to 241 of 241) with none different. 7 of 126 exports move and 119 are byte-identical: where a type's copies agree (the office as built and at permit, the terrain housing files, RE1, the held-out models) nothing changes. The change adds property values and raises diagnostics.decoded.parameter_value_count by the same, and adds 49 IfcRailingType objects with their IfcRelDefinesByType relations (Revit's housing export has none, as rvt-rs's office export already does for its typed railings).

Motivation

W7 (#1193): Pset_RailingCommon.Reference and Height were missing on 237 railings and Qto_RailingBaseQuantities.Length on 318 in the census of Measure run 43018018669. Rows registered on #1636 before the runs were read: #1636 (comment) (the first probe), #1636 (comment) (the type probe) and #1636 (comment) (this change).

Changes

  • src/research/partition_schema_mvp/types.rs: railing_type_picks and the loop over find_railing_type_names offer each type object's name with its partition to LatestCopy (as type_data_names does for element data names) instead of requiring the copies to agree.
  • probes/examples/probe_re431_railing_types.rs, tools/re/railing_types_vs_ifc.py: the probe prints, per railing and per BaseRailing copy, the type objects its words name and the name each copy of them holds in each partition; the scorer holds three ways of choosing a name against Revit's.
  • reports/element-framing/RE-431-railing-type-names.md, docs/release-1.0-criteria.md, docs/format-reconnaissance.md, docs/evidence.md, docs/status.md, changelog.d/added/1193-railing-type-names.md.

Testing

Unit tests are banned in this repository: none added. Verified end to end on real files:

  • full / CI passed on the final head
  • Unfiltered Measure of the change against main dae660b8, every flag, keep_ifc (43052157947, head 8298fefd, kept under refs/archive/2026-11-11/cited/8298fefd8110):
    • Property census, the 42 models with a Revit export: Revit's values 213,756 each side; equal 199,261 to 199,972 (+711); missing 14,434 to 13,723; different 61 to 61; the values rvt-rs writes that Revit does not 358 to 358. Pset_RailingCommon.Reference and Height 4 to 241 of 241 equal each, and Pset_EnvironmentalImpactIndicators.Reference +237 (the railings' type name again): the timber housing 56 of 56 as built and at permit, the concrete housing 43 of 43 each, the timber office at permit 41 of 41 (from 4), the two terrain office files 1 of 1 each.
    • What moves: 7 of 126 exports; the other 119 are byte-identical. On the 7 pairs (tools/re/ifc_element_diff.py) no element is added or removed and 237 elements differ, each a railing that gains Pset_RailingCommon Height and Reference, Pset_EnvironmentalImpactIndicators Reference, the Other properties Family, Family Name, Family and Type, Type and Type Id, Identity Data Type Name and rvt-rs's RvtElementRecordGeometry FamilyName, FamilyNameSource and TypeName, with nothing removed or changed; the entities added are 49 IfcRailingType and 49 IfcRelDefinesByType, 335 IfcPropertySet, 237 IfcRelDefinesByProperties and 2,517 IfcPropertySingleValue. No held-out export moves.
    • same-project gates pass on the measured head; the Measure job that makes the verdict failed afterwards on ECONNRESET in an artifact download (ci: Measure goes red on a transient ECONNRESET in an artifact download #1742, ci: Measure tries each artifact download a second time after a pause, so a transient ECONNRESET does not turn a run red (#1742) #1743).
    • Qto_RailingBaseQuantities.Length does not move (RE-254's rule is a stair railing's path alone; the housing's free railings stay without it).
  • The probes: Measure 43044928311, 43048938486 and 43050258474: on all 198 railings of the four large housing files the railing names exactly one StairsRailingAttr, its copies hold two names, and the latest partition's copy has Revit's name on 198 of 198 (the routed copy's too); on the office's 41 and the terrain files' 2 each all three ways agree.
  • Not timed: no new read; the change replaces how two names are merged.

Audit-honesty checklist

  • A user-visible change has its entry as a fragment under changelog.d/added/.
  • docs/release-1.0-criteria.md, docs/evidence.md and docs/status.md state what is written and what is left without (Qto_RailingBaseQuantities.Length on the housing's free railings).
  • No emojis, no private paths in committed files.
  • Reverse-engineering finding: a probe, a scorer and a dated report are included.

Legal and contribution hygiene

  • Apache-2.0. No Autodesk proprietary source, internals or NDA material.
  • No new test fixtures.

Breaking changes

None. A railing that held no type gains one; no existing value changes.

Related issues

Refs #1193, #1636.

…pe in its BaseRailing copies, against the type name Revit's export gives it (#1193) (RE-431)
…object holds in each partition and the routed one, to read which copy names the type Revit's export does (#1193) (RE-431)
…st copy of its type object, which gives it Reference and Height (#1193) (RE-431)
…ish name and a newer English one, and that the newer is Revit's on 198 of 198 (#1193) (RE-431)
…s and the terrain offices' 237 railings gain their type, Reference and Height, each Revit's, none different (#1193) (RE-431)
@DrunkOnJava
DrunkOnJava merged commit ec6cbb9 into main Nov 11, 2026
63 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/1193-railing-type-names branch November 11, 2026 16:50
DrunkOnJava added a commit that referenced this pull request Nov 11, 2026
…1713) (#1765)

## Summary

Revit's export gives every `IfcRailing` a `PredefinedType`; rvt-rs wrote
`$` on all 378 railings of the 42 models with a Revit export (#1713).
This adds `IFCRAILING` to `category_map::PREDEFINED_TYPE_ENUMERATORS`
with the IFC4 `IfcRailingTypeEnum` enumerators, so a railing takes its
own or its type's "IFC Predefined Type" where that value is an
enumerator of the entity — the same rule RE-45 and RE-419 already apply
to slabs, coverings, shading devices, roofs, the waste, electric,
fire-suppression, sanitary and air terminals, and furniture. Nothing
else changes: the `Railing` mapping keeps no default, and
`category_map::predefined_type_left_out` still keeps the occurrence's
value off a Revit 2027 save (#1692).

## Evidence

**What Revit writes.** The office's own IFC4 export (`revit.ifc`) holds
41 `IFCRAILING`, and rvt-rs's export of the same file holds the same 41
by `Tag`, each with `$` in the last attribute. Tabulated by the type
name (the text before the last colon of `Name`) and the last attribute:

| type | railings | Revit's `PredefinedType` |
|---|---:|---|
| `KAI-4` | 10 | `HANDRAIL` |
| `KJO-1` | 22 | `HANDRAIL` |
| `KAI-1` | 1 | `GUARDRAIL` |
| `KAI-2` | 2 | `GUARDRAIL` |
| `KAI-3` | 2 | `GUARDRAIL` |
| `KAI-5` | 3 | `GUARDRAIL` |
| `KAI-6` | 1 | `NOTDEFINED` |

32 `HANDRAIL`, 8 `GUARDRAIL`, 1 `NOTDEFINED`, and every railing of a
type has that type's value: 7 types, 7 values.

**What does not decide it.** Not the name: `KAI-4` is `HANDRAIL` and
`KAI-1` is `GUARDRAIL`, and `KAI-6` is `NOTDEFINED`. Not the host:
RE-390 counts 26 of the office's railings naming a stair and 8 naming a
ramp, where 32 are `HANDRAIL`, so a stair-hosted railing is not the rule
and a ramp-hosted one is not either.

**What does.** A value that is constant per railing type is the type's
own, which is what RE-45's "IFC Predefined Type" reads (the instance's,
else its type's, `ExportParameters::effective_predefined_type`). RE-190
measured 40 `IfcRailing` export-parameter values in the office's
railings' data objects, so the office's railings do carry IFC export
parameters, and `attach_ifc_export_overrides` already attaches them to
the railing as `m_ifc_predefined_type`; the only thing that kept the
value out of the export was that `IFCRAILING` was not in the enumerator
table, so `predefined_type_for` returned `None` and the mapping's own
`None` was written. The mechanism is proven on other classes: RE-419
reads 872 of 884 furniture equal to Revit's with none different, and
RE-190 78 of 78 waste terminals, 51 of 51 electric appliances, 40 of 40
fire-suppression terminals, 15 of 15 sanitary terminals and 1 of 1 air
terminal. revit-ifc's `IFCExportInfoPair` keeps a value that is an
enumerator of the entity and defaults the rest (RE-419, cited by class,
CLEANROOM.md source 5).

**What stays `$`.** A railing with no "IFC Predefined Type" of its own
or its type's, and one whose value is not an `IfcRailingTypeEnum`
enumerator. I did not add the `NOTDEFINED` default RE-419 gave
furniture: the only railing measured with `NOTDEFINED` is the office's
one `KAI-6`, and I cannot tell whether its type carries the value or
nothing, so a default would write `NOTDEFINED` where Revit writes
`HANDRAIL` on any file whose export parameters are not read (Revit 2023
and earlier, where `attach_ifc_export_overrides` does not run). On the
office that leaves at most that one railing unset; on the other 41
models the railings whose types carry no value stay unset too. A Revit
2027 save keeps none, through `predefined_type_left_out`.

## Changes

- `src/ifc/category_map.rs`: `IFCRAILING` joins
`PREDEFINED_TYPE_ENUMERATORS` with `HANDRAIL`, `GUARDRAIL`,
`BALUSTRADE`, `FENCE`, `USERDEFINED`, `NOTDEFINED`
(`IfcRailingTypeEnum`), and the table's doc comment records why the
value is the railing type's and not its host's.
- `changelog.d/fixed/1713-railing-predefined-type.md`: the user-visible
change.
- `docs/release-1.0-criteria.md`: the RE-427 sentence no longer reads
the railing row of #1713 as open.

No test is edited. `tests/railing_type.rs` finds the railing by the last
quoted attribute of its `IFCRAILING` line, which is the `Tag` before and
after this change, and the type object's `Tag` likewise.

## Measured

One Measure run scored this change together with the four others it was
drafted beside (run 43058225020, head `d17975d3`, base `aa5dc4c6`):
every model, with the BIM4LCA office and housing, the 23 Revit 2025
models, Autodesk's samples of every release, rac_advanced, BIMcollab and
the held-out pairs. All 39 shards and both same-project gates passed,
and the check run `same-project gates` on `d17975d3` reads pass. 20 of
126 exports change; each changed row carries the name of the value its
change writes, so the rows below are this change's alone. A second run
kept both sides' exports of the 25 sample saves of 2024 to 2027, which
no Revit export scores, and they were compared entity by entity with the
step ids taken out (run 43073245751). A third measured the four office
files with `--revit-set-placement`, as W7 is measured (run 43073951032).
After the second read's two fixes, the stack's final head with `main`
merged (`e41d96b5` against `39826420`) was measured again in full (run
43077331708, rows registered on #1636 before it was read): every row
below repeats, 24 of 126 exports move and no other, and both
same-project gates pass on that head.

| Model | `IfcRailing.PredefinedType` same as Revit, before | after |
differs | unset where Revit writes `NOTDEFINED` |
|---|---:|---:|---:|---:|
| Office as built | 0 of 41 | 40 of 41 | 0 | 1 |
| Office at permit | 0 of 41 | 40 of 41 | 0 | 1 |
| Timber office as built | 0 of 41 | 38 of 41 | 0 | 3 |
| Timber office at permit | 0 of 41 | 38 of 41 | 0 | 3 |
| Office terrain, concrete and timber | 0 of 1 each | 1 of 1 each | 0 |
0 |
| Housing terrain, concrete and timber | 0 of 2 each | 2 of 2 each | 0 |
0 |
| Concrete housing as built and at permit, on `main` with #1738 | 0 of
43 each | 43 of 43 each | 0 | 0 |
| Timber housing as built and at permit, on `main` with #1738 | 0 of 56
each | 56 of 56 each | 0 | 0 |

- No railing differs from Revit's on any model. The ones left are
railings whose type holds no value: Revit writes `NOTDEFINED` there and
rvt-rs writes nothing, as before.
- The four housing rows are from the final run: #1738, which landed
between the two runs, reads the housing's railing types from their
latest copy, and with it all 198 housing railings take Revit's value. On
the first run's base they were unchanged.
- No other model moves: the Revit 2025 models, the held-out pairs and
every sample save are unchanged by this change.
- `FENCE` is not listed: it is a railing type in IFC4X3 only, and the
first draft of this change listed it (found by the second read, fixed in
`d8944595`). A railing holding it keeps no `PredefinedType`.
- **Type objects, which no export scores.** rvt-rs writes an
`IfcRailingType` where Revit's exports of these models write none (the
census's "typed in ours but not in Revit's export", unchanged), and a
railing type now takes its value as the types of the other listed
classes do: on the office 4 `GUARDRAIL`, 2 `HANDRAIL` and 1 `NOTDEFINED`
where all 7 were `NOTDEFINED`. On the timber office one type whose
railings hold two different values is written as two type objects, by
the rule that already keys a type object by entity and predefined type,
so its type objects go from 1,432 to 1,433 as built and 1,399 to 1,400
at permit. No WHERE rule finding is added on any model.

## Still open

- The 1 and 3 railings Revit writes `NOTDEFINED` on are left unset.
Writing `NOTDEFINED` where a type holds no value would close them on
these files, but RE-427 found the 2027 exporter leaves the attribute
off, so it is not written without a measurement per release.

The four changes measured with this one are merged (#1761 to #1764).
`main` is merged into this branch, its diff is the railing change alone
(three files, checked equal to its own two commits), and that head is
measured again on its own: run 43089839851, rows registered on #1636
before it is read. First draft: #1729.

## Testing

- Built, linted and tested by CI on this head; nothing was built on a
workstation.
- Verified end to end on real Revit files against Revit's own exports:
the Measure runs named above, which anyone can repeat with `gh workflow
run measure.yml --ref main -f ref=<this head> -f
base=aa5dc4c6d93e861015c10e0a0d8f9f16c8b57e71 -f nordic=true -f
r2025=true -f samples=true -f racadv=true -f bimcollab=true -f
holdout=true`.
- No test was added: no unit test, and no pinned count moves except
where the body says so.

## Audit-honesty checklist

- [x] Docs state what this change writes and what it leaves out
- [x] A changelog fragment under `changelog.d/`
- [x] No emojis, private paths or personal data in committed files
- [x] Limits are in the body above and in the code's doc comments

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary source, decompiled internals or NDA
material. Where revit-ifc (CLEANROOM.md source 5) is cited, it is read
and cited by file and class, and no code is copied.
- [x] No fixture with real-world personal data

## Breaking changes

None.
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