Skip to content

fix(native_segments): walk the partitions of Revit 2016 and 2017 (#421) - #571

Merged
DrunkOnJava merged 3 commits into
mainfrom
fix/b06-native-walk-2016-2017
Oct 3, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
fix/b06-native-walk-2016-2017

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

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 red run: native_partitions_walk (B06, do not merge) #566) is in the commit message. 2016 and 2017 failed on SignatureMarker, and 2018 on the schema stop that fix(schema_registry): read the trailing references of Revit 2018's SiteSurface.m_facets (#421, #154) #561 has since fixed.
  2. The fix.

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.

Reviewed by Cursor Bugbot for commit 4784a82. Configure here.

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.

A real-file target: native_segments::walk reads every partition of every
family of 2016 to 2026 with the file's own schema, each yielding a group.

Red on main (5131dc7), draft PR #566, build + real files / ubuntu-latest
/ stable (and windows-latest):

  thread 'every_family_partition_walks_to_its_end' panicked at
  tests/native_partitions_walk.rs:66:5:
  native_segments::walk reads every family partition to its end:
  ["2016 Partitions/58: partition schema class absent: SignatureMarker",
   "2017 Partitions/60: partition schema class absent: SignatureMarker",
   "2018: schema: schema name byte budget at 351466: 786452"]
  test result: FAILED. 0 passed; 1 failed

The expected reasons: 2016 and 2017 have no SignatureMarker class
(puzzbobb, #421); 2018's schema stop is fixed by #561, now on main.
The 2016 and 2017 schemas have no SignatureMarker class and their
partitions write none, so walk now requires the class only where a
marker is met. m_continuationBits is (n << 2) | flags with n = 1 from 2018
and 100 or more before (puzzbobb, #421); walk accepted only 4 to 7 and
now reads the continuation flags from the low two bits, requiring n to
be set. The native record path still admits only 2023, 2024 and 2027
(the pre-2018 size accounting and id width are not needed to walk).
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 3, 2026 11:18
@DrunkOnJava
DrunkOnJava merged commit 98e1816 into main Oct 3, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/b06-native-walk-2016-2017 branch October 3, 2026 11:45
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