Skip to content

Prefer the stored schema release over the saving year - #247

Merged
mahach666 merged 1 commit into
IOExtend:mainfrom
tsaregorlionheart:codex/fix-schema-release-layout
Nov 16, 2026
Merged

mahach666 merged 1 commit into
IOExtend:mainfrom
tsaregorlionheart:codex/fix-schema-release-layout

Conversation

@tsaregorlionheart

Copy link
Copy Markdown
Contributor

Fixes #31.

An older year parsed from BasicFileInfo currently overrides a recognized newer schema release. That makes the declared element rows and ID widths fail the release checks and can leave an otherwise readable element table empty.

Prefer the recognized stored schema release for all existing layout decisions. Use the saving year only when the schema release is unknown. This resolves the policy question in the issue in favor of the schema in either direction; it deliberately replaces the earlier minimum-of-two rule. Declared-width consistency checks and conflicting schema-evidence handling remain in place. Diagnostics now name the actual selected layout for the reverse mismatch too.

Coverage:

  • Synthetic compound files exercise both schema views, element-table decoding, record ID widths and routing. Cases cover both mismatch directions, matching years, missing/unknown release evidence and contradictory declared widths.
  • Full reads of Autodesk's public 2022 structural basic sample and 2024 Snowdon Towers Site sample are compared with copies where only the labelled Format year changes. Model serialization, deterministic IFC and compact JSON with properties match after normalizing only the deliberately changed Metadata.RevitVersion field. The 2024 case runs with both the native schema reader and R22Layout geometry decoding.
  • Public fixture URLs, SHA-256 hashes and opt-in test instructions are recorded in tests/RvtIO.Tests/Fixtures/README.md. No Revit models or vendor binaries are included.

Validation:

  • dotnet restore RvtIO.slnx --source https://api.nuget.org/v3/index.json
  • dotnet build RvtIO.slnx -c Release --no-restore: succeeds.
  • dotnet pack RvtIO.slnx -c Release --no-build --no-restore: succeeds.
  • dotnet test tests/RvtIO.Tests/RvtIO.Tests.csproj -c Release --no-build --no-restore: net8.0: 10,812 passed; net10.0: 10,816 passed; 443 skipped and 0 failed per target, with both public fixture variables set.
  • The eight synthetic positive cases were also run against the pre-change library from 5868285: the three older-saving-year cases fail, confirming the regression.
  • git diff --check: clean.

Private fixtures/external corpora were unavailable; the three new public-sample regression cases ran and passed on both targets. Build/pack retain existing nullable/analyzer and System.IO.Hashing net8.0 support warnings; the changed files introduce no compiler warnings.

Matching-release export comparison against 5868285, using the same CLI options (--ifc, --compact-json, --ifc-timestamp 2026-11-16T00:00:00Z):

Public sample IFC Compact JSON
Revit 2022 structural basic byte-identical (5,097,562 bytes) byte-identical (4,408,126 bytes)
Revit 2024 Snowdon Towers Site byte-identical (6,204,871 bytes) byte-identical (3,289,090 bytes)

The intentionally patched year is a regression input, not a claim that Revit writes files with an older saving release than their schema. The change protects decoding from an unreliable text year while preserving the saved year in the returned metadata.

@mahach666
mahach666 merged commit 872509b into IOExtend:main Nov 16, 2026
5 checks passed
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.

Select the file layout from the schema release stored in the file

2 participants