Repository navigation
perf(ci): Measure runs its items concurrently, its exports and probes alone, and stops repeating work - #843
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7fb46d145f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
One line per step (export, glTF, rvt-info, schema checks, each scorer), in a .log file the compare job's diff leaves out, so a run shows where its time goes.
…ne per CPU, longest first Each item keeps its own folder and runs its steps in order as before; MEASURE_JOBS items run at once (nproc by default), the models scored against Revit's export first, then by file size. The IFC4 property set definitions are fetched once before the items start and written whole, then renamed, so no item reads a partial file. Each item's log group is written when it ends, with its wall time.
A wall hosting several doors was meshed, with all its openings, once per door: 284 s of the BIM4LCA office's 724 s in Measure. The box is the same each time, so each wall's is kept by its id.
…ts openings Meshing each host wall once left the office's door scorer at 246 s (run 39275375253): most of its 194 hosted doors have a wall of their own, and each wall was meshed with every opening cut out of it. Only the wall's box is read, so the openings are not cut.
ports_vs_ifc ran IfcOpenShell's full schema validation of the export again after Measure's schema step had (40 s of the BIM4LCA office's serial 506 s): ifc_validate_summary.py now writes the findings it reads, and ports_vs_ifc --validation reads them, printing the same lines. ifc_schema_arity.py parsed the file three times in one run; its checks share one parse.
…Shell's iterator create_shape meshed each door's mapped type geometry again for every door: the office's 269 doors in each file took 215 s even with host walls meshed once and uncut (run 39277422406). The iterator meshes a representation several elements map once; its boxes are bit-identical to create_shape's on the synthetic fixture and Revit's RE1 Architecture export.
…shellcheck took for reading its output (SC2094)
…times the summary compares are taken as before
…ace sets from the points its faces index, rather than meshing them
… limit is what it always was
…models and samples do
DrunkOnJava
force-pushed
the
perf/measure-parallel
branch
from
October 19, 2026 18:53
3c73402 to
a01c277
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Measure's Measure step runs its models, families and samples concurrently, one per CPU, longest first, and stops repeating work. On each runner CPU with a serial run to compare, a full run's Measure step takes 2.2 to 2.8 times less time: on the AMD EPYC 7763, 15.5 minutes, even with a probe on every file and the families added, against 33.4 to 36.3 for six serial runs without them; on the EPYC 9V45, 8.2 against 22.8. Every score, hash and report is the same file for file. Exports still run alone, before the items, so the export times the summary compares are as reliable as before. Probes still run alone, after the items, so their 20-minute limit means what it did. Each step's wall time and the runner's CPU and memory are recorded, so a run says where its time went.
Motivation
A full Measure run (the reference models, the BIM4LCA office, Autodesk's samples and the R2025 models) took 36 to 38 minutes, 95% of it the Measure step, which ran its 89 exports and their 27 scorers one after another. The runner has 4 vCPUs, and
vmstatduring a serial run shows them 70.2% idle. Of the scorers,door_bodies_vs_ifcalone took 211 s on each office model, and 192.7 s of that was IfcOpenShell building every polygon of Revit's door bodies as a B-rep face to mesh it, for a box. The office's 222 face-set doors hold 934,846 faces.Changes
tools/ci/measure-reference-models.sh:rvt-ifc.logas before;MEASURE_JOBSat once (nprocby default): the models scored against Revit's export first, then the rest, each by file size;timings.log, which the compare job's diff leaves out.tools/ci/ifc4_property_sets.py: the IFC4 definitions are fetched once before the items start, written whole and then renamed, so no item reads a partial file.tools/ci/ifc_validate_summary.pywrites the validator's findings tovalidation.jsonl, andtools/re/ports_vs_ifc.py --validationreads them instead of validating the export again. It prints the same lines.tools/ci/ifc_schema_arity.py: its checks share one parse of the file instead of three.tools/re/door_bodies_vs_ifc.py:IfcPolygonalFaceSets, and which no opening voids, has its box read from the points its faces index, throughifcopenshell.util.placement's mapping and placement matrices;.github/workflows/measure.yml:vmstatsamples the runner every 10 s intovmstat.log.Testing
Every run is the Measure workflow itself, dispatched from this branch with
-f nordic=true -f samples=true -f r2025=true, onmainat 2b5ba2f (before #832) or 23a9d76.main), + families and the same probeThe serial runs of the same day on other branches, a few commits from 2b5ba2f, took 33.4, 35.2, 35.6 and 36.3 minutes on the EPYC 7763 (39254274438, 39261416282, 39263341670, 39259646397) and 22.8 on the EPYC 9V45 (39253035097).
The runner's CPU is GitHub's choice and moves a run's time by up to about 1.7x, and two runs on the same CPU type here differ by 26% (10.3 and 13.0 on the EPYC 9V74). The comparisons below pair runs on the same CPU, or the same commit.
Results. All six runs of the final script give the same results. The runs on 23a9d76 are identical to
main's serial run of the same commit (39273188597) in all 1,439 files: scores, IFC hashes, schema reports,rvt-infooutput and witness observations. The runs on 2b5ba2f are identical to the serial runs in 1,410 files. The other 29 areports_vs_ifc.txt, which carry the attribute comparison feat(ifc): a port is typed by its connector's domain, and an electrical port is SOURCEANDSINK (#828) (RE-197) #832 added to that scorer since, and are identical once those lines are removed. All 29door_bodies_vs_ifc.txtfiles are identical, among them the R2025, RE1 and Core Interior ones, whose doors the iterator still meshes. Only timings differ.Export times. Of the 58 exports that take at least half a second, on the EPYC 7763:
Running them alone costs about 2.3 minutes of the Measure step (17.7 against 15.4).
Probes. With
-f families=true -f probe=probe_re135_undeclared_records(the probe onmainwith the most per-id scanning) on 23a9d76, this branch (39297493132) andmain's serial script (39297497513) give identical results in all 1,576 files, the 101 probe outputs among them, each endingexit 0. That probe peaks at 1.9 s on a file, so this checks the order, not a slow probe. A probe now runs as it did under the serial script, with nothing beside it, so its 20-minute limit means the same. The Measure step was 15.5 minutes on an EPYC 7763 against 33.3 on the faster EPYC 9V74.Door boxes. The direct box equals IfcOpenShell's mesh box to 1.1e-13 ft on ten of the office's doors, the three of 12,896 faces among them. On each office model the scorer takes 17 s on an EPYC 7763 with three items beside it (10 to 15 s on the other CPUs), against 211 s alone before.
Memory. In every final run at least 12.8 GB of the runner's 16 GB stayed free or reclaimable throughout, with no swap.
Lanes. Four items on four vCPUs take each step about 1.6 times as long as alone on the EPYC 7763 (the exports' median, 1.58), since the vCPUs are two cores' hyperthreads. With the CPU 1 to 4% idle during the items, more lanes would not help.
bash -nandshellcheckpass on the script with no notes. Main's two SC2086 notes onRVT_IFC_FLAGSare gone too, because the directive now sits on the command. Smoke runs with stub binaries checked the order: the exports one after another, then the items, then the probes, with a model's probe scorer after its probe and a sample's release pair. No unit tests, by the repository's rule.tools/bench.shtimes the decoder, which this does not change.Audit-honesty checklist
Legal and contribution hygiene
CONTRIBUTING.md)CLEANROOM.md)Breaking changes
None to the crate. Measure's result folders gain
timings.log(andvmstat.logat the top), which the compare job's diff leaves out; a run's log groups appear when each item ends rather than in a fixed order.Note
Low Risk
Changes are limited to CI measurement scripts and research scorers; export/score outputs are intended to stay identical, with only new timing/vmstat artifacts and log ordering differences.
Overview
Measure CI runs much faster by restructuring
measure-reference-models.sh: IFC exports still run serially first (sorvt-ifc.logwall times stay comparable), then models/families/samples run in parallel (MEASURE_JOBS, defaultnproc, longest/scored-first ordering), and probes run serially last (20‑minute timeouts unchanged). Each step records wall time in per-itemtimings.log; the workflow also capturesvmstatevery 10s intoresults/vmstat.log.Duplicate IFC work is removed:
ifc_schema_arityshares one parsed model across checks;ifc_validate_summarycan emitvalidation.jsonl, whichports_vs_ifc --validationreuses instead of re-validating; IFC4 pset definitions are prefetched once with an atomic rename so concurrent readers never see a partial CSV.door_bodies_vs_ifcis optimized for Revit polygonal-face-set doors (box from indexed face points + placement) and batches wall/door meshing via IfcOpenShell’s iterator, with host walls meshed once without opening subtractions.Reviewed by Cursor Bugbot for commit a01c277. Configure here.