Skip to content

fix(elements): read a file that kept an older release's schema #421 - #1081

Merged
DrunkOnJava merged 3 commits into
DrunkOnJava:mainfrom
puzzbobb:feat/schema-marker-release
Oct 29, 2026
Merged

DrunkOnJava merged 3 commits into
DrunkOnJava:mainfrom
puzzbobb:feat/schema-marker-release

Conversation

@puzzbobb

@puzzbobb puzzbobb commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A file that kept an older release's schema is now read as that release (#421). schema_release names the release the file's schema belongs to, and RevitFile::layout_release gives it to the readers when it is older than the release that saved the file. A schema that matches no measured release still reads nothing.

Motivation

A field report on #421 tested 49 project files saved by Revit 2024 to 2027. 25 of them carried an older release's element-record marker, and all 25 read as zero elements and zero Levels:

  • 17 carried the 2024 or 2025 marker;
  • 8 carried 3c01ffffffff8205 or 2901ffffffff4805.

file_bbox_marker refuses a schema marker that differs from the saving release's constant, and the Level, type-record and name readers use the saving release's constants too.

The report treated the second pair of markers as unknown, but they are Revit 2023's and 2022's: Outline and ElementParents are 0x013c and 0x0582 in 2023's schema, and 0x0129 and 0x0548 in 2022's. The files' histories start in 2014 to 2020, which fits. Those releases write the 32-bit records that partition_element_records_2023 reads. So accepting their markers in file_bbox_marker is not enough: the whole file has to be read as its schema's release.

Changes

  • src/partition_element_records.rs: schema_release. A 2024 to 2027 schema is matched by its bbox_marker; a 2015 to 2023 schema is matched by its schema_tags. None when nothing matches.

  • src/partition_element_records_2023.rs: file_schema_tags, the SchemaTags32 of the file's own schema.

  • src/reader.rs: RevitFile::layout_release (memoised). It gives the schema's release when that is older than BasicFileInfo's version, and the saving release otherwise.

  • The readers that took BasicFileInfo's version now take layout_release:

    • src/partition_names.rs, src/partition_phases.rs, src/partition_scanner.rs, src/partition_arc_walls.rs, src/partition_design_options.rs, src/partition_connector_pairs.rs;
    • src/native_document.rs, src/native_element_parameters.rs, src/native_family_forms.rs;
    • compute_second_prologue_ids;
    • the walker's partition merge;
    • in src/ifc/mod.rs: the Level storeys, the ArcWall path, the instance transforms and the diagnostics' scans.

    Metadata, reports, the doctor, the export's "Revit N export" description and the door GlobalId suffix (which follows the exporting Revit) keep the saving release.

  • examples/probe_421_schema_marker.rs: prints schema_release and layout for each file, and scanned is the marker the readers now get.

  • docs/compatibility.md (known limitations) and changelog.d/fixed/schema-marker-release.md.

