A local agent got tricky C++ algorithms right by testing its own mistakes
Karatsuba multiplication and a recursive halfgcd, from academic papers into an existing codebase. A Qwen-powered Hermes agent took many tries, but its own tests caught the errors.
Done withHermes AgentSpotted· by HN user nullc· Oct 16, 2026
Result Its own mutation-tested tests caught the errors
“It wrote extensive test cases and validated them with mutation testing (per my standard instructions)-- took many tries getting the algorithms right but with the tests handy it found and fixed the errors.”
Spotted: found in the wild. Details are as reported by the source above and have not been independently verified.
What they did
They gave the agent a pile of relevant academic papers and their existing C++ codebase, which already had an internal field arithmetic library. They had it implement karatsuba multiplication of characteristic-2 polynomials, then the recursive halfgcd algorithm for the same polynomials. They also had it write extensive test cases and validate them with mutation testing.
How it went
The agent correctly found the optimizations that used the field’s own properties on its own. It took many tries to get the algorithms right, but with the tests in place it found and fixed the errors itself.
Try it yourself with Hermes Agent
Give your coding agent the relevant reference papers and your existing codebase, then ask it to implement a specific algorithm following the codebase's existing conventions. Tell it to write extensive tests and validate them with mutation testing, then let it iterate and fix its own errors using the test results.
A starting prompt written by Agents in the Wild. Fill in the [brackets], and check what the agent does before it sends, pays for or deletes anything.
Their Hermes agent on Qwen took a C++ entropy extractor from 12MB/s to about 48, then kept optimizing alone. Six hours later it stopped, just past 100MB/s, with a correct implementation.
Their Hermes coding agent works unattended for about 15 minutes, opens a PR and pings them to review. At basic coding tasks, they say it's faster than they are.
Booking swimming lessons for their son was on the to-do list. Hermes Agent monitored availability and automatically booked a suitable slot the moment one opened up.
An 8D music video with millions of views sparked a test: could an agent make one? Hermes Agent wrote the lyrics and music, made visuals from the song and added the 8D effect and audio-responsive video.
Payment portals, and bills always left to the last minute. One photo of a mailed bill went to a Hermes Agent with a Stripe agent wallet, and it paid the bill and filed the receipt.
Mood, food, habits and sleep, logged daily for months. A Hermes agent writes end-of-day reports (they miss a lot), but asking Claude for correlations surfaced a pattern they'd never noticed.