[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlaplus] Full static Raft safety TLAPS proof



Verdi rocq proof was also a source of inspiration
https://www.linkedin.com/posts/formalsystems_verdi-rocq-versus-tla-activity-7507400988496977920-Gi7i?utm_medium=ios_app&rcm=ACoAAClKCqsBa6PMSgR_bPQjUfLFQcGPiIcbBFs&utm_source=social_share_send&utm_campaign=copy_link

On Thu 19 Nov 2026 at 16:25, Ovidiu Marcu <ovidiu21marcu@xxxxxxxxx> wrote:
Hi,

I took a quick look at leader completeness
https://github.com/etcd-io/raft/issues/549

I had to add some extra history variables for this invariant you may want to look at 

On Thu 19 Nov 2026 at 16:01, Marco Manino <mrcmnn@xxxxxxxxx> wrote:
Hi everybody!

The dqlite team @ Canonical (Alberto Carretero, Anatoliy Bilenko and I) wanted to share some interesting result we achieved during our development in the last few months. We were able to co-author with AI (mostly ChatGPT Sol 5.6 and 6.1, with ocassional help from GLM5.3): a full safety proof for Raft in TLAPS. This includes all safety invariants that were defined by Ongaro, mostly following the definitions from `etcdraft` (with caveats, see below). It does not contain configuration change, but it does contain message passing, and as such is very different from MongoDB's high level previous proof as it is much closer to implementation. To the best of our knowledge, this is the first TLAPS proof for Raft with message passing.

The spec itself is actually derived from Ongaro and, except for `LeaderStepdown` (normally called `CheckQuorum`), it is actually a strict subset (as in TLAPS `=>` operator) of the original spec. We think probably the most interesting part of this is the process we followed both for the proof and for the simplification/refinement of the original spec: each refinement step simplifies the spec by restricting its behaviors and each of those steps is proven to be a subset of the previous version. For example we proved equivalence of message bags and message sets WRT the original Raft spec (we think this is a general property, but we would need to formalize it properly). At the moment, the repository that we are sharing only contains the end result, that is the final spec and the proof. We will soon add one commit for each refinement, starting from Ongaro's spec and moving on to the proven one.

In the process, we also discovered a couple of problems in etcd invariants: [`MoreUpToDateCorrectInv` was false](https://github.com/etcd-io/raft/issues/515) and [LeaderCompletenessInv was too](https://github.com/etcd-io/raft/issues/515) strong.

The proof is around 10K lines worth of TLAPS, but it can be improved, and it does not use any additional history variable. Both the refinement and the proof itself required a lot of guidance as AI can't deal with the complexity/peculiarities of tlapm (yet?). Some of the proofs were done completely manually, for example refinement proofs that used the `\cdot` operator.

We are thinking to write a paper on the above, but we would love someone else look at it to make sure that we didn't miss anything big. We also think the process we used to write this AI-assisted proof can be interesting to the community, but we wanted to hear if that would be interesting to you.

Here is the link to our repo that includes all our changes and the proof itself: https://github.com/canonical/raft-tla

Cheers,
Anatoliy[^1], Alberto[^2] and Marco[^3]

[^1]: anatoliy.bilenko@xxxxxxxxx
[^2]: angelalbertoc.r@xxxxxxxxx
[^3]: mrcmnn@xxxxxxxxx

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion visit https://groups.google.com/d/msgid/tlaplus/1c1e1f19-e905-4606-a99d-8ef6497bf71cn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion visit https://groups.google.com/d/msgid/tlaplus/CAGxa7HWoRjZsoPFuja7BiPXVzNFxV2nCoDsjTCXrhpHx_CFd9A%40mail.gmail.com.