Trillions of electrons and ions are the scale problem behind OpenAI’s latest Codex case study, and that makes it more than a story about an astrophysicist getting coding help.
Chi-kwan Chan, a researcher at the University of Arizona and Steward Observatory, is using Codex to refine and test algorithms that simulate how particles move around black holes, according to Openai. The narrow use case is black hole plasma. The broader test is whether AI-generated scientific code can be useful in research where “mostly right” is not good enough.
Trillions of particles turn Codex into a scientific-code stress test
Black hole simulations force researchers to translate extreme physics into executable workflows. That translation is fragile. A model can look sophisticated and still encode the wrong assumption, timestep, or numerical shortcut.
Chan’s work sits inside that tension. He is part of the international Event Horizon Telescope (EHT) collaboration, which published the first image of a black hole in 2019. The EHT team is now gathering observations to produce the first video of a supermassive black hole, focused on the one at the center of the M87 galaxy.
The challenge is not only collecting observations. It is converting those observations into physical understanding. OpenAI’s source describes that process as requiring large-scale data processing, large computing workflows, and simulations that can model some of the most extreme physics in the universe.
MLXIO analysis: that is why Codex matters here. The headline is not “AI helps write code.” It is that AI is being inserted into a scientific loop where code, math, physics, and verification all have to survive contact with reality. That same question sits behind broader adoption of AI coding systems, including our coverage of 5M Users Send OpenAI Codex Into White-Collar Work, but Chan’s use case is far less forgiving than a routine productivity workflow.
Chan is using Codex to search algorithm space, not replace astrophysics
Chan studies the region around a black hole rather than the black hole’s interior. Since light cannot escape after crossing the event horizon, scientists observe matter just outside that boundary.
“It’s a surface of no return,” said Chan.
The visible signal comes from matter swirling near the event horizon, where glowing plasma can be measured and simulated. The 2019 EHT image showed a black hole’s shadow embedded in glowing plasma near that region. Chan helped develop simulation and computing tools used to interpret those observations.
Codex enters at the algorithmic layer. Chan suspected that new mathematical techniques could avoid a costly bottleneck: simulations that track every tiny spiral made by particles moving around magnetic field lines. Instead of hand-exploring every possible mathematical approach, he uses Codex to derive candidate algorithms and test them against known solutions.
That distinction matters. Codex is not being described as discovering black hole physics on its own. Chan still defines the scientific problem, inspects the numerical schemes, tests the outputs, and judges whether the code reflects the intended physical model.
“But exploring all the mathematical possibilities by hand would have taken an enormous amount of time,” Chan said.
The plasma problem breaks the easy simulation shortcut
The technical bottleneck starts with plasma: superheated matter made of electrically charged electrons and ions. In many simulations, researchers simplify plasma by treating it like a fluid. That works reasonably well when plasma is dense enough that particles collide frequently.
Near the supermassive black holes Chan’s team studies, some regions become so hot and diffuse that particles rarely meet.
“They don’t really collide with each other,” he said.
That breaks the shortcut. Instead of colliding, particles mostly spiral around magnetic field lines. Modeling that correctly requires following trillions of electrons and ions as they rapidly corkscrew around a black hole. Standard simulations must calculate every tiny turn, which forces extremely small timesteps.
OpenAI says even the world’s fastest supercomputers can spend most of their time calculating those minuscule particle motions instead of simulating the larger behavior scientists want to study.
“For decades, this has limited how realistically we can simulate black hole plasma,” Chan said.
| Simulation approach | What it simplifies | Where it strains |
|---|---|---|
| Fluid-style plasma modeling | Treats plasma through well-known equations for collective motion | Less suitable when electrons and ions rarely collide |
| Particle-tracking modeling | Follows electrons and ions more directly | Can require tiny timesteps across trillions of particles |
| Codex-assisted algorithm search | Helps propose and implement numerical schemes | Still needs inspection, testing, and physical validation |
The real gain is faster failure, not instant correctness
Codex generated many possible approaches for Chan. OpenAI is explicit that not all of them were right.
That is not a side note. It is the core of the workflow.
“But that’s okay,” Chan said. “Most scientific ideas fail. What matters is that these algorithms are testable. Once you find one that works, it can potentially unlock simulations that were previously impossible.”
MLXIO analysis: the value proposition here is not that Codex produces trusted science code on command. It is that it may let researchers explore more candidate implementations before deciding which ones deserve serious computational time. In a domain constrained by tiny timesteps and massive particle counts, faster iteration can compound.
The guardrail is testability. Chan’s group uses Codex to propose and implement numerical schemes they can inspect, test, and understand physically. OpenAI contrasts that with AI systems that can return results without showing the steps used to produce them.
This is the sharper lesson for scientific AI. A model that produces plausible code is not enough. The code has to enter a process where failure is expected, detected, and discarded.
AI-assisted astrophysics is still bounded by verification
OpenAI’s source says large language models still make mistakes and that many scientists remain cautious about using AI in research. Chan’s answer is not blind trust. It is scientific method applied to AI output.
“We don’t accept an idea because it came from Einstein, from a bright student, or from an AI model,” he said. “We accept it only after repeated testing.”
That line frames the defensible use of Codex in high-stakes research. The model can accelerate proposal and implementation. It cannot suspend the burden of proof.
MLXIO analysis: this is also where scientific use differs from many commercial coding workflows. In a black hole simulation, an elegant-looking implementation can be worse than useless if it hides a numerical flaw. The consequence is not just a broken app. It is a distorted interpretation of observations.
This connects to a broader question in technology strategy: which AI tools deserve trust when the output is technical, consequential, and hard for non-experts to audit? We explored that organizational problem from a wider angle in Future Trends Reveal What Leaders Can't Ignore Next. Chan’s case offers a narrower answer: trust the process, not the model.
If the algorithms work, the scale target is simulations once out of reach
OpenAI says that if the approaches Chan is testing succeed, the new algorithms could eventually let scientists simulate trillions of particles around black holes. That would open physics that has remained out of reach for decades.
The conditional matters. This is not a completed breakthrough claim. It is a research path.
The forward-looking signal is still important. EHT is moving from still images toward video. Chan and colleagues are improving instruments and observing capabilities. Better simulations are needed to connect those observations to physical interpretation, especially around the event horizon where glowing plasma carries the information scientists can actually measure.
MLXIO analysis: black hole modeling could become an early benchmark for whether generative AI belongs in demanding scientific computing. Evidence that would strengthen the case includes inspectable algorithms, reproducible tests against known solutions, and simulations that survive expert review. Evidence that would weaken it would be subtle numerical failures, opaque code paths, or workflows where AI output becomes difficult to audit.
Codex will not discover new black hole physics alone. But if it helps researchers test more mathematical ideas without loosening standards, it may change who gets to explore the hardest simulations — and how quickly those simulations move from impossible to testable.
Impact Analysis
- Codex is being tested in scientific workflows where small coding errors can distort physics results.
- Black hole simulations require AI-generated code to meet higher standards than typical productivity use cases.
- The work could influence how researchers use AI tools in data-heavy fields like astrophysics and computational science.










