Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ name: Nightly
# edit no test notices; each edit rebuilds moq-net's tests, about 27 runner-hours
# for the full set, so it rotates (see sh/rs/mutants.sh).
#
# `route-proof` type-checks the route rule's convergence proof with Agda, about
# two minutes. The Rust side of its binding, the generated `Vectors.agda`, is
# checked current by every PR's tests; the proof itself only changes when the
# rule does, which review checks.
#
# `quic-interop` runs moq-quic against other QUIC stacks through the QUIC
# Interop Runner, an hour of simulated links per peer, which only a moq-quic
# change or a bumped pin moves.
Expand Down Expand Up @@ -506,6 +511,20 @@ jobs:
env:
TLA_CACHE: .tmp/tla-cache

route-proof:
name: Route proof (Agda)
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/nix
# No dev shell: the proof brings its own Agda pin (nix/route-proof.nix).
- name: Type-check
run: nix shell --inputs-from . nixpkgs#just --command just test route-proof

# Media QA with a Firefox player against a Chromium fixture. The Chromium
# player already runs in interop.yml, nightly and on release PRs. WebKit has
# engine defects this cannot pass; see test/interop/README.md.
Expand Down
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@

runner-userns-profile = import ./nix/runner/unshare.nix { inherit pkgs; };

# Nightly `just test route-proof` type-checks the route rule's convergence
# proof. Its own Agda pin, so neither the dev shell nor `nix flake check`
# fetches it.
route-proof = import ./nix/route-proof.nix { inherit system; };

# The QUIC Interop Runner's host tools (`just test quic-interop`): tshark
# reads its pcaps, OpenSSL makes its certificates (the dev shell's LibreSSL
# has no config for them), and Compose drives Podman where Docker's plugin is
Expand Down
54 changes: 54 additions & 0 deletions nix/route-proof.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# The route rule's convergence proof (rs/moq-net/verify/route-algebra), type-checked
# against agda-routing at the Agda and standard library it was released for:
# Agda 2.6.4.3 and standard-library 2.0, which nixos-24.05 pins. The repository's
# nixpkgs has moved past both, so the proof keeps its own pin, fetched only when
# this attribute is evaluated.
{ system }:
let
pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/b134951a4c9f3c995fd7be05f3243f8ecd65d798.tar.gz";
sha256 = "0zydsqiaz8qi4zd63zsb2gij2p614cgkcaisnk11wjy3nmiq0x1s";
}) { inherit system; };
inherit (pkgs) agdaPackages;

# Daggitt and Griffin's library, at the commit that moved it to Agda 2.6.4.
routing = agdaPackages.mkDerivation {
pname = "routing-library";
version = "unstable-2023-12-27";
src = pkgs.fetchFromGitHub {
owner = "MatthewDaggitt";
repo = "agda-routing";
rev = "241d45ae5c783f9ecdfa0be4030286d26c468f6d";
sha256 = "1w7lm8sy5xji6ibbsxs8k65cbp9704kdv56wcrba53y61lgj782l";
};
buildInputs = [ agdaPackages.standard-library ];
# No Everything file upstream: check the convergence results, which import
# every module the proof uses.
buildPhase = ''
runHook preBuild
agda RoutingLib/Routing/VectorBased/Convergence/Results.agda
runHook postBuild
'';
meta = { };
};

