We found an undocumented bug in the Apollo 11 guidance computer code
A deep dive into the Apollo Guidance Computer's venerable code has unearthed a 57-year-old bug, a resource lock leak that could have catastrophically disabled the IMU's alignment capabilities. This discovery, made using an AI-native behavioral specification language, highlights how modern analysis can still find critical flaws in even the most scrutinized historical software. The story captivates HN by blending historical engineering, complex software principles, and cutting-edge AI tools.
The Lowdown
After decades of meticulous scrutiny, a team has uncovered an undocumented bug in the Apollo 11 guidance computer (AGC) code. This flaw, a resource lock that leaks on an error path, could have silently crippled the guidance platform's ability to realign, posing a dire threat to the astronauts. The discovery was made possible by leveraging advanced AI techniques and a behavioral specification language called Allium.
- The Apollo Guidance Computer's code has been extensively studied, transcribed, and emulated since its public release, yet this specific flaw remained hidden.
- Using Claude and their open-source behavioral specification language, Allium, Juxt distilled 130,000 lines of AGC assembly into 12,500 lines of specifications, directly pointing to the defect.
- The bug lies in the
LGYROresource lock, which is acquired when the computer needs to torque gyroscopes but fails to release if the Inertial Measurement Unit (IMU) is 'caged' during the process. - If triggered, this would cause all subsequent gyro operations (alignment, drift compensation) to hang indefinitely, as the system waits for a lock release that never comes.
- The article vividly describes a hypothetical scenario where Michael Collins, alone behind the Moon, could have accidentally triggered the cage, leading to a non-diagnostic failure of the guidance system during a critical alignment.
- Margaret Hamilton's pioneering software engineering in the AGC made it incredibly robust, with features like priority scheduling and restart protection, but this logical flaw in resource management was a different class of problem.
- The AGC's defensive restart logic, which cleared
LGYROduring full memory reinitialization, inadvertently masked the bug, explaining why it was never observed in flight or testing. - The team emphasizes that while tests verify code, behavioral specifications ask "what the code is for," revealing unmet obligations in resource lifecycles that traditional methods miss.
This finding serves as a powerful reminder that even in seemingly perfect, historically significant code, deep-seated flaws can persist. It underscores the potential of new analytical methods to provide fresh insights into complex systems, bridging the gap between legacy software and modern verification techniques.
The Gossip
AI Authorship Aversion
Many commenters quickly focused on the article's writing style, expressing a strong sentiment that it felt generated by an LLM. Terms like "soulless and plastic" and "AI prose" were used, with some describing a "physiological response" of frustration. Commenters attempted to identify specific phrases or patterns that suggested AI authorship, rather than human writing, leading to some flagged comments.