You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default saved meshes: after #1691 the peak memory is still 1.4 to 4.4 times 0.17.0's on Revit 2023 to 2027 files; where the rest sits #1694
area:geometryWork in the geometry area.area:ifcWork in the ifc area.priority:P2Important quality, usability, or hardening work.type:bugCorrectness defect or regression.
After #1691 the default export's peak memory on Revit 2023 to 2027 files is still 1.4 to 4.4 times 0.17.0's; the part #1691 did not move is not the owners' graphs.
Measure run 42954375538 (#1691's head 8cf93e9 against main at 8334726, timed on one runner per file) and run 42949360321 (main against v0.17.0). Peak memory, MiB:
#1691 lets go the owners that name nothing (walls) after the first read and meshes them a buffer at a time; that took 20% to 47% off the files whose walls are many. It left rac_basic (18.8 MB, 330 boxed elements, 3.0 s) where it was: 875 MiB, 4.4 times 0.17.0's, so most of the remaining growth is something else.
Where to look.RevitFile::inflated_partition keeps each inflated partition for the handle's lifetime (#266), and reading every boxed element's saved graphics now touches nearly every partition that holds graphics, where doors and windows touched few; the symbols' batches (BATCH_OBJECT_BUDGET, 20,000 graph objects) and the owners kept for their symbols (every owner that names a symbol keeps its graph from the first read) are the other holders. Nothing here is measured: the first step is a memory profile of rac_basic 2023 by stage (open, owners read, each batch, write), which Measure's timing run can give with a probe that prints the process's peak after each stage.
--no-saved-meshes returns 0.17.0's memory. The 0.18.0 notes state this table.
First step: where the heap sits in the saved-mesh stage. Rows registered before the run.
probe_1075_heap_stages (exact heap bytes by stage, with the resident set beside them, from #1075) on Autodesk's samples of Revit 2023 and 2024 at main979ec42 (the stage saved_meshes runs attach_scoped_with_control with the default scope): Measure run 42958124918, scorers=none, base=none.
On rac_basic 2023 the live heap at the end of the saved_meshes stage is at least 500 MiB over its start, and the stage's peak is the export's peak.
Of that, the inflated partitions the pass leaves in the handle's cache (the inflate <stream> lines of the graphics partitions) are 300 MiB or more, and the decoded graphs of one batch (symbols and owners) 150 MiB or less.
On Snowdon Towers Architectural the same split holds, the inflated partitions being at least half of the stage's peak.
If 1 holds and 2 misses, the cache is not the holder and the next step is the batches' graphs and the owners kept for their symbols (at_peak says which block sizes); if 1 misses, the growth is outside the stage, in the STEP model it builds.
Result of Measure 42958124918 against the rows registered above: row 1 half held, rows 2 and 3 missed. The memory is in the meshing, not in the cache. Rows for the next run registered at the end, before it.
probe_1075_heap_stages at main979ec42 on Autodesk's samples of Revit 2023 and 2024. The stage saved_meshes is the production pass (attach_scoped_with_control, default scope). MiB:
file
pass's peak over its start
live at its end over its start
process peak (RSS)
inflated partitions in the cache
512-byte blocks at the peak
triangles
rac_basic 2023
630.6
26.3
879
91
502
714,649
rac_advanced 2023
292.0
215.6
557
82
232
596,651
rme_advanced 2024
499.9
158.1
987
221
359
1,646,864
Snowdon Towers Architectural 2024
1,220.4
211.1
2,093
425
869
4,206,305
Row by row, as registered:
rac_basic 2023, "the live heap at the end of the saved_meshes stage is at least 500 MiB over its start": missed, it is 26.3 MiB over (166.3 MiB after the stage, from 140.0). "The stage's peak is the export's peak": held, 770.6 MiB live and 879.4 MiB resident, against 168.9 MiB at the export stage's peak. The memory is a transient inside the pass, not something the pass keeps.
"The inflated partitions the pass leaves in the cache are 300 MiB or more": missed, the cache is 91.1 MiB (two streams) and is already in the heap when the stage starts. "The decoded graphs of one batch 150 MiB or less": held but not the holder: the 16 named symbols' graphs together (10,391 objects) are 68.0 MiB, 6.7 KiB an object, near the 4.8 KiB the batch budget assumes.
Snowdon Towers Architectural, "the inflated partitions at least half of the stage's peak": missed, 424.8 MiB of a 1,900 MiB peak (22%); the blocks of 512 bytes hold 869 MiB (46%).
What the run shows instead: at each pass's peak the largest share of the live bytes is in blocks of 512 bytes (502 of 771 MiB on rac_basic, 869 of 1,900 on Snowdon Architectural), the saved-meshes event's live heap rises from 173 to 770 MiB while the batch is meshed (444 of 444 items) and ends at 181, and the 512-byte blocks do not follow the triangles (737 bytes a triangle on rac_basic, 217 on Snowdon Architectural). So the lever is what the meshing of a batch holds at once, not the symbols' graphs or the partition cache.
Next step: which call sites hold the pass's peak. Rows registered before the run.
probe_1075_heap_sites (dhat: the call stack of every allocation, bytes at the highest heap, stage meshes = the pass alone, profiled from its start, on an export made unprofiled) on Autodesk's samples of Revit 2023 (rac_advanced, rac_basic, rst_basic) at main979ec42: Measure, scorers=none, base=none.
On rac_basic 2023 the pass's at_peak is 550 MiB or more (the run above: 630.6 over the start).
One function (the innermost rvt:: frame, by function) holds half or more of it, and it is in the meshing (native_parametric_mesh, native_saved_mesh, or a mesh_* function of native_saved_scene), not in the graph decode (native_parameters, object_graph, native_document) or the inflate.
The blocks of 512 bytes are that same function's: it holds 400 MiB or more of them.
On rac_advanced 2023 (292.0 over the start above) the largest function at the peak is the same one.
If 2 misses (the peak is spread over decode and mesh), the lever is the batch's size: bytes of body rather than the 20,000 graph objects of BATCH_OBJECT_BUDGET, and the next run sizes batches that way. If 2 holds in the meshing, the next step reads that function for what it keeps per face and per element, and frees it where the batch's elements finish. Either fix moves no body: the unfiltered Measure's ifc.sha256 stays identical, and --no-saved-meshes still returns 0.17.0's memory.
What the table above does not say about the holder. The 512-byte blocks that hold the peak are the size class of decoded graph objects (the heap-stage run's own saved_symbols read shows 644 MiB of them for 79,868 objects on rst_basic 2023, 8 KiB an object), not of finished meshes: after the pass the model keeps all 714,649 triangles of rac_basic in +26 MiB. So the holder is not yet established as "the batch's meshes"; it may as well be the owners' graphs the pass keeps (decoded for every owner before the first batch) or the streaming buffer of the walls. The dhat run (rows above) names the call sites; a fix waits for it.
Result of Measure 42960663793 (probe_1075_heap_sites, stage meshes, main979ec42) against the rows registered above: rows 1, 3 and 4 held, row 2 missed on where. The pass's peak is decoded graph objects, not meshes. Rows for the next run registered at the end, before it.
dhat follows every allocation of the pass alone (attach_scoped_with_control, default scope) and says what was live when its heap was highest. MiB at that peak, and the share of the largest single call site:
file
peak
largest site
share
2nd site
rac_basic 2023
630.7
497.9
79%
Cursor::field_as 49.9
rac_advanced 2023
292.0
234.9
80%
Cursor::field_as 21.1
rst_basic 2023
59.4
46.5
78%
5.5 (stream read)
Core Interior
153.3
129.3
84%
Cursor::field_as 11.8
RE1 Architecture
75.4
60.8
81%
5.5 (stream read)
Einhoven
6.0
5.0
83%
0.4
The largest site on all six is the same: the leaf nodes of a BTreeMap (825,000 blocks of 633 bytes on rac_basic, which is the size of a serde_json::Map<String, Value> node, 11 slots of a 24-byte String and a 32-byte Value), allocated by native_parameters::Cursor::field_as / class_in, inside decode_graph_in called from decode_graph_cached (the stacks, all six of the largest). Nothing in the meshing is near it: tessellate_uv holds 11.7 MiB on rac_basic (1.9%), graphics_impl 8.9, the primitives' vectors under 1%; what the pass leaves (26.4 MiB at its end) is the compact mesh.
Row by row, as registered:
Held.rac_basic 2023's pass peaks at 630.7 MiB (550 or more asked).
Held in size, missed in place. One function holds 497.9 MiB, 79% (half asked), and it is in the graph decode (native_parameters), not in the meshing as the row required.
Held in number. The 512-byte blocks are that function's, 497.9 MiB (400 asked); since it is the decode's, they are not the mesher's.
Held. On rac_advanced 2023 the largest site at the peak is the same, 234.9 of 292.0 MiB.
So the earlier reading, that a batch's finished meshes are the holder, is wrong: after the pass the model keeps all 714,649 triangles of rac_basic in +26 MiB, and the peak is the decode. The row's branch "if 2 misses" named a mixture of decode and mesh; the miss here is all decode, and the batch's size by body bytes is the lever only if the decoded set at the peak is many records. That is what the next run measures.
Why this is not the budget. 825,000 leaf nodes is at least that many decoded objects live at once (an object with up to 11 fields takes one node), against a buffer of owners and a batch of symbols that each stop at about 20,000 graph objects (OWNER_OBJECT_BUDGET, BATCH_OBJECT_BUDGET). Either a few records are decoded whole far past the budget (a record is added to the buffer before the budget is looked at) or many are held at once.
Next step: how big the records are. Rows registered before the run.
probes/examples/probe_1694_owner_sizes.rs (branch research/1694-owner-sizes) reads the records the pass reads (channel 103, the ids of every building element of the export) one at a time, keeps nothing of them, and prints their graph objects, body bytes and symbols named, with a histogram and the share of the largest 1, 5 and 25. Measure on Autodesk's samples of Revit 2023 and 2024 and the reference models, scorers=none, base=none.
On rac_basic 2023 the records hold 700,000 graph objects or more in all.
The largest 5 records hold half or more of them.
The largest record alone holds 100,000 objects or more, five times the buffer's budget.
The same shape on rac_advanced 2023 and Core Interior: the largest 5 hold half of the objects.
If 2 or 3 miss (thousands of small records), the live set at the peak is the pass keeping many records at once and the next probe prints what the pass holds by stage in the batch loop; if they hold, the lever is not to decode a record's whole graph as a Value tree where meshing reads a few of its fields, or to bound the buffer by objects before a record is added.
Result of the owner-size probe (Measure 42971398698, probe_1694_owner_sizes at 0e8d4a1) against the rows registered above: all four missed. The owners are small; what the pass holds at its peak is not the owners. Rows for the next probe registered at the end, before it.
The probe reads the 467 owner records of rac_basic 2023 one at a time and keeps nothing. They hold 18,280 graph objects in all (700,000 or more asked), and the largest holds 1,849:
file
owners
graph objects
largest
largest 5
largest 25
rac_basic 2023
467
18,280
1,849
21.2%
47.0%
rac_advanced 2023
5,682
87,367
2,060
7.9%
21.5%
rst_basic 2023
454
26,520
1,025
19.3%
65.9%
Core Interior
970
104,516
404
1.9%
9.3%
RE1 Architecture
85
2,138
292
44.5%
88.8%
Einhoven
35
593
353
84.1%
94.9%
Missed.rac_basic 2023's owners hold 18,280 graph objects, not 700,000.
Missed. The largest 5 hold 21.2%, not half.
Missed. The largest owner holds 1,849 objects, not 100,000; no owner on any of the six files holds more than 2,060.
Missed. Core Interior's largest 5 hold 1.9%; rac_advanced's 7.9%.
So the 825,000 decoded nodes of rac_basic 2023's peak (630.7 MiB, 79% of it) are not owners: the owners of the whole file are 18,280 objects, a 45th of the nodes dhat counts. They are the shared symbols the owners name (InstanceInfo.m_symbolId), which extract_in_batches_with_control reads a batch at a time: "on the BIM4LCA office 105 symbols hold 99% of the graph objects of 538 doors and windows". The plan sizes the first batch at 8 symbols before it knows one, then sizes each next batch as 20,000 * (records read) / (their objects) clamped to 4..=1,024 symbols, so a batch of 4 symbols is the smallest it can plan, and a symbol that holds 100,000 objects makes any batch holding it 5 times the budget however it is planned.
Next probe, rows registered before the run.probes/examples/probe_1694_batch_plan.rs (branch research/1694-batch-plan) reads the owners, then every shared symbol they name and the symbols those name, a level at a time keeping counts, and replays the pass's plan on those counts (the sort, the first batch of 8, the next batch's size from the one before, the closure each batch reads). It prints each batch's owners, symbols named, shared records read and graph objects, the peak batch, and the 12 largest symbols with the number of owners that name each. Measure on Autodesk's samples of Revit 2023 and 2024 and the reference models, scorers=none, base=none.
On rac_basic 2023 the batch with the most graph objects holds 150,000 or more (7.5 times the 20,000 the plan aims at); the 825,000 nodes dhat counts at the peak are at least that many objects' fields.
One shared symbol record holds 40,000 objects or more (twice the budget by itself), so no batch size can keep that batch within the budget.
The peak batch is one of the first three planned (the first is sized at 8 symbols before any is known; each next one from the average of the one before).
On rac_advanced 2023 the peak batch holds 60,000 objects or fewer (3 times the budget), and on Core Interior 40,000 or fewer: the overshoot is the small file's.
If 2 holds, the lever is not the batch's size: a symbol is read whole, and the memory per decoded object (a serde_json field map, 633-byte nodes) is what makes it cost, so the fix is in how a graph is decoded (the existing Options::graph_fields projection keeps only the fields a reader names). If 2 misses and 1 holds, the plan overshoots because its first batch and its clamp know nothing of a symbol's size, and a batch can be sized by the record's body_bytes, which is known before it is decoded.
Why run B still missed time, the lever that follows, and its rows before any run.
The probe of 1958414b (43283294375) counts each partition's groups by channel:
file
partitions
the largest partition's share of the inflated bytes
channel 103 groups
channel 103 share
one walk of every segment
Snowdon Towers Architectural
3
99.6% of 444 MB
1,611
33%
916 ms
concrete office, as built
2
100.0% of 378 MB
1,210
34%
645 ms
concrete housing, as built
80
84% of 427 MB
1,239
44%
908 ms
2024 rme_basic
1
100% of 187 MB
650
27%
341 ms
On these files one partition holds nearly everything, so the record index can skip almost no partition. Each read of the pass inflates the whole file. Run B's added time on Snowdon Towers Architectural, 21.2 s, is about 23 such walks.
Two levers were ruled out first:
Inflating only channel 103's segments would leave about 1.20 on Snowdon Towers Architectural and 1.44 on the housing file.
Keeping channel 103's inflated bytes would hold about 124 MiB on the office, against about 75 MiB of headroom under its bar.
A read without the copies inflates only the groups that hold a record it selects, as the record index names them, every copy of that record included. A group's first marker is read before it is inflated.
A group it skips still has its markers, continuation flags, channel and checkback checked.
The pass builds channel 103's index from the handle's copies, with a read that selects nothing, before it lets them go. That read also checks every group's records, as each read on main does.
Without an index (a budget other than the default, or a partition over the stream limit), each read inflates every group as in run B.
C1. Mechanism, registered first. Probe probe_1694_group_sizes at 343690a5 on the same models, before any timing run. After the census it makes the default export and prints the bytes its native walks inflated themselves, which only the pass does, over the file's inflated bytes. To meet run B's time bars, given run B's added time and the walk times above:
at most 1.7 on 2024 rme_basic (its 1.05 bar allows about 0.57 s, about 1.7 walks);
at most 3.7 on Snowdon Towers Architectural and on the concrete office as built (their 1.10 bar).
If C1 misses, the reads that select nearly every channel-103 group (the owners, the owners that name nothing, and the symbols' sizes) are looked at first, before any timing run.
C2. Timing, only once C1 holds. Samples and the BIM4LCA models against main97397b9e, rounds and runners as in runs A and B:
Exports byte for byte: every ifc.sha256 and every scorer file equals main's.
Peak: Snowdon Towers Architectural at or below 984 MiB, and the concrete office at or below 853 MiB as built and 954 MiB at permit. No file more than 3% above main. A file whose main rounds fall into two values, as Snowdon Towers HVAC's do, is judged on its lowest and highest rounds, as in the comment above.
Time: the median of the 28 samples of Revit 2023 to 2027 within 1.05 of main's, and the three largest within 1.10.
Exports: every ifc.sha256 and every scorer file equals main's. Holds.
Time: no file of Revit 2023 to 2027 is slower than main by more than 3% (the slowest is 1.00). The median of the 28 samples is 0.99, from 0.93 (Snowdon Towers Architectural, 40.8 s to 38.0 s) up. Holds.
Peak: every file is within 1% of main but one. Snowdon Towers HVAC read 325 MiB on main and 339 MiB on the head, 1.04. Run B read the same main commit on that file at 338 MiB, so main alone moved 4% between runs. Judged as registered above, over every round of run A and the re-time (43281306266, second attempt):
head's lowest round, 332,008 KiB, against main's 330,192: 1.005;
head's highest round, 347,524 KiB, against main's 346,668: 1.002.
On the re-time alone the medians are 333,472 against 332,308 KiB (1.004). Holds.
All three rows of A hold. #1817's head is taking the unfiltered run for the exports (43287191948) before it is marked ready.
Peak: Snowdon Towers Architectural 1,115 → 797 MiB (bar 984), the concrete office 945 → 778 as built (bar 853) and 1,035 → 836 at permit (bar 954). No file is above main. Holds.
Time: the median of the 28 samples is 1.32 (1.13 to 1.79), against a bar of 1.05. The three largest are 1.61, 1.52 and 1.35, against 1.10. The four housing files are at 1.95 to 2.07. Missed.
The index removed each read's second walk, and on main it costs no time or saves some. The uncached walks still cost about a third more time, because each read still inflates every segment of every partition it visits. Why that is nearly the whole file, and the lever that follows, with its rows, are in the comment above.
C1 read against its rows: holds. Probe run 43287108843 at 343690a5. Each figure is the bytes the pass's own walks inflated during a default export, divided by the bytes of one walk of the whole file.
file
inflated by the pass
over the file
registered ceiling
2024 rme_basic
75.0 MB of 187.3 MB
0.40
1.7
Snowdon Towers Architectural
234.7 MB of 444.0 MB
0.53
3.7
concrete office, as built
119.7 MB of 378.0 MB
0.32
3.7
On run B's head, each read inflated the whole file, about 23 walks on Snowdon Towers Architectural. With the group skip, the whole pass now inflates about half a walk.
The other files of the run fall from 0.03 (the terrain office) to 0.54 (rac_advanced and the concrete housing as built).
The counter covers every walk the pass makes. The pass's other threads only mesh graphs that are already decoded, and they cannot reach the file.
C2, the timing run on the rows above, is 43288830617: samples and the BIM4LCA models, against main97397b9e.
C2 read against its rows: all three hold. Timing run 43288830617, head 343690a5 (#1813, with #1817's index) against main97397b9e. Base and head were timed on one runner, three rounds a file, and the table shows medians.
Exports: byte for byte. Every ifc.sha256 and every scorer file equals main's. The scorer diff lists only areas_across_saves.txt and areas_across_saves_2021.txt, which the head side alone writes, as in runs A and B. The same-project gates pass. Holds.
Peak.
file
main
head
bar
Snowdon Towers Architectural
1,104 MiB
798 MiB
984 MiB
concrete office, as built
945 MiB
779 MiB
853 MiB
concrete office, at permit
1,014 MiB
833 MiB
954 MiB
The highest head / main ratio of any file is 1.02, 2021 rst_basic (86 to 88 MiB). Snowdon Towers HVAC reads 324 to 249 MiB, so its two values do not come into it. The timber office at permit, the largest peak of the run, goes 1,342 to 1,154 MiB. Holds.
Time. The median of the 28 samples of Revit 2023 to 2027 is 1.00 (bar 1.05). The three largest files are all faster (bar 1.10):
file
head / main
Snowdon Towers Architectural
0.95
concrete office, as built
0.95
concrete office, at permit
0.95
The four housing files went from 1.95 to 2.07 in run B to 0.89 each, and every BIM4LCA office is between 0.93 and 0.95. Holds.
No row asked for a per-file time bar, but two small samples are slower: 2023 rac_basic 2,298 to 2,458 ms (1.07) and 2027 rac_basic 3,751 to 3,937 ms (1.05). Their peaks fall 25%.
So the lever does what C1 said it would. Each read of the saved-graphics pass inflates only the groups that hold its records, and the pass no longer keeps the handle's inflated copies. The peak on the three largest files is now 0.72, 0.82 and 0.82 of main's, and the export is no slower.
Before #1813 is marked ready, it takes one unfiltered byte-identity run on 343690a5: the R2025 set, rac_advanced, BIMcollab and the held-out models, which C2 did not hold. It then merges main once #1817 lands.
#1813's unfiltered byte-identity run, 43293676880: every export is equal. The run measured 343690a5 against main97397b9e, the models C2 did not hold included.
All 126 models' ifc.sha256 equal main's: the samples of every year, the R2025 set, rac_advanced 2015 to 2020, BIMcollab and the held-out models.
The scorer diff lists only areas_across_saves.txt and areas_across_saves_2021.txt, which the head side alone writes, as in every run since A.
area:geometryWork in the geometry area.area:ifcWork in the ifc area.priority:P2Important quality, usability, or hardening work.type:bugCorrectness defect or regression.
Activity
fix(research): the saved-mesh pass reads each owner's graph with the …
DrunkOnJava commentedon Nov 11, 2026
First step: where the heap sits in the saved-mesh stage. Rows registered before the run.
probe_1075_heap_stages(exact heap bytes by stage, with the resident set beside them, from #1075) on Autodesk's samples of Revit 2023 and 2024 atmain979ec42 (the stagesaved_meshesrunsattach_scoped_with_controlwith the default scope): Measure run 42958124918,scorers=none,base=none.rac_basic2023 the live heap at the end of thesaved_meshesstage is at least 500 MiB over its start, and the stage's peak is the export's peak.inflate <stream>lines of the graphics partitions) are 300 MiB or more, and the decoded graphs of one batch (symbols and owners) 150 MiB or less.If 1 holds and 2 misses, the cache is not the holder and the next step is the batches' graphs and the owners kept for their symbols (
at_peaksays which block sizes); if 1 misses, the growth is outside the stage, in the STEP model it builds.chore(release): the 0.18.0 notes, README, docs and help text carry th…
DrunkOnJava commentedon Nov 11, 2026
Result of Measure 42958124918 against the rows registered above: row 1 half held, rows 2 and 3 missed. The memory is in the meshing, not in the cache. Rows for the next run registered at the end, before it.
probe_1075_heap_stagesatmain979ec42 on Autodesk's samples of Revit 2023 and 2024. The stagesaved_meshesis the production pass (attach_scoped_with_control, default scope). MiB:rac_basic2023rac_advanced2023rme_advanced2024Row by row, as registered:
rac_basic2023, "the live heap at the end of thesaved_meshesstage is at least 500 MiB over its start": missed, it is 26.3 MiB over (166.3 MiB after the stage, from 140.0). "The stage's peak is the export's peak": held, 770.6 MiB live and 879.4 MiB resident, against 168.9 MiB at the export stage's peak. The memory is a transient inside the pass, not something the pass keeps.What the run shows instead: at each pass's peak the largest share of the live bytes is in blocks of 512 bytes (502 of 771 MiB on
rac_basic, 869 of 1,900 on Snowdon Architectural), thesaved-meshesevent's live heap rises from 173 to 770 MiB while the batch is meshed (444 of 444 items) and ends at 181, and the 512-byte blocks do not follow the triangles (737 bytes a triangle onrac_basic, 217 on Snowdon Architectural). So the lever is what the meshing of a batch holds at once, not the symbols' graphs or the partition cache.Next step: which call sites hold the pass's peak. Rows registered before the run.
probe_1075_heap_sites(dhat: the call stack of every allocation, bytes at the highest heap, stagemeshes= the pass alone, profiled from its start, on an export made unprofiled) on Autodesk's samples of Revit 2023 (rac_advanced,rac_basic,rst_basic) atmain979ec42: Measure,scorers=none,base=none.rac_basic2023 the pass'sat_peakis 550 MiB or more (the run above: 630.6 over the start).rvt::frame,by function) holds half or more of it, and it is in the meshing (native_parametric_mesh,native_saved_mesh, or amesh_*function ofnative_saved_scene), not in the graph decode (native_parameters,object_graph,native_document) or the inflate.rac_advanced2023 (292.0 over the start above) the largest function at the peak is the same one.If 2 misses (the peak is spread over decode and mesh), the lever is the batch's size: bytes of body rather than the 20,000 graph objects of
BATCH_OBJECT_BUDGET, and the next run sizes batches that way. If 2 holds in the meshing, the next step reads that function for what it keeps per face and per element, and frees it where the batch's elements finish. Either fix moves no body: the unfiltered Measure'sifc.sha256stays identical, and--no-saved-meshesstill returns 0.17.0's memory.DrunkOnJava commentedon Nov 11, 2026
Two notes before the call-site run reports.
mainat 979ec42 (run 42957158734, release WASM): Core Interior'sestimatedPeakBytesis 321.6 MiB (ten times the file, Viewer: show real decode progress, and say clearly when a model is too large for the browser #1195) against a wasm memory of 383.3 MiB with the meshes on (308.1 with them off); RE1 Electrical 128.2 estimated against 212.5 measured (160.9 off), RE1 Architecture 63.2 against 117.5 (96.4 off). The pre-check has no row in the release notes; it should follow the pass's real cost once Default saved meshes: after #1691 the peak memory is still 1.4 to 4.4 times 0.17.0's on Revit 2023 to 2027 files; where the rest sits #1694 settles it.saved_symbolsread shows 644 MiB of them for 79,868 objects onrst_basic2023, 8 KiB an object), not of finished meshes: after the pass the model keeps all 714,649 triangles ofrac_basicin +26 MiB. So the holder is not yet established as "the batch's meshes"; it may as well be the owners' graphs the pass keeps (decoded for every owner before the first batch) or the streaming buffer of the walls. The dhat run (rows above) names the call sites; a fix waits for it.chore(release): prepare v0.18.0 (#1688)
DrunkOnJava commentedon Nov 11, 2026
Result of Measure 42960663793 (
probe_1075_heap_sites, stagemeshes,main979ec42) against the rows registered above: rows 1, 3 and 4 held, row 2 missed on where. The pass's peak is decoded graph objects, not meshes. Rows for the next run registered at the end, before it.dhat follows every allocation of the pass alone (
attach_scoped_with_control, default scope) and says what was live when its heap was highest. MiB at that peak, and the share of the largest single call site:rac_basic2023Cursor::field_as49.9rac_advanced2023Cursor::field_as21.1rst_basic2023Cursor::field_as11.8The largest site on all six is the same: the leaf nodes of a
BTreeMap(825,000 blocks of 633 bytes onrac_basic, which is the size of aserde_json::Map<String, Value>node, 11 slots of a 24-byteStringand a 32-byteValue), allocated bynative_parameters::Cursor::field_as/class_in, insidedecode_graph_incalled fromdecode_graph_cached(the stacks, all six of the largest). Nothing in the meshing is near it:tessellate_uvholds 11.7 MiB onrac_basic(1.9%),graphics_impl8.9, the primitives' vectors under 1%; what the pass leaves (26.4 MiB at its end) is the compact mesh.Row by row, as registered:
rac_basic2023's pass peaks at 630.7 MiB (550 or more asked).native_parameters), not in the meshing as the row required.rac_advanced2023 the largest site at the peak is the same, 234.9 of 292.0 MiB.So the earlier reading, that a batch's finished meshes are the holder, is wrong: after the pass the model keeps all 714,649 triangles of
rac_basicin +26 MiB, and the peak is the decode. The row's branch "if 2 misses" named a mixture of decode and mesh; the miss here is all decode, and the batch's size by body bytes is the lever only if the decoded set at the peak is many records. That is what the next run measures.Why this is not the budget. 825,000 leaf nodes is at least that many decoded objects live at once (an object with up to 11 fields takes one node), against a buffer of owners and a batch of symbols that each stop at about 20,000 graph objects (
OWNER_OBJECT_BUDGET,BATCH_OBJECT_BUDGET). Either a few records are decoded whole far past the budget (a record is added to the buffer before the budget is looked at) or many are held at once.Next step: how big the records are. Rows registered before the run.
probes/examples/probe_1694_owner_sizes.rs(branchresearch/1694-owner-sizes) reads the records the pass reads (channel 103, the ids of every building element of the export) one at a time, keeps nothing of them, and prints their graph objects, body bytes and symbols named, with a histogram and the share of the largest 1, 5 and 25. Measure on Autodesk's samples of Revit 2023 and 2024 and the reference models,scorers=none,base=none.rac_basic2023 the records hold 700,000 graph objects or more in all.rac_advanced2023 and Core Interior: the largest 5 hold half of the objects.If 2 or 3 miss (thousands of small records), the live set at the peak is the pass keeping many records at once and the next probe prints what the pass holds by stage in the batch loop; if they hold, the lever is not to decode a record's whole graph as a
Valuetree where meshing reads a few of its fields, or to bound the buffer by objects before a record is added.DrunkOnJava commentedon Nov 11, 2026
Result of the owner-size probe (Measure 42971398698,
probe_1694_owner_sizesat 0e8d4a1) against the rows registered above: all four missed. The owners are small; what the pass holds at its peak is not the owners. Rows for the next probe registered at the end, before it.The probe reads the 467 owner records of
rac_basic2023 one at a time and keeps nothing. They hold 18,280 graph objects in all (700,000 or more asked), and the largest holds 1,849:rac_basic2023rac_advanced2023rst_basic2023rac_basic2023's owners hold 18,280 graph objects, not 700,000.rac_advanced's 7.9%.So the 825,000 decoded nodes of
rac_basic2023's peak (630.7 MiB, 79% of it) are not owners: the owners of the whole file are 18,280 objects, a 45th of the nodes dhat counts. They are the shared symbols the owners name (InstanceInfo.m_symbolId), whichextract_in_batches_with_controlreads a batch at a time: "on the BIM4LCA office 105 symbols hold 99% of the graph objects of 538 doors and windows". The plan sizes the first batch at 8 symbols before it knows one, then sizes each next batch as20,000 * (records read) / (their objects)clamped to 4..=1,024 symbols, so a batch of 4 symbols is the smallest it can plan, and a symbol that holds 100,000 objects makes any batch holding it 5 times the budget however it is planned.Next probe, rows registered before the run.
probes/examples/probe_1694_batch_plan.rs(branchresearch/1694-batch-plan) reads the owners, then every shared symbol they name and the symbols those name, a level at a time keeping counts, and replays the pass's plan on those counts (the sort, the first batch of 8, the next batch's size from the one before, the closure each batch reads). It prints each batch's owners, symbols named, shared records read and graph objects, the peak batch, and the 12 largest symbols with the number of owners that name each. Measure on Autodesk's samples of Revit 2023 and 2024 and the reference models,scorers=none,base=none.rac_basic2023 the batch with the most graph objects holds 150,000 or more (7.5 times the 20,000 the plan aims at); the 825,000 nodes dhat counts at the peak are at least that many objects' fields.rac_advanced2023 the peak batch holds 60,000 objects or fewer (3 times the budget), and on Core Interior 40,000 or fewer: the overshoot is the small file's.If 2 holds, the lever is not the batch's size: a symbol is read whole, and the memory per decoded object (a
serde_jsonfield map, 633-byte nodes) is what makes it cost, so the fix is in how a graph is decoded (the existingOptions::graph_fieldsprojection keeps only the fields a reader names). If 2 misses and 1 holds, the plan overshoots because its first batch and its clamp know nothing of a symbol's size, and a batch can be sized by the record'sbody_bytes, which is known before it is decoded.62 remaining items
perf(research): each uncached read of the saved-graphics pass inflate…
DrunkOnJava commentedon Nov 12, 2026
Why run B still missed time, the lever that follows, and its rows before any run.
The probe of
1958414b(43283294375) counts each partition's groups by channel:On these files one partition holds nearly everything, so the record index can skip almost no partition. Each read of the pass inflates the whole file. Run B's added time on Snowdon Towers Architectural, 21.2 s, is about 23 such walks.
Two levers were ruled out first:
The lever (
343690a5, on #1813's branch):maindoes.C1. Mechanism, registered first. Probe
probe_1694_group_sizesat343690a5on the same models, before any timing run. After the census it makes the default export and prints the bytes its native walks inflated themselves, which only the pass does, over the file's inflated bytes. To meet run B's time bars, given run B's added time and the walk times above:If C1 misses, the reads that select nearly every channel-103 group (the owners, the owners that name nothing, and the symbols' sizes) are looked at first, before any timing run.
C2. Timing, only once C1 holds. Samples and the BIM4LCA models against
main97397b9e, rounds and runners as in runs A and B:ifc.sha256and every scorer file equalsmain's.main. A file whosemainrounds fall into two values, as Snowdon Towers HVAC's do, is judged on its lowest and highest rounds, as in the comment above.main's, and the three largest within 1.10.DrunkOnJava commentedon Nov 12, 2026
Runs A and B read against the rows above (both against
main97397b9e, base and head timed on one runner, three rounds a file).A. The record index alone (
86ee8199, #1817), run 43277786356.Exports: every
ifc.sha256and every scorer file equalsmain's. Holds.Time: no file of Revit 2023 to 2027 is slower than
mainby more than 3% (the slowest is 1.00). The median of the 28 samples is 0.99, from 0.93 (Snowdon Towers Architectural, 40.8 s to 38.0 s) up. Holds.Peak: every file is within 1% of
mainbut one. Snowdon Towers HVAC read 325 MiB onmainand 339 MiB on the head, 1.04. Run B read the samemaincommit on that file at 338 MiB, somainalone moved 4% between runs. Judged as registered above, over every round of run A and the re-time (43281306266, second attempt):main's 330,192: 1.005;main's 346,668: 1.002.On the re-time alone the medians are 333,472 against 332,308 KiB (1.004). Holds.
All three rows of A hold. #1817's head is taking the unfiltered run for the exports (43287191948) before it is marked ready.
B. #1813 with the index (
b0308461), run 43277793055.main. Holds.The index removed each read's second walk, and on
mainit costs no time or saves some. The uncached walks still cost about a third more time, because each read still inflates every segment of every partition it visits. Why that is nearly the whole file, and the lever that follows, with its rows, are in the comment above.docs(research): the record index's rustdoc says it holds one channel'…
DrunkOnJava commentedon Nov 12, 2026
C1 read against its rows: holds. Probe run 43287108843 at
343690a5. Each figure is the bytes the pass's own walks inflated during a default export, divided by the bytes of one walk of the whole file.On run B's head, each read inflated the whole file, about 23 walks on Snowdon Towers Architectural. With the group skip, the whole pass now inflates about half a walk.
The other files of the run fall from 0.03 (the terrain office) to 0.54 (rac_advanced and the concrete housing as built).
The counter covers every walk the pass makes. The pass's other threads only mesh graphs that are already decoded, and they cannot reach the file.
C2, the timing run on the rows above, is 43288830617: samples and the BIM4LCA models, against
main97397b9e.DrunkOnJava commentedon Nov 12, 2026
C2 read against its rows: all three hold. Timing run 43288830617, head
343690a5(#1813, with #1817's index) againstmain97397b9e. Base and head were timed on one runner, three rounds a file, and the table shows medians.Exports: byte for byte. Every
ifc.sha256and every scorer file equalsmain's. The scorer diff lists onlyareas_across_saves.txtandareas_across_saves_2021.txt, which the head side alone writes, as in runs A and B. The same-project gates pass. Holds.Peak.
mainThe highest head /
mainratio of any file is 1.02, 2021rst_basic(86 to 88 MiB). Snowdon Towers HVAC reads 324 to 249 MiB, so its two values do not come into it. The timber office at permit, the largest peak of the run, goes 1,342 to 1,154 MiB. Holds.Time. The median of the 28 samples of Revit 2023 to 2027 is 1.00 (bar 1.05). The three largest files are all faster (bar 1.10):
mainThe four housing files went from 1.95 to 2.07 in run B to 0.89 each, and every BIM4LCA office is between 0.93 and 0.95. Holds.
No row asked for a per-file time bar, but two small samples are slower: 2023
rac_basic2,298 to 2,458 ms (1.07) and 2027rac_basic3,751 to 3,937 ms (1.05). Their peaks fall 25%.So the lever does what C1 said it would. Each read of the saved-graphics pass inflates only the groups that hold its records, and the pass no longer keeps the handle's inflated copies. The peak on the three largest files is now 0.72, 0.82 and 0.82 of
main's, and the export is no slower.Before #1813 is marked ready, it takes one unfiltered byte-identity run on
343690a5: the R2025 set, rac_advanced, BIMcollab and the held-out models, which C2 did not hold. It then mergesmainonce #1817 lands.perf(research): release_inflated_partitions is crate-private, and the…
perf(research): each read of the saved-graphics pass visits only the …
DrunkOnJava commentedon Nov 12, 2026
#1813's unfiltered byte-identity run, 43293676880: every export is equal. The run measured
343690a5againstmain97397b9e, the models C2 did not hold included.ifc.sha256equalmain's: the samples of every year, the R2025 set,rac_advanced2015 to 2020, BIMcollab and the held-out models.areas_across_saves.txtandareas_across_saves_2021.txt, which the head side alone writes, as in every run since A.Since that run, #1813 has two new commits:
2853e3f5makesrelease_inflated_partitionscrate-private and adds a doc line.e640f162mergesmainafter perf(research): each read of the saved-graphics pass visits only the partitions holding a record it selects, from a record index of its own channel (#1694) #1817 landed. It took perf(research): the saved-graphics pass of a default export walks the partitions without the handle's inflated copies (#1694) #1813's side of both conflicts, which is perf(research): each read of the saved-graphics pass visits only the partitions holding a record it selects, from a record index of its own channel (#1694) #1817's code plusgroup_startsand the wanted groups. It changes only comments against2853e3f5, and theRecordIndexdoc equalsmain's.So this run and C2's rows hold for the head. #1813 is marked ready.
perf(research): the saved-graphics pass of a default export walks the…
DrunkOnJava commentedon Nov 12, 2026
Closed by #1813, merged as
1a9aacc7together with #1817's per-channel record index. The target is met.main, 126 of 126 in the unfiltered run, held-out models included (comment 6834969701).fix(research): an extract that makes the definitions counts that walk…
ci: Measure's summary opens with its verdict: which exports and diagn…
research: an opt-in ledger keeps every native pass a thread makes, wi…