Skip to content

ci: the readers census reads a body saved as a triangle mesh from the IFC and meshes the others on every core (#1616) - #1622

Merged
DrunkOnJava merged 2 commits into
mainfrom
ci/gates-fast-face-sets
Nov 9, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
ci/gates-fast-face-sets

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

tools/re/save_pair_bodies.py, which the census of tools/re/readers_across_saves.py meshes every body of two saves with, now reads a body Revit saved as a triangle mesh from the IFC and meshes every other body in one call on all cores. The numbers it compares are the old ones: the same bodies, world boxes identical to the last bit, volumes within 9.2e-5 of the old against a tolerance of 1e-3, and no verdict of any pair changes.

Motivation

#1616: the samples-2024-2099 shard of Measure takes 34 to 50 minutes of its 90 on the saved-mesh default (#1610), where it took 11. With each body meshed by its own create_shape call, a Revit 2026 save of rac_advanced took 52 of 55 s of the census's meshing, and a profile of bodies_across_saves.py on the 2026 and 2025 saves of rac_basic (59.3 s, with the meshing already on all cores) puts 57.6 s in the census of readers_across_saves.py and 56.1 s of those in IfcOpenShell's iterator. IfcOpenShell builds an OpenCASCADE face from each triangle of an IfcTriangulatedFaceSet and meshes it again. Timed element by element (one create_shape each, on a Mac carrying other work, 106 s in all): two sanitary terminals of 163,040 triangles took 22.3 s and 20.3 s and 23 footings of 2,936 triangles 26.4 s, and of rac_basic's 441 bodies 314 are triangle meshes. The triangles are what the census compares, and they are in the file.

Changes

  • tools/re/save_pair_bodies.py:
    • face_set_mesh (new): a product whose one Body representation holds one IfcTriangulatedFaceSet (no PnIndex, a 3D point list, indices in range) and that has no HasOpenings is read as its points through its ObjectPlacement (ifcopenshell.util.placement.get_local_placement) and the unit scale, with the file's own triangles. Anything else returns None.
    • bodies(): pairs and Tag rules unchanged (a Tag more than one product carries is still not scored; a product with no Tag is still counted apart). Face sets are read; the rest is meshed by IfcOpenShell's iterator on every core, one call, where it was one create_shape per element. A body the iterator does not return did not mesh, as one that raised did. The volume is the same formula about the world's origin.
    • The module docstring says which bodies are read and which are meshed.

Testing

Unit tests are banned here, and none is added. The old and the new bodies() were run on the kept exports of Measure's samples (keep_ifc=true, Revit 2025 and 2026 saves of each project) and compared body by body (the harness imports the two bodies() and prints the figures below; the old one is git show cbeba4c7:tools/re/save_pair_bodies.py):

Export Bodies Read from the file Old meshing New meshing Worst volume difference Worst world box difference
rac_basic 2025 441 314 62.8 s 0.9 s 9.2e-5 0
rac_basic 2026 441 314 64.5 s 0.8 s 9.2e-5 0
rst_basic 2025 and 2026 453 not counted 7.2 s 0.4 s 5.8e-11 0
rac_advanced 2025 5,527 not counted 401 s 34 s 8.9e-9 0
rac_advanced 2026 5,527 not counted 403 s 32 s 8.9e-9 0
Core Interior (2024) 854 not counted 51.6 s 29.7 s 1.6e-10 0

The same Tags, the same bodies that did not mesh (none), the same class and BodySource on every body. The seconds are one run each on a Mac carrying other work (its load average was above 100 for the longer runs, and several runs went at once), so they are indicative; the gates' own time on Measure's runners is below. The one volume that moves by more than 1e-6 is a door of rac_basic 17 m from the world's origin: its triangles do not share their corners to the last micron, IfcOpenShell joins those corners and the file's triangles are not joined, so the volume about the world's origin takes each gap times its distance. That is 9.2e-5 of the door's volume against the census's tolerance of 1e-3; no other body is above 7.1e-7.

Verdicts, the census's own comparison (same(), world box 3 mm and volume 0.1%) over every body present in both the 2025 and 2026 saves, with each implementation's bodies: rac_basic 441 pairs, 440 the same in both; rst_basic 453, all the same in both; rac_advanced 5,527, 5,523 the same in both; no verdict differs.

rme_advanced and rme_basic (about 6,600 bodies a save, 94 and 100 MB exports) were not compared body by body here: the old meshing takes too long on a loaded Mac. The Measure run below holds them to the same gates as the base side's.

Measure. Run 42668227629 (-f ref=625537fe187a2bf90d8f1730c52aae41db9ee831 -f base=none -f samples=true -f sample_years="2024 2027" -f scorers=bodies_across_saves, from this branch) holds the 2024 to 2027 saves of every sample project to the gates on this head.

Save Old New
rac_advanced 2026 / 2027 397 / 395 63 / 64
rac_basic 2026 / 2027 410 / 411 13 / 14
rme_advanced 2026 / 2027 1,125 / 808 155 / 139
rme_basic 2026 / 2027 1,203 / 831 150 / 116
rst_basic 2026 / 2027 59 / 59 13 / 14
the 2025 saves (compared with 2024's, no census) 4 to 75 4 to 82
all 15 saves 5,880 933

The shard's own time is more than the gates: each sample's schema step (schema-validate-rules, IfcOpenShell's WHERE rules, 112 s on rac_advanced 2026 and 248 s on rme_advanced 2026) is the other large part of an item, so #1616 stays open for it.

  • tools/check-local.sh: N/A, no Rust or workflow change (a Python file under tools/re/ that Measure runs).
  • Verified end to end on real Revit files: Autodesk's sample projects (Revit 2025 and 2026 saves), as above and in the run below.
  • No change to the IFC exporter, so no witness refresh.
  • Performance change: the timing is that of the gates in the Measure run below, before and after.

Audit-honesty checklist

  • The pages say what was checked and what was not: the volume of a mesh whose triangles do not share their corners differs from IfcOpenShell's by the gaps' contribution (at most 9.2e-5 measured), and the census's printed volumes can differ in their fifth digit from the old ones.
  • No user-visible change, so no changelog fragment.
  • No emojis, private paths or PII.

Legal and contribution hygiene

  • Apache-2.0. No Autodesk proprietary source, decompiled internals or NDA'd content. The exports are those of Autodesk's sample projects, fetched by Measure.

Breaking changes

None.

Related issues

Refs #1616 (its "done when" is the heaviest job of a samples=true run under about 45 minutes; this PR takes the gates' share, and the schema step is the rest).

… IFC and meshes the others on every core (#1616)

tools/re/save_pair_bodies.py meshed each of the 5,527 bodies of a Revit
2026 rac_advanced save with its own create_shape call, which builds an
OpenCASCADE face from every triangle of a saved mesh and meshes it again.
The census of tools/re/readers_across_saves.py does that for both saves
of a pair, and a profile of the gates on rac_basic puts 96% of their time
there: two sanitary terminals of 163,040 triangles took 40% of it.

A body that is one IfcTriangulatedFaceSet with no opening cut from it is
now read from the file: its triangles, placed by its ObjectPlacement and
scaled to metres. Every other body goes through IfcOpenShell's iterator on
all cores in one call.

Against the old meshing, on the kept exports of the Revit 2025 and 2026
saves of rac_basic, rac_advanced and rst_basic, and of Core Interior: the
same bodies, the same ones that did not mesh, the same classes and sources,
world boxes identical to the last bit, and volumes within 9.2e-5 of the old
(one door of rac_basic; 9e-9 on rac_advanced, 6e-11 on rst_basic), against
a tolerance of 1e-3.
…triangles use (#1616)

A point list can hold points no triangle indexes: the writer appends each
saved primitive's whole vertex array, and 155 of the office's 11,084 face
sets hold some, up to 481 in one. IfcOpenShell's meshing only ever saw the
vertices of the triangles, so the box of a body read from the file moved
with such a point where the old box did not: on a copy with one unused
point 500 m away the volume was equal and the box moved 499.9 m. None lies
outside its triangles' box in the files measured, so no gate text changed,
but another model could turn a pair red.

The corners are now those of verts[np.unique(faces)] for every body, the
two paths alike. The volume is untouched. Found by rvtDevelop's second read
of #1622.
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 9, 2026 18:43
@DrunkOnJava
DrunkOnJava merged commit bfa3698 into main Nov 9, 2026
69 checks passed
@DrunkOnJava
DrunkOnJava deleted the ci/gates-fast-face-sets branch November 9, 2026 18:58
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

The gates-only Measure on the final head (bc9fb93, after the box fix; 42675088490) finished after the merge, because arm.sh did not count this file among the gates' own and armed without waiting for it: the same-project gates verdict on bc9fb93 is a pass (15 samples held to their earlier saves, and the Areas on 4 saves), the gate text of all 15 saves is again byte for byte that of run 42647512042, and the gates' time per save, summed, is 949 s against 5,880 s. arm.sh lists tools/re/save_pair_bodies.py now.

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