agda = agdaPackages.agda.withPackages [
agdaPackages.standard-library
routing
];
in
pkgs.runCommand "route-proof"
{
src = ../rs/moq-net/verify/route-algebra;
nativeBuildInputs = [ agda ];
LC_ALL = "C.UTF-8";
# `nix shell .#route-proof.agda` gives the same Agda for editing the proof.
passthru = { inherit agda; };
}
''
cp -r $src proof
chmod -R u+w proof
cd proof
agda Everything.agda
touch $out
''
21 changes: 19 additions & 2 deletions quest/m2/multicast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Settled:
sends only what the node originates, which ends a LAN peer publishing
through a neighbour whose uplink survived; both switches).
7. ✅ **The proof is mechanized, with TLA+ and sweeps beside it**
([proof](/quest/m2/multicast/proof.md); rejected: a written proof with
([proof](/rs/moq-net/verify/route-algebra/README.md); rejected: a written proof with
property tests, the kind of argument that passed review here and failed
for the echo, the deferred echo, and belief by distance; TLA+ and sweeps
alone, which say nothing about an arbitrary topology).
Expand Down Expand Up @@ -209,6 +209,21 @@ publishers, in route messages, unless noted):
move). The route stands after the last claim leaves (rejected:
withdrawing it, which races the claim's own end and would show a
reader offline where the publisher ended cleanly).
- Order at equal rank, decided by the coordinator on 2026-11-16 while
the maintainer was away, pending their confirmation: a route with no
marked link on its path beats a marked one, then the next hop in use,
the shorter path, and the neighbour. A relay holding two routes of
equal rank, one learned over a marked link, had kept whichever came
first, so a neighbour behind its own marked link was reachable or not
by arrival order, and under a fixed order by the neighbours' keys
([proof](/rs/moq-net/verify/route-algebra/README.md)). The mark only turns on along
a path, so extending a route still never improves it. A strictly
cheaper marked route still wins; an operator who wants the unmarked
side preferred raises its priority. On the bake-off it moved no
settled result, only failure transients on peered tiers: 220 to 225
for a home dying on 15 relays, 954 to 924 on 32 (rejected: leaving it
to arrival order; dropping the next hop in use, which moves a
subscription for an equal route; ranking the mark ahead of cost).
14. ✅ **A silent death is left to keep-alives and the opt-in metadata
standby** ([route health](/quest/m3/route-health/README.md)). No arm
fixed it: readers behind a relay that dies unnoticed for 3 s stay unfed
Expand Down Expand Up @@ -245,7 +260,9 @@ a further departure is a decision to list in its PR:
whose path names it, sends none to a neighbour already on the path, and
refuses one at or below a session floor. Rank is not draining, then the
lowest priority on the path, then the summed cost, each link adding at
least 1, so extending a route never improves it. A closed session and a
least 1, so extending a route never improves it. At equal rank a route
with no marked link beats a marked one, then the next hop in use, the
shorter path, and the neighbour (item 13). A closed session and a
draining node are each named once per neighbour, and a closed session's
message ends every route its sender offered through it. A node advertises
once per burst of input.
Expand Down
1 change: 0 additions & 1 deletion quest/m2/multicast/accept.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ Public API: none. Wire: none expected.
## Required

- [The switch](/quest/m2/multicast/switch.md) - the sessions these cases run on
- [The proof](/quest/m2/multicast/proof.md) - what these cases need not show
80 changes: 0 additions & 80 deletions quest/m2/multicast/proof.md

This file was deleted.

20 changes: 20 additions & 0 deletions quest/m2/multicast/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,24 @@ the [epic](/quest/m2/multicast/README.md)'s items 13 and 14):
- Selected routes looped for a moment in partitions and deaths (up to 3 rounds
at 32 relays, where today's reached 4); requests must fail closed first.

Found 2026-11-16 by the [proof](/rs/moq-net/verify/route-algebra/README.md)
([moq-dev/moq#8904](https://github.com/moq-dev/moq/pull/8904), whose
`rs/moq-net/verify/route-algebra/README.md` holds the arguments):

- Candidates order by rank, then no marked link on the path, then the next hop
in use, the shorter path, and the neighbour (the epic's item 13, the mark's
place decided by the coordinator pending the maintainer's confirmation).
`route/relay.rs` keeps its own copy of this order; make it match.
- Order equal routes by the neighbour's Node ID, or give the proof's binding
the key the router orders them by: the proof orders them by the neighbour,
the prototype by its simulation's node index.
- Record the chain as the claim instance's path: the announcing relay first,
then each grant's exporter and adopter, so a node refuses a claim naming it
in the role it would take. The prototype records only the adopters, so it
refuses fewer echoes than the proof assumes.
- Move the binding: point `route/tests/algebra.rs` and `route/tests/sticky.rs`
at the router's own functions for a node's own route, sending a route on,
taking one in, ordering candidates, and listing them, regenerate
`Vectors.agda`, and run `just test route-proof`.

Public API: none. Wire: none.
2 changes: 1 addition & 1 deletion quest/m2/multicast/warmth.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ when readers only join (Imase and Waxman, 1991). Leaves and moves are what
the sweep adds to that.

A cost that depends on who subscribed is outside the
[proof](/quest/m2/multicast/proof.md)'s theorem. Argue it separately and
[proof](/rs/moq-net/verify/route-algebra/README.md)'s theorem. Argue it separately and
sweep it: taking a route only makes it cheaper for others, and leaving one
only worsens an offer nobody uses. A cycle that outlasts the messages in
flight fails the mechanism; count the transient ones with the readers they
Expand Down
Loading