Skip to content

(fix) Issue #355 instance materials - #886

Merged
DrunkOnJava merged 23 commits into
DrunkOnJava:mainfrom
puzzbobb:issue355-instance-materials
Oct 24, 2026
Merged

DrunkOnJava merged 23 commits into
DrunkOnJava:mainfrom
puzzbobb:issue355-instance-materials

Conversation

@puzzbobb

Copy link
Copy Markdown
Contributor

Summary

Family instances, curtain mullions and panels, off-centre columns and walls now carry Revit's materials. Each is read by name from the native records, or from the family's own embedded document, instead of a byte offset or a value-block scan (RE-200 to RE-206). Every element rvt-rs gives a material on Snowdon Towers has Revit's set (5,134 of 5,134, against 3,457 of 4,042 on main). Every wall of the R2025 models has Revit's "Default Wall", and RE1 Architecture and Electrical are at 71 of 71 and 49 of 49.

Motivation

#355 tracks the element-to-material link for family instances. After #580, Snowdon Towers still differed from Revit's export on 218 mullions (with 847 more given no material), 94 off-centre columns, 17 trees, 21 counter tops and a few single elements. A 2025 wall layer that takes its category's material got none. This serves 1.0 requirement W7 (Properties, docs/release-1.0-criteria.md), which counts materials among what is read.

Each finding was checked against Revit's own IFC4 export before it was used:

RE rule read from
200 a type whose map holds no material: the instance's own material parameters, else <Unnamed> FamilyInstance.m_pInstParams
201 a mullion's or curtain panel's material the type's m_renderStyleId (RE-166's +135 moves to +133 on 10 of Snowdon's 13 exported mullion types)
202 an off-centre column: one layer of the wall it was first joined to, on the column's side CutPairGStep.m_otherId in m_id order, VWallDriver.m_pCrv, SWall.m_isFlipped
202 rendered content (RPC, planting) is <Unnamed> Family.m_eRenderModelType 4
203 a type's materials; a material's name FamilySymbol.m_geomTag2MaterialId by name (RE-82's scan also takes a nested component's); Material.m_name
204 <Unnamed> only where the family shows geometry with no material the family document's forms (RE-163 keyed block): m_materialId, m_cutting, IS_VISIBLE_PARAM
205 the first joined wall that overlaps the column; a column standing out past both faces takes the exterior layer; a material only hidden forms have is left out as RE-202 and RE-204
206 a layer taking its category's material where the object styles are unset or not read (every 2025 file); nested families' Visible bound to a family parameter the category's GStyleElem → GStyle.m_materialElemId; FamilyParametrizedElemParamsCell, parameters matched by caption

Changes

  • src/native_instance_materials.rs (new, RE-200): an instance's material parameter values.
  • src/partition_curtain_materials.rs (RE-201): m_renderStyleId by name; the offsets fill only the types it does not read.
  • src/native_column_joins.rs (new, RE-202, RE-205): a column's joins in order; a straight wall's exterior side.
  • src/native_rendered_content.rs (new, RE-202): types whose family is rendered content.
  • src/native_type_materials.rs (new, RE-203): a type's map by name, with its unset flag and family.
  • src/native_family_forms.rs (new, RE-204 to RE-206): a family's document, and its nested families' documents.
  • src/partition_materials.rs:
    • scan_material_names prefers Material.m_name and is memoised (RE-203);
    • scan_category_material falls back to the category's graphics styles (native_category_material, RE-206).
  • src/partition_schema_mvp.rs:
    • refine_type_materials, attach_partly_unset_materials, attach_first_join_materials, attach_rendered_content_materials;
    • attach_curtain_materials replaces an <Unnamed>-only set.
  • src/reader.rs: memoised material names and category style materials on RevitFile.
  • src/native_document.rs: group_records is pub(crate), for the family-document reader.
  • src/lib.rs: the five new modules.
  • Tests, in tests/element_materials.rs: r2025_window_trims_take_their_instance_materials (RE-200) and r2025_walls_take_their_category_material (RE-206).
  • Probes:
    • examples/probe_re200_instance_material_params.rs
    • examples/probe_re201_curtain_render_styles.rs
    • examples/probe_re202_column_joins.rs
    • examples/probe_re203_type_maps.rs
    • examples/probe_re204_family_forms.rs
    • examples/probe_re206_category_styles.rs
  • Reports: reports/element-framing/RE-200-… to RE-206-….
  • Docs: CHANGELOG.md; README.md (the family-instance and material rows); docs/status.md (a dated RE-200 to RE-206 entry); docs/support-matrix.json; dated addenda in docs/rvt-moat-break-reconnaissance.md.

