gavin.codes

gavin.codes

@gavin.codes

12 followers7 following90 posts

We ported a significant fragment of libexpat to Lean. This provides significantly higher confidence in security.

This is what a software verification stack *should* look like. If we had this, we could have high assurance and *fast* software. Without this we are going to be playing wack-a-mole with software security.

Can you write a concurrency library directly in a theorem prover? Can you write real software with it, perhaps a webserver? Can it be similar in performance to servers used in industrial production? What language should I use for Vericoding? Yes, yes and yes! And Lean clearly viable.

Hot Take: Theorem provers are ready to do most of what you're currently doing with programming languages and they can often do it a lot better.

Consciousness is as methodologically interesting as revelations from God. Thomas Paine noted revelation can only have validity to the recipient. Beyond that is hearsay. The state of "consciousness" as an experience makes sense only to the one experiencing it.

There are no measurements to make which identify the state. As such it is completely vacuous as a scientific category.

gavin.codes reposted

The gap between what written code and human understanding is widening due to AI code generation. Merging software verification with design by contract offers a way out. Top-level contracts for humans, sub-contracts for the machine prover. Full breakdown: scidonia.ai/blog/contrac...

scidonia.aiUnderstanding Software in the Large: Contracts and Compositionality | ScidoniaA top-level contract tells you what a system does. Sub-contracts tell the prover how it does it. You only need to read the first one. This is componentisation in real terms โ€” and it changes how we thi...

gavin.codes reposted

We used LLMs to prove PCF type preservation in Rocq from scratch. The cost? As low as $0.06. When a mechanised proof costs less than a bug report, vericoding (using AI to write code and a prover to guarantee it) becomes the new standard. scidonia.ai/blog/proof-a...

scidonia.aiProof as Commodity | ScidoniaWe proved type preservation for PCF โ€” a classic typed lambda calculus benchmark โ€” using two frontier LLMs and rocq-piler. DeepSeek v4 completed it in 21 minutes for $0.06. Claude Opus 4.8 took 14 minu...

1/2 Can we safely let AIs do almost all of the coding? What do we need to avoid getting mountains of slop? * Small control surface [Specification] * Deterministic proof of correctness [Proof assistant]

This is essentially a "compiler" for specifications โ€” the dream of declarative programming. The change will be as big as shift as the shift away from assembly. But is this feasible? YES! We've already shown how it can be used for contracts on sequential python. This is the answer to AI slop.

This is really a rough draft of the future. Specification as control surface, code as disposable and organisations of AIs with specific responsibilities.

Dmytri Kleiner@dmytri.to

Ahoy, #SlopPunk, put this in your pi: github.com/dmytri/sh... The simplest/stupidest/most portable spec-driven workflow with context isolation for any agent. This is still *very new* and *very stupid*, so ymmv. > Specs are durable. Code is disposable. Agents are replaceable.

Proving properties of software has historically been hard because proof is hard. But if we don't do the proofs, then the hard problem resolves to getting the right specification. This will remain hard, but it will probably also be the main activity in the near future. Time to take this seriously!

Just tried to run my "benchmark" proof (PCF+ref type preservation) on Fable 5. It took 10 minutes and did not make ONE SINGLE ERROR. No tactics out of place, no iteration. Just full Rocq proofs the first time. This is mental.

1/3 Proving very basic properties of software can have huge impacts. The NASA Mars Climate Orbiter failed due to a mismatch between Pound-seconds (Imperial) and Newton-seconds (Metric). This mistake cost $327 Million.

2/3 Theorems which use dimensional analysis are absolutely trivial to prove and can be discharged 100% of the time as they fall into decidable theory: linear algebra. We can adorn python with units and get iron-clad assurance of correctness with no runtime cost and no additional code.

3/3 Axiomander, our MCP for proving properties of python, shows how easy it is to augment python with this capability. Why isn't everyone already doing this?

1/4 Here is a video of neuro-symbolic theorem proving in action using the (opensource) Rocq-piler MCP (we renamed when updating to Rocq) with the Rocq theorem prover.

View full thread

1/4 Here is a video of neuro-symbolic theorem proving in action using the (opensource) Rocq-piler MCP (we renamed when updating to Rocq) with the Rocq theorem prover.

2/4 We (at Scidonia) have spent considerable effort to increase the theorem proving ergonomics for LLMs with our MCP and have gotten the following one-shot for a type preservation theorem about the programming language PCF with references (sort of a micro-ML language) on video.

2/2 Done with the following prompt: "You are a proof assistant. You need to use only MCP tools to work your way through a coq proof. This proof is in mcp-coq-lsp/test_issues.v. You will need to add lemmata as you discover the need. Please fully close the main theorem."

Cross-checking generated content increases quality substantially, but what models should I use to *cross-check* generated content. It turns out for entity extraction you can use almost anything! Use the model which is 200x cheaper. See below ๐Ÿ‘‡

Riffing on an idea that is making the rounds of using a wiki knowledge base to drive your LLM, we tried this approach just for chat short term memory. The results were very sensitive to the ontology and organisation, we get better results than raw summary. It works amazingly well! See below ๐Ÿ‘‡

Ontologies can be helpful in structuring short term memory for interactive agents. We developed a methodology for short-term memory assessment and demonstrate a comparison between naive summarisation and ontology centric memory. Full discussion and methodology below ๐Ÿ‘‡

Entity extraction from documents can provide huge benefits to organisations. If your model is hallucinating information - it will pollute downstream assets. The key is appropriate provenance tracking and cross checking. Methodology link below ๐Ÿ‘‡

gavin.codes reposted

Are you using the right models to analyze your documents? When performing large-context entity extraction, model matters and cross checking has an important impact on precision. It is easier for models to check than to generate, so checking is often worthwhile.

Generative AI is finally making software verification not just practical, but it a requirement (pun intended). AI slop is a serious problem, but it is also an opportunity.

In the very near future code will be organised more around contract than implementation, just as currently we organise around high-level constructs and not machine code.