Skip to content

fix(native_document): an element whose route holds none of its records takes its latest copy (#548) - #565

Merged
DrunkOnJava merged 2 commits into
mainfrom
fix/b04-current-record-fallback
Oct 3, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
fix/b04-current-record-fallback

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

native_document::extract emits an element's record only from the partition its stored revision routes to (native_index::route_episode). Records in other partitions are skipped as historical.

RE-145 (probe examples/probe_re145_current_copy_routing.rs, Measure run 37117317288) found partitions that hold none of the routed elements' records:

  • Einhoven: 6 elements route to Partitions/1.
  • Core Interior: 10 elements route to Partitions/48.

So the native path emitted 2,609 of Einhoven's 2,615 elements and 26,415 of Core Interior's 26,425, although every declared element on both files has a record.

Fix. A first pass records which partitions hold each selected element's records, per channel. When the routed partition holds none, the current record is the copy in the latest partition that holds one. That is the copy the route itself picks wherever it finds one: 569 of 571 differing pairs on Core Interior, 887 of 887 on the 2021 rac_advanced sample. The new summary field current_records_outside_route counts them.

The commits are separate:

  1. test(native_document) adds the real-file target tests/native_current_records.rs. Its red run on main (draft PR red run: native_current_records (B04, do not merge) #564, corpus tier 2) is in the commit message: Revit_IFC5_Einhoven.rvt: 6 declared elements have no emitted record: [2846, 5973, 5974, 5976, 5978, 5979].
  2. The fix and its changelog entry.

The target reads the project corpus, so it runs in Corpus health (tier 2 — external), which is not a required check. I will read that job before arming.


Note

Medium Risk
Changes which native partition record is chosen for a subset of elements, affecting downstream consumers of native_document::extract output.

Overview
native_document::extract no longer drops elements whose stored revision routes to a partition that holds none of their records. A pre-pass builds per-channel, per-element partition holders; emission still treats other partitions as historical, but when the routed partition is empty for that element, the current copy is taken from the latest partition that actually holds a record (RE-145, #548).

Record parsing inside partition walks is refactored into shared group_records, and Summary gains current_records_outside_route to count fallback emissions. CHANGELOG documents the behavior; tests/native_current_records.rs asserts every declared element on Einhoven and Core Interior gets an emitted channel-101 record when the project corpus is present, and CI registers the new real-file target.

Reviewed by Cursor Bugbot for commit 0c63572. Configure here.

Measured

  • Corpus health (tier 2 — external) on this PR: tests/native_current_records.rs passes on Einhoven and Core Interior.
  • Measure run 37117901879 compared head against main with the samples: all 6 model IFCs are byte-identical, and every scorer, rvt-info and diagnostics.json output is identical on all 6 models and 36 samples. The exporter does not read these records, so nothing it writes changes.

…emitted (#548)

A real-file target: native_document::extract over channel 101 on
Einhoven and Core Interior, where every declared element has a channel-101
record (RE-145), emits one record per declared element and reports no
selected element without one.

Red on main (5131dc7), draft PR #564, Corpus health (tier 2 - external):

  thread 'every_declared_element_has_its_current_record_emitted' panicked
  at tests/native_current_records.rs:48:9:
  Revit_IFC5_Einhoven.rvt: 6 declared elements have no emitted record:
  [2846, 5973, 5974, 5976, 5978, 5979]
  test result: FAILED. 0 passed; 1 failed

The expected reason: those are the six elements RE-145 found routed to
Partitions/1, which holds none of their records (stored revision 1).
Core Interior's ten (routed to Partitions/48) are not reached, since the
first file fails.
…s takes its latest copy (#548)

native_document::extract emits a record only from the partition its
element's stored revision routes to (native_index::route_episode). On
Einhoven 6 elements route to Partitions/1 and on Core Interior 10 to
Partitions/48, and those partitions hold none of their records, so they
were skipped as historical and emitted nowhere (RE-145, Measure run
37117317288).

A first pass now records which partitions hold each selected element's
records per channel; when the routed partition holds none, the current
record is the copy in the latest partition that holds one. That is the
copy the route picks wherever it finds one (RE-145: 569 of 571 differing
pairs on Core Interior, 887 of 887 on the 2021 rac_advanced sample). The
summary counts these in current_records_outside_route. The group record
split moves into group_records, shared by both passes, unchanged.

Decided here: the fallback takes the latest partition rather than refusing
the element, since the measured route agrees with the latest copy, and
the cost is a second walk of the partitions.
@DrunkOnJava
DrunkOnJava merged commit 7e0b22c into main Oct 3, 2026
28 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/b04-current-record-fallback branch October 3, 2026 10:59
DrunkOnJava added a commit that referenced this pull request Oct 3, 2026
…d can land on an empty partition (#548) (#569)

This answers #548, which copy of an element's record is current, for
every file measured (Measure runs 37116666890 and 37117317288).

- Where copies differ, `native_index::route_episode` takes the latest
partition's copy on 1,518 of 1,522 differing ids. On 2021 `rac_advanced`
that is 887 of 887, as puzzbobb and RE-143 found.
- The route also sends 6 elements of Einhoven and 10 of Core Interior to
partitions that hold none of their records. #565 (B04) fixed that: such
an element now takes its latest holding partition's copy.

New: the probe `examples/probe_re145_current_copy_routing.rs` and the
report `reports/element-framing/RE-145-current-copy-routing.md`.

Open: why the route lands on an empty partition.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Research-only: new probe example, report, and changelog; no production
extraction or routing code changes in this diff.
> 
> **Overview**
> Documents **RE-145** research for #548: how
`native_index::route_episode` chooses which partition’s channel-101
record counts as “current” when an element appears in multiple
partitions.
> 
> Adds **`examples/probe_re145_current_copy_routing.rs`**, which walks
partition streams, compares routed partitions to where records live, and
(on admitted Revit versions) cross-checks **`native_document::extract`**
skip/emit counts. Adds
**`reports/element-framing/RE-145-current-copy-routing.md`** with
Measure-run tables across Core Interior, Einhoven, RE1 models, and
Autodesk samples.
> 
> **Findings recorded in CHANGELOG:** for differing copies, routing
picks the **latest partition’s** copy on **1,518 / 1,522** ids
(including 887/887 on 2021 `rac_advanced`); a smaller set routes to
partitions with **no** copy for that element (16 on Einhoven/Core
Interior in the report), which the changelog notes was addressed
separately in **#565**.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9189130. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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