The commits run test → feat → research → docs for RE-200. Then come four feat/fix commits (RE-201 to RE-206), a perf commit, the RE-206 test, the research commit, two docs commits, an in-code note on what RE-205's rule rests on, and the docs/status.md entry.

Testing

Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead.

  • tools/check-local.sh passes (fmt, clippy, rustdoc, build, real-file / CLI / contract checks)

    • tools/check-local.sh passes on this branch as rebased onto b6086d4: cargo fmt --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, rustdoc with -D warnings, cargo build --workspace --all-targets --all-features, and tools/ci/verify-real-files.sh at 248 of 248. It was run with CARGO_PROFILE_DEV_DEBUG=0, because the debug symbols of every example do not fit on this machine's disk. The checks themselves are unchanged.
    • --corpus (tools/ci/verify-real-files.sh --profile ci --no-fail-fast) passes, 248 of 248. It reads the project corpus CI fetches: magnetar-io/revit-test-datasets at the pinned fd755e1, with the RE1 models beside it, each checked against ci.yml's sha256, and the R2025 models in r2025/. Its samples are phi-ag's Autodesk family files. Both new tests run there instead of skipping.
  • Verified end to end on real Revit files: the command, the files (and their licence), and the measured result against Revit's own export are in the PR body, with the script or probe that reproduces it

    • rvt-ifc MODEL.rvt -o out.ifc, then python tools/re/element_materials_vs_ifc.py out.ifc REVIT.ifc (IfcOpenShell 0.9.0.post1, as tools/ci/requirements-ifc.txt pins), on main and on this branch.
    • First measured on main at e56245f, then again after rebasing onto b6086d4 (feat(ifc): gable, hip and slope-arrow roofs as their planes, and roof slopes on Revit 2025 (#356) (RE-199) #870, roof planes), on both main and the branch. All 28 scores are unchanged on both sides, and apart from materials, the branch writes the same entities as main on every model.
    • The table counts elements with Revit's exact set, of those rvt-rs gives a material:
    model (licence) Revit gives materials main this branch
    R2025 01 to 06, 10 models (puzzbobb, Apache-2.0, Sloped roofs need a Revit 2024/2025 pitched-roof oracle #356) 5 or 6 0 of 0 5 of 5
    R2025 08 to 11 7 or 8 0 of 0 7 of 7
    R2025 12 18 4 of 13 18 of 18
    R2025 13 to 17 21 to 23 4 of 13 18 of 18
    R2025 18 9 0 of 0 9 of 9
    Core Interior (magnetar corpus, MIT) 854 836 of 842 the same
    RE1 Architecture (Drshelden/IFC-ECS, MIT) 72 70 of 70 71 of 71
    RE1 Electrical 49 47 of 47 49 of 49
    RE1 Mechanical, Plumbing 43, 60 43, 60 the same
    Snowdon Towers Sample Architectural (Autodesk sample, 2025 copy, local only) against bldrs-ai/test-models' Revit IFC4 export 5,541 3,457 of 4,042 5,134 of 5,134
    • The probes reproduce each finding on any model, and each report gives its command and numbers.
    • On Snowdon, element by element, no element whose set was Revit's on main gets a different set at any step.
    • Both new tests were seen failing first:
      • RE-200's on main: 9 of 9 trims and muntins <Unnamed>;
      • RE-206's with the graphics-style fallback disabled: 117 of 117 walls without a material.
    • The tests read RVT_PROJECT_CORPUS_DIR/r2025/, the layout of tools/ci/fetch-r2025-models.sh, and skip without it. CI's test jobs don't fetch it, so they skip there. A Measure run with -f base=main -f r2025=true reproduces the R2025 rows on GitHub's runners.
  • If this touches the IFC exporter: the witness verdicts replay (see CONTRIBUTING.md) or the changed observations are refreshed in this PR

    • rvt-ifc --observation on Core Interior for magnetar-2024-core-interior and magnetar-2024-core-interior-slim, then tools/ci/witness-verdict.py --compare-committed. Both give PASS.
    • The rvt-rs, IfcOpenShell and IFClite observations replay byte for byte, and no observation is refreshed. Core Interior's export is unchanged by this PR.
  • If this is a performance change: reran tools/bench.sh and attached the before / after

    • The perf commit wins back most of the time this PR's own material steps add. It memoises the material names and the categories' style materials on RevitFile, and makes the family-document walks reuse the inflated partitions. Its output is byte-identical on all 28 models.
    • tools/bench.sh, main at c023b7f against this branch before its rebase onto b6086d4, on the same machine (hyperfine 1.19.0; 2.0 rejects the script's > /dev/null; phi-ag's Autodesk family samples):
    command, 2024 family sample main (ms) this branch (ms)
    rvt-info (text) 9.3 ± 0.5 9.5 ± 0.7
    rvt-info (json) 9.6 ± 1.0 9.4 ± 0.1
    rvt-schema 10.1 ± 0.1 10.5 ± 0.6
    rvt-history 3.5 ± 0.2 3.9 ± 0.3
    rvt-history --partitions 8.4 ± 0.1 8.7 ± 1.3
    rvt-analyze (text) 23.8 ± 1.3 24.0 ± 1.3
    rvt-analyze (json) 23.9 ± 1.6 23.6 ± 0.1
    rvt-analyze --json over the 11 releases 190 ± 1 191 ± 5

    The two are equal within their spread: these CLIs do not reach the code this PR changes.

    • tools/bench.sh times only family files, which never reach the project material steps. The project export was therefore timed too, with rvt-ifc on Snowdon Towers:

    Single runs while the perf commit was made: main 19.8 s, this branch before it 32.6 s, after it 23.3 s.

    Measured with hyperfine on the same machine (hyperfine -N --warmup 1, 5 runs; 3 on Snowdon), rvt-ifc MODEL.rvt -o out.ifc, main at c023b7f against this branch before its rebase onto b6086d4:

    model main (s) this branch (s) ratio
    Core Interior 6.70 ± 0.03 7.45 ± 0.04 1.11
    RE1 Architecture 1.59 ± 0.02 1.98 ± 0.02 1.25
    Snowdon Towers 19.59 ± 0.02 23.09 ± 0.05 1.18

    The cost is in reading the native records and the family documents. It is the new limitation listed below.

Audit-honesty checklist

  • README / docs reflect the current state after this PR — no claims of features that are not actually shipped in this PR
    • README.md changes its family-instance and material-name rows.
    • docs/status.md gains a dated RE-200 to RE-206 entry, with the measured results and what is still not read.
    • docs/support-matrix.json and CHANGELOG.md are updated.
  • If a limitation was resolved, the "Known limitations" / "What works today" section in the relevant docs is updated
    • The README and support matrix no longer list counter tops' nested appliances and planting as differences.
    • The support matrix no longer says family instances get no material.
  • If a new limitation was introduced, it is documented in the PR body and in-code
    • The project export is slower: 11 to 25% on the models timed above. This is in RE-206's report.
    • The rule for a column standing out past both faces of its wall rests on one asymmetric case, 1366814. It is stated in attach_first_join_materials' doc and in RE-205's report.
    • RE-201 to RE-205 change exports only on Snowdon Towers, which CI cannot fetch. This is stated in the reports and in docs/status.md.
  • Commit messages describe WHAT changed and WHY, not "fix things" or "updates"
    • The commits are Conventional Commits, each naming its issue and RE number.
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files
    • The probes and tests take their paths from arguments or RVT_PROJECT_CORPUS_DIR.
    • The commits are authored with GitHub's noreply address.
  • If this is a reverse-engineering finding: a reproducible probe under examples/ and a dated addendum to docs/rvt-moat-break-reconnaissance.md are included
    • There is a probe for each finding. RE-205 reuses RE-202's and RE-204's.
    • There is a report under reports/element-framing/ for each.
    • docs/rvt-moat-break-reconnaissance.md has seven addenda, dated 2026-10-21.

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0 (see CONTRIBUTING.md)
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see CLEANROOM.md)
    • Every member name comes from the file's own Formats/Latest schema, read by rvt-rs's catalog walker.
  • Any new test fixtures use synthetic values (testuser, 111111, FY-20XX, etc.) and contain no real-world PII

Breaking changes

None to the API: five new public modules, and scan_category_material and scan_material_names keep their signatures. The IFC output changes on files that hit these cases: materials now associated with mullions, panels, columns, family instances and walls that had none or another set.

Screenshots or output samples

Snowdon Towers, the material set of the element's IfcRelAssociatesMaterial:

element main this branch Revit's export
IfcMember 946584, Rectangular Mullion 2.5" x 5" rectangular (Black) <Unnamed> Aluminum Clad (Black) Aluminum Clad (Black)
IfcColumn 1372323, Rectangular Column (Off Center) 24"D x 24"W <Unnamed> Gypsum Wall Board Gypsum Wall Board
IfcFurniture 782459, Counter Top w Sink Hole 24" Depth Appliance - Gasket, Appliance - Stainless Steel, Appliance - Steel - Black, Counter Top, Steel, Polished Counter Top Counter Top

probe_re206_category_styles on Snowdon Towers:

{"category":"Walls","effective":"Default Wall","graphics_styles":"Default Wall"}
{"category":"Floors","effective":"Default Floor","graphics_styles":"Default Floor"}
{"category":"Roofs","effective":"Default Roof","graphics_styles":"Default Roof"}
{"category":"Ceilings","effective":null,"graphics_styles":null}

Related issues

@puzzbobb
puzzbobb requested a review from DrunkOnJava as a code owner October 22, 2026 07:24
…runkOnJava#355)

Revit's export of 12_Rooms_Door_Windows.rvt (the R2025 models, DrunkOnJava#356)
gives its 3 interior trims, 3 exterior trims and 3 muntin patterns the
materials their instance parameters name: "Wood - Stained", "Clad -
White" or both. Their types' geometry-material maps hold only unset
values, so main writes <Unnamed> on all 9.

Reads RVT_PROJECT_CORPUS_DIR/r2025/, the layout of
tools/ci/fetch-r2025-models.sh, and skips without it.

Red on main (e56245f), locally with the R2025 models: 9 of 9 differ.
… 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.
…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.
…t a material (DrunkOnJava#355) (RE-204)

A type whose map holds -1 entries has <Unnamed> in Revit's export only
where its family's own document (the keyed block its Family record names,
RE-163) shows model geometry with no material. native_family_forms reads
the block's solid forms, free-form solids and model text: m_materialId,
m_cutting and IS_VISIBLE_PARAM. Where every form with no material is hidden
or void, or there is none and the family nests no instance and every form
decodes, the type adds no <Unnamed>.

Snowdon Towers: 21 Washer_Dryer_Combo and 1 TableWithUmbrella (hidden
forms) wrong -> right; RE1 Electrical's 284621-FirePanel (no unset form,
no nested instance) wrong -> right, 48 -> 49 of 49. No element goes from
right to wrong; Core Interior, RE1 Architecture, Mechanical, Plumbing and
the R2025 models are unchanged.
…unkOnJava#355) (RE-205)

- A column's wall is the first join (CutPairGStep order) among the walls
  that overlap it, so a foundation wall below it is passed over; a column
  that stands out past both faces of its wall takes the exterior layer.
  Snowdon Towers: 1918459 and 1366814 wrong -> right, 108 of 108
  off-centre columns.
- A material that only hidden forms of a type's family have
  (IS_VISIBLE_PARAM 0 in the family's own document) is left out, as
  Revit's export leaves it: Refrig_Base_wDrawers's "Clearance".

Snowdon Towers 5,114 -> 5,117; no element goes from right to wrong, and
every other export (Core Interior, RE1 x4, R2025) is unchanged.
…ies' hidden forms (DrunkOnJava#355) (RE-206)

- A category's material, where the object-styles entry (RE-91, RE-115) is
  not read or unset, is the one its graphics styles name
  (GStyle.m_materialElemId of the GStyleElem with that m_categoryId). On
  Snowdon Towers (Walls entry 0) and every 2025 file the Walls styles
  name "Default Wall", Floors "Default Floor" and Roofs "Default Roof".
- native_family_forms reads the documents of nested families too. A
  nested form whose Visible is bound to a family parameter is shown by
  that parameter's value on the nested instance, else its type, matched
  by caption. A type left with only geometry without a material is
  <Unnamed>. AC_Bandstand Canopy's dome ("Include Dome" 0 on its one
  instance) no longer gives "Acrylic, Clear".

Snowdon Towers: 5,117 -> 5,134 of 5,134 element material sets equal to
Revit's; wall 619550 and 15 walls without a material now right. R2025:
walls, roofs and floors of 21 models gain Revit's set (01 to 18, 5 to 18
elements each, none wrong). Core Interior and RE1 unchanged.
…alks reuse the inflated partitions (DrunkOnJava#355)

Half a dozen material steps each read the material names, now with a
native pass behind them (RE-203), and the family-document reader
(RE-204, RE-206) inflated every partition three more times. The names
and the categories' style materials are memoised on RevitFile, and the
family walks take each stream's members from inflated_partition.

Snowdon Towers export: 32.6 s -> 23.3 s (main: 19.8 s). All 28 exports
measured are byte-identical to before apart from timestamps.
… (RE-206)

Every wall of the R2025 models has Revit's material set: "Default Wall",
the material the Walls category's graphics styles name, 117 walls in 21
models. With the graphics-style fallback disabled the test fails, 117 of
117 walls without a material. Skips without RVT_PROJECT_CORPUS_DIR/r2025/.
)

