From 64ea43f0a416bd208fc56ef5e265a7e668737ef2 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 13 Nov 2026 19:28:48 -0800 Subject: [PATCH] quest: drop the route inductive invariant No checker can step the route model: Apalache stalls on the first transition (#8564), no Rust TLA+ checker qualifies (#8600, #8669), and the maintainer wants no more JVM model checking here. Co-Authored-By: Claude Opus 5.5 --- quest/m1/route-inductive.md | 75 ------------------- quest/m1/route-trace-validation.md | 2 +- quest/m2/cluster-routes/README.md | 2 +- .../m2/cluster-routes/route-exhaustive-sim.md | 3 +- 4 files changed, 3 insertions(+), 79 deletions(-) delete mode 100644 quest/m1/route-inductive.md diff --git a/quest/m1/route-inductive.md b/quest/m1/route-inductive.md deleted file mode 100644 index a1e980dfffe..00000000000 --- a/quest/m1/route-inductive.md +++ /dev/null @@ -1,75 +0,0 @@ -# [L] The route rules hold from any state, not only the runs TLC reaches - -## Goal - -An inductive invariant of the route model implies `NoRevival`, `NoFalseEnd`, -`NoRegression`, `Truthful`, and the loop rule the model proves for the path -rule: no relay uses a route whose path names it, and selected next hops loop -only within the bound the model (`rs/moq-net/verify/route/RouteHandoff.tla`) -found: through a stale route whose news is on its way (`LoopsAreStale`, -`StaleIsChased`). Apalache -checks in Nightly that it holds initially and that every step preserves it -from any state satisfying it, on each mesh shape of up to five relays. The -rules then hold for runs of any length and any number of changes, where -TLC's pass covers one claim, two revisions, and two session opens or closes. - -## Plan - -Decided 2026-11-10 (maintainer, /quest-plan on what could be proved about -moq-net): - -- ✅ An inductive invariant checked by Apalache (rejected: a TLAPS proof for - every mesh size, whose hand-written steps break on each model change, until - this invariant has settled; verifying the Rust itself in Verus or Lean, - which needs the code rewritten around the prover). -- ✅ m1 (rejected: m4), because a flaw in the routing design is cheapest to - fix before lite-07 is cut. It does not gate the cut: a flaw it finds becomes - a fix quest that joins [Finalize moq-lite-07](/quest/m2/lite07-finalize.md) - then. - -Decided 2026-11-12 (maintainer, /quest-plan on the quests still written for -Babel), asked what happens to this quest now that the route rule is the path -([routes epic](/quest/m2/cluster-routes/README.md) Plan item 27): -✅ keep it in m1, rewritten for the path rule (rejected: m4, since the path -argument is simpler than Babel's; deleting it and resting on the bounded -TLC runs and the sweeps). The claim rules are where the stale copies were, -and they are what a bounded run covers least. `LoopFree` leaves the Goal as -an invariant: under the path rule selected next hops can loop for a moment -when two unrelated things fail at once, which the maintainer accepted, so -the invariant implies the bound the model states instead. - -What it removes is the bound on the run, not on the mesh: revisions, -sessions, and churn are unbounded, while the relay count and queue lengths -stay constants the config states. Say both bounds in the `verify-route` skill. - -- Start from the path argument: no relay holds or selects a route whose path - names it, every route in flight extends the path its sender held when it - sent it, and every withdrawal in flight names a hop whose session closed. - The doubt's timer is a step that may fire at any moment, as the model has - it. Strengthen until Apalache finds no counterexample to induction. -- A counterexample to induction starts from a state that may be unreachable. - If TLC cannot reach it, the invariant is too weak: strengthen it. If it can, - replay it on `route::tests::Sim` as the skill says before calling it a bug. -- Apalache needs type annotations. Add them to the spec TLC already checks, - so both tools read one file and neither drifts. -- `NoCountToInfinity` follows from `SimplePaths`, which is inductive once - the invariant also says a route is held only from a node the holder shares - a link with: every route sent adds its sender to hops that did not name it - ([moq-dev/moq#8487](https://github.com/moq-dev/moq/pull/8487)). Start there. -- Apalache checks safety. That every hold ends is no checked rule: the - model has no fairness, and the `verify-route` skill argues it from - `Budget` and `QuietIsSettled`. Leave it there. -- Run it through the `tla` recipes with Apalache from the flake. If five - relays does not fit Nightly, record the largest mesh that does and its time. -- A refinement check such as `RefinesClaims` runs on the smallest exhaustive - config that exercises it, where each distinct state is checked once, not on - a simulated config such as `Blind.cfg`, where every sampled trace re-checks - it, unless measuring shows the simulated config is cheaper. `SumOver` folds - with `FoldSet` through the Community Modules' Java override the `tla` - recipes load; keep one fold for both checkers. - -Public API: none. Wire: none. - -## Related - -- [Route sweeps are checked against the TLA+ model](/quest/m1/route-trace-validation.md) - ties the same spec to the code diff --git a/quest/m1/route-trace-validation.md b/quest/m1/route-trace-validation.md index f8e2e6bf906..0b537f71e94 100644 --- a/quest/m1/route-trace-validation.md +++ b/quest/m1/route-trace-validation.md @@ -15,7 +15,7 @@ the route model drifting from the code ([moq-dev/moq#8447](https://github.com/mo Decided 2026-11-10 (maintainer, a later /quest-plan the same day): - ✅ m1 (rejected: staying in m4). The mesh configs beside it, the - [inductive invariant](/quest/m1/route-inductive.md), and the + inductive invariant (dropped 2026-11-13: no checker can step the model), and the [cache-aware routing proof](/quest/m2/cache-routing-proof.md) all build on `RouteHandoff.tla`, so drift there costs the most. - ✅ The other three models get trace validation too, each its own m4 quest diff --git a/quest/m2/cluster-routes/README.md b/quest/m2/cluster-routes/README.md index a11619e7c91..cd25d34fbaf 100644 --- a/quest/m2/cluster-routes/README.md +++ b/quest/m2/cluster-routes/README.md @@ -53,7 +53,7 @@ The items below were decided 2026-11-10 (maintainer, /quest-plan on lite-07 rout Measured on 24 relays (the mesh sweep's sparse shape, 16 seeds), against today's router, with the doubt lasting 4 hops of delay: a detour settles in 12 hops of delay where the distance takes 15.7, and in 6.2 where it does not run through the far end of the closed link; the publisher's relay dying costs 124 route messages where the distance costs 276, with no loop and 6 claims sent again; and a link closing in a clique costs 44 messages with one publisher behind it and 198 with eight, where the distance costs 621 and 5,024. Accepted: a detour through the far end of a closed link waits the timer out; selected routes can loop for a moment when two unrelated things fail at once (32 of 120,000 churn steps), which the distance never does; and holds and doubt have passed sweeps. The model covers both, but its no-stale-route property holds only for one failure and a patient timer; `StaleIsChased` bounds the rest. The timer's length is the model's and the router's to settle, from the maintainer's 1 s. Rejected: Babel's distance; paths with nothing else, which hunt through stale paths (65,219 messages for one publisher leaving a clique of 12); no doubt, which loops when a relay with several neighbours dies; and a doubt lifted by an epoch the node floods, which resolves in a couple of hops but costs a message per session on each relay-to-relay close ("Epoches are a bit scary in terms of messages"). -28. ✅ Decided 2026-11-12 (maintainer, /quest-plan on the quests still written for Babel), asked how item 27's removal is split and ordered: **the router first with no wire change, then a switch of the sessions, and the switch lands before the route stream.** [The router](/quest/m2/cluster-routes/scope.md) runs the path rule with a route per scope, sans-IO, beside today's router. [The switch](/quest/m2/cluster-routes/switch.md) puts it on the lite-07-wip wire, the draft, the Rust sessions, and `js/net`, and deletes Babel's router. [The interest set](/quest/m2/cluster-routes/interest-set.md) then edits the path router only, and [the route stream](/quest/m2/cluster-routes/route-stream.md) follows the switch with no echo or route request to carry. The switch's recommended wire puts the answer that ends a hold on the publisher half, behind the routes its sender sent first, so the path rule needs no order between streams that today's sessions lack for one prefix. [Acceptance](/quest/m2/cluster-routes/acceptance.md) is of the switched sessions, and [the inductive invariant](/quest/m1/route-inductive.md) stays in m1, rewritten for the path, without `LoopFree` as an invariant. Rejected: the router quest in m1; one quest for router, wire, draft, sessions, and `js/net`; the route stream first, which builds the echo and ROUTE_REQUEST on the new stream and then deletes them; one wire change for the path rule and the one stream together; moving the inductive invariant to m4; deleting it. +28. ✅ Decided 2026-11-12 (maintainer, /quest-plan on the quests still written for Babel), asked how item 27's removal is split and ordered: **the router first with no wire change, then a switch of the sessions, and the switch lands before the route stream.** [The router](/quest/m2/cluster-routes/scope.md) runs the path rule with a route per scope, sans-IO, beside today's router. [The switch](/quest/m2/cluster-routes/switch.md) puts it on the lite-07-wip wire, the draft, the Rust sessions, and `js/net`, and deletes Babel's router. [The interest set](/quest/m2/cluster-routes/interest-set.md) then edits the path router only, and [the route stream](/quest/m2/cluster-routes/route-stream.md) follows the switch with no echo or route request to carry. The switch's recommended wire puts the answer that ends a hold on the publisher half, behind the routes its sender sent first, so the path rule needs no order between streams that today's sessions lack for one prefix. [Acceptance](/quest/m2/cluster-routes/acceptance.md) is of the switched sessions, and the inductive invariant stays in m1, rewritten for the path, without `LoopFree` as an invariant. Rejected: the router quest in m1; one quest for router, wire, draft, sessions, and `js/net`; the route stream first, which builds the echo and ROUTE_REQUEST on the new stream and then deletes them; one wire change for the path rule and the one stream together; moving the inductive invariant to m4; deleting it. Reversed 2026-11-13 (maintainer, /quest-complete): ✅ the inductive invariant is deleted, since Apalache cannot step even one transition of the route model ([moq-dev/moq#8564](https://github.com/moq-dev/moq/pull/8564)), no Rust TLA+ checker qualifies ([moq-dev/moq#8600](https://github.com/moq-dev/moq/pull/8600), [moq-dev/moq#8669](https://github.com/moq-dev/moq/pull/8669)), and no more JVM model checking is wanted here (rejected: keeping it paused). The route layer's core landed in [moq-dev/moq#7676](https://github.com/moq-dev/moq/pull/7676): a diff --git a/quest/m2/cluster-routes/route-exhaustive-sim.md b/quest/m2/cluster-routes/route-exhaustive-sim.md index db0a00f04d1..46fd4bfa82b 100644 --- a/quest/m2/cluster-routes/route-exhaustive-sim.md +++ b/quest/m2/cluster-routes/route-exhaustive-sim.md @@ -44,8 +44,7 @@ out. Nightly. This sits beside [trace validation](/quest/m1/route-trace-validation.md), which -keeps the TLA+ model honest for [the inductive invariant](/quest/m1/route-inductive.md) -and the design work done on the spec before code exists. It replaces neither +keeps the TLA+ model honest for the design work done on the spec before code exists. It replaces neither that nor the seeded sweeps on larger meshes (`tests/integration/mesh_sweep.rs`). If the spike shows the search covers what a model check does, recommend in the PR what to do with the