HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
schildep
verified-3d-mesh-intersection
Lean2026–2026
schildep / verified-3d-mesh-intersection

verified-3d-mesh-intersection

Formally verified 3D mesh intersection - trust 93 lines of spec, not 1000+ lines of AI-written code

2Distinct people
6Mentions
0Explicit recommenders
110GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Formally verified 3D mesh intersection - trust 93 lines of spec, not 1000+ lines of AI-written code

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour6 dated mentions

Observed mentions: 2026-07-28 13:07:14 UTC to 2026-07-28 15:50:05 UTC.

012342026-07-28 13:00:00 UTC to 2026-07-28 14:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 commentsJul 28, 13:002026-07-28 14:00:00 UTC to 2026-07-28 15:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJul 28, 14:002026-07-28 15:00:00 UTC to 2026-07-28 16:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJul 28, 15:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jul 28, 13:002026-07-28 13:00:00 UTC2026-07-28 14:00:00 UTC413
Jul 28, 14:002026-07-28 14:00:00 UTC2026-07-28 15:00:00 UTC101
Jul 28, 15:002026-07-28 15:00:00 UTC2026-07-28 16:00:00 UTC101

What Hacker News says

6 sources
The implementations uses exact rationals numbers. So there are no issues with numerical errors. We can do all geometrical operations exactly. Many performant implementations have a separate layer that tries to use floats to decide inequalities and fall back to higher precision when floats are not sufficient. As I understand, this layer can be separated from the geometrical predicates we need (what I mean by predicate is for example deciding which side of a plane a point is), so we could formalize that arithmetic layer separately using axioms on floating point numbers and then plug it in the existing code. I think we could do that and still provide exact outputs and prove the same spec we have right now and the performance should increase a lot, since most of the computations right now is computing all these predicates exactly. I would not
Read the rest
say numerical stability is the one enemy of CSG. See the special cases https://github.com/schildep/verified-3d-mesh-intersection#sp... and bugs in an alternative C++ implementation that also used exact rationals mentioned in https://github.com/schildep/verified-3d-mesh-intersection#co.... Also note that many implementations don’t even try to treat special geometrical cases correctly (for example they „cheat“ by using something called simulation of simplicity which provides some guarantees against some bugs, but at the expense of not treating the cases exactly correctly which can lead to artifacts).
In Show HN: Formally verified 3D CSG: Trust 93 lines spec, not 1000 lines AI code
Both the implementation and the proof are written in Lean. In the files I reference here https://github.com/schildep/verified-3d-mesh-intersection#mi... there are theorems about the function that does the mesh intersection computation. The implementation is in the CSG/Impl folder. The proof is in the CSG/Proof folder. They are imported and tied together in the human reviewed file. Lean checks that these theorems in the human reviewed file are proven via the proofs.
In Show HN: Formally verified 3D CSG: Trust 93 lines spec, not 1000 lines AI code
permute·Jul 28, 2026Submission

Show HN: Formally verified 3D CSG: Trust 93 lines spec, not 1000 lines AI code

To my knowledge, this is the first formally verified implementation of a 3D constructive solid geometry (CSG) operation: mesh intersection, implemented in Lean 4 and verified against a concise specification that pins down the surface of the resulting mesh exactly and guarantees practical well-formedness conditions on the triangulation. This project is also an experiment in avoiding having to trust AI-generated code. A human reviewer only needs to read 93 lines of formal specification and run the Lean checker to certify the correctness of the kernel, skipping the intricate 1000+ lines of AI-written implementation. To prove correctness, AI autonomously wrote over 60,000 lines of Lean proofs, which also never have to be inspected by a human. The Lean checker guarantees conformance to the specification at compile time, with zero trust placed
Read the rest
in any LLM. This allows us to treat the implementation and proofs as a black box. I guided the agent through the milestones described in the readme to arrive at the result presented here. Also take a look at the web demo https://schildep.github.io/verified-3d-mesh-intersection/, which runs the verified mesh intersection kernel compiled to WebAssembly in your browser.
115 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.