Repository navigation
fix(schema_registry): read the trailing references of Revit 2018's SiteSurface.m_facets (#421, #154) - #561
Merged
Conversation
…421) A real-file target: schema_registry::parse, the native path's parser, reads each family's Formats/Latest (2016 to 2026) and gives the same classes, by tag and name, as formats::schema_classes, which reads every one of them to its end. Red on main (c5f7e43), draft PR #560, run 37116554570, build + real files / ubuntu-latest / stable: thread 'every_family_catalog_is_read_to_its_end' panicked at tests/schema_registry_catalogs.rs:60:5: schema_registry::parse reads every family catalog to its end: ["2018: schema name byte budget at 351466: 786452"] error: test failed, to rerun pass `--test schema_registry_catalogs` The expected reason, and the only failing release: puzzbobb's report on #421 and #154 (SiteSurface.m_facets writes its class reference twice).
…teSurface.m_facets (#421, #154) A composite member that is not itself an array, over a fixed array of plain class references, writes those references once more after the nested descriptor (2018's SiteSurface.m_facets, 0x500d over 0x100e, the only member of that shape from 2016 to 2027; puzzbobb, #421). The parser read them once, so the next member's name length was read two bytes early and parsing stopped at byte 351,466. Written from the byte rule; the patch in the report is not copied (CLEANROOM.md).
DrunkOnJava
enabled auto-merge (squash)
October 3, 2026 10:45
This was referenced Oct 3, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Oct 3, 2026
… (#571) `native_segments::walk` stopped on every 2016 and 2017 partition, for two reasons (puzzbobb, #421). - **No `SignatureMarker` class.** The 2016 and 2017 schemas lack it, and their partitions never write one. It is now required only where a marker is met. - **`m_continuationBits`.** The word is `(n << 2) | flags`, with `n` = 1 from 2018 and 100 or more before. `walk` accepted only 4 to 7. It now reads the continuation flags (1 = from the previous segment, 2 = into the next) from the low two bits, and requires `n` to be set. The native record path still admits only 2023, 2024 and 2027. Admitting 2016 to 2022 needs the pre-2018 size accounting and the per-group id width, and a Revit export to check against. The commits are separate: 1. `test(native_segments)` adds the real-file target `tests/native_partitions_walk.rs`: every partition of every family from 2016 to 2026 walks to its end. Its red run on `main` (draft PR #566) is in the commit message. 2016 and 2017 failed on `SignatureMarker`, and 2018 on the schema stop that #561 has since fixed. 2. The fix. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes low-level partition segment parsing used by the native path; scope is narrow (walk + optional markers) and covered by a broad corpus test, but mistakes could affect partition reads on older Revit files. > > **Overview** > **`native_segments::walk`** no longer fails on pre-2018 family partitions. Two format mismatches from #421 are addressed: **`SignatureMarker`** is optional at startup (2016/2017 schemas lack the class and never write the marker), and **segment continuation** validation uses the low flag bits only—`m_continuationBits` is `(n << 2) | flags` with large `n` before 2018, so the old `4..=7` check wrongly rejected valid markers. > > A new real-file test **`tests/native_partitions_walk.rs`** walks every `Partitions/*` stream for corpus samples **2016–2026** and expects at least one decompressed group per partition; CI lists it in **`tools/ci/test-targets.txt`**. **CHANGELOG** documents the fix. The **native record extraction path** is unchanged and still limited to 2023, 2024, and 2027. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4784a82. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> ## Measured Measure run 37118576160 compared head against `main` with the families and samples: all 6 model IFCs are byte-identical, and every scorer, `rvt-info` and diagnostics output is identical on 6 models, 11 families and 36 samples.
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.
schema_registry::parseis the parser the native record path uses. It stopped at byte 351,466 of the Revit 2018 catalog (schema name byte budget), on Autodesk's 2018 family and on 2018rac_basic.The cause is one member shape. A composite member that is not itself an array, over a fixed array of plain class references, writes those references once more after the nested descriptor. That member is 2018's
SiteSurface.m_facets(0x500dover0x100e), the only one of that shape in any catalog from 2016 to 2027 (puzzbobb, #421 and #154). The parser read the reference once, so it read the next member's name length two bytes early. It now reads the trailing references and checks that their tags match. The fix is written from the byte rule; the patch in the report is not copied (CLEANROOM.md).The commits are separate:
test(schema_registry)adds the real-file targettests/schema_registry_catalogs.rs. Every family catalog from 2016 to 2026 must be read to its end and give the same classes, by tag and name, asformats::schema_classes. Its red run onmainis in the commit message (draft PR red run: schema_registry_catalogs (B03, do not merge) #560, run 37116554570):["2018: schema name byte budget at 351466: 786452"]. No other release failed.This unblocks the 2018 part of B06 (the native path on 2016 to 2022) and the #154 checklist item "every schema is read to its end".
Note
Medium Risk
Changes binary schema parsing on the native path; scope is narrow (one catalog member shape) but wrong handling would break schema/class resolution for affected files.
Overview
Fixes Revit 2018 family catalog parsing so
schema_registry::parse(used on the native record path) no longer stops mid-stream with a schema name byte budget error.The bug was a one-off member layout: a non-array composite over a fixed array of plain class references repeats those references after the nested descriptor (
SiteSurface.m_facetsin 2018). The parser now consumes that trailing reference block and checks tag agreement.Regression coverage: new real-file test
schema_registry_catalogsreads everyFormats/Latestfamily catalog (2016–2026) to EOF and compares class tag/name sets toformats::schema_classes; CI picks up the target viatools/ci/test-targets.txt.Reviewed by Cursor Bugbot for commit e760ad7. Configure here.