Repository navigation
ci(measure): build each side once and hand the binaries to its shards as an artifact (#1457) - #1459
Merged
Merged
Conversation
… as an artifact (#1457) Every shard of a commit installed Rust, restored rust-cache and, all at once on a commit the binary cache had not seen, built the same binaries: over 36 dispatched runs Build was 150 of 720 job-minutes, and a run of 12 shards built 12 times. A new job per side (needs: plan) holds the measured checkout, Rust, rust-cache with today's save-if rule (the shard clause goes), the binary cache key, restore, the Build step with the MCP server rules and the probes, and Save. It copies exactly rvt-ifc, rvt-gltf, rvt-info, rvt-rs-mcp when present and examples/<probe> for each probe that exists at the ref into a clean directory and uploads it as measure-bin-head or measure-bin-base. Each shard downloads its side's artifact into measured/target/ci, checks that the commit the binaries are of is its own checkout's, sets the executable bit and runs no Rust. A failed build skips the shards; the same-project gates job then leaves its two checks out and writes NOT MEASURED. Timing warns when timing-build's commits differ from the plan's. No cache-save rule is relaxed; their comments say what they are for now. Refs #1457
… down, and a re-run overwrites its shard results (#1457) The shards needed the Build jobs to succeed, so a base ref that no longer builds skipped the head shards, the head results and the gates' verdict. The measure job now runs after a failed Build job: that side's shards fail at the artifact download, the other side's run, Compare (which needs every shard) is skipped, and the verdict reads NOT MEASURED, never a success. The gates job leaves its two checks out only when no head result exists at all. The per-shard result upload gains overwrite: true, so a re-run of all jobs does not fail at the upload. Refs #1457
DrunkOnJava
marked this pull request as ready for review
November 5, 2026 20:12
DrunkOnJava
enabled auto-merge (squash)
November 5, 2026 20:22
18 tasks done
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 builds each side once, in a
Build head/Build basejob, and hands the binaries to that side's shards as the run artifactmeasure-bin-head/measure-bin-base. A shard no longer installs Rust, restores rust-cache or builds anything.Motivation
One item of #1457. Every shard of a commit missed the binary cache at once and built the same binaries: over 36 dispatched runs Build was 150 of 720 job-minutes (21%), and a 12-shard run built 12 times. The figures under Testing are from runs on
8096218c; they are labelled measured, modelled or projected.Changes
.github/workflows/measure.ymlplanalso outputssides(["head"]or["head","base"]).build(needs: plan, matrix over the sides,fail-fast: false): the measured checkout, Rust, rust-cache with today'ssave-ifminus the shard clause, the binary cache key, restore, the Build step (MCP server rules and the probes unchanged), Save. It then copiesrvt-ifc,rvt-gltf,rvt-info,rvt-rs-mcpwhen present andexamples/<probe>for each probe that exists at the ref (no hashed copies, no.dfiles) intobin-outwithbuilt-commit.txt, and uploads it asmeasure-bin-<side>(3 days).measurenowneeds: [plan, build], withif: !cancelled() && needs.plan.result == 'success'so that a failed Build job of one side does not take the other side's shards with it. It downloads its side's artifact intomeasured/target/ci, checksbuilt-commit.txtagainst its own checkout of the ref, removes that file, sets the executable bit, and writesmeasured-commit.txtitself. It keeps the measured checkout (PROBE_SCORER_DIR,commit.txt). Rust, rust-cache, the binary cache steps and Build are gone from it; nothing left in a shard calls cargo or rustc (tools/ci/measure-reference-models.shtests-x "$BIN/rvt-rs-mcp"and-x "$BIN/examples/$name", so an absent optional binary is skipped as before).same-project-gatesalso needsbuild. A new step looks for any head result: with none (the head side's build failed) it prints a warning and leaves out its two checks, which would fail on a results directory that does not exist; with some (only the base side's build failed) the checks run on them as always. The verdict is written either way, and--measure-resultnames the Build jobs when they did not succeed.upload-artifactthat lacked it gainsoverwrite: true(the per-shard results,semantic-diff,compare-scorer-diff,timing-bin,measure-timing-shard-*,measure-timing), so a re-run of Compare or of all jobs does not fail at an upload with a 409.timing-mergewarns, in the log and under the table, whentiming-build's commits differ from the plan's (full SHAs only; a ref that did not resolve, or an empty output, gets a notice).timing-builditself is unchanged.docs/maintaining.md: the score-cache "Where it lives" bullet and the build-script sentence, the MCP server bullet, and a new section "Measure builds each side once".No cache-save rule is relaxed: the rust-cache, binary cache, score cache, BIM4LCA and R2025 save conditions are as they were, except that rust-cache's loses the
rest/allshard clause because there is one job per side. The comments now say why the rules stand: a shard still runs the measured ref's binaries and, for a probe, its scorers, with the score cache and model folders writable.The PR changes only
.github/workflows/measure.ymlanddocs/maintaining.md. Neither is in the same-project gate paths (arm.sh'sGATE_PATHS:src/, the two across-saves scorers and their check scripts,same_project_verdict.py,measure-reference-models.sh,fetch-autodesk-samples.sh,autodesk-sample-projects.tsv), so no samples verdict is needed to land it. The merges ofmainwere clean.Testing
Unit tests are banned; none added. This is workflow YAML and a docs page.
tools/check-local.shpasses: N/A, no Rust or tool code changed, and no local builds here (lane rule 2).actionlint .github/workflows/measure.yml: only the known complaint about theuses: $/.github/actions/fetch-corpusform.Head resultsstep were run locally with shims forcargoandgit(no build).--ref ci/measure-builds-once-per-sideon8096218c(a branch dispatch saves no cache, the C2 rule). Everything after it (overwrite: trueon six more uploads, and merges ofmain) changes behaviour only on a re-run, and no run was repeated for it.A: run 42093529476 (
base=main nordic=true scorers=none; three shards a side; head8096218c, basemainat5c35e190). Measured:ifc.sha256is identical between the two sides on all 10 models (Core Interior, Einhoven, the four BIM4LCA office files, the four RE1 models).Finishedline a side. Both sides built cold (binary cache key not found): head 54 s, base 82 s in the Build step, 1.08 and 1.65 job-minutes for the jobs.measure-bin-headandmeasure-bin-baseare 13,892,029 bytes each (zipped;rvt-ifc,rvt-gltf,rvt-info, no server or probe in this run). Upload 2 s and 3 s; the download step is 1 to 3 s in each of the 6 shards.needs: buildcovers both legs: the head shards waited 0.6 minute for the base build. They then waited 12 to 56 s for a runner, so a shard started 0.8 to 1.2 minutes after the head build and 0.2 to 1.0 after the base build, against starting at once and building inside the job. This run's shards were under a minute each, so the hand-off is a large share of it; a run whose shards take 10 minutes or more does not notice it. The old layout's wall-clock for these inputs was not measured.Projected saving on old-workflow dispatched runs with many shards, from their measured Build steps (each of the two builds taking as long as the average Build step of that run, plus about 0.5 job-minutes for the hand-off). Not measured on this head:
main)B: run 42093534779, the failure path (
base=ead78d23, the parent of the commit that addedrvt-gltf,models=core-interior samples=true sample_years=2027 scorers=bodies_across_saves). No base can lack a binary and still have theciprofile (rvt-gltfof 2026-04-20 predates it, 2026-08-30), so its Build fails at--profile ci. Run conclusion: failure. Measured:Build base: failure in 0.18 minutes,error: profile 'ci' is not defined.Build head: success.Measure head all: success (1.98 minutes). It exported and hashed Core Interior (the sameifc.sha256as in A) and the five 2027 samples;bodies_across_savesread SKIPPED, since no 2024 or 2025 save is in the run.Measure base all: failure atMeasured binariesafter 0.23 minutes,Unable to download artifact(s): Artifact not found for name: measure-bin-base.Same-project gates: the job ended green, having read the head result, and wrote the check run 127480566389 (read withfilter=all): conclusionneutral, titleNOT MEASURED: a measure shard ended failure, the Build jobs ended failure, with the three 2027 samples and the Areas SKIPPED.C: run 42093539067 (
base=fadd80b5, the commit beforervt-mcpexisted,models=einhoven probe=probe_re343_door_flips), success. Measured:Build basewarnsthe measured ref has no rvt-mcp crate: the MCP server's answers are NOT MEASURED on this sideand notesprobe_re343_door_flips does not exist at the measured ref: skipped on this side. Its artifact is 12,719,068 bytes (the three binaries). Its Einhoven results hold the exports,info,schemaand the space kinds, and nomcp_answers_vs_ifc.txt, nomcp-dump.jsonand noprobe.txt.rvt-rs-mcpand the probe). Einhoven hasmcp_answers_vs_ifc.txt(mcp answers: consistency PASS: every check equal) andprobe.txt(8 lines,native records: 2 emitted, 2 graphs complete, 0 unsupported,exit 0).neutral,NOT MEASURED: samples=true was not set.The pull-request run on
8096218c, 42093503546, one shard a side: 11.6 job-minutes, 7.8 minutes wall-clock. On9af280b7(run 42071807841) it was 12.8 and 6.9. The same event on the old workflow was 10.1 and 6.4 (42069752413) and 9.8 and 6.5 (42069162886). With one shard a side nothing is saved, and the second runner start and the artifact hand-off cost about 1.5 to 2.7 job-minutes.Audit-honesty checklist
python3 tools/release/changelog.py checkpasses).Legal and contribution hygiene
Breaking changes
None for users of the tool. Three behaviours of the workflow change:
refs/pull/N/head) is checked out as given by the Build job and by every shard. If it moves between them, the shard fails with a message naming both commits, where before shards could silently measure different commits.Screenshots or output samples
None.
Related issues
Refs #1457