Mullion and panel types' m_renderStyleId (RE-201); off-centre columns'
joined-wall layer and rendered content (RE-202, RE-205); type maps and
material names from the native records (RE-203); family documents'
unset, hidden and nested forms (RE-204, RE-205, RE-206); category
materials from graphics styles (RE-206).
…terial limitations resolved (DrunkOnJava#355)

Dated addenda for each finding in docs/rvt-moat-break-reconnaissance.md,
as the PR template asks of a reverse-engineering finding. The README's
family-instance row and the support matrix no longer list counter tops'
nested appliances and planting as differences, nor say that family
instances get no material.
…m native records (DrunkOnJava#355) (RE-200 to RE-206)

CONTRIBUTING asks for docs/status.md to change in the same pull request
as the capability it describes. It now states what RE-200 to RE-206 read,
the measured results against Revit's exports, and the elements whose
material is still not read.
@puzzbobb
puzzbobb force-pushed the issue355-instance-materials branch from 579d684 to 5612b1b Compare October 22, 2026 11:30
@DrunkOnJava

Copy link
Copy Markdown
Owner

Heads-up: #890 just landed on main. It moves the research readers (the partition_*, native_* and element_record_* modules) to rvt::research, behind a new unstable-research feature, so that 1.0's semver promise covers only the stable core (RELEASE.md, "What 1.0 keeps stable"). For this PR that means three small changes when you rebase:

  1. Declare your new modules (native_column_joins, native_family_forms, native_instance_materials, native_rendered_content, native_type_materials) in src/research.rs instead of src/lib.rs, e.g.
    #[path = "native_instance_materials.rs"]
    pub mod native_instance_materials;
    and add the name to the pub(crate) use research::{...} list in src/lib.rs, which keeps every crate::native_instance_materials path inside the crate working. The file itself stays in src/.
  2. Probes and tests import research modules through rvt::research. Probes, tests and benches get the feature automatically through a dev-dependency, so nothing else is needed:
    sed -i -E 's/\brvt::(partition_|native_|element_record_)/rvt::research::\1/g' examples/*.rs tests/*.rs
  3. Inside the crate, RevitFile::element_names, design_options, second_prologue_ids and partition_data_objects are now called memoised_element_names and so on; the original names exist only with the feature.

CI now also builds the library without the feature (cargo check --lib --bins with -D unnameable_types), so a stable item that returns a research type fails there. Maintainer edits are on for this branch: if you'd rather I push the rebase, say so and I will.

@DrunkOnJava

Copy link
Copy Markdown
Owner

One more heads-up, so nothing new needs reworking later: before 1.0 the id fields of the stable types (level_id, host_id, type_id, symbol_id, element_id, DecodedElement::id) become an rvt::ElementId newtype instead of Option<u32>. Serialised JSON stays the same number. Research modules can keep their raw integers and convert at the boundary with ElementId::from(id) (or ElementId::from_raw(u64), which applies the carries_no_element_id rule). I will open that PR only after this one has landed or you have answered, so it does not land under you.

@puzzbobb

Copy link
Copy Markdown
Contributor Author

Thanks for the heads-up. Yes please go ahead and push the rebase onto main. On ElementId that's fine open it whenever it suits you. I have follows on this pr that I'll rebuild around the new scheme once they've been pushed.

# Conflicts:
#	src/lib.rs
#	src/partition_curtain_materials.rs
@DrunkOnJava

Copy link
Copy Markdown
Owner

Pushed: main is merged into your branch (81d7244). As on #887, this is a merge, not a rebase, so nothing was force-pushed and git pull fast-forwards your local branch.

The merge resolves two conflicts:

  • src/lib.rs's module list.
  • The module doc of partition_curtain_materials.rs, where main had moved a backlog id into a // Tracker: comment. Your RE-201 paragraph is kept above it.

It also makes the #890 moves:

  • The five new modules (native_column_joins, native_family_forms, native_instance_materials, native_rendered_content, native_type_materials) are declared in src/research.rs, with an index line each, and listed in src/lib.rs's pub(crate) use research::{...}.
  • The six probes import through rvt::research.

No stable code calls the new modules: the materials reach the export through the research readers the exporter already uses. So unlike #887 this needed no stable wrapper. Nothing is built locally, so this PR's CI is the check.

@DrunkOnJava

Copy link
Copy Markdown
Owner

I merged main into this branch again and moved its CHANGELOG.md entry, unchanged, into a fragment under changelog.d/ (#938, PR #940). Every PR added its entry at the top of the same section of CHANGELOG.md, so each landing left the others in conflict with main, which GitHub cannot resolve; this branch had been re-merged three times for that alone. With the entry in a file of its own, the queue can update the branch by itself. From now on a PR adds changelog.d/<section>/<name>.md instead of editing CHANGELOG.md (changelog.d/README.md once #940 lands), and a release assembles them.

@DrunkOnJava
DrunkOnJava merged commit 9d114d0 into DrunkOnJava:main Oct 24, 2026
27 checks passed
DrunkOnJava added a commit that referenced this pull request Oct 24, 2026
…e assembles (#938) (#940)

## Summary

Changelog entries become fragments, one file per pull request at
`changelog.d/<section>/<name>.md`, and a release assembles them into
`CHANGELOG.md` (`tools/release/changelog.py assemble`). CI checks every
fragment (`tools/release/changelog.py check`). Closes #938.

## Motivation

Every pull request added its entry at the top of the same `[Unreleased]`
section, so each landing left every other open pull request in conflict
with main on `CHANGELOG.md`. The queue then skipped them as `DIRTY`
until someone merged main into each one by hand. On 2026-10-24 that
happened after every landing:

- #926 landing put #927 and #930 back in conflict;
- #936 landing did the same to #886, #887, #927, #930 and #935, all with
green CI.

The `merge=union` driver that resolves such conflicts is in a
maintainer's own git configuration, not this repository, and GitHub's
merge never applied it. Nor does union merging keep the blank line
between two entries.

A fragment is a file of its own, so two pull requests never touch the
same lines, and GitHub's update-branch, which the queue uses, merges
them cleanly.

## Changes

- `tools/release/changelog.py` (stdlib only):
- `check` fails on a fragment outside a known section (`added`,
`changed`, `fixed`, `removed`, `security`, `research`), an empty one, or
one whose first line does not start an item (`- **`);
- `assemble` puts each fragment at the top of its section under
`[Unreleased]`, making the heading in Keep a Changelog order where it is
missing, one blank line apart, in name order, and deletes the fragments.
- `changelog.d/README.md`: the format.
`changelog.d/changed/changelog-fragments.md`: this PR's own entry.
- `.github/workflows/ci.yml`: the `check` step, beside the
conflict-marker guard.
- `RELEASE.md` step 5 runs `assemble` first.
- `CONTRIBUTING.md`, `docs/maintaining.md` and the PR template point at
`changelog.d/`.
- `CHANGELOG.md`'s preamble says unreleased changes are also in
`changelog.d/`.

This PR leaves the existing `[Unreleased]` entries where they are. The
open pull requests' entries move into fragments in those pull requests,
each with one last merge of main.

## Testing

I ran the tool on a scratch copy of main's `CHANGELOG.md`:

- `check` with three fragments: `changelog.d: 3 fragment(s), each in a
section and starting an item`;
- `assemble` put two `added` fragments at the top of `### Added`, in
name order with a blank line between, and made `### Security` between
`### Removed` and `### Research`; it deleted the three fragments and
left `README.md`;
- `check` on a fragment that does not start an item, and on one in an
unknown directory: both reported, exit 1;
- on this branch, `check` passes on its one fragment, and
`tools/ci/api-doc-ids.py` and the YAML parse pass.

## 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 (see
`CONTRIBUTING.md`)
- [x] This PR contains no Autodesk proprietary source, decompiled
internals, or NDA'd SDK content (see `CLEANROOM.md`)

## Breaking changes

None for users. Contributors write their entry under `changelog.d/` from
now on.
@DrunkOnJava DrunkOnJava mentioned this pull request Oct 24, 2026
10 of 12 tasks
DrunkOnJava added a commit that referenced this pull request Oct 24, 2026
## Summary

Prepares v0.7.0 (RELEASE.md steps 4 to 8): the version files, the
`[0.7.0]` changelog section assembled from `changelog.d/`, the README's
release section, and corrections to the status docs where they still
described the state before RE-212 or before the BIM4LCA office was
measured. Merging this is not the release; the signed tag on its squash
commit is.

## Motivation

Griffin's go-ahead (2026-10-24, about 3:00 PM): tag v0.7.0 once #887,
#930, #935, #940, #942 and #943 are on main with CI green. All six have
landed, the last at b04c0cb (#930). #934 (`--revit-property-sets`,
breaking) and #923 (the `ElementId` newtype, breaking) go in the next
release.

## Changes

- **Version files** (0.6.1 to 0.7.0): `Cargo.toml`, `rvt-py/Cargo.toml`
(and its `=0.7.0` pin on `rvt`), `rvt-wasm/Cargo.toml`, the `rvt` pin in
`tools/stream_evidence/Cargo.toml`, `viewer/package.json`,
`CITATION.cff` (`date-released: 2026-10-24`),
`.release-please-manifest.json`, and the workspace crates' entries in
`Cargo.lock` and `fuzz/Cargo.lock`.
- **`CHANGELOG.md`**: `python3 tools/release/changelog.py assemble`
moved the nine fragments in, then `[Unreleased]` became `[0.7.0] —
2026-10-24`, with an introduction, credits to puzzbobb (#870, #886,
#887, #935) and n3ur0m4n (#882), and "Upgrading from 0.6": the research
readers behind `unstable-research`, the `#[non_exhaustive]` types, the
error variants (and Python's `ValueError`), `SimpleDecoder`, the
property set builders' `Vec`, the removed `ifc::pset_validate`, the
element walk failing closed, and changed exports. Headings in the
assembler's order (Added, Changed, Fixed, Removed, Research), one each.
`[Unreleased]` is left empty.
- **Entries corrected for the release as a whole**: #847's pipe-port
entry said In ports' axes were wrong because their flow direction was
not read, and that other family-instance ports had no placement; RE-212
and #943 changed both, and it now gives main's counts (Measure
40126110706, base side: 124 of 124 and 62 of 62 with Revit's axis;
joined ports 108 and 53 as Revit's, 10 and 6 opposite). The
unjoined-ports entry says Revit 2025 in its headline. RE-215's entry
adds the office.
- **`README.md`**: "Release 0.7.0 and main", what 0.7.0 adds in brief.
The 0.6.1 section listed RE-215 under 0.6.0's additions; it shipped in
neither.
- **`docs/support-matrix.json`**:
- `native-symbol-cut-sizes`: the BIM4LCA office's result, and
`user_impact` limited to families whose symbol cuts an outline;
- `element-record-mep-connections`: still said HVAC and piping
directions, names and descriptions are not read and In ports' axes are
reversed; it now states RE-212 (direction, `InPort_`/`OutPort_` names,
`Flow` descriptions, axes), keeps SystemType and the electrical
description as unread, and lists RE-212's probe, scorer, test and report
as evidence.
- **`docs/status.md`** and
**`reports/element-framing/RE-215-symbol-cut-loops.md`**: the office,
which §6 called NOT MEASURED, as measured on 2026-10-24 (Measure
40121636312 and 40122363218): 187 of its 269 doors cut an outline and
have Revit's sizes; its 269 windows and other 82 doors are drawn by
symbols with no cut loop (#810).

## Testing

Unit tests are banned in this repository: do not add them. Show the
change working end to end on real files instead.

- [ ] `tools/check-local.sh` passes: this PR's CI. No code changes; the
version string changes the IFC header.
- [x] Verified end to end on real Revit files: no behaviour changes; the
measurements cited are the runs named above.
- [ ] If this touches the IFC exporter: the IFC header carries the
version (#417), so both Core Interior `rvt-rs.json` observations and
their verdicts are refreshed from this PR's CI run (its
`octetproof-core-interior` artifact) in a follow-up commit here,
differing only in `witness_version` and the verdict hashes.
- N/A: performance.

## Audit-honesty checklist

- [x] README / docs reflect the current state after this PR
- [x] The changelog section is assembled from the fragments;
`changelog.py check` passes with none left
- [x] Resolved limitations updated (RE-212's in the support matrix, the
office's NOT MEASURED)
- N/A: no new limitation
- [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
- N/A: not a reverse-engineering finding

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary content
- [x] No fixtures

## Breaking changes

The release's, listed under "Upgrading from 0.6" in `CHANGELOG.md`. This
PR itself changes no API.

## Screenshots or output samples

N/A: the IFC changes only in its header's version.
DrunkOnJava added a commit that referenced this pull request Oct 24, 2026
## Summary

The 1.0 `ElementId` newtype (#873, S1). The typed layer of the stable
API carries `Option<rvt::ElementId>`:
- the element structs' ids (`level_id`, `host_id`, `type_id`,
`symbol_id` and the rest, 95 fields);
- `geometry::recovery::OpeningHostRelationship::host_element_id`;
- the arc-wall record's ids.

`ElementId` wraps an `i64`, the Revit API's `ElementId.Value`, and
serialises as the bare number. So the JSON the CLIs print and the values
Python sees are the same integers, and the schemas and stubs are
unchanged.

**What keeps the `u32`.** The wire-level views mirror the bytes and keep
the `u32` the file stores: `walker::DecodedElement::id`,
`walker::InstanceField::ElementId` and `elem_table::ElemRecord`.
`DecodedElement::element_id()` gives the typed id. The line is the one
between the walker, which reads the file, and the element structs, which
interpret it. Converting the walker too would have meant about 130
call-site changes in research code, for a type that describes raw
fields.

## The type

- `ElementId::new(i64)` and `get() -> i64`.
- `From<u32>`, and `from_raw(u64) -> Option<ElementId>`, which applies
the no-id rule: 0, and values from `u32::MAX` up, name no element
(RE-30, RE-43).
- `as_u32() -> Option<u32>` gives the stored form.
- It derives `Copy`, `Eq`, `Ord`, `Hash` and transparent serde, and
implements `Display`.

## How it was made

`sweep.py` rewrites a fresh `main` mechanically and is idempotent. It
retypes the fields, converts the decoders' `Some(*id)` assignments, and
makes exact edits at the typed layer's edges. It will be re-run after
#886 and #887 land, so the edits apply to the code as it is then. This
stays a draft until that re-run is green.

## Testing

- [x] CI: build, clippy (`-D warnings`), the real-file tests, MSRV, docs
and the Python wheel, all green on the second pass.
- [ ] The re-run after #886 and #887.

## Audit-honesty checklist

- [x] README / docs reflect the current state after this PR (CHANGELOG
"Breaking")
- [x] No limitation resolved or introduced
- [x] Commit messages describe what and why
- [x] No emojis
- [x] No private paths, personal email addresses, or internal jargon in
committed files
- [ ] Reverse-engineering finding: N/A

## 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
@DrunkOnJava

Copy link
Copy Markdown
Owner

This shipped in v0.7.0, released today (2026-10-24) on crates.io, PyPI, the release archives and the container image, and it is credited in the release notes. Thank you.

@puzzbobb
puzzbobb deleted the issue355-instance-materials branch October 27, 2026 18:04
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.

Element materials: shading colours decode exactly; names and the element-to-material link do not yet

2 participants