Repository navigation
fix(formats): strip Formats/Latest's checksum pages and read the whole schema (#410) - #412
Merged
Merged
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_07ef7b8e-8344-48ba-a719-d62b05958d0e) |
This was referenced Sep 27, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Sep 27, 2026
… printable from rvt-capabilities --matrix (#404) (#413) Closes #404. ## What changes - **README top**: one statement of what rvt-rs is (a reader, measured model by model, not a converter), a table of what you can rely on per input (2024/2025 projects, 2026, 2023 and earlier, families), and typical uses. Separates `main` from the latest release (v0.2.0) and points at `[Unreleased]`. - **Stale README rows fixed**: "on real project files the walker only recovers HostObjAttr ... proxies", "rectangular profiles only", "no curved, sloped or B-rep geometry", "Export IFC produces the scaffold (not typed elements)", "openings ✓" (they are the door's box, #227), "`rvt-ifc` scaffold by default" (the mode is an acceptance bar, not a decode limit). - **`docs/supported-profile.md`** rewritten for BIM users: four levels (opened, elements identified, geometry, properties), per-input and per-category tables with the measured figures, what an approximation looks like in the output, and how to report a problem without sharing the building. - **`docs/status.md`**: a short current summary; the long per-finding narrative is kept under "Finding history" (later paragraphs win); its hand-maintained capability table is replaced by the support matrix; the roadmap no longer says "0.2.0 release hold, crate 0.1.x". - **One capability source**: `rvt-capabilities --matrix` (`-f text` or JSON) prints `docs/support-matrix.json` from any build (`rvt::capability::SUPPORT_MATRIX_JSON`), so the 54-row matrix, not a separate 8-row manifest, is what a user sees. The default `rvt-capabilities` output is unchanged. ## Checks - `cargo fmt --check`, `cargo clippy --all-targets --all-features -D warnings`. - `support_matrix`, `binary_inventory`, `json_schema_contracts` (with the family corpus): pass. - `rvt-capabilities --matrix -f text` prints 54 capabilities; `rvt-capabilities --matrix` parses as JSON with 54. Every figure quoted is one the README's measured tables or the support matrix already carry. #412 updates the schema figures separately; whichever lands second rebases. ## Legal and contribution hygiene - [x] Apache-2.0; documentation and a CLI flag only. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation and a read-only CLI flag only; no decode, export, or runtime behavior changes. > > **Overview** > Unifies **what rvt-rs claims it can do** across the README, `docs/status.md`, and `docs/supported-profile.md`, and makes **`docs/support-matrix.json`** the single machine-readable source (`SUPPORT_MATRIX_JSON` in `src/capability.rs`). > > The **README** now leads with a reader (not universal converter) story, a **per-input reliability table** (2024/2025 vs older releases vs families), typical uses, and **`main` vs v0.2.0** / `[Unreleased]`. It **corrects outdated capability rows** (typed 2024/2025 elements from partition records, partial geometry/openings, viewer IFC on recent projects, `rvt-ifc` modes as quality gates). > > **`supported-profile.md`** is rewritten for BIM users: four levels (opened → elements → geometry → properties), measured geometry/property tables, and how diagnostics and export modes behave. > > **`status.md`** adds a short current summary, labels the long narrative **Finding history**, **drops the hand-maintained capability table** in favor of the support matrix + `rvt-capabilities --matrix`, and **updates the roadmap** (v0.2.0 shipped, v0.3.0 drafted). > > **`rvt-capabilities --matrix`** prints the full 54-row matrix as JSON or human-readable text; default manifest output is unchanged. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4b41be5. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…e schema (#410) Formats/Latest is stored in checksum pages like the database streams but was inflated without the strip, so it drifted after about 140 KB while still decoding cleanly, and schema parsing stopped at 64 KB to keep the drift out. Stripped, its gzip CRC32 and ISIZE verify on all 23 files measured (they fail unstripped on all 23) and every file of one release inflates to the byte-identical schema. rvt-rs now reads all of it: 4,126 classes and 11,562 fields on Revit 2024 instead of 395 and 1,114. The integrity diagnostic reports ok only when the trailer verifies, as #255 proposed. IFC output is unchanged on every corpus file. Credit: STE1200 (Discussion #112) for the page layout and grammar, rosejn (#255) for accepting the strip on a verifying trailer.
DrunkOnJava
force-pushed
the
fix/formats-page-strip
branch
from
September 27, 2026 20:09
eb6f20b to
86551d1
Compare
DrunkOnJava
enabled auto-merge (squash)
September 27, 2026 20:09
1 task done
DrunkOnJava
added a commit
that referenced
this pull request
Sep 27, 2026
… definition ordinal (#154, #223) (RE-76) (#416) Part of #154; answers #223. Report: `reports/element-framing/RE-76-schema-class-tags.md`. Probe: `examples/probe_re76_schema_class_tags.rs`. ## What changes - `formats::schema_classes` / `RevitFile::schema_classes`: the `Formats/Latest` grammar, reading the whole page-stripped stream (#410) and giving every class its serialization tag, the definition ordinal (12 first, one more per top-level or inline definition; inline references repeat their tag, so a misread stops the parse). Bounded nesting, no panics on hostile input. - `PartitionElementRecord::class_tag`: the `u16` at `+0x4a`. - Every record-backed element gets `RevitClass` in `RvtElementRecordGeometry`. ## Evidence | | classes | stopped | |---|---|---| | 2016 family | 3,792 (tags 12..3803) | end of stream | | Core Interior, Snowdon (2024) | 4,492 (12..4503) | end of stream | | RE1 Architecture (2025) | 4,600 (12..4611) | end of stream | | 2026 family | 4,690 (12..4701) | end of stream | Every record of ten categories resolves, to the class a BIM user expects: walls `SWall` / `ArcWall` / `FaceWall`, floors `Floor`, rooms `RoomElem`, roofs `ProfileRoof`, stairs `StairsElement`, ceilings `Ceiling`, families `FamilyInstance` or, for type symbols, `FamilySymbol`. Independent check: Snowdon's 32 `ArcWall` records are exactly the 32 walls RE-75 found storing an arc (24 exported). `RevitClass` on export: Core Interior 970 of 970, RE1 Architecture 85 of 85, Snowdon Towers 6,081 of 6,081. The only other IFC change is that property. Both Core Interior verdicts replay PASS with refreshed rvt-rs observations (+970 `IFCPROPERTYSINGLEVALUE`). ## Not changed `SchemaTable.tag`, `class_tag_map` and the `Global/Latest` walker still use the `u16` after each class name, which is the base-class reference; moving them changes the walker's input and stays in #154. ## Checks `tools/check-local.sh` (205 suites) and all 48 corpus-gated integration test binaries before rebasing onto #412's squash; after it, fmt and `support_matrix`, `field_type_coverage`, `json_schema_contracts`, `element_records_2025` with the corpora. ## Legal and contribution hygiene - [x] Apache-2.0. Grammar and the `+0x4a` reading credited to STE1200 (Discussion #112, public Apache-2.0 scripts), `+0x46` to jakobhirn-bit (same thread), ordinal numbering also in rosejn's #255. Implemented independently in Rust; no Autodesk or ODA material. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches core partition decode and IFC property emission; schema grammar parsing is new surface area but fail-closed on parse errors and does not alter geometry or GlobalId behavior. > > **Overview** > **Adds Revit-native class names to record-backed elements** by parsing `Formats/Latest` with a grammar that assigns each class a **serialization tag** (definition ordinal from 12 upward), then resolving the `u16` at partition element record **`+0x4a`** against that table. > > New **`formats::schema_classes`** / **`RevitFile::schema_classes`** expose the class list; **`PartitionElementRecord::class_tag`** carries the raw tag. During MVP decode, **`attach_revit_classes`** maps tags to names like `SWall`, `ArcWall`, `FaceWall`, `Floor`, `FamilyInstance`, and `FamilySymbol`. IFC export writes a **`RevitClass`** text property on each element’s geometry property set (Core Interior +970 `IFCPROPERTYSINGLEVALUE`; witness hashes refreshed). > > **`SchemaTable.tag`**, **`class_tag_map`**, and the **`Global/Latest`** walker are **unchanged**—they still use the `u16` after each class name (base reference), not the definition ordinal. > > Docs: CHANGELOG, support-matrix row `element-record-revit-class`, RE-76 report, and **`probe_re76_schema_class_tags`** example. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 48bd6505a45516c332d763d9d8f775a043894875. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
Closes #410. Completes the
Formats/Latesthalf of #151.What changes
compression::is_checksum_paged_streamincludesFormats/Latest, so every reader of the schema (RevitFile::schema, the walker, the partition scanner,rvt-analyze, the diagnostics) inflates it page-stripped.formats::parse_schemascans the whole stream.SCHEMA_SCAN_LIMITstays as a constant forparse_schema_with_scan_limit, which the probe uses to show the old 64 KB window.diagnose_formats_latest_integrityreportsokonly when the stripped stream's gzip CRC32 and ISIZE trailer verifies,uncertain(RVT_FORMATS_MULTIPAGE_UNVERIFIED) when it inflates but does not verify,incompletewhen it does not inflate. Accepting the strip on that condition is rosejn's idea from feat(parser): add native model attributes and geometry extraction #255.Evidence
examples/probe_schema_page_strip.rs(rewritten) over the 11 sample families and the project corpus:bce7907b…, 2024 (5)0bfb947b…, 2025 (8)c964f9aa…. Unstripped, a family and a project of the same release differ.Across the 11 releases: 122,107 fields (before: 13,570). The 64 KB cap was hiding drift, not "binary object data".
rvt-inspect --jsonnow reportschecksum_tail_stripping: enabled, integrity_status: okfor Formats/Latest on the 2026 family and Core Interior.Tests changed, not added
tests/field_type_coverage.rsinflated with the unstripped call; it now uses the gated one and fails on anyUnknownfield outside a listed residual of 14 fields (9 to 12 per release:0e 04,0e 13,0e 53,0e 54pointer and collection modifiers, a0akind,04 00 04 00). The old "zero Unknown" gate held only because it saw 64 KB.tests/checksum_page_framing.rsand thecompressionunit tests pinnedFormats/Latestas ungated; they now assert it round-trips through the strip, and that a stream without a verifying trailer isuncertain.Checks
tools/check-local.sh: passed (204 suites) before the trailer check; compression tests, clippy and the corpus-gatedchecksum_page_framing,json_schema_contracts,field_type_coverage,support_matrixrerun after it.RVT_SAMPLES_DIRandRVT_PROJECT_CORPUS_DIRset: passed.Public claims corrected
README,
docs/support-matrix.json,docs/compatibility.md,docs/status.md,ROADMAP.md: the schema figures, and RE-20's note thatLevelis absent from the schema, which was an artifact of the 64 KB scan (Levelis class 2422 of Revit 2024's schema; storeys already come from element records, so nothing else changes).Follow-ups
schema_registry.rsin feat(parser): add native model attributes and geometry extraction #255, agree). Element records name their class by it at +0x4a (Element record +0x46: the flag word's bits no Revit export has tested (RE-261) #223, measured).Legal and contribution hygiene
Note
Medium Risk
Changes core decompression for every schema consumer; behavior is gated by trailer verification and broad tests, but wrong strip logic would affect all class/field introspection downstream.
Overview
Formats/Latestis inflated with the same checksum-page strip as Partitions and Global streams, fixing silent drift past ~140 KB that made unstripped inflation look valid while corrupting the tail. Production paths that already callinflate_stream_at(e.g.RevitFile::schema, walker, probes) therefore get the full, release-consistent schema instead of a truncated or garbage tail.Schema parsing and CI gates move to the whole stream:
parse_schemascans all decompressed bytes (64 KB limit kept only viaparse_schema_with_scan_limitfor comparisons).field_type_coverageinflates through the gated path, expects ~122k fields corpus-wide, and allows a documented RESIDUAL set of 9–12 unclassified encodings per release.diagnose_formats_latest_integritymarks integrity ok when the stripped member’s gzip CRC32/ISIZE verify, otherwise uncertain withRVT_FORMATS_MULTIPAGE_UNVERIFIED; witness JSON drops the old multipage warning.Docs and README correct prior “100% field classification” and “Level absent from Formats” claims (artifacts of the 64 KB window). IFC exports on measured corpora are unchanged.
Reviewed by Cursor Bugbot for commit eb6f20b3f73e8b68884f9dab7a69326d72328cc4. Configure here.