Testing

Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead.

  • tools/check-local.sh passes (fmt, clippy, rustdoc, build, real-file / CLI / contract checks)
    • tools/check-local.sh (required gates): "check-local: all requested gates passed"; cargo test --test integration 297 passed; cargo clippy --all-targets --all-features -- -D warnings clean.
    • cargo +1.87 check --profile ci --all-targets (the MSRV job) passes.
  • Verified end to end on real Revit files: the command, the files (and their licence), and the measured result against Revit's own export are in the PR body, with the script or probe that reproduces it
    • No file here has an older release's schema. The one local model upgraded from 2019 and saved by 2025 carries 2025's marker, so this PR cannot show the fix on a file of its own. The reporter offered to run a build against their files; the counts to compare are their 0 elements and 0 Levels per file.
    • cargo run --profile ci --example probe_421_schema_marker -- <files> on the local files of 2015 to 2027 (Autodesk's sample projects and templates, the BIM4LCA models and the other files Measure reads, plus local ones): on all 120, schema_release is the saving release, for every release from 2015 to 2027. So layout is the saving release on each, and nothing they read can change.
  • If this touches the IFC exporter: the witness verdicts replay (see CONTRIBUTING.md) or the changed observations are refreshed in this PR
    • I ran rvt-ifc on 132 local files of 2008 to 2027 with this branch and with main at e5846fe, leaving out the timestamp lines. All 132 exports are byte-identical, including Core Interior (2024) and every pinned sample at hand.
  • If this is a performance change: reran tools/bench.sh and attached the before / after
    • N/A: not a performance change. layout_release reads the memoised schema once per file.

Maintainer integration (rebased on main 2026-10-29)

  • Rebased onto main (after fix(reader): name every stream a resource limit stops and refuse a partial export (#1075) #1083); puzzbobb's commit is unchanged in content.
  • Added: the export diagnostics warn when the layout release differs from the saving release ("Saved by Revit N but keeps Revit M's schema ..."), and release_support follows the release the file is read as, so a 2025 save with a 2022 schema is reported as 2022's experimental support, not 2025's.
  • Added: elem_table::layout, and a warning when Global/ElemTable falls back to the implicit layout. Both record readers drop records whose ElementId is not declared there, so a file on the fallback still reads none; the field report saw that on 5 of its 8 files with a 2022 or 2023 schema, so this PR alone likely leaves those 5 empty.
  • Added: probe_421_schema_marker prints elem_table (stated count, layout taken, and for 28 and 40 bytes the rising ids, the first drop and whether the count fits): counts and indices only, for the reporter to post.
  • Measured on CI: Measure run 40928760469 (the original head, samples=true, probe_421_schema_marker, base main): schema_release == release and layout == release on all 58 Autodesk sample projects of 2015 to 2027, with 13 distinct markers (2022 29 01 ff ff ff ff 48 05, 2023 3c 01 ff ff ff ff 82 05, which are the field report's two unknown markers); all 58 sample exports and Core Interior byte-identical to main. Not measured on any affected file: none is in any corpus.

Audit-honesty checklist

  • README / docs reflect the current state after this PR — no claims of features that are not actually shipped in this PR
    • docs/compatibility.md says the change is unmeasured here, and that the counts are the field report's.
  • A user-visible change has its entry as a fragment under changelog.d/<section>/ (see changelog.d/README.md), not in CHANGELOG.md
    • changelog.d/fixed/schema-marker-release.md; tools/release/changelog.py check passes.
  • If a limitation was resolved, the "Known limitations" / "What works today" section in the relevant docs is updated
  • If a new limitation was introduced, it is documented in the PR body and in-code
    • The routing is shown only on files whose schema is their own release's. A schema of a release before 2015 matches nothing and keeps the saving release.
  • Commit messages describe WHAT changed and WHY, not "fix things" or "updates"
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files
  • If this is a reverse-engineering finding: a reproducible probe under examples/ and a dated addendum to docs/rvt-moat-break-reconnaissance.md are included
    • N/A: no new layout is measured. probe_421_schema_marker gains the two fields the reporter can run.

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0 (see CONTRIBUTING.md)
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see CLEANROOM.md)
  • Any new test fixtures use synthetic values (testuser, 111111, FY-20XX, etc.) and contain no real-world PII
    • N/A: no fixtures are added.

Breaking changes

None. RevitFile::layout_release, schema_release and file_schema_tags are added; no signature changes. On a file whose schema is its own release's, every reader gets the release it got before.

Screenshots or output samples

probe_421_schema_marker rac_basic_sample_project.rvt "Snowdon Towers Sample Architectural.rvt"
{"file":"rac_basic_sample_project.rvt","release":2022,"schema":"29 01 ff ff ff ff 48 05","constant":null,"header_tag":1340,"prologue":1340,"scanned":null,"schema_release":2022,"layout":2022}
{"file":"Snowdon Towers Sample Architectural.rvt","release":2025,"schema":"59 01 ff ff ff ff d3 05","constant":"59 01 ff ff ff ff d3 05","header_tag":1479,"prologue":1479,"scanned":"59 01 ff ff ff ff d3 05","schema_release":2025,"layout":2025}

A file of the kind reported would show, for example, "release":2026,"schema":"46 01 ff ff ff ff ab 05",…,"scanned":"46 01 ff ff ff ff ab 05","schema_release":2024,"layout":2024, where main gives "scanned":null.

Related issues

Refs #421 (item 1 and the field report on file_bbox_marker's fail-closed rule).

puzzbobb and others added 2 commits October 29, 2026 15:42
…t release (DrunkOnJava#421)

A project saved by Revit 2024 to 2027 can carry the schema of a release
it passed through. Its element-record marker is then that release's, so
file_bbox_marker, which refuses a schema marker that differs from the
saving release's constant, read nothing. In a field report on DrunkOnJava#421, 25
of 49 project files saved by 2024 to 2027 carried the marker of 2022,
2023, 2024 or 2025 and read as zero elements and zero Levels; the 17
with a 2024 or 2025 marker read once every reader took that release.

schema_release names the release the file's schema belongs to: the 2024
to 2027 release whose bbox_marker the schema gives, or the 2015 to 2023
release whose schema_tags it has (file_schema_tags reads the file's
own). RevitFile::layout_release takes it when it is older than the
saving release, and otherwise the saving release. The partition readers
and the exporter's scans take layout_release instead of BasicFileInfo's
version, so such a file is read with its schema's marker, tags,
envelope and Level layout. 2022 and 2023 schemas go to the 32-bit
reader. A schema that matches no measured release still reads nothing.
Metadata, reports, the doctor and the door GlobalId suffix keep the
saving release.

probe_421_schema_marker prints schema_release and layout per file.

On the 120 local files of 2015 to 2027 the schema's release is the
saving release, and all 132 local files export byte-identically against
main.
…lemTable fits no layout (DrunkOnJava#421)

The diagnostics now warn when RevitFile::layout_release differs from the
saving release, and take the release-support status of the release the
file is read as. A Global/ElemTable on the implicit fallback layout leaves
every element record undeclared, which the field report saw on 5 of its 8
files with a 2022 or 2023 schema; that is now a warning too, through
elem_table::layout. probe_421_schema_marker prints the table's stated count,
the layout taken and, for 28 and 40 bytes, the rising ids and the first
drop: counts and indices only, for a reporter to post.
@DrunkOnJava
DrunkOnJava force-pushed the feat/schema-marker-release branch from 7b47429 to 17c0ffe Compare October 29, 2026 19:43
@DrunkOnJava

Copy link
Copy Markdown
Owner

Thanks, puzzbobb. Reviewed and integrated; I rebased the branch on main (after #1083) and added one commit on top, described under "Maintainer integration" in the description. In short:

  • Your 2022 and 2023 markers check out on CI: Measure run 40928760469 ran your probe at your head on all 58 of Autodesk's sample projects of 2015 to 2027. Each release has one distinct marker, 2023's is 3c 01 ff ff ff ff 82 05 and 2022's 29 01 ff ff ff ff 48 05, schema_release and layout equal the saving release on every file, and all 58 sample exports and Core Interior are byte-identical to main.
  • The diagnostics now say when a file is read as another release than the one that saved it, and report the support status of the release it is read as.
  • The field report says 5 of its 8 files with a 2022 or 2023 schema fall back to the 12-byte ElemTable layout. Both record readers drop records whose ElementId is not declared there, so those 5 will likely still read nothing with this PR. The diagnostics now warn about that fallback, and probe_421_schema_marker prints the table's fit (counts and indices only), so the reporter can show us why it does not fit.

Measure run 40942773596 checks the rebased head against main on every model and sample.

DrunkOnJava added a commit that referenced this pull request Oct 29, 2026
…in's own code (#1084)

## Summary

Measure saves its shared rust cache (key `measure`, restored by every
later Measure run) only when it measured main's own code: the head job
when `ref` is empty, the base job when `base` is empty or `main`, the
timing job when both hold.

## Motivation

Measuring an outside contributor's pull request is done by dispatching
Measure from main with `-f ref=refs/pull/N/head`. `save-if: github.ref
== 'refs/heads/main'` was true for those runs, so on a cache miss the
contributor's build scripts would have run with the ability to write a
cache later main runs restore. Checked on 2026-10-29: Measure has
`contents: read`, no secrets, `persist-credentials: false`; no cache was
saved by the runs on #1081 and #1074, and the two existing measure
caches were deleted. This closes the remaining channel.

## Changes

- `.github/workflows/measure.yml`: both `Swatinem/rust-cache` steps'
`save-if`.

## Testing

Unit tests are banned in this repository: do not add them.

- [x] The workflow parses (YAML load); CI's workflow lint runs on this
PR. A Measure dispatch from main with no `ref` still restores and saves;
one with `ref` set restores only.
- [ ] Verified on real Revit files: N/A, CI-only.

## Audit-honesty checklist

- [x] No user-visible change, so no changelog fragment.
- [x] No emojis, private paths or internal jargon.

## Legal and contribution hygiene

- [x] Apache-2.0; no Autodesk material.

## Breaking changes

None.

## Related issues

None.
@DrunkOnJava

Copy link
Copy Markdown
Owner

Measure run 40942773596 (17c0ffe against main c2bb334, every model and scorer, including the 58 Autodesk sample projects 2015 to 2027): 89 of 89 IFC exports byte-identical, and no model's diagnostics or rvt-info output changed. That is the expected result: on every measured file the schema release equals the saved release and the ElemTable fits its release's layout, so the new warnings and the layout-based support label only apply to files like the ones reported on #421. Arming this to land; thank you, @puzzbobb.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 29, 2026 20:20
@DrunkOnJava
DrunkOnJava merged commit d165dfc into DrunkOnJava:main Oct 29, 2026
28 checks passed
@DrunkOnJava DrunkOnJava mentioned this pull request Oct 30, 2026
4 tasks done
DrunkOnJava added a commit that referenced this pull request Oct 30, 2026
## Summary

Release metadata for v0.11.0 (RELEASE.md steps 4 to 7). Merging this is
not the release: the signed `v0.11.0` tag on its squash commit is.

## Motivation

`main` holds user-facing fixes that installed users do not have yet,
above all #1075 (a model over the reader's limits exported empty with
exit status 0; the reporter can verify only from a release) and #421
(files that kept an older schema read as zero elements). It also holds
the breaking removal of unused stable API (#1128), which makes this a
minor release.

## Changes

- Version 0.11.0 in `Cargo.toml`, `rvt-py/Cargo.toml` (and its `=0.11.0`
pin), `rvt-wasm/Cargo.toml`, `tools/stream_evidence/Cargo.toml`,
`viewer/package.json`, `CITATION.cff` (dated 2026-10-30), both
lockfiles' workspace entries, and the `FILE_NAME` / `IFCAPPLICATION`
lines of the two synthetic IFC fixtures, which the contract checks
compare byte for byte since #1133. RELEASE.md's version list now names
those fixtures.
- `CHANGELOG.md`: `changelog.py assemble` moved the 33 fragments into
`[0.11.0] — 2026-10-30`, with an introduction, credits (puzzbobb: #1074,
#1076, #1077, #1081; n3ur0m4n: #1073) and "Upgrading from 0.10" (removed
API, exit status 3 for a model over the limits, saved meshes on by
default, properties no longer written, `Flagged` schema fields, the
probes crate).
- `README.md`: "Release 0.11.0 and main", and the reconnaissance probes
point at `probes/examples/` (#1132).
- `rvt-py/README.md` (packed into the wheel): what `write_ifc()` does
when part of a file was over the limits.

## Testing

CI is the gate. After this PR's CI, both Core Interior `rvt-rs.json`
witness observations and their verdicts are refreshed from its
`octetproof-core-interior` artifact (only `witness_version` and the
verdict hashes may differ); the PR stays unarmed until then.

## Audit-honesty checklist

- [x] The changelog section and README release section state only what
the entries measured
- [x] No emojis, private paths or internal jargon

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary content

## Breaking changes

The release carries #1128's removal of unused public API; "Upgrading
from 0.10" lists what a user changes.
DrunkOnJava added a commit that referenced this pull request Oct 30, 2026
…eporter's files (#1147)

## Summary

The 0.11.0 release introduction, the README's release section, the
status page and the roadmap stated the #421 and #1075 fixes without the
caveat their own changelog entries carry: neither is measured yet on the
files that showed the problem, which are private. Each now says what was
measured.

## Motivation

A side agent flagged it after the release. The entries themselves are
accurate. #1081's entry says "Not yet measured on an affected file", and
#1075's says "Not measured on the reporter's files, which are private".
The summaries written for the release dropped those words.

## Changes

- `CHANGELOG.md`: the [0.11.0] introduction now says the following, with
the paragraph rewrapped.
- #1075 is measured by lowering the limits below the reference files'
streams (Core Interior's 17 MB partition against an 8 MiB limit,
`tests/resource_limits_cli.rs`), and no model over the default limits
has been read with `--large-model`.
- #421 is measured only on the reference and sample files, none of which
keeps an older schema.
- `README.md`: the same caveat on both bullets of "Release 0.11.0 and
main". The README packed into the 0.11.0 crate on crates.io cannot be
edited; this fixes the repository copy, and the next release ships it.
- `docs/status.md`, `ROADMAP.md`: the same in their 0.11.0 lines.

The GitHub release page for v0.11.0 is updated from this section once it
lands. I am also asking the reporter, hemanth1986, on #421 and #1075 to
try 0.11.0 on the affected files and report counts only.

## Testing

N/A: docs only. The evidence named is in `tests/resource_limits_cli.rs`
and in Measure run 40928760469 (#1081's 58 sample projects).

## Audit-honesty checklist

- [x] Docs state only what was measured
- [x] No changelog fragment: this corrects a released section
- [x] No emojis, private paths or internal jargon

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary content

## Breaking changes

None.
@puzzbobb
puzzbobb deleted the feat/schema-marker-release branch November 4, 2026 17:28
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.

2 participants