Skip to content

feat(diagnostics): say when most of a file's element records could not be attributed - #293

Merged
DrunkOnJava merged 3 commits into
mainfrom
feat/unattributed-element-frames
Sep 22, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
feat/unattributed-element-frames

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

When most of a file's element records can't be attributed to an ElementId, the export now says so: a per-class skipped count, plus a warning at the top of the list that the model is incomplete. Before this, a Snowdon Towers export carrying a few percent of the building looked like any other partial export.

Motivation

RE-30 (#290) measured that on Autodesk's Snowdon Towers 2024 samples, most wall, door, window, column, floor and room records use a second prologue with no ElementId at +0x00. The fail-closed decode rightly skips them. Nothing in the diagnostics told a user that the IFC they downloaded holds 6 walls of a 1,200-wall building.

Changes

  • partition_element_records::count_unattributed_frames (pure, over bytes) and scan_unattributed_frames (every partition, keyed by class):
    • One memmem pass over the bbox marker. It counts frames whose +0x12 category is one of the new RECOVERED_CATEGORIES and whose +0x00 is 0 or above u32::MAX.
    • Partitions are already inflated and memoised by then, so the cost is the search. Core Interior's full export takes 2.9 s.
  • Export diagnostics:
    • A skipped item element_record_without_element_id with per-class classes.
    • A warning inserted first, because the viewer's Warnings row shows only the first warning inline.
  • Fix: the "Suppressed N low-confidence schema scan candidates" warning read skipped[0]. Whenever below-confidence elements exist, that item is the below-confidence one, so the warning reported the wrong count. It now finds its own item.
  • tests/project_count_fixtures.rs: every manifest project must report no unattributed frames.
  • Docs: docs/export-diagnostics.md, the schema's reason description, CHANGELOG.

Testing

  • tools/check-local.sh with both corpora: fmt, clippy -D warnings, rustdoc -D warnings, full test suite (see below)
  • Unit test: an attributed wall is not counted; an all-FF wall and a 0x00000006_ffffffff door are, each under its own category; a category outside the set is not
  • Corpus-gated project_count_fixtures: Core Interior, Einhoven and tier-1 report none
  • Local-only measurement on the Snowdon samples:
file unattributed by class
2024_Core_Interior.rvt 0
Revit_IFC5_Einhoven.rvt 0
Snowdon architectural 2,043 Wall 1,216 · Door 245 · Floor 198 · Column 180 · Window 150 · Room 54
Snowdon structural 75 Wall 50 · Floor 24 · Window 1

rvt-inspect on the structural sample now opens its Warnings block with: "75 wall, door, window, column, floor or room record(s) in this file use an element-record layout whose ElementId this release cannot locate, so they are not exported and the model is incomplete (RE-30)."

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • If a limitation was resolved, the "Known limitations" / "What works today" section in the relevant docs is updated (N/A: this surfaces a limitation rather than resolving one)
  • New limitation documented: RE-30, now visible per file in the diagnostics
  • Commit messages describe WHAT changed and WHY
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files
  • N/A: builds on RE-30, adds no new reverse-engineering finding

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)
  • Test fixtures: synthetic records in the unit test; corpora are gated, not committed

Breaking changes

None. Diagnostics gain a skipped reason and, on affected files only, one warning.


Note

Low Risk
Additive export diagnostics and documentation; decode/export selection is unchanged aside from fixing which skipped item feeds the low-confidence schema warning.

Overview
Export diagnostics now flag incomplete models when most partition element records have no attributable ElementId (RE-30). A partition scan counts wall/door/window/column/floor/building-pad/room frames that look like element records (BuiltInCategory at +0x12, bbox marker at +0x50) but carry no valid id at +0x00, and surfaces them as a skipped entry with reason element_record_without_element_id and per-class counts. When that total is non-zero, a model is incomplete warning is inserted first in warnings so rvt-inspect, --diagnostics, and the viewer’s inline Warnings row show it prominently.

The implementation adds RECOVERED_CATEGORIES, count_unattributed_frames, and scan_unattributed_frames in partition_element_records, wired from IFC export diagnostics assembly in src/ifc/mod.rs.

Bug fix: the “Suppressed N low-confidence schema scan candidates” message no longer uses skipped[0]; it looks up the low_confidence_schema_scan_candidate item so unrelated skipped buckets (e.g. unattributed frames) do not skew the count.

Tests and docs: tests/project_count_fixtures.rs asserts manifest corpus projects report zero unattributed frames; CHANGELOG, README, docs/export-diagnostics.md, and the diagnostics JSON schema document the new reason.

Reviewed by Cursor Bugbot for commit 78858f2. Configure here.

…t be attributed

On Autodesk's Snowdon Towers 2024 samples most wall, door, window,
column, floor and room records use a prologue with no ElementId at +0x00
(RE-30). The fail-closed decode skips them, so the IFC carries a small
fraction of the building while the diagnostics looked like any other
partial export.

partition_element_records::count_unattributed_frames counts, in one
memmem pass over the bbox marker, frames whose category is one the
exporter recovers and whose +0x00 is not an ElementId. The export
diagnostics add them as a skipped item (reason
element_record_without_element_id, per-class counts) and put a warning
first in the list that the model is incomplete, since the viewer shows
only the first warning inline. Snowdon architectural: 2,043 (1,216 walls,
245 doors, 198 floors, 180 columns, 150 windows, 54 rooms); structural:
75; Core Interior and every project-count fixture: none, which
tests/project_count_fixtures.rs now asserts.

The "Suppressed N low-confidence schema scan candidates" warning read
skipped[0], which is the below-confidence item whenever one exists; it
now finds its own item.
…-30)

The What-does-not-work-yet row listed the Core Interior results without
saying they do not carry to Autodesk's Snowdon Towers 2024 samples, where
7 of 2,171 records in the recovered categories decode and the export
diagnostics now count the rest.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) September 22, 2026 20:31
@cursor

cursor Bot commented Sep 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_8aa2b7c5-3068-414e-9b79-1d33f72c0440)

@DrunkOnJava
DrunkOnJava merged commit 2b9b04b into main Sep 22, 2026
21 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/unattributed-element-frames branch September 22, 2026 20:36
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