Maximum Vibe-Coding, Telling Claude to fix the BTRFS RAID56 write hole

I’ve been a bit busy so I haven’t been working on this super actively, but I thought it was funny to get silly reminders that AI has no actual intelligence. This one was so dumb it about gave me an aneurysm.

TLDR, “The fix to one problem is impossible because the tool to fix it refuses to fix it because it doesn’t do what the other path for the same function already does.”

That should be getting fixed now.
Progress~


image

That should be running tests for about an hour now and will then work on a de-rate + auto-repair for damaged data, then flushing damage evidence that can’t be auto repaired during a scrub to the log when for review.

Using pseudo-code as an intermediate representation (IR) for AI-driven code porting and cross-platform translation is one of the most effective architectural patterns in software engineering.

When you try to force an AI to do a direct 1-to-1 translation of a large game or app codebase (e.g., converting a complex Unity C# script straight into Unreal C++ or Swift), the model often gets bogged down in syntax errors, missing library imports, and mismatched paradigm structures. By introducing a pseudo-code bridge, you break the process into logical steps.

Its funny as i was really just working on my variant of a source code to pseudo code to new target platform code…multi ai work line path

More progress.

45 minutes of tests now.

Tests complete.

Some more bugs…




Hmm… I want to see a failure case for this… I don’t really like the “unproven” part.

And I got worried too soon. It did test it and validated the fix.

Another fix is in place. The stripe should no longer be reallocated before the repair is able to run, so the repair won’t inadvertently overwrite new data.

And that’s everything so far. Time to start more tests.

Das a lot. Time to punish it!

Hopefully soon! There have been so many bug fixes that it feels like it’s got to be getting close, but I’m honestly not sure given how stupid some of these bugs are.

What percentage of bugs has it actually found so far…?

Not directly related, but on theme. I am also using Claude to optimize both the ROCm and Vulkan kernel for Laguna S 2.1 on an AMD Strix Halo 395 box.

https://claude.ai/artifact/PHVTtNEePBGWhh8wUuLt47

Vulkan looking good in those numbers… The prefill though. Neat!

Should tell it to look for and minimize write amplifications and where they must occur try to make it so the writes occur as sequentially as possible.

Also the write hole closure/torn writes need a lot of tests.

3 Likes

Which is why the vast majority of software written in the last 15 years SUCKS ASS.

1 Like

Just want to throw in my 2 cents here (as a software engineer for the past 12-14 years).
I’ve been playing around with Claude a lot recently (mostly hobby projects) and while its come a long way it still do stupid shit all the time and make bad algorithms to solve problems, insist something is impossible until i point at the API it must use etc. it also keeps “forgetting”
stuff all the time in large codebases.

My employer pays for any AI usage if i want to use it, but i have yet to actually ship anything AI made that is not debugging and troubleshooting code. The tools are in my opinion great for troubleshooting, explaining and providing overview of code, light refactoring, finding bugs or mistakes and creating Proof of consents .The Common denominator for all these is that they do not have the same correctness requirements, if anything is wrong i can just ignore it and move on. the same can not be said for the code that i am shipping.

I have given both the latest Claude and GPT models a fair shot at solving some of my simpler tasks at work, but i have ended up reverting and fixing the problem by hand because of how these tools tend to just throw new tweaks on bad code until it passes tests instead of actually cleaning up the code and make a more elegant fix. Sure i could probably have given it a better more details prompt, but if i have to explain every step and every little ting its suppose to do its faster to just do it myself.

so based on my experience with Claude so far there is no chance in hell i would use any “fix” Claude has made to BTRFS on my own system risking data loss. To me its just the fact that its vibe coded that makes me not trust it. i have had way to many cases in my hobby projects where i have thought it solved something only for it to break completely when something changes later on.

i like to describe these AI tools as mimicking machines, they mimic whatever they where trained on and they keep getting more and more convincing every day, and have recently reached a point where the imitation is useful, but its still just an imitation, and there is no intelligence, just a next token prediction and huge amounts of data somehow lossy compressed into the model.

5 Likes

Well I just got back from work, ate dinner and saw that Claude is still running. So now I have 24 hours of logs to read…

This is definitely a consideration and I think this is one of the most valid arguments against AI code in general. That being said, maybe I’m naive, but Claude has been testing it’s own code for the past 24 hours, so I genuinely question if code written by human developers has anywhere near the same level of rigor or testing.

I do get your point though, and I do mostly agree with it. It is just a bit hard for me to believe given what I’m currently watching. That also being said, I had Opus 4.6 review a codebase I was writing with it and it said it didn’t find any bugs, and then Opus 5 said it was absolutely filled with them. So… Maybe I’m being dumb.

So often when I hear people talk about how AI coding doesn’t work or is bad, I hear them talk like they are sitting there hovering over the code with a broom like an angry Karen.

It makes me wonder if people swatting it with a metaphorical broom and trying to be overly controlling is some part of the issue people are having or there really is some big issue I am not catching because I have blinders on. I rarely have significant issues getting it to do what I want, though it might also be the language and size of code base that I am working with. I’m really not sure.

I am really trying to think of a time this has happened for me and I honestly can’t think of anything that I can’t attribute to an edge case of something I was working with (like reverse engineering the video and control API for IPMI or iLO, so I could build an MCP tap for it), or something changing in a unexpected way, both of which would be equally, and probably far more likely with human written code.

If you have any examples I would love to hear them because I feel I’m either completely blind or tons of people are just really bad at using AI for coding.

I should probably make more of an effort to read the outputted code, but honestly I mostly don’t care unless it presents an issue, and this generation really hasn’t. Maybe the code isn’t hyper optimal, but I’m not trying to sit here and be pedantic when I want something to just work the way I tell it to. And after a few prompts it almost always does.

I generally find most software to be poorly thought out, slow and painful to use, and with some reasonable prompting, testing, correction and a tasteful amount of verbal abuse, I am able to get an app that does exactly what it is supposed to and works perfectly.
And if somehow there is a bug then it’s at most 3-4 prompts away from being fixed.

Alternately, I have wondered, is everyone just using something stupid like Haiku 4.5, Qwen Coder, or somehow lobotomizing their AI agent?

Anyway, my confusion aside, I appreciate your insight. I am just still finding myself unable to square this circle.

I will make a point to specifically have it look for that. I haven’t thus far, but it spontaneously called out one that we kind of built in on purpose for logging. Since so much of the filesystem is a rusted out flaming dumpster full of bullet holes, it really has no mechanism to protect data whatsoever and actively destroys it in a substantial number of cases.

Because of this I have needed to have Claude build fault logging in a few different ways so you can try to repair failed writes, determine which write failed(so you know which part of the parity is defective and can actually repair it), and generally just not yeet all your data.

output_s

Added logging:

I’m still reading the log of stuff since yesterday and I’ll post an update once I can parse that and my eyes stop hurting.

2 Likes

No, it’s why the vast majority of software today exists at all.

If all we had were assemblers and c, the amount of software today would be much, much less and far more limited in scope.

2 Likes

i can share one of my AI forgot / got stupid again moments from yesterday.
I am playing around with a code formatting tool and testing it against a variety of code to find different styles people write in, and add options to configure the tool to format it in that way.

At some point when i feed it examples and told it we need to add a rule for this way of formatting it had started hard-coding the number of indentations in the code instead of adding options to my format.json file. we (me and Fable 5) had already been working a lot on this project and made a whole lot of rules the correct way, but i am guessing at some point compaction made it lose something and when the goal was to make code A look like code B it was easy and fast to just hard-code the indentations.

I noticed this quite quickly and got it to fix it for the 2 or 3 rules it had started hard-coding values for, but to me this is still an example on how it looks like you get what you want and all tests passes but at some point you will realize that it didn’t do want you had asked for and just “threw” changes at the code base to get a test to pass instead of actually write the entire thing.

while i like to get different AI models to look over other AI models work, i have noticed that some models are really bad at some concepts and “finds bugs“ that are not real. i had to stop / revert some of Opus 4.8 “fixing“ of a “ thread safety issue“ because it was not a real issue, it simply did not correctly understand how multi-threading worked it seemed. it added a lot of unnecessary bloat to synchronize threads unnecessarily and it would just slow down the program. this is one of the other problems i have with AI code, it can add bloat and if you are not familiar with the code you guess its necessary and leave it there even if it causes performance loss. cases like these are more difficult to notice as there’s nothing that stop working, its just bad code.

none of these issues are big deals for pet projects, but when its in a commercial setting these things actually matters. now in AIs defense i have seen just as bad code made by humans, but its usually been contractors that don’t give a shit about maintainability and know they will move on to a new customer at some point anyway.

I have seen “increaseTestCoverageTest“ that just calls a bunch of methods without testing anything just to make it seem like the software has high coverage as thats what the client was looking at. the people who had made that code had left several years before i stumbled upon it but to me this is just being an asshole to both the client and the people how inherit that code.

4 Likes

Yeah, I could see this easily being something I wouldn’t encounter, or would encounter in the form of text/items on the screen not looking right.
If you aren’t, I would tell it to explicitly save it any of your important structural instructions into the Project Instructions File, CLAUDE.md. I have done that quite a bit on some projects, especially when it starts acting dumb.
And I highly recommend the Superpowers plugin.

Are you trying to make a style enforcement/formatting system kind of like what they have in Eclipse?

Yeah, that I get too. I’m sure there is a decent amount of non-optimal things in the code I’ve made. It just depends what you’re making I guess. If I was really worried about it I’d just put it on a loop to optimize everything.

“Johnson! We need more blinky lights and text prints in the codey thing! I want to know it’s working! Call every function!” lol

2 Likes

Acknowledged and raised a “No amount of jerking off to code written by human developers makes everyone writing code a level 80 code autist.”

https://claude.ai/artifact/PHVTtNEePBGWhh8wUuLt47

I currently have Claude in a loop optimizing llama.cpp, and it has squeezed +13% speed out of decode on the ROCm kernel and +237% on Vulkan at 0 tok cache. At 256k tokens, it has improved ROCm by +84%.

On Prefill, it has improved ROCm by +121% and Vulkan by +28%.

In other words… numbers don’t lie, working with models is fine if you’re not an idiot and ask for receipts.

2 Likes

Update, Claude has now been going for 48 hours on it’s own and has been running substantial testing.

For write faults on degraded mounts, I am interested in feedback. Claude initially started building out a “fail loudly” kind of approach for them, but I pushed it to instead start refusing and potentially go read-only.
I think this is kind of a complicated, personal decision, so I am going to try to have Claude build it out with going read-only as the default but the loud failure as a fall back flag.

If you look at the “Know open issues” > “Costs of strict refusal”, you can see a bit of an explanation of the issue. TLDR, in an effort to maximize data security the FS is not allowed to return any data that can’t be adequately confirmed. The result of this is that you start restricting data changes so you don’t overwrite valid data that would be required for a parity recalc.

If a drive is failing writes, then you may not know if the information was written successfully. Now you might end up overwriting your parity data with a recalculated value that is invalid. This would then destroy the one copy of your data that could have been used to recover the stripe. The same kind of behavior played out in a few ways, but that’s the reason for the refusal to write.

There is now logging of what failed, and where, and it is logged. If anything tries to write more though, it will be blocked. The reason is that RAID5, for example, would only handle a single bad write. This means that you have drives 0 - 3, and drive 0 fails a write. That is now your entire safety net for that stripe of data. So you have valid data for the stripe on 1 - 3, but 0 is invalid. Now if you lose another drive then the data is gone.

I think that about covers it for now. I’m going to have it fix the silent write holes and start building out a new system for tracking writes since the disk started glitching.

Also, that usage… I’m glad I have a subscription…

Acknowledged and raised a “No amount of jerking off to code written by human developers makes everyone writing code a level 80 code autist.”

https://claude.ai/artifact/PHVTtNEePBGWhh8wUuLt47

I currently have Claude in a loop optimizing llama.cpp, and it has squeezed +13% speed out of decode on the ROCm kernel and +237% on Vulkan at 0 tok cache. At 256k tokens, it has improved ROCm by +84%.

On Prefill, it has improved ROCm by +121% and Vulkan by +28%.

while i can not comment on the code produced, i can tell you that my experience doing things like this tend to hyper optimize for you hardware and software stack, and may not be applicable on other machines and may even reduce the performance or break features when ran on other machines.

one of my experiments in the past was to try to improve rendering in web browsers, and Claude found some interesting caching techniques for specific canvas sizes in Firefox, but when i tried to use it in Brave the performance got way worse. The performance gains that Claude had “discovered“ was made solely by running and measuring the result, and so it did not really “know” why it worked only that it did work, it could very well break in the next update or next major release of Firefox, and was useless in any other browser. but for just my specific Firefox version it improved performance a lot. (the real/final solution to my problem was replacing one of my algorithms that did the color calculations)

i am not saying your llama.cpp findings are not real performance gains, but i would be careful to claim that its better than llama.cpp, i there is a high chance that your code has some tradeoffs that the llama developers did not want to do, or it may have found a a local optimum in your hardware and software configuration.

i find it useful to get the AI to explain why something is better and if its not rooted in anything concrete that makes sense to me and only based on measurements or guess work i am avoiding it.

Now i don’t want to be a downer here, as long as you have fun and feel you get your money’s worth then that’s what’s important.

2 Likes

Yeah, but that’s what I’m currently going for. I specifically want the maximum speed on the Strix Halo device I’m working with.

Well llama.cpp was literally broken before I started poking it, so in at least one or two aspects it is.

This comes back to my assertion that…

I in no means think the developers of llama.cpp are lazy, incapable or wouldn’t be able to make something that ultimately is better than an AI, but they didn’t, and the code is currently bad/broken/doesn’t properly fit the use case.

It is just odd to me that so many people are not finding use out of it, because I have found, Claude and gen 5 specifically, to be astoundingly capable.
I literally gave it half a dozen bug fixes and corrections, and a whole feature to build last night, went to bed, and it’s done and exactly what I wanted.

As for the rendering in web browsers, I would definitely tell Claude to

“Run tests and optimizations across all the major browsers and the past year’s worth of recent software releases. If any optimization works on one browser and not another, either scrap it if it is under a 5% gain, or gate it behind a test for which browser the user is using. Do you think you would be able to do this successfully inside of Docker or something or would you need a live system with a GPU?”

Obviously you wouldn’t be able to test Safari without an Apple system, but you should be able to test everything across every major browser quite easily. Then you put it in an automated training loop.

Further, you tell it to turn that whole thing into a test and configure it to auto-run on every new release if you really want to be fancy.

1 Like