Skip to content

fix(elem_table): declare each record's current id, not a first id nothing names (#760) (RE-189) - #797

Merged
DrunkOnJava merged 4 commits into
mainfrom
fix/760-declared-current-ids
Oct 18, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
fix/760-declared-current-ids

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

elem_table::declared_ids declares each Global/ElemTable record's current id only: its second id on the 40-byte layout when that is not 0, its first otherwise. Where the two differ, nothing in the file names the first id unless it is also another element's current id, so it no longer counts as declared on its own (#760, RE-189).

Motivation

#760 (found by @pinterbanget while landing #737): Snowdon Towers Architectural declares 84 ids that name no record. They are the first ids of the 84 records whose two ids differ, which declared_ids kept beside the second. The issue's bar for dropping them was: does anything in the file name a first id? If nothing does, dropping them is the fail-closed choice.

Changes

  • src/elem_table.rs: declared_ids maps each record to its current id. Its doc states the measurement.
  • examples/probe_re189_first_id_references.rs: for every record whose ids differ, it searches every stream for both ids, as u64 and u32, inflated where compressed. It names the partition chain record holding each partition hit, and it sorts the first ids by what names them.
  • reports/element-framing/RE-189-first-ids-name-nothing.md, and a CHANGELOG [Unreleased] Fixed entry.

Testing

The probe, Measure run 39157096050 (-f samples=true). The Snowdon models are Autodesk's samples, fetched for the run and never stored.

Snowdon Architectural Snowdon Structural
Records whose ids differ 84 27
First ids that are another element's current id 0 7
Other first ids named in a project element record 0 0
... named only in loaded families' own documents (and, on Architectural, Global/ContentDocuments) 43 2
... named nowhere 41 18

None of the other 28 files with 40-byte records that Measure reads has a record whose ids differ.

The change, Measure A/B run 39158195119 (-f samples=true, base main):

  • CI's 6 reference models: every output, the IFC hash and GLB among them, is byte-identical.
  • The 49 samples: every rvt-info output and every export diagnostics file is identical, except one field on the two Snowdon models. decoded_element_fraction rises as its denominator loses the stray ids: 47,317 → 47,233 declared on Architectural, 16,591 → 16,571 on Structural.

The corpus target that first showed this (partition_record_chain::every_first_prologue_frame_starts_a_record_of_its_own_id) runs only where Snowdon is in RVT_PROJECT_CORPUS_DIR, and CI's corpus does not include it, so this pull request's CI cannot show it passing. On these numbers, Architectural's declared set now equals the 47,233 ids that have a record. The rebase onto main after the A/B (#793) touches no Rust source.

Clean room

The changes in this PR are based on public byte observations of Autodesk's published sample projects and the magnetar and Drshelden models (sources 1 to 3). I have not used Autodesk SDK source, ODA SDK source, leaked internal documentation, NDA material, or decompiled internal Revit implementation code beyond public symbol exports, and I have not copied or translated code from revit-ifc.

Breaking changes

None in output. declared_ids returns fewer ids on files whose ElemTable records carry two different ids (two Snowdon models among the 55 measured).

Closes #760


Note

Medium Risk
Changes how element ids are declared across many ownership and export call sites, but measurement shows identical IFC/GLB on reference models; only diagnostic denominators shift on Snowdon samples.

Overview
elem_table::declared_ids no longer treats both ids on 40-byte Global/ElemTable records as declared elements. It now emits one id per record—the secondary when non-zero (current ElementId), otherwise the primary—so creation-time primary ids that nothing in the project references are dropped from the declared set.

Research on Snowdon Towers (RE-189) motivated the change: those stray first ids are not named by project element records. A new probe_re189_first_id_references example scans partitions and other streams to document where differing ids appear; reports/element-framing/RE-189-first-ids-name-nothing.md and CHANGELOG capture the findings.

Measured impact: CI reference exports stay byte-identical; only Snowdon models show fewer declared ids and a higher decoded_element_fraction in diagnostics. revit_global_ids still reads both ids from the table, so GlobalIds are unchanged.

Reviewed by Cursor Bugbot for commit a17f9458a82dced07e513afbbe38662c20dada67. Configure here.

@DrunkOnJava DrunkOnJava added re-finding New RVT on-disk format finding area:elements Work in the elements area. type:bug Correctness defect or regression. labels Oct 18, 2026
@DrunkOnJava
DrunkOnJava force-pushed the fix/760-declared-current-ids branch from 6e78628 to a17f945 Compare October 18, 2026 19:32
@DrunkOnJava
DrunkOnJava force-pushed the fix/760-declared-current-ids branch from b21fed8 to f6f52f8 Compare October 18, 2026 23:08
@DrunkOnJava
DrunkOnJava merged commit a21d871 into main Oct 18, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/760-declared-current-ids branch October 18, 2026 23:17
@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 -->
DrunkOnJava added a commit that referenced this pull request Oct 27, 2026
… RE-189 and RE-211 closed (#1064)

## Summary

The README now lists what `main` adds after 0.9.0, and it no longer
lists as open three gaps that RE-189, RE-211 and the materials work
closed. It also fixes a broken anchor and a fuzz case count that was
wrong.

## Motivation

Griffin asked for the README to be brought up to date. It already
carried every measured figure from #1049 to #1063 in its tables, but:

- the "Support and evidence" link pointed at `#release-070-and-main`, a
heading that no longer exists;
- it sent readers to `[Unreleased]` in `CHANGELOG.md`, which is empty
since #938 moved unreleased entries to `changelog.d/`;
- it listed roofs by extrusion as not decoded (#883, closed by #930,
RE-211), the ElemTable's first ids as an open question (#760, closed by
#797, RE-189) and family instances' materials as decoder work (#34,
closed 2026-09-27; the table's own row covers RE-149 to RE-206);
- it said 38 fuzz regression cases, but `tests/fuzz_regressions.rs` has
64, all of them run in CI (`hardening fuzz_regressions` in
`tools/ci/test-targets.txt`). It already had 64 when the sentence was
written (#713).

## Changes

- `README.md`:
  - the anchor now points at "Release 0.9.0 and main";
- "Release 0.9.0 and main" lists what `main` adds, taken from the
`changelog.d/` fragments: base quantities, the diagnostics, and RE-248
and RE-251 to RE-255. On the office as built that is 21,065 quantities,
against 0.9.0's 20,157;
- the roofs row says a Revit 2025 roof by extrusion is drawn as its
section. Its RE-211 figures (1,187 of 1,187 vertices within 0.001 ft,
volume 1.00015 of Revit's) are stated apart from RE-199's 18 roofs,
since its volume is outside the 1e-4 those meet. The two gap lists now
say "outside Revit 2025", as `docs/status.md` already does;
  - the ElemTable row is Done, with RE-189's finding;
  - #34 is gone from the decoder-work list;
  - 38 becomes 64;
- main's walls' `Width` is called an extension to slanted and unplaced
walls, since 0.9.0 already had `Width` (RE-244).
- `docs/support-matrix.json`, row `element-record-roof-outlines`: the
notes still called #883 open. They now record RE-211's reading and
measurement, and the evidence lists its reader, writer, probe, scorer
and report. The status stays `partial`.

N/A: no code, no export change, no changelog fragment (docs-only).

## Testing

- `python3 tools/ci/api-doc-ids.py`: every cited RE finding has a report
(240 reports).
- `python3 tools/ci/wasm-api.py docs rvt-wasm/src/lib.rs README.md
docs/viewer-api.md`: 22 bindings, matching.
- `python3 tools/release/changelog.py check`: 18 fragments, valid.
- Every `](#...)` anchor in the README resolves to a heading, every
relative link resolves to a file, and there are no home paths.

## 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`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:elements Work in the elements area. re-finding New RVT on-disk format finding type:bug Correctness defect or regression.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snowdon Towers Architectural: 84 ElemTable first ids that name no record are still declared (RE-41)

1 participant