Skip to content

fix(schema_registry): read the trailing references of Revit 2018's SiteSurface.m_facets (#421, #154) - #561

Merged
DrunkOnJava merged 5 commits into
mainfrom
fix/b03-schema-registry-2018
Oct 3, 2026
Merged

DrunkOnJava merged 5 commits into
mainfrom
fix/b03-schema-registry-2018

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

schema_registry::parse is 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 2018 rac_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 (0x500d over 0x100e), 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:

  1. test(schema_registry) adds the real-file target tests/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, as formats::schema_classes. Its red run on main is 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.
  2. The fix.

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_facets in 2018). The parser now consumes that trailing reference block and checks tag agreement.

Regression coverage: new real-file test schema_registry_catalogs reads every Formats/Latest family catalog (2016–2026) to EOF and compares class tag/name sets to formats::schema_classes; CI picks up the target via tools/ci/test-targets.txt.

Reviewed by Cursor Bugbot for commit e760ad7. Configure here.

…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
DrunkOnJava enabled auto-merge (squash) October 3, 2026 10:45
@DrunkOnJava
DrunkOnJava merged commit 4f3004d into main Oct 3, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/b03-schema-registry-2018 branch October 3, 2026 11:04
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.
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.

1 participant