Skip to content

RE: Which copy of an element's record is current when two partitions hold different ones (571 ids on Core Interior) #548

Closed

Description

@DrunkOnJava

RE-135 (PR #547) scanned every header record of every partition and found that some ElementIds open more than one record in a project's leading chain (RE-35):

file Revit ids that open two or more chain records
Core Interior 2024 1,444 (1,340 declared in Global/ElemTable)
RE1 Electrical 2025 109
Einhoven 2023 13
RE1 Architecture 2025 4
RE1 Mechanical 2025 32
RE1 Plumbing 2025 31

No id after the chain repeats, and none after the chain is also a chain id, so this is inside the project's own records. A standalone family has none.

RE-35 counted the declared ids that have a record in a chain; it did not count how many records each has. What the second record of an id is, which of the two a reader should take, and whether either is what the ElemTable's second id (RE-41) points at, are all unmeasured.

Where to start: extend examples/probe_re135_undeclared_records.rs to print, for each repeated chain id, both records' classes, categories, flags and sizes, and run it with the Measure workflow (-f probe=...) on Core Interior and RE1 Electrical. No export is known to be wrong because of this; the exports are scored against Revit's own in every Measure run.

Refs #152, Discussion #112.

Activity

  1. added
    area:elements
    area:partitions
    priority:P3
    type:research
    on Oct 1, 2026
  2. DrunkOnJava commented on Oct 1, 2026

    @DrunkOnJava
    OwnerAuthor

    Explained by RE-136 (#549, reports/element-framing/RE-136-older-releases-and-repeated-ids.md), measured on the runners (Measure run 36869273382).

    An id that opens more than one record in a project's leading chain has them in different partitions, never two in one stream (0 of 1,444 on Core Interior; none adjacent), and always with the same class. They are copies of one element's record held in several partitions. 873 of Core Interior's 1,444 are byte-identical and 571 differ (by class: SWall 236, FamilyInstance 184, RoomElem 111, Floor 12, LevelRoomPlan 9, VarSketch 9); the other models are the same shape (RE1 Electrical 109 ids, 80 identical; Mechanical 32, 22; Plumbing 31, 17; Einhoven 13, 8; Architecture 4, 1). None of the repeated ids is one the ElemTable writes only as a secondary id.

    No export value disagrees with Revit's because of it: Core Interior's export has Revit's GlobalId on all 854 elements and all 360 walls within 0.001 ft of Revit's faces and ends.

    What stays open, and why this issue stays open under a narrower title: which copy is the current one when two copies differ (571 on Core Interior), and what differs between them. It matters only if a differing copy carries a different box, type or placement from the record rvt-rs reads. A next probe would print, for each differing pair, the bytes that differ and the ElemTable's revision counters (RE-35 section 6) for the id, and score the walls of the pairs against Revit's export.

  3. changed the title [-]RE: ElementIds that open two records in a project's leading chain (1,444 on Core Interior)[/-] [+]RE: Which copy of an element's record is current when two partitions hold different ones (571 ids on Core Interior)[/+] on Oct 1, 2026
  4. puzzbobb commented on Oct 1, 2026

    @puzzbobb
    Contributor

    A likely answer from 26 files I have (2014 to 2027). I don't have Core Interior or RE1, so the probe below is for running on those with Measure.

    The repeats are a later partition re-writing records. An id opens a second chain record only in a file with more than one partition, and every second record is in the highest-numbered partition:

    file Revit partitions chain records ids repeated in the last partition byte-identical the rest
    rac_basic project 2019 8, 9 8,016 7,965 51 51 (all of Partitions/9) 50 1, 4 bytes longer
    rst_basic project 2019 15, 16 13,846 13,810 36 36 (all of Partitions/16) 35 1, 4 bytes longer
    Golden Nugget Architektur 2025 111, 112, 113 49,469 49,449 20 20 (all of Partitions/113) 19 1, same size
    Golden Nugget Gebäudetechnik 2025 141, 142, 143 42,203 41,559 644 644 (all of Partitions/143) 588 56, same size
    Revit2014.rvt 2014 0, 1 24,070 24,069 1 1 (of 2,036 in Partitions/1) 0 1, 16 bytes longer

    The other 21 files have none: 20 have one partition, and Snowdon Towers Architectural (2025) has three (122 to 124) and no repeats.

    The copies that differ look like an edit. On both 2019 files the second copy's reference list is one entry longer: the u32 count at +0x3a goes up by one (0x11 → 0x12, 0x15 → 0x16), an id is inserted into the list, and the record is 4 bytes bigger. On Golden Nugget Architektur a single flag byte changes (0x20 → 0x00 at +0x73). On Gebäudetechnik the 56 differ at the same handful of offsets (+0x142, +0x158, +0x16e in most).

    So the last partition reads as an incremental save: re-saved elements are written again to a new partition, and the earlier record stays. A reader would take the copy from the highest-numbered partition.

    Not settled:

    • That Revit takes the later copy. That needs a model with Revit's export where the two copies differ in something the export shows. None of these five has an export.
    • The second id (RE-41). On four files every repeated id's ElemTable record carries the same id twice. On Gebäudetechnik 95 of the 644 don't, so the two ids can still differ.
    • Why one partition is all repeats in four files but has 2,035 new records in the 2014 file.

    The chain here is RE-35's from 2024 on, and the 32-bit one from 2014 to 2023: [u32 id][u32 size][u16 ElementHeader tag][u16 count], then a 12-byte trailer whose last u32 repeats the size (see my #421 comment). The ElemTable is read from 0x06 (#152).

    Probe: examples/probe_548_repeated_chain_ids.rs (one JSON line per file)
    //! #548: ElementIds that open two records in a project's leading chain.
    //!
    //! FACTS, each checked here on every file given:
    //!
    //! 1. An id opens a second chain record only in a file with more than one
    //!    partition, and every such second record is in the highest-numbered
    //!    partition. In most such files that partition's chain holds nothing
    //!    else.
    //! 2. Most second records are byte-identical to the first; the rest differ
    //!    as an edit would (a longer reference list, a flag byte).
    //! 3. For each repeated id, whether its `Global/ElemTable` record carries
    //!    the same id twice (RE-41) is counted.
    //!
    //! The chain is RE-35's (2024 on) or the 32-bit one of 2014 to 2023
    //! (`[u32 id][u32 size][u16 ElementHeader tag][u16 count]`, a 12-byte trailer
    //! repeating the size). The table is read from `0x06` (#152).
    //!
    //! ```text
    //! cargo run --profile ci --example probe_548_repeated_chain_ids -- FILE.rvt ...
    //! ```
    
    use rvt::RevitFile;
    use rvt::compression::inflate_stream_at;
    use rvt::partition_element_records::partition_record_chain;
    use rvt::partition_element_records_2023::record_marker;
    use rvt::streams::GLOBAL_ELEM_TABLE;
    use std::collections::BTreeMap;
    
    fn u16_at(b: &[u8], at: usize) -> Option<u16> {
        b.get(at..at.checked_add(2)?)
            .map(|x| u16::from_le_bytes([x[0], x[1]]))
    }
    
    fn u32_at(b: &[u8], at: usize) -> Option<u32> {
        let x = b.get(at..at.checked_add(4)?)?;
        Some(u32::from_le_bytes([x[0], x[1], x[2], x[3]]))
    }
    
    /// The 32-bit chain from offset 0: `(id, start, end)` of each record.
    fn chain_32(b: &[u8], header_tag: u16) -> Vec<(u64, usize, usize)> {
        let mut out = Vec::new();
        let mut at = 0usize;
        while let (Some(id), Some(size)) = (u32_at(b, at), u32_at(b, at + 4)) {
            if u16_at(b, at + 8) != Some(header_tag) || size < 12 {
                break;
            }
            let end = at + size as usize;
            if u32_at(b, end + 8) != Some(size) {
                break;
            }
            out.push((u64::from(id), at, end));
            at = end + 12;
        }
        out
    }
    
    /// The number in `Partitions/NN`.
    fn partition_number(stream: &str) -> u32 {
        stream
            .rsplit('/')
            .next()
            .and_then(|n| n.parse().ok())
            .unwrap_or(0)
    }
    
    struct Record {
        partition: u32,
        id: u64,
        bytes: Vec<u8>,
    }
    
    fn probe(path: &str) -> rvt::Result<String> {
        let file = std::path::Path::new(path)
            .file_name()
            .map(|name| name.to_string_lossy().into_owned())
            .unwrap_or_default();
        let mut rf = RevitFile::open(path)?;
        let revit = rf.basic_file_info()?.version;
        let d = inflate_stream_at(GLOBAL_ELEM_TABLE, &rf.read_stream(GLOBAL_ELEM_TABLE)?, 8)?;
        let count = u32_at(&d, 2).unwrap_or(0) as usize;
        let (stride, second) = if revit >= 2024 { (40, 20) } else { (28, 4) };
        // id -> whether its table record carries the same id twice
        let table: BTreeMap<u64, bool> = (0..count)
            .filter_map(|k| {
                let at = 6 + k * stride;
                let (a, b) = (u32_at(&d, at)?, u32_at(&d, at + second)?);
                Some([(u64::from(a), a == b), (u64::from(b), a == b)])
            })
            .flatten()
            .collect();
        let Some((marker, header_tag)) = record_marker(&mut rf) else {
            return Ok(format!(
                "{{\"file\":{file:?},\"revit\":{revit},\"marker\":null}}"
            ));
        };
        let mut streams = rf.partition_stream_names();
        streams.sort_by_key(|s| partition_number(s));
        let partitions: Vec<u32> = streams.iter().map(|s| partition_number(s)).collect();
        let mut records = Vec::new();
        for stream in &streams {
            let Ok(inflated) = rf.inflated_partition(stream) else {
                continue;
            };
            let b = inflated.bytes();
            let spans: Vec<(u64, usize, usize)> = if revit >= 2024 {
                partition_record_chain(b, &marker)
                    .iter()
                    .map(|r| (r.element_id, r.start, r.end))
                    .collect()
            } else {
                chain_32(b, header_tag)
            };
            for (id, start, end) in spans {
                records.push(Record {
                    partition: partition_number(stream),
                    id,
                    bytes: b[start..end].to_vec(),
                });
            }
        }
        let mut first: BTreeMap<u64, usize> = BTreeMap::new();
        let mut per_partition: BTreeMap<u32, (usize, usize)> = BTreeMap::new();
        let (mut repeats, mut identical, mut same_id_twice) = (0, 0, 0);
        let mut size_changes: BTreeMap<i64, usize> = BTreeMap::new();
        for (i, record) in records.iter().enumerate() {
            let slot = per_partition.entry(record.partition).or_default();
            slot.0 += 1;
            let Some(&j) = first.get(&record.id) else {
                first.insert(record.id, i);
                continue;
            };
            slot.1 += 1;
            repeats += 1;
            let earlier = &records[j];
            if earlier.bytes == record.bytes {
                identical += 1;
            } else {
                *size_changes
                    .entry(record.bytes.len() as i64 - earlier.bytes.len() as i64)
                    .or_default() += 1;
            }
            same_id_twice += usize::from(table.get(&record.id) == Some(&true));
        }
        let last = partitions.last().copied();
        let in_last = per_partition
            .iter()
            .filter(|(p, _)| Some(**p) == last)
            .map(|(_, (_, r))| *r)
            .sum::<usize>();
        let last_all_repeats = per_partition
            .get(&last.unwrap_or(0))
            .is_some_and(|(n, r)| repeats > 0 && n == r);
        let changes: Vec<String> = size_changes
            .iter()
            .map(|(delta, n)| format!("\"{delta:+}\":{n}"))
            .collect();
        Ok(format!(
            "{{\"file\":{file:?},\"revit\":{revit},\"partitions\":{partitions:?},\
             \"chain_records\":{},\"ids\":{},\"repeats\":{repeats},\"repeats_in_last_partition\":{in_last},\
             \"last_partition_all_repeats\":{last_all_repeats},\"identical\":{identical},\
             \"size_change_of_others\":{{{}}},\"table_record_same_id_twice\":{same_id_twice}}}",
            records.len(),
            first.len(),
            changes.join(","),
        ))
    }
    
    fn main() {
        let paths: Vec<String> = std::env::args().skip(1).collect();
        if paths.is_empty() {
            eprintln!("usage: probe_548_repeated_chain_ids FILE.rvt ...");
            std::process::exit(2);
        }
        for path in &paths {
            match probe(path) {
                Ok(line) => println!("{line}"),
                Err(err) => println!("{{\"file\":{path:?},\"error\":{:?}}}", err.to_string()),
            }
        }
    }
  5. DrunkOnJava commented on Oct 1, 2026

    @DrunkOnJava
    OwnerAuthor

    RE-139 (#551, reports/element-framing/RE-139-partition-copies.md) measures what differs between the copies, on the runners (Measure runs 36881222392, 36881931583 and 36882594734).

    On Core Interior, of the 571 ids whose copies differ, the bounding boxes of 171 walls, 96 family instances, 111 rooms and 12 floors differ by up to a foot; the wall examples differ by exactly one inch (0.0833 ft). They are different revisions of the element, held in the main partition and one other (Partitions/46 with 59 for 377 ids, with 55 for 12). Where a copy's box is the same (58 walls, 88 family instances) other bytes differ. The RE1 models' boxes are equal or differ by less than 1e-9 ft; Einhoven's Partitions/2 copies of wall 2808 and instance 5317 are translated by (48.246, 31.17) ft, not examined.

    Does the choice reach the export? All 171 walls whose boxes differ are exported, and all 360 exported walls on Core Interior match Revit's faces and ends to 0.001 ft. But the exported body of a wall comes from its type's layers and its axis, not from the box's thickness (wall 20796 is exported 0.6667 ft thick where its copies' boxes are 0.5 and 0.5833 ft deep), so that does not say the other copy would give the same.

    Still open, which keeps this issue open:

    • Which copy is current. The ElemTable's revision counters (RE-35 section 6) and the partitions' own metadata were not compared with the copies.
    • Whether the other copy gives the same export. Taking each copy in turn and scoring walls, rooms and family instances against Revit's would say.
    • What the bytes after the box (+148 on walls, +156 and later on family instances) are.
  6. 4 remaining items

  7. puzzbobb commented on Oct 2, 2026

    @puzzbobb
    Contributor

    The reader already has a rule for this, and it can be tested: native_document routes each element's m_lastModificationDate through Global/DocumentIncrementTable with native_index::route_episode, and skips a chain record outside the routed partition as historical. RE-143 dated the copies on 2021 rac_advanced from the releases either side, and the earlier comment here dated Golden Nugget's from the records' own logs. On both, the routing picks the newer copy every time the copies differ.

    The probe below runs native_segments::walk on every partition, collects the channel-101 chain records outside ContentKey blocks, and routes every declared id as native_document does. It compares each record's body between partitions.

    file partitions ids with differing copies routed to the newer copy ids with identical copies
    2021 rac_advanced (RE-143) 7, 8 887 887 (Partitions/8) 3,150
    Golden Nugget Gebäudetechnik (2025) 141, 142, 143 56 56 (Partitions/143) 588
    Golden Nugget Architektur (2025) 111, 112, 113 1 1 (Partitions/113; its two copies' logs are equal) 19
    • Newer copies. On rac_advanced, "newer" is RE-143's answer: the Partitions/8 copy, dated from 2020 and 2022 on the 750 ids whose boxes differ. On Gebäudetechnik it's the later logged change.
    • Identical copies. Every one of the 2,786 ids that route to Partitions/7 on rac_advanced has byte-identical copies, so the choice makes no difference there.

    So on these files the existing rule answers #548. Running the probe on Core Interior would say where its 571 route (Partitions/59 and 55, if the pattern holds).

    One thing the same run shows: single copies routed away. On the 2025 files with several partitions, some elements with only one chain record are routed to a partition that holds none of their records:

    file elements with one copy routed to another partition
    Golden Nugget Gebäudetechnik 40,915 1,777 (all to Partitions/141)
    Golden Nugget Architektur 49,429 8,671 (all to 111)
    Snowdon Towers Architectural 50,529 2,583 (2,581 to 122, 2 to 123)
    Snowdon Towers Structural 16,612 694 (to 22)
    Snowdon Towers HVAC 12,716 372 (to 23)

    They always go to the lowest-numbered partition. native_document would count each as a historical record and drop the element.

    That's latent for 2025, which extract_records doesn't admit, but Core Interior (2024) has several partitions, so its skipped_historical_records and missing selected ids are worth a look. On the single-partition samples (2024 and 2027 rac_basic and rst_basic, 2027 rac_advanced) every element routes to its partition.

    I don't know why. The records' own logs explain some of them but not as a rule: on Gebäudetechnik, 640 of the 1,777 have a logged change later than the table's date that routes to their partition, but routing by the log instead would misroute 4,914 others.

    Files. 2021 rac_advanced and the 2024 and 2027 samples match research/autodesk-sample-projects.tsv. Golden Nugget (sha256 398c3d57… Gebäudetechnik, 4815e537… Architektur) and Snowdon Towers (8ac90a85…, 489d9364…, a1756cfd…) are the copies I used before. None has a Revit export that decides the single-copy case.

    Probe: examples/probe_548_route_copies.rs (one JSON line per file; rustfmt and clippy -D warnings clean on c5f7e43)
    //! #548: does the partition that `native_index::route_episode` gives an
    //! element hold its newer copy?
    //!
    //! For every chain record (channel 101, outside a `ContentKey` block) the
    //! probe notes the partition it is in. For every id the table declares it
    //! routes the id's `m_lastModificationDate` through `Global/
    //! DocumentIncrementTable`, as `native_document` does, and reports where
    //! that partition is among the partitions holding the id's records.
    //!
    //! ```text
    //! cargo run --profile ci --example probe_548_route_copies -- FILE.rvt ...
    //! ```
    
    use rvt::RevitFile;
    use rvt::compression::prepare_stream_for_inflate;
    use rvt::native_index;
    use rvt::native_segments;
    use rvt::schema_registry;
    use std::collections::{BTreeMap, BTreeSet};
    use std::io::Read;
    
    fn single(rf: &mut RevitFile, name: &str) -> anyhow::Result<Vec<u8>> {
        let stored = rf.read_stream(name)?;
        let prepared = prepare_stream_for_inflate(name, &stored);
        let offset = if name == "Formats/Latest" { 0 } else { 8 };
        let mut out = Vec::new();
        flate2::bufread::GzDecoder::new(&prepared[offset..]).read_to_end(&mut out)?;
        Ok(out)
    }
    
    fn main() {
        for path in std::env::args().skip(1) {
            let name = std::path::Path::new(&path)
                .file_name()
                .map(|n| n.to_string_lossy().into_owned())
                .unwrap_or_default();
            match probe(&path) {
                Ok(v) => println!("{}", serde_json::json!({ "file": name, "result": v })),
                Err(e) => println!(
                    "{}",
                    serde_json::json!({ "file": name, "error": format!("{e:#}") })
                ),
            }
        }
    }
    
    fn probe(path: &str) -> anyhow::Result<serde_json::Value> {
        let mut rf = RevitFile::open(path)?;
        let release = rf.basic_file_info()?.version;
        let registry = schema_registry::parse(&single(&mut rf, "Formats/Latest")?)?;
        let episodes = native_index::creation_episodes(&single(&mut rf, "Global/History")?, &registry)?;
        let index = native_index::parse(&single(&mut rf, "Global/ElemTable")?, &registry, &episodes)?;
        let increments = native_index::storage_increments(
            &single(&mut rf, "Global/DocumentIncrementTable")?,
            &registry,
        )?;
        let id_bytes = if release >= 2024 { 8 } else { 4 };
    
        // id -> partitions holding a chain record of it.
        let mut holders: BTreeMap<u64, BTreeSet<u32>> = BTreeMap::new();
        // (id, partition) -> the channel-101 record body.
        let mut bodies: BTreeMap<(u64, u32), Vec<u8>> = BTreeMap::new();
        // (id, partition) -> latest save counter in the record's own modification
        // log (2024 on: u16 count at +0x0e, 22-byte blocks from +0x12, each
        // ending in an i32 counter).
        let mut logged: BTreeMap<(u64, u32), i32> = BTreeMap::new();
        let names: Vec<String> = rf
            .stream_names()
            .into_iter()
            .filter(|n| n.starts_with("Partitions/"))
            .collect();
        let mut present = BTreeSet::new();
        for stream in &names {
            let partition: u32 = stream["Partitions/".len()..].parse()?;
            present.insert(partition);
            let stored = rf.read_stream(stream)?;
            let prepared = prepare_stream_for_inflate(stream, &stored);
            native_segments::walk(&prepared, &registry, 1 << 30, |source, bytes| {
                if source.content_key.is_some() || source.channel != 101 {
                    return Ok(());
                }
                let header = id_bytes + 4;
                let mut pos = 0;
                while pos + header <= bytes.len() {
                    let id = if id_bytes == 4 {
                        u64::from(u32::from_le_bytes(bytes[pos..pos + 4].try_into()?))
                    } else {
                        u64::from_le_bytes(bytes[pos..pos + 8].try_into()?)
                    };
                    let len =
                        u32::from_le_bytes(bytes[pos + header - 4..pos + header].try_into()?) as usize;
                    holders.entry(id).or_default().insert(partition);
                    bodies.insert(
                        (id, partition),
                        bytes[pos + header..pos + header + len].to_vec(),
                    );
                    if id_bytes == 8 {
                        let blocks = usize::from(u16::from_le_bytes(
                            bytes[pos + 0x0e..pos + 0x10].try_into()?,
                        ));
                        let latest = (0..blocks)
                            .filter_map(|k| {
                                let at = pos + 0x12 + 22 * k + 18;
                                Some(i32::from_le_bytes(bytes.get(at..at + 4)?.try_into().ok()?))
                            })
                            .max();
                        if let Some(latest) = latest {
                            logged.insert((id, partition), latest);
                        }
                    }
                    pos += header + len + 4;
                }
                Ok(())
            })?;
        }
    
        // Where the routed partition falls among the holders, for ids held once
        // and for ids held in several partitions.
        let mut tally: BTreeMap<String, usize> = BTreeMap::new();
        let mut route_errors = 0;
        let mut single: BTreeMap<String, usize> = BTreeMap::new();
        for (id, identity) in &index.identities {
            let Some(held) = holders.get(id) else {
                *tally.entry("declared, no chain record".into()).or_default() += 1;
                continue;
            };
            let routed =
                match native_index::route_episode(identity.stored_revision, &increments, &present) {
                    Ok(p) => p,
                    Err(_) => {
                        route_errors += 1;
                        continue;
                    }
                };
            if held.len() == 1 {
                let only = *held.iter().next().unwrap();
                let log = logged.get(&(*id, only)).copied();
                let later = log.is_some_and(|l| i64::from(l) > i64::from(identity.stored_revision));
                let by_log = log
                    .and_then(|l| u32::try_from(l).ok())
                    .and_then(|l| native_index::route_episode(l, &increments, &present).ok());
                let k = format!(
                    "one copy: routed {}, log later than table {}, routed by its log {}",
                    if routed == only { "to it" } else { "elsewhere" },
                    later,
                    match by_log {
                        None => "-",
                        Some(p) if p == only => "to it",
                        Some(_) => "elsewhere",
                    }
                );
                *single.entry(k).or_default() += 1;
            }
            let identical = held.len() > 1 && {
                let mut it = held.iter().map(|p| bodies.get(&(*id, *p)));
                let first = it.next().flatten();
                it.all(|b| b == first)
            };
            let copies = if held.len() == 1 {
                ""
            } else if identical {
                " [identical copies]"
            } else {
                " [differing copies]"
            };
            let key = match (held.len(), held.contains(&routed)) {
                (1, true) => "one copy, routed to it".to_string(),
                (1, false) => format!("one copy, routed elsewhere ({routed})"),
                (_, true) if routed == *held.iter().max().unwrap() => {
                    "several copies, routed to the highest-numbered".to_string()
                }
                (_, true) => "several copies, routed to a lower-numbered one".to_string(),
                (_, false) => format!("several copies, routed to none of them ({routed})"),
            };
            *tally.entry(format!("{key}{copies}")).or_default() += 1;
        }
        Ok(serde_json::json!({
            "release": release,
            "partitions": present,
            "increments": increments.len(),
            "route_errors": route_errors,
            "tally": tally,
            "single_copies": single,
        }))
    }
  8. DrunkOnJava commented on Oct 3, 2026

    @DrunkOnJava
    OwnerAuthor

    Thank you. The routing test was the right one, and it reproduces.

    Which copy the route takes (RE-145, #569). The probe routes every declared element as native_document does and compares the result with the partitions that hold its channel-101 records. Where copies differ, the route takes the latest partition's copy on 1,518 of 1,522 differing ids:

    • 887 of 887 on 2021 rac_advanced, your count;
    • 569 of 571 on Core Interior;
    • 5 of 6 on Einhoven;
    • 55 of 56 across the RE1 models.

    Of the four others, two on Core Interior route to a middle partition of three that holds a copy, and Einhoven's 2846 and one RE1 Electrical element route to a partition that holds neither copy.

    Routed to a partition without the element. You found this on 2025 files. Here it shows up on files the native path admits:

    • Einhoven: 6 elements (stored revision 1) route to Partitions/1;
    • Core Interior: 10 (stored revision 31, identical copies in 46 and 51) route to Partitions/48.

    extract emitted none of the 16, so it returned 2,609 of 2,615 and 26,415 of 26,425 elements. Single copies routed away: Einhoven's 5, none on Core Interior, RE1 or the 2019 to 2027 samples. Your Golden Nugget and Snowdon counts are on files we don't hold.

    Fixed in #565. When the routed partition holds none of an element's records, the native path now takes the copy in the latest partition that holds one, and counts it in current_records_outside_route. A new real-file target requires one emitted record per declared element on Einhoven and Core Interior; its red run on the old code listed exactly Einhoven's six. No export changed.

    That answers this issue's question on every file measured: the current copy is the routed partition's, which is the latest partition's wherever copies differ, and the latest holding partition's where the route finds none. Why the route lands on an empty partition is still open; the modification-log comparison is noted but not reproduced here. I'm closing this with the report in reports/element-framing/RE-145-current-copy-routing.md.

  9. DrunkOnJava commented on Oct 24, 2026

    @DrunkOnJava
    OwnerAuthor

    A further measurement of RE-145's rule, from #227 (RE-216, #949). Instance transforms had their own copy problem: 8 Core Interior doors have element data in Partitions/46 and Partitions/59 that differ by an inch across the host. The copy Revit's export draws, the only one that places its opening on the cut loop, is the one in the partition native_document routes their current record to. The transform reader now takes that copy instead of dropping the instance, using native_document::routed_partitions. It is one stacked-door pattern, so it agrees with the 1,518 of 1,522 rather than adding much to them.

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:elementsarea:partitionspriority:P3type:research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions