Repository navigation
ci(measure): the samples run in two halves by release and the held-out models in a shard of their own (#1237) - #1318
Merged
Merged
Conversation
…t models in a shard of their own, so no shard outlasts an office file (#1237)
1 task done
DrunkOnJava
enabled auto-merge (squash)
November 4, 2026 03:28
This was referenced Nov 4, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Nov 4, 2026
…ips the sliver pairs that cannot be nearest, with the same output (#1237) (#1320) ## Summary `tools/re/mesh_bodies_vs_ifc.py` scores its bodies on every CPU, finds the vertices of a body with a lexsort instead of `np.unique(axis=0)`, and skips the sliver triangles that cannot be a point's nearest. Every line it prints is the same on every model. ## Motivation The scorer took 75 to 85 s of each BIM4LCA office shard (run 41760244593's `timings.log`, EPYC 7763; the shard's `saved_meshes_vs_ifc` 215 s, `schema-validate` 168 s and `wall_heights_vs_ifc` 149 s are longer steps), all of it on one CPU. On the faster runners of run 41767184413 the old scorer took 14 to 16 s. Follows #1311, which shards each side. Where its time goes, measured on the office permit pair (a warm mesh cache, as in Measure, where `saved_meshes_vs_ifc` meshes first in the same task): - Meshing is not the cost in Measure: `mesh_parts` reads both files' bodies from the cache in 0.0 s (run 41762111248). Alone and cold it is 13 s for rvt-rs's IFC and 56 s for Revit's (run 41762114063), which the cache already removes. - The scoring loop is 41.2 s of 46.0 s (a fast runner), 1,068 `surface_distance` calls: 622 exhaustive ones 4.3 s, 446 pruned ones 32.6 s. cProfile: `distances` 27.1 s, `sample` (`np.unique(axis=0)`) 3.9 s, `ifcopenshell.open` 3.4 s for both files. - Inside the pruned path (run 41763294622, instrumented `distances`): the sliver pass, 25,117 calls of 8 triangles against every point, is 16.6 s of the 34.9 s serial loop. ## Changes - `tools/re/mesh_bodies_vs_ifc.py`: - `score_pair` / `score_all`: each body (its volume ratio and both `surface_distance` calls) is one task of a fork process pool over the CPUs (`RVT_MESH_WORKERS` sets the count, as for `mesh_parts`), heaviest first, collected in `tags` order, so the printed rows and rankings are built from the same values in the same order. Fewer than 16 bodies, or one CPU, score in this process; a dead worker falls back to scoring in this process. - the sliver pass measures a point against a sliver only when the point is within the nearest distance found plus the slack of the sliver's box or of its plane. A sliver's `inside` cannot be trusted, so its plane distance (`|height|`, which `distances` gives for a point it takes as inside) is part of the bound, and the distance to any of its three edges is no less than the distance to its box. A pair that is measured goes through the same `distances` arithmetic as before. - `sample` sorts the vertices with `np.lexsort` and drops repeats, which is `np.unique(axis=0)` without its structured-array comparison. - a worker stops at its next body when its parent has died (the `getppid` check `ifc_common.mesh_parts` uses), and an `RVT_MESH_WORKERS` that is not a number means the CPU count. - No change to `ifc_common.py`, the cache paths, `measure.yml` or `measure-reference-models.sh`. ## Testing Unit tests are banned in this repository: none added. Checked end to end on the BIM4LCA office files (CC BY-SA 4.0, `research/bim4lca-measure.tsv`) in Measure: - Same-process A/B on one runner (EPYC 7763, run 41764599268, the office permit pair, 534 bodies): the main-branch scorer 40.7 s serial; this scorer 21.9 s serial and 8.9 s with 4 processes; all 534 x 3 results (volume ratio and both distances) equal as floats, 0 mismatches (`res_new == res_old`). The stages of the 21.9 s: setup 0.9, block bounds and seeds 5.0, pair pass 4.4, sliver pass 6.1 (6.9 M of 78 M sliver pairs measured), exhaustive about 3.5, `sample` 0.7. - Threads instead of processes: 16.0 s against 13.1 s on 4 CPUs (run 41763294622), so processes. - `sample`: byte-identical to `np.unique(axis=0)` on all 1,068 samples of the office pair. - Filtered Measure with `base=main` (run 41765844976, models: both office files, core-interior, re1-architecture, three r2025 models, scorers `saved_meshes_vs_ifc mesh_bodies_vs_ifc`): `mesh_bodies_vs_ifc.txt` byte-identical (`cmp`) head against base on all 7 models, empty `compare-scorer-diff`. - Unfiltered Measure, `base=main nordic r2025 samples holdout` (run 41767184413, head 6cc6702): the scorer diff has no `mesh_bodies_vs_ifc` line (its one entry is the base side's missing terrain models, a BIM4LCA host failure handled in #1322), and `cmp` finds the office permit and as-built `mesh_bodies_vs_ifc.txt` byte-identical head against base. - What that run's step times do not show: `mesh_bodies_vs_ifc` took 19.5 s (permit, EPYC 9V74) and 16.5 s (as-built, EPYC 9V45) on the head side, 14.5 s (EPYC 9V45) and 15.6 s (Xeon 6975P-C) on the base side. Head and base ran on different CPUs, and `saved_meshes_vs_ifc` in the same runs took 164 s and 134 s against 119 s and 142 s, so those times compare machines, not code. The same-process A/B above is the evidence of the gain; a same-runner measurement of the whole shard has not been made. - [x] Verified end to end on real Revit files: the command, the files and the result are above; the reproduce command is `gh workflow run measure.yml --ref <ref> -f ref=<sha> -f base=main -f nordic=true -f models="nordic-office-*" -f scorers="saved_meshes_vs_ifc mesh_bodies_vs_ifc"` - [x] If this is a performance change: the before / after is above (Measure, not `tools/bench.sh`, which times the exporter) - [ ] `tools/check-local.sh`: not run (no Rust, workflow or documented-behaviour change; a Python scorer under `tools/re/` only) ## Audit-honesty checklist - [x] README / docs: no claim changes - [x] No user-visible change, so no `changelog.d/` fragment - [x] No new limitation. The pool is a fork pool, so the scorer needs a platform with `fork` (Linux, macOS), as `mesh_parts` does - [x] No emojis, no private paths or addresses ## Legal and contribution hygiene - [x] Apache-2.0 - [x] No Autodesk proprietary source or SDK content - [x] No new fixtures ## Breaking changes None. The scorer's output is byte-identical. ## Output samples Run 41765844976, `cmp` of `mesh_bodies_vs_ifc.txt`, head against base: ``` nordic-office-permit identical nordic-office-as-built identical core-interior identical re1-architecture identical r2025-12_Rooms_Door_Windows identical r2025-13_Rooms_Stairs identical r2025-17_Rooms_Stairs_Spiral identical ``` ## Related issues Refs #1237, as #1311 and #1318 (the shards) do.
DrunkOnJava
added a commit
that referenced
this pull request
Nov 4, 2026
…e Actions cache and saved from main (#1237) (#1322) ## Summary Since #1311 and #1318, each office shard and the "rest" shard of both sides fetch the BIM4LCA office files, so up to six jobs ask VTT's host for them at once. In run 41767184413, base "rest" waited 27 minutes on that host (03:32 to 03:59 UTC) before giving up. The terrain models were then NOT MEASURED on that side, and the R2025 archive and a held-out file also failed to download there. Measure now keeps these models in the Actions cache: - **BIM4LCA office files** (VTT, CC BY-SA 4.0): restored into `_bim4lca-measure`, checked against their pins, and hard-linked into `models/`. This is how CI's corpus job already keeps its BIM4LCA models. `fetch-bim4lca.py` asks the host only for files that are missing or fail their pin. - **puzzbobb's R2025 models** (Apache-2.0): restored into `_r2025`, keyed on the pins and on the fetch script; on a miss they are fetched as before. - **Saving:** both caches are saved from runs on `main` only, after a fetch that verified every file. - **Held-out models:** they carry no licence, are never cached, and keep fetching per run. ## Testing - actionlint finds nothing new. - Measure 41772557042 runs this branch on the permit office and one R2025 model with no cache, which exercises the miss path. A run from a branch does not save, so the hit path is first seen on the next `main` run after the merge. Its fallback is the fetch as before. ## Legal and contribution hygiene - [x] Apache-2.0. The BIM4LCA files' CC BY-SA 4.0 and the R2025 models' Apache-2.0 allow keeping copies. Nothing is committed. ## Related issues Refs #1237.
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
#1311's four shards a side left two long ones. In run 41761654404 (cebe163, every model and the samples):
This splits the two long ones:
holdout-* spent-*, since the held-out fetch brings both. "Rest" no longer fetches them.That makes six jobs a side, twelve with base; the account's limit is 40 concurrent jobs.
Unchanged: a pull request's run (one "rest" shard per side) and a filtered or pair run (one "all" shard). Changed besides the two long shards: a run with
holdoutbut nonordicorsamplesnow gets "held-out" and "rest", not one "rest" shard with the held-out fetch on.The second read ran the plan for all 64 combinations of
nordic,samples,r2025,holdout,bimcollabandfamilies, against the unsharded model set. Every combination measured each model and sample exactly once, and head and base always got the same shards. It also checked custody: the held-out scrub runs in every shard before upload, and "rest" no longer fetches held-out files.Proof
Measure 41765200637 runs this branch (at 5336512, the first seam) at main cebe163 with the same inputs as runs 41760252584 (unsharded), 41760244593 (6 shards) and 41761654404 (4 shards). Those three already give byte-identical
measure-headoutput, every file but the per-shard runner and vmstat logs. This run is held to the same diff; Result: identical to the unsharded run file for file (every difference is a per-shard runner or vmstat log), in 12.4 minutes from dispatch to Compare with the queue congested, against 44. Per shard, the Measure step took 8.9 min (office as built), 7.8 (samples 2022 on, at that seam), 5.7 (rest), 5.5 (held-out), 5.3 (office at permit) and 2.7 (samples to 2021). The seam then moved to 2023/2024; Measure 41767218509 (samples only, at 4aefcab) gives all 58 samples identical to the unsharded run's, in 7 minutes.Legal and contribution hygiene
Related issues
Refs #1237, #1311.