Skip to content

elem_table_corpus: 2024 project parse_records returns 26424, header declares 26425 (never exercised in CI) #206

Closed

Description

@DrunkOnJava

Found while running the full suite locally with RVT_PROJECT_CORPUS_DIR set, as part of PR #205. Pre-existing, not introduced by that PR — it touches no src/ file and no line of this test.

---- project_2024_file_parses_all_declared_records stdout ----
thread ... panicked at tests/elem_table_corpus.rs:98:5:
assertion `left == right` failed: parse_records should return exactly header.record_count on 2024 project files
  left: 26424
 right: 26425

Reproduce:

RVT_PROJECT_CORPUS_DIR=<magnetar>/Revit cargo test --release --test elem_table_corpus

on 2024_Core_Interior.rvt (sha256 c805df445d613b408e37337765572021265e3f5dfdc7d1fa53b22ba1600b8014). The other three tests in the file pass, including the 2023 project equivalent, so this is specific to the 40-byte 2024 ElemTable layout — a single record short, likely a terminating-record or stride edge case at the tail rather than a wholesale framing error.

The reason nobody noticed: no CI job runs this test with a corpus. corpus-tier2 and writer-patch-corpus set RVT_PROJECT_CORPUS_DIR, but they name specific test targets (corpus_tier2_health, project_corpus_smoke, project_count_fixtures, cfb_roundtrip_delta). The matrix cargo test jobs run every target but without the env var, so elem_table_corpus takes its if !p.exists() { return; } skip path on every run. The test is effectively dead in CI.

Two things worth doing:

  1. Fix the off-by-one (or, if 26424 is provably the honest count, correct the assertion and say why the header over-declares — but not without evidence).
  2. Add elem_table_corpus to the corpus-tier2 job so the gap cannot reopen silently. Note that doing so will make CI red until (1) lands, which is the correct order.

Related: #153 (RE: Validate ElementHeader framing for ElementId and class-tag recovery) covers the framing this test guards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions