Skip to content

diagnosis counts over the failure graph instead of listing its chains - #44

Merged
sajonaro merged 1 commit into
mainfrom
graph-occam
Oct 7, 2026
Merged

sajonaro merged 1 commit into
mainfrom
graph-occam

Conversation

@sajonaro

@sajonaro sajonaro commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

This is step T2 of the improvement plan, the last open engine item from G2.

Why

The chains a model allows grow exponentially with its depth. Before every probe decision, scenario-guided diagnosis listed all of them, then filtered and ranked the list. The scale benchmark showed the wall: about 0.4M chains at 6 tiers, 2.4M at 7, and 8 tiers did not finish.

What changes

  • Diagnosis loads the sidecar's graph unexpanded (scenarios.LoadSiblingSet). This applies to mgtt diagnose, plan and MCP.
  • Occam decides over the graph (occamOnGraph):
    • liveness per node (the step's state) and per edge (a redundancy group that holds), each decided once;
    • scenarios.Count gives the live chains and the chains through each component, by DP over the live graph. It runs per root, because group carriage depends on the root.
    • scenarios.LiveByLength builds live chains layer by layer, only as far as asked. Length ranks first, so the shortest layer holds the decision, ranked exactly as before: suspect, elimination count, scenario order.
  • Eliminates names the first 10 scenarios, and EliminatesCount counts all of them. That's what MCP and mgtt plan already show.
  • Fallbacks: a cyclic graph, or a sidecar in the old chain-list format, still goes through listing. simulate --from-scenarios and --fuzz still iterate chains.

Exactness

  • Property test: over 1,200 random graphs and liveness patterns, Count's live and per-component counts and LiveByLength's chains, layer by layer and ID by ID, equal brute force over Expand. It fails on a dropped edge check and on a dropped root-alone rule (both checked).
  • Differential test: every random store (sparse and dense) also runs over the graph. The decisions are identical: probe, Stuck reason, Eliminates (first 10) and count. A deterministic case covers Done.

Speed (BenchmarkScale)

Tiers Listing (load + decision) Graph (decision)
6 2.7 s + 0.9 s 32 ms
8 does not finish 68 ms
10 — 148 ms

Verified

go test ./... passes 22 packages; make downstream passes 16/16.

T2. Scenario-guided diagnosis expanded every chain (exponential in model
depth) and filtered and ranked the list before each probe decision. It now
reads the sidecar's graph unexpanded (scenarios.LoadSiblingSet) and
decides over it (occamOnGraph):

- liveness per node (the step's state) and per edge (a holding redundancy
  group), each decided once;
- scenarios.Count: live chains and chains per component by DP over the
  live graph, per root since group carriage depends on the root;
- scenarios.LiveByLength: live chains layer by layer, only as far as asked;
  length ranks first, so the shortest layer holds the decision, ranked as
  before (suspect, elimination count, scenario order).

The chains counted are Expand's exactly: a property test compares counts,
per-component counts and the chains layer by layer against enumeration over
1,200 random graphs and liveness patterns, and fails on a dropped edge
check or a dropped root-alone rule. The occam differential test now also
runs every random store over the graph: identical decisions, with
Eliminates naming the first 10 and EliminatesCount counting all, which is
what MCP and mgtt plan show. A cyclic graph falls back to listing.

BenchmarkScale: 32 ms per decision at 6 tiers (listing: 2.7 s to load,
0.9 s to decide), 68 ms at 8 and 148 ms at 10, where listing never
finished.
@sajonaro
sajonaro merged commit e712233 into main Oct 7, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant