Repository navigation
fix(elem_table): the header's record count is the u32 the table states (#745) - #764
Merged
Merged
Conversation
#745) ElemTableHeader::record_count kept the low 16 bits of the u32 at 0x02, documented as safe because no table measured held 65,536 records. A Nordic LCA office project's table states 72,798 (#745), so rvt-elem-table reported 7,262 declared records and the implicit fallback layout would parse only that many (helenkwok noted the loose end). The field is a u32 now, and parse_records takes its limit from the stated count on both layouts. Two comparisons in existing tests cast the parsed length instead of the count; their assertions are unchanged.
DrunkOnJava
enabled auto-merge (squash)
October 18, 2026 09:58
DrunkOnJava
added a commit
that referenced
this pull request
Oct 18, 2026
## Summary Prepare v0.5.0. Merging this is not the release: the release is the signed `v0.5.0` tag on the merged commit, which runs `publish.yml` (crates.io, PyPI, the release binaries and the container image). The tag waits for the maintainer's go-ahead. ## Motivation `main` is 0.4.0 plus everything under `[Unreleased]`: Revit 2026 projects (experimental), MEP ports, connections and systems, Revit's level, category, family, type and phase properties, rooms aggregated into their storeys, Snowdon Towers exporting again, and the first pull requests from outside contributors. Before 1.0 a breaking change bumps the minor version, and these are breaking for a 0.4 user: - The MSRV is 1.87 (was 1.85). - `rvt` has no `wasm` feature; the bindings are the `rvt-wasm` crate (C6). - Each `IfcSpace` is aggregated into its storey instead of contained in it (#744). - `ElemTableHeader::record_count` is a `u32` (#764). - Type objects take Revit's GlobalIds (RE-167). ## Changes - **Versions 0.4.0 → 0.5.0:** `rvt`, `rvt-py` and its pin, `rvt-wasm`, the `stream_evidence` pin, both lockfiles (only the workspace crates' version lines change), `.release-please-manifest.json` and `viewer/package.json`. - **`CHANGELOG.md`:** `[Unreleased]` becomes `[0.5.0] — 2026-10-18`. - An introduction, the contributors, and an **Upgrading from 0.4** section. - The community pull requests' entries are added and credited (#737, #738, #744, #751, #752, #753, #755, #757, #758). - The repeated Added, Changed, Fixed and Research headings, which later merges had appended, are folded into one each. All 107 entries are kept as written (checked as a multiset) and in their order, and everything from `[0.4.0]` down is byte-identical. - #778's clean-room policy change is added under Changed, so the section has 108 entries. - **`CITATION.cff`:** it said 0.1.2 (2026-04-20), though `RELEASE.md` has it agree with `Cargo.toml` at every tag. Its abstract now describes the project as the README does, without the "first open-source tool" and "verified against 11 releases" claims. - **Registry descriptions:** crates.io showed 0.4.0's description, which leaves out Revit 2023, and PyPI one that called element extraction and geometry "active research" and the export "document-level IFC4 scaffolding". `Cargo.toml` and `pyproject.toml` now say what the README says: typed elements from Revit 2023 to 2025 projects, 2026 experimental. - **Witnesses:** the IFC header carries the version (#417), 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: every job `CI passed` requires, the witness replays among them. - On the tag, the publish workflow runs its own checks before anything is published: wheel install and model open on each OS, `cargo install` and the CLI sample smoke, the docs.rs build preview and the viewer load smoke. crates.io and PyPI publish only after all of them pass, and PyPI only after crates.io. ## Audit-honesty checklist - The docs keep describing 0.4.0 as the latest release until each 0.5.0 channel has been checked from what was published. That follows in a separate pull request (`docs/install.md`, `docs/python.md`, `docs/status.md`, `docs/supported-profile.md` and the README's release section). - crates.io's trusted publisher (repository DrunkOnJava/rvt-rs, workflow `publish.yml`, environment `crates-io`) has to be in place before the tag, as `docs/maintaining.md` says; it is a registry-side setting this repository cannot check. ## Legal and contribution hygiene N/A: release metadata only. Contributors are credited by their GitHub names in the CHANGELOG. ## Breaking changes Listed under Motivation, with the migration for each in the CHANGELOG's **Upgrading from 0.4**.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ElemTableHeader::record_count kept the low 16 bits of the u32 at 0x02,
documented as safe because no table measured held 65,536 records. A
Nordic LCA office project's table states 72,798 (#745), so rvt-elem-table
reported 7,262 declared records and the implicit fallback layout would
parse only that many (helenkwok noted the loose end). The field is a u32
now, and parse_records takes its limit from the stated count on both
layouts. Two comparisons in existing tests cast the parsed length instead
of the count; their assertions are unchanged.
Testing
elem_table_corpusandproject_corpus_smokekeep their assertions; only the side of each comparison that is cast changes.u16truncation on it in Nordic LCA office as-built (Revit 2024, 14 streams, one 62 MB partition): walker finds levels and materials only #745.rustfmt --checkis clean on every changed file. CI runs the rest.Legal and contribution hygiene
Note
Medium Risk
Changes core ElemTable header parsing and record limits; low blast radius but affects how large Revit projects are read and exported.
Overview
Fixes ElemTable parsing for projects whose table declares more than 65,535 records.
ElemTableHeader::record_countis now the fullu32at0x02instead of truncating to 16 bits, which mis-reported counts (e.g. 72,798 → 7,262) and capped how many records were parsed on the implicit fallback layout.parse_recordsalways uses the samestated_countlimit for explicit and implicit layouts, so both paths honor the full declared count. Thervt-elem-tableJSON output and corpus tests were updated to compare against the widened type without changing the intended assertions.Reviewed by Cursor Bugbot for commit 0a5ff8b. Configure here.