Skip to content

feat(materials): family instances whose type draws with no material take <Unnamed>, and joined columns their walls' material (#355) - #580

Merged
DrunkOnJava merged 8 commits into
mainfrom
fix/b09-instance-materials
Oct 3, 2026
Merged

DrunkOnJava merged 8 commits into
mainfrom
fix/b09-instance-materials

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Part of #355 (B09). puzzbobb's material rule starts from the map RE-82 reads, which is FamilySymbol.m_geomTag2MaterialId. Where every value in that map is unset, rvt-rs read no map and gave the instances no material.

What Revit's export gives these elements:

  • Core Interior's 256 columns: <Unnamed> on 107, "Default Wall" on 149. The column-cuts module already found exactly those 149 joined to walls, and those walls' material is "Default Wall" (356 of 360 walls).
  • The RE1 MEP models: <Unnamed> on 150 of the 152 fittings, terminals, proxies and control elements it relates a material to.

What changes:

  • partition_type_materials::unset_material_types: a family type whose first map holds only unset values, with distinct keys no larger than 0xffff (the geometry tags, RE-149 probe examples/probe_re149_type_value_blocks.rs). A map with a material in it answers no, so partial maps (RE-124) are untouched. Their columns and products take UNNAMED_MATERIAL.
  • element_record_column_cuts::column_joined_walls: each column's overlapping named walls, carried as m_column_joined_wall. A column that would take <Unnamed> takes its joined walls' layer material instead, when every joined wall names the same set.
  • Doors, windows, walls and slabs are unchanged, so RE-84's opening-only doors and windows are untouched. The 2023 path is unchanged.
  • The element-material scorer now also counts, by Revit entity, the elements rvt-rs gives no materials.

Commits:

  1. test(ifc) adds the real-file target tests/element_materials.rs: all 256 Core Interior columns have Revit's material set. Its red run on main (draft red run: element_materials (B09, do not merge) #579) is in the commit message: 0 of 256, all 256 with none.
  2. The scorer change.
  3. The probe.
  4. The feature.
  5. The changelog.

Measured

