Bloated C++ Code PVS-Studio's analysis of VibeTensor, a deep learning system software fully generated by AI agents from NVIDIA Labs, found the code bloated and repetitive, with over 400 C++ files and around 100,000 lines, yet containing few real errors. The static analyzer flagged redundant code, such as a loop condition always false, and the project's verbosity makes it unreadable and difficult to analyze. website uses cookies https://pvs-studio.com/en/privacy-policy/ to enhance your browsing experience. There's an old joke among programmers that you should never pay them by the line of code, because they'll end up writing long, pointless code and leaning hard on copy-paste. These days that joke writes itself, except now the "programmer" is GenAI, and it actually gets paid per line. Ironic. One of my hobbies is picking apart generated C++ code, just to get a sense of how the software development industry is evolving: which problems are fading out, and which new ones are cropping up. After reading my post Real-world C++ projects built with GenAI: do they exist? someone suggested I check out the VibeTensor: System Software for Deep Learning, Fully Generated by AI Agents I checked it with the PVS-Studio static analyzer and also read through the C++ code with my own eyes. I was curious how many errors a classic code review versus static analysis would each turn up. Turns out I still can't answer that. The code is bloated to the point of being unreadable, and that bloat is the whole problem. Wading through it felt like slogging through a swamp, and the analyzer got just as bogged down as I did. Don't get your hopes up for a big error count either. There's barely any code in this project actually worth analyzing. And that's despite the project not being small at all, over 400 C++ files, around 100,000 lines total. That size is deceptive though. Most of the project isn't really there to be looked at or analyzed. The core issue here is just verbosity. You see it in code snippets that repeat over and over, and in plain pointless busywork that bloats the code for no reason. In the past, people would've called this copy-paste /en/blog/terms/0068/ coding. That's not quite what happened here, but code generation gets you to the same place. Instead of extracting shared logic into functions, new code just gets generated again and again to solve nearly identical problems. Scroll through the files for a while and you'll start getting déjà vu, as the same blocks of code keep popping up. They're sort of different, sort of not. Here's what I mean https://github.com/NVlabs/vibetensor/blob/fe85461faca02ba95d7bf1f8289002ff8cf91652/src/vbt/dispatch/dispatcher.cc L760-L853 : Like I mentioned in my article C++: Write, shorten, optimize , this exact block of code shows up nine times across different tests: js const std::size t nd = sizes.size ; std::vector