HN
Today

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

This project presents the first formally verified 3D mesh intersection, leveraging AI to generate intricate code and 60,000 lines of proofs. The revolutionary aspect is that humans only need to review a concise 93-line specification, with the Lean checker guaranteeing correctness without trusting the voluminous AI-generated output. Hacker News is captivated by this novel approach to software verification, which promises unparalleled robustness in complex computational geometry and redefines the human-AI collaboration model.

78
Score
34
Comments
#4
Highest Rank
7h
on Front Page
First Seen
Jul 28, 1:00 PM
Last Seen
Jul 28, 7:00 PM
Rank Over Time
54511202530

The Lowdown

A groundbreaking project introduces a formally verified 3D mesh intersection, a core operation in Constructive Solid Geometry (CSG). Utilizing the Lean 4 proof assistant, the system significantly reduces the human burden of verifying complex code by having AI generate the implementation and proofs, while humans only audit a minimal specification.

  • This marks the first formally verified implementation of a 3D CSG mesh intersection operation.
  • The system is verified against a 93-line formal specification, written in Lean 4.
  • AI autonomously generated over 1,000 lines of implementation code and more than 60,000 lines of formal proofs.
  • Human reviewers only need to examine the 93-line specification; the Lean checker independently verifies the AI-generated proofs, thereby eliminating the need to trust the AI's output directly.
  • The approach inherently handles complex geometrical special cases that often plague traditional CSG implementations.
  • Currently, the implementation prioritizes correctness over performance, using exact rational numbers, leading to slower execution times (e.g., 24 seconds for two 70k-triangle meshes).
  • This method guarantees correctness for all possible inputs, a significant advantage over traditional testing, which only validates specific scenarios.

This project not only advances the field of computational geometry but also offers a compelling new paradigm for software development where AI can tackle immense complexity, while formal verification ensures absolute correctness with minimal human oversight.

The Gossip

A Kernel of Truth: Deconstructing Trust in AI-Generated Code and Proofs

The central discussion revolves around the project's audacious claim of "minimal human review" and "zero trust in LLMs." Commenters actively questioned how trust is established when AI generates such vast amounts of code and proofs. The author clarified that trust is placed in the small, human-readable specification and the Lean checker's mechanical verification of the AI-generated proofs, treating the AI's output as a black box. This sparked further debate on the broader limits of this trust model, including the unverified nature of Lean's code generation to C and the reliability of underlying hardware, though the consensus was that it substantially reduces the trusted computing base.

Exactitude's Expedition: Precision, Performance, and Practicality

A significant thread delved into the project's use of exact rational numbers for numerical stability, contrasting it with the floating-point arithmetic commonly used in high-performance 3D applications. While appreciating the robustness against numerical errors, many commenters expressed concerns that the resulting performance penalty (e.g., 24 seconds for two 70k-triangle Stanford bunnies) renders it impractical for real-time or large-scale use. The author explained this trade-off for correctness but suggested that a hybrid approach, incorporating floating-point decisions with additional trusted axioms, could improve performance while retaining formal guarantees.

Constructive Solid Geometry's Current Context and Future

Enthusiastic users of Constructive Solid Geometry (CSG) engaged in a discussion about its merits for 3D modeling, particularly in game development and CAD, where current implementations often suffer from glitches or lack robust integration. Commenters explored the potential for extending this formally verified approach to other CSG operations (union, difference, XOR) and its applicability to existing tools like FreeCAD or Blender. While the author confirmed the feasibility of extensions and the stronger guarantees compared to traditional fuzz testing, the general sentiment was that widespread adoption would necessitate significant performance improvements or reimplementation.