r/ScientificComputing • u/Fractal-Bifurcat • 4d ago
AI Programming in Scientific computing (Trust Issues)
I work as software engineer developing simulation engine for multiphase 1D wellbore flow. I am starting to transition from mostly writing code with help of AI to managing AI writing the code.
Half year ago it seemed crappy but nowadays it is getting very good. Nonetheless I still feel anxious about letting just implement everything and just ask about the tests. Also I am always worried that it my seem to work but underlying physics is screwed up.
I am curious what is your experience with developing simulation software with AI. Do you have some tips and tricks how to do it efficient but still know what is going on in the heart of the solver ?
2
u/Fractal-Bifurcat 2d ago
I would add here a remark, that test are one thing which is important. However sometimes I feel it is difficult write good test for simulation software because you don't only need that end effect looks good and does it's desires function like in webdev, but you need to be sure that underlying physics is correct. Another issue is that I realized that often I don't understand the problem fully when I start development and earlier I got the understanding along the implementing. Therefore it is difficult to write good specification with well defined tests in the beginning of the process.
2
u/Right_Letterhead_587 4d ago
My expirience with physics simulation and AI, it's pretty bad. This year I use Claude, Gemini and ChatGPT to develop a physics engine similar to MuJoCo, simple rigid motion with classical integrators in openGL and C. The result was very poor.
8
u/andrewsb8 4d ago
If you are not sure if the tests are verifying the underlying physics, you need to write more tests until you are sure. But if you can only utilize the AI to figure out what tests to write and can't determine their validity, yeah there's a chance its completely wrong under the hood.
3
u/Psy_Fer_ 3d ago
A few of us in bioinformatics wrote a paper about using AI in scientific computing. We all mostly found that it's useful, but validation and verification (and not just blindly trusting AI tests) is extremely important. Taking various approaches to check the output depending on what we were doing. Also agents can be dumb sometimes and will be quite rigid in their "thinkin", which is where I find myself doing most of the heavy lifting when designing new tools and methods.
https://www.biorxiv.org/content/10.64898/2026.07.29.741496v2
1
u/Dangerous_Bid2935 2d ago
The tests really are your north star. If you're uncertain about your code, then your tests aren't robust enough. There is mostly no point in manually writing or reviewing code itself anymore in the age of such capable LLMs, your main job as an engineer is designing tests that ensure the written code is airtight.
1
u/MM_X__ 4d ago edited 4d ago
First. "Nonetheless I still feel anxious about letting just implement everything and just ask about the tests." . If you mean chain "implement -> make tests". It is fundamentally wrong in LLM. Even before it was a bad idea, but in human world with some level of trust and common sense it was okeish. TDD always was about make a test, get it red, make implementation.
Start from requirements, make the executable (hence TDD, CI/CD, etc) after start make implementation.
Follow the chain: requirement -> tests suite -> implementation
The issue with TDD what I can see, it is not enough with LLM world. In TDD you can cover just one case from one requirement. And it is especially should be visible in Scientific computing I believe. There is technics as "Property-based testing" but it is not creating a proper gate it doesn't work too. Answer can be formal verification for example, but who knows.
Basically we are going back to fundamentals, to get the trust back, we need to understand requirements and be sure it is protected. And a good requirements list which implemented as a gate is just one aspect.
I got you, there is no good answer. We need to rebuild Software Engineering Fundamentals to make it trustable, maintainable, functional, scalable, etc.
But there is always good fundamentals ideas: do it and small steps, iterate the every step, review everything, not speed up if you are not sure and so on
At end of the day, I would describe it as be engineer and do engineering using the best engineering practices. Don't be vibe coder.