Skip to content

perf(roadmap): build the cycle graph once for each selection - #6534

Merged
dan-petty merged 4 commits into
mainfrom
perf/6516-build-the-cycle-graph-once
Nov 20, 2026
Merged

dan-petty merged 4 commits into
mainfrom
perf/6516-build-the-cycle-graph-once

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

The stage and implement judges built the graph of all open items again for each judged item with an open dependency. open_dependency now takes the graph from its caller as a function that it calls only when a dependency is open. Each judge holds its graph as a cached property, so a selection builds it at most once, and none when no dependency is open.

cycle_of now does a breadth-first search from the asked item with one parent for each item. It gives a shortest cycle and copies no path at each step.

devops roadmap explain 4814 over 807 open items: 47 graph builds (162 s) and 408 s in total before; 2 builds (8 s) and 266 s after, with the same output. Explain runs three selections, so it builds up to three graphs, not one as the proposed design of #6516 asked; design.md says why.

Closes #6516

Change: openspec/changes/archive/2026-11-20-6516-build-the-cycle-graph-once/

Plan the change that builds the dependency graph at most once for each
stage and implement selection, and that gives a shortest cycle through
the item with a breadth-first search.
Add the failing tests of #6516: a stage selection and an implement
selection over several items with an open dependency build the graph
once, a selection with no open dependency builds none, the path of an
item is a shortest cycle, and a ring of 20,000 items gives its whole
ring. The tests count the builds with sys.monitoring, so no test
replaces a function.
open_dependency takes the dependency graph from its caller as a function
that it calls only when a dependency is open. The stage and implement
judges hold the graph of their items as a cached property, so a
selection builds it at most once and builds none when no item has an
open dependency (#6516).

cycle_of searches only for the item that the caller asks for. The
search is breadth-first with one parent for each item, so it gives a
shortest cycle and copies no path at each step. The eager path of each
open item, the cycles field and the graphlib gate go.
Apply the delta to roadmap-dependency-cycle. The strict validation asks
for requirements of at most 500 characters, so the shortest-cycle rule
is its own requirement.
@dan-petty dan-petty added type/infra Type infra: the build, CI, images or cluster scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 20, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: 6b596bf62ac15bd19639c38966bdea4833a51a44

Check Conclusion Link
Semantic PR title queued run
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
Trivy success run
Plan Check skipped run
CodeQL success run
Fail-to-Pass Check skipped run
Dependency Freshness skipped run
Test Job Duration skipped run
Tests on Main skipped run
Analyze (python) success run
Static Analysis success run
Tests & Coverage (shard 3 of 5) success run
Tests & Coverage (shard 2 of 5) success run
MCP Server Image success run
Analyze (actions) success run
Design Tokens success run
Tests & Coverage (shard 4 of 5) success run
Tests & Coverage (shard 5 of 5) success run
Service Image success run
Tests & Coverage (shard 1 of 5) success run
Changed-Test Independence success run
Runner Image success run

Skipped check: Plan Check
Skipped check: Fail-to-Pass Check
Skipped check: Dependency Freshness
Skipped check: Test Job Duration
Skipped check: Tests on Main

@dan-petty
dan-petty marked this pull request as ready for review November 20, 2026 17:06
@dan-petty
dan-petty merged commit 2990a57 into main Nov 20, 2026
31 checks passed
@dan-petty
dan-petty deleted the perf/6516-build-the-cycle-graph-once branch November 20, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/infra Type infra: the build, CI, images or cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(roadmap): stage and implement build the cycle graph per item

1 participant