Skip to content

perf(research): the wall read that draws a Revit 2015 to 2023 export's walls keeps their top joins, so the export does not read every wall's record again for them (#1824) - #1828

Merged
DrunkOnJava merged 4 commits into
mainfrom
perf/1824-wall-top-joins-once
Nov 12, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
perf/1824-wall-top-joins-once

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

On Revit 2015 to 2023, native_walls_and_top_joins_into already reads each wall's whole SWall or ArcWall record and finds whether its top is joined. It now leaves that answer in WallReads, as it already does with the type ids and the load bearing. In the same pass it reads the walls with no type in the export, for their type id, top join and load bearing alone. read_wall_records and attach_wall_top_joins then find every wall's answer there, instead of reading every wall's record again. This is part (1) of #1824. Part (2), the GStyleElem read and its release question, is not taken here.

Motivation

#1824 (1): two passes read the same wall records for m_wall_top_joined. The second pass, WallReads::read from read_wall_records, selects every wall only to find the top join the first had read. The one consumer (export_content.rs) takes the first value.

The first run showed that keeping the top joins was not enough. attach_wall_layers asks the whole-record read only for the walls with a type in the export, since only they get layers. The later readers ask every wall, so a file with any typeless wall still made the second pass.

Changes

  • src/research/native_walls.rs:
    • native_walls_and_top_joins_into extends reads.top_joined with the top joins it read, and reads.top_joins_read with those walls only.
    • It takes facts_only: walls read in the same pass for their type id, top join and load bearing, and left out of the records it returns. A facts-only wall counts as read only where its record was read.
    • Per-thread counts of the passes WallReads makes (wall_read_passes) and of the facts-only walls read (wall_facts_only_reads), for the probe.
  • src/research/partition_schema_mvp/walls.rs: attach_wall_layers passes the walls with no type in the export as facts_only.
  • probes/examples/probe_1824_wall_top_joins_once.rs: the passes and the facts-only walls of the default export, and the top joins read both ways on fresh handles: the whole record (native_walls_and_top_joins) and the projected graph (WallReads::top_joins).
  • changelog.d/changed/1824-wall-top-joins-once.md.

Testing

Unit tests are banned here. The evidence is one unfiltered Measure of this head against main, timed, with the probe on every model. It covers the samples of every year, the BIM4LCA models, the R2025 set, rac_advanced and the held-out models.

The first run, 43302451503 on b49ebda5, was read against the rows below in their first form:

This head merges main (at 8421e655) and adds facts_only.

Rows, registered before the second run:

  1. Unchanged. Every ifc.sha256, every diagnostics.json the run keeps and every scorer file equal main's.
  2. The same value both ways. On every model the probe reads, top_joins ... equal=true.
  3. No second pass. On every sample of Revit 2015 to 2023, export wall_read_passes=0. A sample with a pass is named, with the walls the pass read and why the first read did not cover them. facts_only is reported per sample.
  4. Time. Over the samples of Revit 2015 to 2023, the median head / main time is 1.00 or less, and no file is above 1.03. Where main's rounds of a file fall into two values, each mode is judged on its own.
  5. Memory. No file's peak is above 1.03 of main's. A typeless wall's whole graph is now built where its projected graph was.
  • rustfmt --edition 2024 --check passes. CI runs the rest of the gate.
  • Verified end to end on real Revit files: the Measure run above.
  • N/A: no exporter output changes (row 1).
  • Performance change: the timing table of the same run (rows 4 and 5).

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • A user-visible change has its entry as a fragment under changelog.d/<section>/
  • N/A: no limitation resolved or introduced
  • 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
  • The probe under probes/examples/ states its FACT

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content
  • No new test fixtures

Breaking changes

None to the stable API. wall_read_passes and wall_facts_only_reads are new public functions under rvt::research, which is unstable-research. native_walls_and_top_joins_into takes a new facts_only argument.

…s walls keeps their top joins, so the export does not read every wall's record again for them (#1824)
…se top join it found, so a wall whose whole graph did not decode is still read (#1824)
… in the export, for their facts alone, so a Revit 2015 to 2023 export makes no second wall pass (#1824)

attach_wall_layers asks the whole-record read only for the walls with a type
in the export, since only they get layers. read_wall_records and
attach_wall_top_joins then ask every wall's type id and top join, so a file
with any typeless wall still made a second pass: Measure 43302451503 found
one on all 22 rac and rme samples of 2015 to 2023, and none on the 11 rst
ones.

native_walls_and_top_joins_into takes those walls as facts_only. It reads
them in the same pass for their type id, top join and load bearing, and
leaves them out of the records it returns, so the walls attach_wall_layers
draws are unchanged. A facts-only wall counts as read only where its record
was read; one that was not is still read by the reader that asks.
wall_facts_only_reads counts them for probe_1824, which now prints them
beside the passes.
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Run 43317496752 (e7aac015 against 8421e655), read against the rows above. rvtDevelop read it too, and rows 4 and 5 each fail on one file.

  1. Holds. 125 of 125 ifc.sha256 are equal, and 101 of 101 diagnostics.json. The scorer diff lists only head-only output.
  2. Holds. All 202 probe files say equal=true.
  3. Holds. All 33 samples of 2015 to 2023 show wall_read_passes=0. facts_only is 0 on every rst, 9 on rac_basic, 33 on rme and 34 on rac_advanced.
  4. Fails on one file. The median head/base over the 2015 to 2023 samples is 0.99. 2018-rst_basic is 1.050 (577 to 606 ms).
  5. Fails on one file. Snowdon Towers Plumbing 2024 peaks at 1.046 of main's (474 to 496 MiB).

On both files this change does nothing the base does not.

  • 2018-rst_basic has facts_only=0 and wall_read_passes=0, as the base had in the first run: every rst sample made no pass before this PR either.
  • Snowdon Plumbing has facts_only=0, so no typeless wall's whole graph is built there.

The rows have no noise clause beyond the two-mode one, though, so I am not relabelling them.

Re-time, registered before it runs. Two timed runs, the samples of 2018 and of 2024 (Measure filters samples by year, not by name), same head, same base, the same three rounds in turn on one runner. Only those two files decide:

  • If both are at or under 1.03 (time for 2018-rst_basic, peak for Snowdon Plumbing), rows 4 and 5 hold. The first readings are recorded here as what they were.
  • If either is above 1.03 again, that row fails. I find the cause before asking for approval.

Outside the rows: Snowdon Towers Architectural 2024 reports wall_read_passes=2, so a second wall read still happens there on 2024. That goes to #1824 as a follow-up, not into this PR.

@DrunkOnJava

DrunkOnJava commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner Author

The re-time, read against the rule registered above (comment 6838942032): rows 4 and 5 hold.

  • Row 4. In run 43328859138 (the 2018 samples), 2018-rst_basic is 0.99 (728 to 721 ms). The other two 2018 samples are 0.99 and 1.01.
  • Row 5. In run 43328868003 (the 2024 samples), Snowdon Towers Plumbing peaks at 0.96 (497 to 475 MiB). Every other 2024 sample is 0.96 to 1.00.
  • Exports and diagnostics are equal on all 13 files of the two runs.

Why the first reading was 1.046. The two peaks are one export's two modes, not this change:

  • Snowdon Plumbing's base reads 474 MiB in one run and 497 in this one, on the same code.
  • Snowdon HVAC does the same, at 235 or 249-250, for base 8421e655 itself across three runs: 43317496752, 43324820431 and this one.
  • A control run, 43329577007, times 8421e655 against itself on the 2024 samples, to show the two modes with no change at all.

Outside row 4's set: Core Interior is 1.04 in the 2024 run (2732 to 2851 ms) and 0.99 in the full run (4484 to 4453 ms).

@DrunkOnJava
DrunkOnJava merged commit 925c482 into main Nov 12, 2026
65 checks passed
@DrunkOnJava
DrunkOnJava deleted the perf/1824-wall-top-joins-once branch November 12, 2026 23:59
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