Skip to content

RE: Reproduce checksum-paged stream decompression and silent corruption #151

Closed

Description

@DrunkOnJava

Provenance and credit

This issue records a finding reported by @STE1200 and their team in Discussion #112, “Set of findings”. Thank you to Steffen and the team for sharing the result, its reported validation oracles, and the clean-room provenance publicly.

The technical statements below are reported claims, not yet independently reproduced by rvt-rs. Per the maintainer reply in the discussion, Griffin will carry the repository-side probes, tests, implementation, and documentation; this issue does not assign formal preparation work to Steffen's team.

Reported finding

Revit streams are reportedly checksum-paged before standard RFC 1951 inflation. Each full 65,249-byte stored page is reported to contain:

  • 64,896 bytes of compressed payload
  • a 353-byte checksum tail that must be removed before inflation

Without removing those tails, inflation reportedly terminates cleanly rather than surfacing an error, but the decoded output drifts after the first page boundary. On the team's sample, Formats/Latest reportedly lost about 48% of its schema. The report states that streams larger than roughly 190 KB are affected.

Reported evidence

  • Gzip member trailers reportedly validated for 209/209 members across two files.
  • The page dimensions are reportedly consistent with constants used by ahzs645/reviter.
  • A Formats/Latest comparison reportedly showed the silent schema loss after the first page boundary.

These observations came from the reporter's Revit 2014 manufacturer family and Revit 2026 project investigations. The exact fixtures, probe output, and page-by-page comparison have not yet been reproduced in this repository.

Why it matters

Silent success with incomplete or shifted output is more dangerous than a clear parse failure: callers can mistake corrupted decoded data for a valid model. If confirmed, this affects the trust boundary of every higher layer that consumes sufficiently large streams, including schema parsing and downstream element decoding.

Independent verification still required

  • Reproduce the stored-page layout on provenance-safe test inputs available to the maintainer.
  • Confirm the exact first divergence and whether the reported roughly 190 KB threshold is invariant or sample-dependent.
  • Validate the reported gzip-trailer oracle and compare current output with output after page-tail stripping.
  • Determine whether partial final pages use the same layout and define fail-closed behavior for malformed/truncated tails.
  • Confirm the relevant read and write paths before changing container framing.

An observation that full pages do not follow the reported 64,896 + 353 layout, or that tail stripping does not restore a stable RFC 1951 stream, would falsify or narrow the hypothesis.

Repository-side acceptance criteria

  • Add a self-contained probe that reports stored-page boundaries, tail handling, decoded length, and a stable content oracle on an allowed fixture.
  • Reproduce or refute the reported layout across at least two independently sourced files and document version/file-type coverage.
  • Add a synthetic regression fixture that crosses at least one full stored-page boundary without embedding private or non-redistributable data.
  • If confirmed, strip/check tails before inflation and return an explicit error for malformed paging rather than silently accepting corrupted output.
  • Pin a regression test that would fail on cleanly terminating but incomplete output.
  • Verify any affected writer round trip, as required by CONTRIBUTING.md for truncated-gzip framing changes.
  • Add a dated, confidence-scored evidence table to the reconnaissance documentation and update public capability/status text.

The probe, dated addendum, byte-pattern regression, provenance, and falsifiability requirements should follow the repository's reverse-engineering contribution guidance.

