Skip to content

span_anchor_audit: --shard and --merge so the longest graph-accuracy gate can run in parallel (Part of #5501) - #6355

Merged
squid-protocol merged 1 commit into
mainfrom
churn/5501-20261024T0420Z
Oct 24, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/5501-20261024T0420Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5501. Checklist: partial [c:5b57f5a0] -- the workflow now needs to run span anchoring as two --shard lanes plus the --merge --ci gate (workflow edit needs allow_workflows, not in this brief), then the wall time is measured against the 5 min target.

What and why

Measured lane times on the three-lane job (#6100): span-anchoring 320 s, import-graph + typescript 282 s, java + python 274 s. The lanes are balanced, so the single longest gate, span anchoring, is the floor (~5.3 min). Splitting more jobs lost to queue waits in #5562, so the split stays inside one job.

This PR makes span anchoring shardable, with no workflow change:

  • span_anchor_audit.py --shard I/N --json part.json scans every Nth top-level data/ directory (hard-linked copy, same relative paths).
  • --merge part*.json [--ci] sums the per-language counts and applies the one baseline. A shard refuses --ci / --regenerate / --merge: one language's files sit in several directories (a .h file under c/ can be C, a makefile or yacc), so per-shard rates would be wrong.

Class / Sibling gaps

Class: a multi-gate CI audit whose longest single gate sets the wall-time floor. Members: span anchoring (done here, as a shardable script). import-graph (245 s) is the next-longest gate; it has no shard mechanism and is not needed until span anchoring drops below it. The call-resolution gates (java 194 s, python 80 s, typescript 37 s) are already shorter than the lanes. call-graph-accuracy-audit.yml and graph-comparison-history.yml are single-gate: none needed. No burned-estate program is involved.

Facts checked

  • Merged shards 0/2 + 1/2 equal the unsharded run exactly on language-crucible: 51 languages, identical units and misanchored counts; --merge --ci prints OK.
  • Directory name is not the language (e.g. cpp/ yields c, cpp, powershell, python), which is why the gate is on the merge.
  • pytest tests/tools/test_span_anchor_audit.py tests/tools/test_ci_retry.py 38 passed; ruff format --check clean; ruff_audit --ci no new findings; audit_check.py all clear.
  • Wall time before/after and runner-minutes: not measurable until the workflow uses it (draft PRs skip this workflow).

Remaining slice (needs allow_workflows)

.github/workflows/graph-accuracy-audit.yml, gate step: four lanes in the same job and step:

( gate span-0 python tests/tools/span_anchor_audit.py --shard 0/2 --json "$RUNNER_TEMP/gaa/span0.json" --samples 3 ) &
( gate span-1 python tests/tools/span_anchor_audit.py --shard 1/2 --json "$RUNNER_TEMP/gaa/span1.json" --samples 3 ) &
( gate import-graph ...; gate call-typescript ... ) &
( gate call-java ...; gate call-python ... ) &
wait
python tests/tools/span_anchor_audit.py --merge "$RUNNER_TEMP/gaa/span0.json" "$RUNNER_TEMP/gaa/span1.json" --ci --samples 3 --summary "$RUNNER_TEMP/gaa/span-anchoring.md"

gate appends --ci --summary, which a shard rejects, so the shard calls need a variant of gate without those flags; the merge's exit code feeds failed. Risk: the runner has 4 vCPUs and each scan already uses cpu_count-1 workers, so four lanes may be CPU-bound; measure on the first run.

🤖 Generated with Claude Code

…racy gate can run in parallel (Part of #5501)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 24, 2026 04:31
@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 04:34
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

1 similar comment
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant