Repository navigation
Scenario listings group chains over the graph - #47
Merged
Merged
Conversation
scenarios_list, scenarios_alive and incident_snapshot listed every chain the model allows, filtered it against the incident's facts, and only then grouped it into classes of the same root, root state and terminal. On a deep model the incident's one-call summary never returned. scenarios.Classes gives the classes from the graph: per root, a walk in topological order carries each node twice, with and without something dead on the way, with how many paths reach it and the least of them in scenario order, so every class gets its count and its shortest chain for the live and the eliminated chains alike. strategy.Liveness is FilterLive's test per node and per edge, which occam over the graph already uses. A cyclic graph lists, as before. Six tiers group in 37 ms (listing alone took 3.2 s) and ten, 354 million chains in 5,501 classes, in 0.46 s. The replies are unchanged: a property test over random graphs and liveness, and a differential test over random facts on a real model, compare them with Representatives over Expand split by FilterLive, and fail when the edge check or the tie-break is broken. all: true asks for every chain and still lists them.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
A follow-up to T2 (#44) and #46: the last place that lists chains during an incident.
Why
scenarios_list,scenarios_aliveandincident_snapshotbuilt their replies in three passes:On a deep model the snapshot, the agent's "everything in one call" tool, never returned.
What changes
scenarios.Classes(g, live)returns the representatives, with counts, for both the live and the eliminated chains, without listing any. Per root it walks the graph in topological order, carrying each node twice: once for paths with nothing contradicted on them and once for paths with something contradicted. It keeps how many paths reach the node and the least of them in scenario order. A chain's prefix is the least path to where it stops, so the least path per node is enough.strategy.Liveness(m, reg, store)exposes the per-node, per-edge form ofFilterLive's test, which occam over the graph already uses.all: trueasks for every chain and still lists them.Same replies
ClassesequalsRepresentativesoverExpand, split by liveness. It compares classes, order, counts, IDs and representative chains, including edge labels and observes. It fails with the edge check removed and with the tie-break reversed (both tried).FilterLive's split.Speed (
BenchmarkScale, newclassescase)Verified
go test ./...passes, and the downstream harness passes 18/18.