Activity

  1. added
    needs-triage
    re-finding
    area:reader
    priority:P0
    type:research
    on Aug 29, 2026
  2. DrunkOnJava commented on Aug 29, 2026

    @DrunkOnJava
    OwnerAuthor

    Optional decompression PR (Finding 1 / @STE1200)

    Steffen’s optional container-layer PR for checksum-page stripping remains welcome. Maintainers will not duplicate or overwrite a contributed implementation if a PR is opened.

    Please comment here (or on Discussion #112) before starting so we can avoid colliding with any in-flight maintainer probes or Finding 1 work. Repository-side reproduction on #151 continues either way — your PR is optional, not required.

    (Coordination note: automation could not post to Discussion #112 from the GitHub App token; this issue comment is the durable record.)

  3. DrunkOnJava commented on Aug 29, 2026

    @DrunkOnJava
    OwnerAuthor

    Discussion #112 issue index + coordination fallback

    Automatic backlinks from #151–#156 to Discussion #112 exist in issue bodies, but the discussion page does not show a compact index. Agents also cannot post discussion comments with the current GitHub App token.

    Issue Title
    #151 RE: Reproduce checksum-paged stream decompression and silent corruption
    #152 RE: Validate Global/ElemTable body as a versioned ownership tree
    #153 RE: Validate ElementHeader framing for ElementId and class-tag recovery
    #154 RE: Reproduce complete Formats/Latest parsing and serialization-tag assignment
    #155 RE: Decode parameter-store wire formats and exact Revit unit encodings
    #156 RE: Reproduce sketch-to-solid geometry reconstruction pipeline

    Durable copy (including maintainer notification how-to and product-Q&A status): docs/disc-112-coordination.md — please mirror into Discussion #112 when a human maintainer can post.

    Product issues: none opened yet; waiting on Steffen’s answers to Griffin’s product questions (no open-ended promises).

  4. DrunkOnJava commented on Aug 29, 2026

    @DrunkOnJava
    OwnerAuthor

    Wave 1 Worker C — independent investigation (probe only; not fixed)

    Credit: @STE1200 / Discussion #112.

    Branch: cursor/wave1-decompress-investigate-67f9 (docs + probes + synthetic tests only — no production inflate wiring).

    Reported vs independently reproduced

    Claim Reported Independently reproduced on redistributable corpus?
    Stored page 65,249 = 64,896 + 353 Yes Yes (aligned with ahzs645/reviter; helpers already on main)
    Strip tails before inflate Yes Yes on large multi-member Partitions/*
    Silent clean terminate + drift Yes Yes on synthetic inject fixtures; partitions show members that fail under control and succeed after strip
    Formats/Latest ~48% schema loss Yes (reporter sample) Not reproduced — structured SchemaTable class/field counts stay flat (e.g. Core Interior 395/1114 both ways)
    ≳~190 KB affected Yes Narrowed — tracks full-page / multi-member desync more than a single size cliff
    209/209 gzip trailer oracle Yes Not re-run (reporter fixtures/method not in-repo)

    Strongest local oracle

    2024_Core_Interior.rvt Partitions/46 (261 full pages):

    • control inflate_all_chunks: 925 ok / 97,957,200 bytes
    • after strip_revit_page_checksums: 935 ok / 98,772,093 bytes (+10 members, +~0.8 MiB)

    Similar ok-count gains on Partitions/53 and /61 under a magic-scan fail→0 oracle.

    Formats/Latest inflate length alone is a weak oracle (strip slightly shortens output while schema classes/fields hold).

    Deliverables

    • Probe: examples/probe_checksum_page_evidence.rs
    • Synthetic multipage fixtures: tests/checksum_page_framing.rs (6/6 green)
    • Wave 2 framing contract draft: docs/re/wave1-checksum-paged-framing-contract-2026-08-29.md
    • Write-up: reports/security/DISC-112-wave1-worker-c-2026-08-29.md

    Confidence

    • High that checksum paging is real and strip-before-inflate is required for large paged partitions; main callers still use bare inflate.
    • Low that the reporter’s Formats ~48% figure applies to our redistributable samples.
    • Not claiming fixed — Wave 2 should wire prepare_stream_for_inflate (or equivalent) at named-stream entry points per the contract draft.

    Note: another agent may be working Finding 1 production wiring on a separate branch; this investigation deliberately stayed on a clean origin/main worktree.

  5. DrunkOnJava commented on Aug 29, 2026

    @DrunkOnJava
    OwnerAuthor

    Independent Wave 1 judge verdict: narrow

    Credit: @STE1200 / Discussion #112.

    Judge baseline: clean origin/main @ 9f5787c (harness #158 merged). Synthetic tests from draft #159 run tools-only. Uncommitted Finding-1 production WIP on the dirty workspace tree was not used.

    Full write-up: /opt/cursor/artifacts/wave1_judge_finding1/VERDICT.md (Cloud Agent artifact).

    Checks (summary)

    # Question Finding
    1 Oracle correctness vs “more chunks”? Synthetic inject/strip proves payload round-trip correctness. Corpus partition oracles prove member recovery (more ok / fail→0 / more bytes), not known-good content. Magic-scan fail counts are oracle-sensitive (Worker C matrix ≠ judge re-run; inflate_all_chunks 925→935 on Partitions/46 does reproduce).
    2 Would regressions fail under bare inflate? Yes — synthetic_multipage_bare_inflate_does_not_round_trip pins bare ≠ payload and strip == payload (6/6 green on clean main).
    3 Coverage vs 2014/2026 claim? Measured on redistributable 2022–2024 (magnetar Core Interior / Einhoven, empty.rfa) + synthetics. Not Steffen 2014 family / 2026 project; 209/209 trailer oracle not re-run. ~190 KB is not a hard cliff.
    4 Private corpus leakage? None observed in Wave 1 public artifacts.
    5 Easier nearby problem? Workers correctly did not claim Formats ~48% on this corpus; partition focus is legitimate but chunk-Δ alone is not content proof.
    6 Naive-strip counterexamples? Confirmed: Formats class_names drop (Core Interior 9579→8575; Einhoven 10495→8474; empty.rfa 7622→6952) while SchemaTable stays flat; inflate length falls after strip.

    Judge re-run highlights

    • Synthetic: bare inflate can succeed with drift; strip restores exact payload.
    • 2024_Core_Interior.rvt Partitions/46: inflate_all_chunks 925 → 935 (+814 893 bytes).
    • Same file Formats/Latest: SchemaTable 395/1114 both ways; class_names 9579→8575.

    Scoped contract (Wave 2 may start)

    CFB stored (never strip in read_stream)
      → [gated is_checksum_paged_stream] strip full-page 353-byte tails (65_249 = 64_896 + 353)
      → optional fixed header
      → truncated-gzip → DEFLATE
    

    Allowed for Wave 2: named-stream wrappers only; writer stays stored-accurate until a paged encoder exists; synthetic + partition member oracles + Formats SchemaTable non-regression.

    Not allowed / not claimed: strip inside raw inflate_at; Formats ~48% recovery; closing 2014/2026 endpoint coverage without fixtures; using class_names / inflate-length as success metrics.

    Wave 2 production implementation may start under this narrowed contract.

  6. 5 remaining items

  7. added 2 commits that reference this issue on Aug 29, 2026
  8. DrunkOnJava commented on Aug 29, 2026

    @DrunkOnJava
    OwnerAuthor

    Finding 1 progress update (credited)

    Credit: @STE1200 and team — Discussion #112.

    Status keys: reported (Steffen) · independently reproduced (maintainers on redistributable corpus) · merged (on main).

    Item Status
    Paging layout 65,249 = 64,896 + 353 Independently reproduced
    Gated strip-before-inflate on Partitions/* and Global/* Merged — #160, narrowed by #162 / #161 / #163
    Formats/Latest strip Excluded from the production gate (class_names regression 9579→8575 on Core Interior). Reported Formats ~48% schema loss was not reproduced on the redistributable corpus (structured class/field counts hold)
    Writer / read_stream Stay stored-byte accurate; no paged encoder yet
    Stream-evidence harness Merged on main — #158
    Evidence matrix docs/recon/wave2-checksum-page-evidence-matrix-2026-08-29.md (+ Cloud Agent artifacts). Strongest oracle: Partitions/46 chunks 925→935
    Findings #152–#156 Still open / awaiting independent reproduction — no Finding 2–6 implementation in this update

    Optional decompression PR from Steffen remains welcome for review against the narrow gate (Partitions/Global only; Formats/Latest excluded).


    Discussion #112: could not post a discussion comment (Resource not accessible by integration). Same update mirrored in docs/disc-112-coordination.md — please paste into Discussion #112 when a human maintainer can post.

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

    area:readerneeds-triagepriority:P0re-findingtype:research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions