Astrophysicist Chi-kwan Chan is using Codex, OpenAI's coding agent, to help build the simulations he runs of black holes — the kind of computational work that sits between general relativity, plasma physics, and high-performance computing. OpenAI published the case study on its site, framing Codex as a research collaborator rather than a productivity tool for shipping web apps. The work feeds into the broader scientific effort to test Einstein's theory of general relativity against direct observational data.
Chan's simulations model the behavior of matter and light near event horizons, where the equations of general relativity stop behaving like anything that has a closed-form answer. To get useful predictions out of the math, researchers write numerical code that discretizes spacetime, integrates the field equations, and traces photon paths through warped geometry. That code is notoriously difficult to write, debug, and optimize, and Chan is using Codex to accelerate parts of that pipeline.
The pitch from OpenAI is straightforward: Codex can read scientific code, propose refactors, generate new routines, and handle the kind of boilerplate around simulation harnesses that eats hours of researcher time. For a domain where a single production run can consume significant supercomputer allocations, getting the code right before the job submits is not a convenience — it is the difference between a usable result and a wasted allocation.
Key facts
- 01Astrophysicist Chi-kwan Chan is using OpenAI's Codex to help build simulations of black holes.
- 02The simulations are used to study extreme physics and test Einstein's theory of general relativity.
- 03Codex assists with the heavy numerical and code-generation work behind relativistic simulation pipelines.
- 04The case study is part of OpenAI's effort to showcase Codex in scientific research workflows beyond commercial software.
Black hole simulation is one of the more demanding corners of computational physics. The Event Horizon Telescope collaboration's images of M87* and Sagittarius A* depended on libraries of synthetic black hole images generated from general relativistic magnetohydrodynamic simulations, then compared against the interferometric data. Chan has worked in that lineage, and the simulation codes involved — written in C, Fortran, CUDA, and increasingly Python wrappers — are exactly the kind of polyglot, performance-sensitive software where an AI coding agent has to actually understand what it is doing rather than just pattern-match.
The case study fits a deliberate pattern from OpenAI: positioning Codex inside research workflows that are visible, technically credible, and unambiguously hard. Astrophysics is a useful showcase precisely because the code is not the kind a junior developer can be hired to write quickly. If Codex can hold its own assisting on relativistic ray tracing or plasma dynamics, the implicit argument is that it can hold its own on most enterprise codebases too.
Codex itself has been through several iterations since OpenAI revived the brand for its coding agent. The current version operates as a longer-horizon agent capable of reading repositories, running tests, and iterating on changes — a meaningful step up from the autocomplete tools that dominated AI coding two years ago. The pricing and access model has been tied to OpenAI's ChatGPT subscriptions and API, putting it in direct competition with Anthropic's Claude Code and other agentic coding products.
The scientific computing angle is where this case study gets interesting from a market perspective. Research code has historically been a backwater for commercial software tooling — the customers are academics with grant budgets, not enterprise procurement teams, and the codebases are idiosyncratic. But the same labs are increasingly buying API credits directly, and a researcher who finds Codex genuinely useful is a researcher who will defend that line item to a department chair.
There are real limits to what an AI agent can do in this domain that the case study does not resolve. Numerical relativity has subtle correctness traps — gauge choices, coordinate singularities, conservation violations — that produce code which runs cleanly and outputs garbage. An agent that confidently refactors a stress-energy tensor routine without understanding the underlying physics could ship plausible-looking bugs into a simulation pipeline. Chan's role as the physicist in the loop is doing the load-bearing work; Codex is a force multiplier, not a replacement for domain expertise.
For OpenAI, the value of publishing the Chan case study is less about converting astrophysicists and more about establishing that Codex is credible in the hardest coding environments scientists run. Every frontier lab is now competing on the agentic coding axis — Anthropic with Claude, Google with Gemini's coding modes, and a tier of startups building on top of all of them. Showing the tool helping simulate spacetime is a more defensible marketing position than showing it building another to-do app.
Working on something we should cover, or seeing a story we missed? Send leads, documents, or feedback to hello@aichatdaily.com. For sensitive tips, see our secure tips page for Signal and PGP options.
Spotted an error? Email hello@aichatdaily.com with the URL and the issue, or read our full corrections policy.




