Index import dependencies for local scope scheduling

This commit is contained in:
2026-10-25 14:41:07 +00:00
parent 64be8b4df5
commit 8dfaf44d1d
7 changed files with 135 additions and 16 deletions

View File

@@ -72,6 +72,12 @@ tuple comparisons. On a stalled graph, deterministic DFS over the residual graph
returns a closed cycle rotated to its smallest key; blocked dependents are not
reported as cycle members.
Import edge preparation builds an importer-to-target adjacency index once for
an acquisition's outer and item-local scheduling, and once for grouped
scheduling. Each scope gathers edges from its participating identities and
retains only edges with both endpoints in its local slots. The retained
inclusion graph still owns cycle diagnostics and source relationships.
Import composition schedules a main tier or one underlay group as a single
strict-scope graph. Applicable collection declarations are gathered for the
scope before peer composition, including identity inherited from lower tiers.

View File

@@ -152,7 +152,7 @@ and race-enabled import/destination tests passed with Go 1.26.10 on Linux.
## 3. Restrict Import-Scope Edge Preparation To Relevant Nodes
Status: open. Priority: medium. Category: algorithmic efficiency and allocation
Status: complete (2026-10-25). Priority: medium. Category: algorithmic efficiency and allocation
scaling.
**Evidence.** `scheduleAcquisitionScopes` in
@@ -190,3 +190,16 @@ coverage in [imports_test.go](../../internal/engine/imports_test.go) and
existing destination/provenance evidence tests. Cover broad independent item
scopes if a consequential gap remains; verify index construction and edge
visitation bounds by source review without new performance gates.
**Completion.** Scheduling now builds an importer-to-target adjacency index once
for an acquisition and shares it across outer and pending item scopes. Grouped
scheduling builds its own index once. Local preparation visits only adjacency
lists for participating identities, includes only edges with both endpoints in
the local slot map, and allocates edge storage as needed rather than reserving
the whole graph per scope. For the broad sibling family, preparation is O(E + P)
before the unchanged stable Kahn scheduling. The inclusion graph and cycle
diagnostics remain unchanged. Tests cover excluded endpoints/unselected slots
and broad main/underlay item scopes with retained helper origins and projected
destinations. Focused scheduling tests, the development check, documentation
links, and `go test -race ./...` passed with Go 1.26.10 on Linux. No timing or
allocation thresholds were introduced.