Repository navigation
ci: Measure's score cache hits again (shell scripts, SHA-pinned runs, the side it restores, ifc_common's siblings()), a run that names no scorers skips the samples' schema checks, and the shards never cached are cut finer - #1704
Conversation
…y commit on main's history, so it stops missing every lookup Run 42980660819 (29 minutes, the unfiltered Measure of a pull request) missed all 4,548 of its score-cache lookups, and 97% of its CPU time was in the steps the cache keeps: schema-validate-rules alone was 4,727 of 17,113 seconds on the head side. Two causes. The key hashed every non-Python file of tools/ci and tools/re, shell scripts included, and 25 of the last 153 commits of main changed one (the scrub script 14 times, the Measure script 8), which reset every entry. And the cache was saved only by a run that left base empty or named it main, so a run that pins its base and head to SHAs, as every comparison of two commits does, never saved: the plan job now asks the compare API whether each commit is main's tip or an ancestor of it, and a side on main's history saves.
…ed, in three each Beside shards that hit the score cache (3 to 5 minutes) the held-out shard took 770 seconds and racadv 899 on the head side of run 42980660819, and a run is as long as its longest shard. The held-out models split by name into the offices, the rvt-holdout house and the rest (which also takes any model added to the lists), racadv-2015 to 2020 into three of two.
…eave schema out, as the reference models do A probe run or scorers=none still ran arity, IfcOpenShell's EXPRESS rules and the property sets on every sample export: 170 to 220 s of a large MEP sample, which set the longest shard of such a run at about 1,000 s (run 42987216721). The models already gate the step with wanted schema; the samples now do too. ifc.sha256, the stage counts and the wall-rule counts are kept.
|
Rows registered before the proof run (the second run of the pair, The cold run read 0 hits on 2,274 cacheable lookups per side (4,278 more per side are never cached by design: held-out, BIMcollab, spent and racadv) and saved under The second run is dispatched from the branch's current head (95b9099: two workflow commits and one shell script after the cold run's commit), with the same
A miss on 1 names the step whose key changed; a miss on 2 stops this PR. |
|
Rows registered before the gate's run (95b9099: the samples' schema checks run only when the run's scorers include 42987216721 (
The default run (no |
|
Result of the gate's run 42990655084 against the rows above: all three held.
So a |
…irst, then the other side's Head and base export different files wherever the measured change reaches, so an entry of the other side hits only for the models both write alike. The second run of the proof pair restored whichever side had saved last and read 8% of its 4,548 cacheable lookups as misses for that reason alone (run 42990521699: 91.7% and 89.9% hits, 5,810 result files equal to the cold run's).
|
Result of the warm run 42990521699 against the first four rows: 2 and 4 held, 3 held on the wall time and not on the shard bound, 1 missed. The miss has one cause, now fixed, and the rows for a third run are registered at the end.
The fix (3fd9b9a): a side restores the newest entry of its own side first ( Rows for the third run (same refs and flags,
|
…iblings() made every importer read dirname since #1400 siblings() moved into tools/re/ifc_common.py on 2026-11-05 (#1400) and uses os.path.split and os.listdir. The cache allowed ifc_common to list a directory (the mesh cache) but not to split a path, so every scorer that imports ifc_common was refused as reading dirname: on a warm run in which every lookup it made hit (42992706693), about 8,200 s of scorer time per side still ran, saved_meshes_vs_ifc alone 1,585 s. The split is allowed there now, a closure that calls siblings() is refused unless EXTRA_INPUTS hashes the files it lists, and psets_vs_ifc declares them as unfilled_openings_vs_ifc does (whose declaration had stopped finding the function). 102 of tools/re's scorers keyed before, 158 do now.
|
Result of the third run 42992706693 (3fd9b9a, side-first restore) against its rows: 1 and 2 held, 3 missed by 43 s and 0.7 min. What it also shows is the larger finding of this PR, and the rows for the pair that tests it.
Why a run in which every lookup hits still takes 10.7 min. The lookups it makes are the light ones. On the 41 models that are not held out, 23 steps are never looked up, because the cache refuses them with The fix (294c4c0): Rows for the next pair (same refs and flags,
|
… its own With the body scorers cached the longest shard of a warm run is the held-out remainder, 454 s on the base side of run 42997978043 (10.2 min in all), and the flowbim.ee house (63.6 MB, against 4 MB for the other models of the shard but the BIM-Speed pairs) is the largest model in it.
|
Result of the second pair (42995189344 cold, 42997978043 warm, The cold run made 3,996 lookups per side (2,274 before the fix of ifc_common), all misses, and took 19.6 min.
So a warm run that pins its base costs the head side only: exports, |
Summary
An unfiltered Measure took 28.9 minutes and the score cache missed all 4,548 of its lookups. This makes the cache hit again and cuts the time a run spends on what it caches: with the same refs and flags, a run whose cache is warm takes 10.2 minutes (25.6 cold under the old key, 28.9 for the last unfiltered run), 3,996 of its 3,996 cacheable lookups on the side that ran hit, and every result file equals the cold run's. Four things kept the cache from hitting, and a fifth made a probe run pay for checks it did not ask for.
Motivation
Griffin asked where Measure's time goes. From the job and step logs of ten runs of today and the per-model
timings.logof 42980660819 (28.9 min): a run is its longest shard (the builds take 3.3 min, 26 shards start within a minute of each other, Compare takes 30 s), every shard is CPU-bound (88 to 98% busy on the 4-vCPU runner), and the work is the score cache's. What kept it from skipping that work, found one at a time as each proof run was read:measure-cache.pyput every non-Python file oftools/reandtools/ciin every key, and 25 of the last 153 commits ofmain(72 hours) changed one (scrub-holdout-results.sh14 times,measure-reference-models.sh8), each resetting every entry.mainwhosebasewas empty ormain; every comparison pins SHAs.ifc_commonmade every body scorer uncacheable. feat(ifc)!: write the openings a cabinet and a door cut in a wall, and a curtain wall's where nothing trims it (#1165) (RE-338) #1400 movedsiblings()intotools/re/ifc_common.pyon 2026-11-05. It splits a path and lists a directory; the cache allowedifc_commonthe listing (for the mesh cache) but not the split, so every scorer that imports it was refused asreads dirname: on a warm run in which every lookup hit, 8,244 s of scorer time per side still ran (saved_meshes_vs_ifc1,585 s,box_bodies_vs_ifc795,wall_bodies_vs_ifc704, 20 more). 102 of the 207 Python files intools/recould be keyed.scorers=none, still ran every sample's schema checks.measure_samplecalledschemaunconditionally, 170 to 220 s of IfcOpenShell's EXPRESS rules on a large MEP sample:samples-2024-2099took 1,223 s in a run that asked for no scorer.Rows were registered on this PR before each run: #1704 (comment), #1704 (comment), #1704 (comment) and #1704 (comment), and the results are read against them in the comments after each.
Changes
tools/ci/measure-cache.py: the key no longer hashes shell scripts (1);ifc_commonmay split a path, and a closure that callssiblings()is refused unlessEXTRA_INPUTShashes the files it lists, whichpsets_vs_ifcandunfilled_openings_vs_ifcnow do (their declaration finds the function in the closure) (4). 158 of the 207 files intools/rekey, from 102..github/workflows/measure.yml: the plan job asks the compare API whether the head and the base are onmain's history (head_on_main,base_on_main), and a side whose commit is on it saves the score cache (2); a side restores the newest entry of its own side first, then the other side's, thenmain's in the same order (3); the held-out shards are cut in three (offices,rvt-holdout-[0-9]*, the rest) andracadvin three, as they are never cached.tools/ci/measure-reference-models.sh: a sample's schema checks run when the run's scorers includeschema(5), as a reference model's do.docs/maintaining.md: the key, where the cache is saved and restored, and the siblings rule.Testing
Measured on the Measure runner (workflow and CI scripts only; no local build). Same refs and flags throughout (
ref1641128,base5f928b4, every flag), each pair with a cache name of its own (score_cache=warm1,warm2) so a pair is not helped by another:main's workflowsaved_meshes_vs_ifc,box_bodies_vs_ifc,wall_bodies_vs_ifc,mesh_bodies_vs_ifc,door_bodies_vs_ifc,layer_sets_vs_ifc), equal the cold run's, none differs.samples=true,scorers=none):samples-2024-2099's Measure step takes 116 s (1,223 s),samples-2008-2023's 46 s (258 s),ifc.sha256equal to the reference run's on 58 of 58 samples, noschema.txton any.psets_vs_ifcandunfilled_openings_vs_ifcand no other (checked withmake_key).tools/check-local.sh: workflow and CI script only; the PR's own CI runsenv config lintmain: 43000996895 (headab86d603against its merge base16411282, every flag,score_cache=warm2): itssame-project gatesverdict and the scorer diff are read on the PRAudit-honesty checklist
docs/maintaining.md)space_profiles_vs_ifc) stay uncached, and so dorvt-gltfandmcp_answers_vs_ifc; the held-out models, BIMcollab,spent-*andracadv-*are never cached by designLegal and contribution hygiene
Breaking changes
None. The first run after this lands starts a cold cache (the key's helper hash changes).
Related issues
Refs #1694 (the wall-time work it began with). #1400 is where
siblings()moved.