Let me try to explain what frustrates me about #AICodingAgent generated (or assisted) PRs by example. This is just one example, but it's quite typical of what I see a lot:
https://github.com/silverbulletmd/silverbullet/pull/1731
First of all: very elaborate PR description that ostensibly sounds like some deep analysis happened here. I'm not sure what the original prompt was here, but I suspect (based on some others by the same author — which I all closed) he has some "magic prompts" along the lines of "find performance bottlenecks and fix them."
And lo-and-behold, Claude found one (and probably more that are shared with yours truly in the 17 other PRs that this author opened):
"Syscalls: Reduced from 4 → 3 per write (25% reduction). This optimization is in the critical user latency path - every file save operation hits this code."
Now you will probably think: sounds reasonable, thank you!
But... is this REALLY a critical user latency path? Every file save does hit this path, but how many of those happen, really? SilverBullet is a single user app, and saves happen (with a sync lag) at most every few seconds if you're actively editing and Internet connected. Is this a path worthy of even a minute of performance optimization? I can think of hundreds that would way more interesting. But here we are.
Now this PR also adds a full benchmark suite to prove the made claims. I haven't actually looked at this code, to be honest because honestly it's pretty irrelevant because I don't feel there's a performance issue to be resolve here at all. I also haven't checked if all those stats in the PR are actually accurate. Again, doing so would take time, which I would consider 100% waste.
But here's the kicker: this PR actually introduces possibly two bugs in the ~10 lines that it actually changes: one definite bug (as I comment in the PR): it sets the creation time of a file to be the modified time, which is just wrong, but actually the only "sensible" think you can do to avoid making the syscall which this PR eliminates.
Second, more subtle, is a second bug is that it introduces a discrepancy between the OS reported file modified timestamp and the "unix clock" one, which it claims is "a few microseconds at most", but that's likely not true (and very filesystem dependent) and ANY discrepancy will mean that the sync engine breaks because it uses those last modified timestamps to check for changes.
And here's the thing. Me explaining this, thinking about it, commenting on it took likely 10x more time than the author spent on producing this piece of art. It doesn't solve an actual problem, it adds 150 lines of useless benchmarks and to top it all off introduces 2 bugs. In this case I think there's no actual way to do this properly, the PR cannot be fixed, it is just based on a wrong analysis. But in many other cases it's possible to get it to some place "good" as in: correct, but STILL it would be a waste of time, because the problem doesn't exist or at least is not worth addressing.
sigh