Measure run 37120595647 compared head against main. The element-material scorer (elements with Revit's exact material set):

model before after still without materials
Core Interior 580 836 12 slabs (Revit: <Unnamed>)
RE1 Electrical 0 47 of 47 2 proxies
RE1 Mechanical 0 43 of 43 none
RE1 Plumbing 0 60 of 60 none
  • No element gained a wrong set.
  • The GLB now draws the 149 joined columns in Revit's material name and colour.
  • RE1 Architecture and Einhoven are byte-identical to main.

Pinned values, approved by the maintainer. Core Interior's material count goes from 86 to 87, the <Unnamed> material. The project-count manifests change to 87. The committed rvt-rs witness observations are regenerated from that Measure run; their hash is the one the IfcOpenShell job's replay computes. These are in their own commit.


Note

Medium Risk
Changes partition binary heuristics and IFC material assignment for columns and family products; wrong unset-map detection could mislabel materials, though behavior is gated and checked against Revit’s Core Interior export.

Overview
Family-instance materials now match Revit when a type has no real geometry-material map (RE-149 / #355). Types whose value block opens with a geometry-tag map where every entry is unset (and no named map was read) are detected via partition_type_materials::unset_material_types; their columns and products get m_type_material = <Unnamed>. Doors, windows, walls, and slabs are not touched.

Joined columns that would stay <Unnamed> can inherit wall materials: column_joined_walls finds overlapping walls from each column’s references, exposes them as m_column_joined_wall on decode, and attach_joined_wall_materials replaces <Unnamed> only when every joined wall’s layer names agree.

Adds the RE-149 probe example probe_re149_type_value_blocks, a real-file IFC test tests/element_materials (256 Core Interior columns vs Revit’s export), CI registration, changelog, and a small bump to the Python material-vs-IFC scorer (tracks elements rvt-rs still gives no materials).

Reviewed by Cursor Bugbot for commit 09a8de7. Configure here.

A real-file target: exporting 2024_Core_Interior.rvt, every one of its
256 columns has the material set Revit's own export relates to it
('Default Wall' on the 149 walls join, <Unnamed> on the 107 no wall
joins), read the IFC4 way through the material association.

Red on main, draft PR #579, Corpus health (tier 2 - external):

  thread 'core_interior_columns_take_revits_materials' panicked at
  tests/element_materials.rs:170:5:
  assertion `left == right` failed: every column has Revit's material
  set; 256 have none from rvt-rs, first differing: []
    left: 0
   right: 256
  test result: FAILED. 0 passed; 1 failed

The expected reason: rvt-rs relates no material to the columns, whose
type's geometry-material map has only unset values.
…ake <Unnamed>, and joined columns their walls' material (#355)

A family type's geometry-material map (RE-82) whose every value is unset
read as no map, so its instances got no material; Revit's export gives
them <Unnamed>. partition_type_materials::unset_material_types finds such
types from the first map in their value block (distinct keys no larger
than 0xffff, only unset values; a map with a material in it answers no,
RE-149), and their columns and products take UNNAMED_MATERIAL.

A column whose reference list joins it to overlapping walls
(element_record_column_cuts::column_joined_walls, carried as
m_column_joined_wall) takes the walls' layer material when every joined
wall names the same one set. On 2024_Core_Interior.rvt that is the 149
columns Revit gives "Default Wall"; the other 107 keep <Unnamed>.

Decided here: doors, windows, walls and slabs are left out, so RE-84's
opening-only doors and windows are untouched; the 2023 path is not
changed.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Unnamed types still flagged void
    • attach_unnamed_materials now removes m_type_without_geometry when it adds , so RE-149 unset-map types are no longer marked as RE-84 void-only.

Create PR

Or push these changes by commenting:

@cursor push b8ef425f00
Preview (b8ef425f00)
diff --git a/src/partition_schema_mvp.rs b/src/partition_schema_mvp.rs
--- a/src/partition_schema_mvp.rs
+++ b/src/partition_schema_mvp.rs
@@ -1631,6 +1631,9 @@
             _ => None,
         });
         if type_id.is_some_and(|id| unset_types.contains(&id)) {
+            element
+                .fields
+                .retain(|(name, _)| name != TYPE_WITHOUT_GEOMETRY_FIELD);
             element.fields.push((
                 TYPE_MATERIAL_FIELD.into(),
                 InstanceField::String(crate::partition_type_materials::UNNAMED_MATERIAL.into()),

You can send follow-ups to the cloud agent here.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 09a8de7. Configure here.

Comment thread src/partition_schema_mvp.rs Resolved
…take the <Unnamed> material (#355)

Approved by the maintainer on 2026-10-03. B09 relates '<Unnamed>', which
Revit's own export also writes, to the 107 columns whose type draws with
no material, so the export writes one more IfcMaterial:

- tests/fixtures/project-counts/2024-core-interior.json and -slim.json:
  materials.decoder_expected 86 -> 87, with a dated note.
- research/witness/magnetar-2024-core-interior{,-slim}/observations/
  rvt-rs.json: regenerated on GitHub's runners by Measure run
  37120595647 (IFCMATERIAL 86 -> 87, IFCMATERIALCONSTITUENT 4 -> 6,
  IFCMATERIALCONSTITUENTSET 2 -> 4, IFCRELASSOCIATESMATERIAL 410 -> 412,
  material_count 86 -> 87). The full observation's hash, 02d20dd6..., is
  the fresh hash the IfcOpenShell job's replay computed on this PR. The
  verdicts do not change: their semantic surface holds no material field.
…without geometry (#355)

attach_type_materials marks an element whose type's map is empty as a type
that draws no geometry (RE-84), and an all-unset map read as empty, so the
flag stayed on the instances that now take <Unnamed>; a hosted one would
have been written as its opening alone. Reported by Cursor Bugbot on
#580.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 3, 2026 13:36
DrunkOnJava added a commit that referenced this pull request Oct 3, 2026
Brings `BACKLOG.md` up to date with this session's landed work,
recording each item's PR, red run, green run and Measure evidence:

- **Done:** B01, B06, B07 (as a reply), B10 to B13, B19, B23 (24,373
lines of mirror suites across seven areas), B24 (measured, no change)
and B25 (the Python suite runs in CI).
- **In review:** B09 (#580).
- **Under way:** B20 (RE-151 for #227).

Docs only.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only backlog sync; no runtime or test behavior changes
in this diff.
> 
> **Overview**
> Updates **`BACKLOG.md`** only: the ranked backlog table and progress
log now match work already merged or answered this session—no code or CI
changes in this PR.
> 
> **Statuses moved to done** include B01 (13 community replies),
B06–B13, B19, B23 (24,373 lines of mirror suites removed across seven
PRs), B24 (measured, no output change), and **B25** (Python wheel-job
integration suite). B07 and B13 are recorded as done via issue replies
(B07 unverified). **B09** is **in review** (#580); **B20** is **in
progress** (RE-151 / #227).
> 
> The progress log adds PR numbers, CI/Measure run links, and short
evidence for each of those items (e.g. material counts for B09,
opening/sketch findings for B20).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d0d9590. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@DrunkOnJava
DrunkOnJava merged commit 094402a into main Oct 3, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/b09-instance-materials branch October 3, 2026 13:41
DrunkOnJava added a commit that referenced this pull request Oct 3, 2026
Updates BACKLOG.md: B09 is done (#580), and B20's #227 slab and
shading-device openings are in #584, with their Measure evidence. The
progress log also records which 0.4.x milestones are blocked here, and
why.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only updates to backlog status and progress notes; no
runtime or test code changes in this diff.
> 
> **Overview**
> **BACKLOG.md** is brought in line with recent merges and in-flight
geometry work.
> 
> **B09** moves from *in review* to **done** in the ranked table. The
progress log now records #580 as merged, with the existing red/green
narrative for `tests/element_materials.rs` and Measure gains on Core
Interior and RE1 disciplines.
> 
> **B20**’s progress section is expanded for milestone **#227** and PR
**#584**: slab and shading-device sketch holes as openings (tag = lowest
sketch-line id), with draft **#583** red run, Measure **62/63** openings
within tolerance, and witness regeneration. It also documents the
remaining **63rd** opening (wall 55840 elevation profile, blocked on
edited-profile reading) and a short list of other **0.4.x** milestones
blocked on Snowdon-only models, missing oracles, or format evidence.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
65de679. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@puzzbobb puzzbobb mentioned this pull request Oct 22, 2026
14 tasks done
puzzbobb added a commit to puzzbobb/rvt-rs that referenced this pull request Oct 22, 2026
… takes the materials its own parameters name (DrunkOnJava#355) (RE-200)

DrunkOnJava#580 gives a column or product whose type's geometry-material map holds
only unset values <Unnamed>. Where the instance's own material
parameters (FamilyInstance.m_pInstParams, a FamilyParams whose m_params
entries hold an ElementId in m_elemId) name materials, Revit's export
gives it those instead.

- native_instance_materials::instance_parameter_materials reads them
  from the instance's native record (native_document::extract_graphs,
  as native_wall_types does for RE-185);
- attach_unnamed_materials takes them, where every one is named, before
  <Unnamed>.

Elements with Revit's material set (tools/re/element_materials_vs_ifc.py):
R2025 models 12 to 17, 4 -> 13 of 13 each; Snowdon Towers (local only)
3,457 -> 3,689, 232 wrong -> right and none right -> wrong. Core
Interior, the RE1 models and the other R2025 models export byte-
identically apart from timestamps.
puzzbobb added a commit to puzzbobb/rvt-rs that referenced this pull request Oct 22, 2026
…rials from native records (DrunkOnJava#355) (RE-201, RE-202, RE-203)

- Mullion and panel types: m_renderStyleId by name; RE-166's +135 offset
  moves to +133 on 10 of Snowdon Towers' 13 exported mullion types. A
  curtain part's type material replaces DrunkOnJava#580's <Unnamed> (RE-201).
- Off-centre columns: the layer of the first joined wall (CutPairGStep
  order) on the column's side, exterior on the left of the wall's
  location line unless SWall.m_isFlipped (RE-202).
- Rendered content (Family.m_eRenderModelType 4) is <Unnamed> (RE-202).
- Type maps: FamilySymbol.m_geomTag2MaterialId read by name where RE-82's
  scan takes a nested component's materials; -1 entries take the
  instance's material parameters or <Unnamed>. Material names prefer the
  native Material.m_name (RE-203).

Snowdon Towers (local only): 3,689 -> 5,092 element material sets equal
to Revit's export. RE1 Architecture 70 -> 71, RE1 Electrical 47 -> 48;
Core Interior and the R2025 models unchanged.
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