Skip to content

perf(ci): Measure runs its items concurrently, its exports and probes alone, and stops repeating work - #843

Merged
DrunkOnJava merged 12 commits into
mainfrom
perf/measure-parallel
Oct 19, 2026
Merged

DrunkOnJava merged 12 commits into
mainfrom
perf/measure-parallel

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

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 vmstat during a serial run shows them 70.2% idle. Of the scorers, door_bodies_vs_ifc alone 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:
    • every rvt-rs export runs first, alone, one at a time, with its time in rvt-ifc.log as before;
    • then each model, family and sample is an item, run in its own result folder, MEASURE_JOBS at once (nproc by default): the models scored against Revit's export first, then the rest, each by file size;
    • then every probe, its pair run and its probe scorer, alone, one at a time;
    • each step's wall time goes to the item's 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.py writes the validator's findings to validation.jsonl, and tools/re/ports_vs_ifc.py --validation reads 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:
    • a door whose one representation is a Body of mapped IfcPolygonalFaceSets, and which no opening voids, has its box read from the points its faces index, through ifcopenshell.util.placement's mapping and placement matrices;
    • every other door, and every host wall, is meshed with IfcOpenShell's iterator;
    • each host wall is meshed once, before its openings are cut, since only its extent is read.
  • .github/workflows/measure.yml: vmstat samples the runner every 10 s into vmstat.log.

Testing

Every run is the Measure workflow itself, dispatched from this branch with -f nordic=true -f samples=true -f r2025=true, on main at 2b5ba2f (before #832) or 23a9d76.

Run Script Measured Runner CPU Measure step Mean CPU idle
39271973525 serial (before) 2b5ba2f EPYC 7763 34.6 min
39272361465 serial (before) 2b5ba2f EPYC 7763 36.2 min 70.2%
39281929849 concurrent, exports beside the items 2b5ba2f EPYC 7763 15.4 min 0.8%
39295886058 + exports alone first 2b5ba2f EPYC 7763 17.7 min 15.8%
39297484598 final: + door face-set boxes, probes alone last 2b5ba2f EPYC 9V45 8.2 min 18.4%
39297489200 final 23a9d76 EPYC 9V74 10.3 min 18.8%
39302262069 final 2b5ba2f Xeon 6973P-C 10.0 min 24.4%
39302265725 final 2b5ba2f EPYC 9V74 13.0 min 18.8%
39297493132 final, + families and a probe on every file 23a9d76 EPYC 7763 15.5 min 17.9%
39297497513 serial (main), + families and the same probe 23a9d76 EPYC 9V74 33.3 min

The 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-info output and witness observations. The runs on 2b5ba2f are identical to the serial runs in 1,410 files. The other 29 are ports_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 29 door_bodies_vs_ifc.txt files 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:

    • the second serial run is within 1.01x to 1.09x of the first (median 1.05);
    • with exports beside the items they were 1.49x to 2.43x (median 1.58), which would have made the summary's base-to-head export list unusable;
    • with exports alone first they are 0.98x to 1.01x (median 1.00).

    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 on main with the most per-id scanning) on 23a9d76, this branch (39297493132) and main's serial script (39297497513) give identical results in all 1,576 files, the 101 probe outputs among them, each ending exit 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 -n and shellcheck pass on the script with no notes. Main's two SC2086 notes on RVT_IFC_FLAGS are 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.

  • Verified end to end through the Measure workflow on the reference models, the BIM4LCA office, Autodesk's sample projects and the R2025 models, fetched for each run and never committed
  • Performance change: before and after are the runs above. tools/bench.sh times the decoder, which this does not change.

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • 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
  • N/A: not a reverse-engineering finding

Legal and contribution hygiene

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

Breaking changes

None to the crate. Measure's result folders gain timings.log (and vmstat.log at 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 (so rvt-ifc.log wall times stay comparable), then models/families/samples run in parallel (MEASURE_JOBS, default nproc, longest/scored-first ordering), and probes run serially last (20‑minute timeouts unchanged). Each step records wall time in per-item timings.log; the workflow also captures vmstat every 10s into results/vmstat.log.

Duplicate IFC work is removed: ifc_schema_arity shares one parsed model across checks; ifc_validate_summary can emit validation.jsonl, which ports_vs_ifc --validation reuses 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_ifc is 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread tools/ci/measure-reference-models.sh Resolved
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
@DrunkOnJava
DrunkOnJava force-pushed the perf/measure-parallel branch from 3c73402 to a01c277 Compare October 19, 2026 18:53
@DrunkOnJava
DrunkOnJava merged commit 3c61066 into main Oct 19, 2026
32 checks passed
@DrunkOnJava
DrunkOnJava deleted the perf/measure-parallel branch October 19, 2026 19:07
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
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