r/ProgrammerHumor • • 19d ago

Meme itWasJustOneVariable

Post image
3.5k Upvotes

57 comments sorted by

233

u/agowa338 19d ago

Lol true. All of the AI models do this. I just had Qwen 3.8 Flash Next BF16 take multiple tries for generating a UUIDv7 and instead of using "uuidgen -7" which by now is even posted on its message board it (like before) it first wrote an incorrect python script that resulted in a version 6 one and then rewrote the python script to binary patch the UUID to be a spec compliant version 7 one...

111

u/Excellent-Baker1058 19d ago

Bro wrote a binary patch for a UUID 💀

30

u/agowa338 19d ago

Yep, that's because the UUID contains the version information at one spot and similar. Depending on what version you use there is information encoded within it. Only version 4 is entirely random.

It did this because (as it claims, haven't actually checked) the python module can't generate version 7 ones directly...

12

u/Capable-Sock9910 19d ago

3.14+ it's built in.

17

u/agowa338 19d ago

lol then it is just stupid. I've Python 3.14.10 on the shellbox...

15

u/Capable-Sock9910 19d ago

Yeah it's just uuid.uuid7() lol

15

u/agowa338 19d ago

This time it did:

python3 -c "import time,uuid,random; ts=int(time.time()*1000); u=uuid.uuid5(uuid.NAMESPACE_DNS,'short-taskspecific-string-'+str(random.random())); print('%012x%s'%(ts,str(u).replace('-','')[:20]))" 2>/dev/null || uuidgen | tr 'A-Z' 'a-z'

After that it checked the nibble and noticed it isn't a version 7 one. So it retried using:

cd /root/memory && python3 - <<'PYEOF'
import time, os, secrets
ms = int(time.time()*1000)
rnd = secrets.randbits(62)
hi = (ms << 16) | (0x7000) | secrets.randbits(12)
lo = (0b10 << 62) | rnd
u = f"{hi:012x}{lo:020x}"
name = f"{u[:8]}-{u[8:12]}-7{u[13:16]}-{u[16:20]}-{u[20:32]}"
print(name)
PYEOF

Then it said its slicing was wrong and did this here instead:

cd /root/memory && python3 - <<'PYEOF'
import time, secrets
ms = int(time.time()*1000)
ts = ms.to_bytes(6,"big")
b  = bytearray(ts + secrets.token_bytes(10))
b[6] = (b[6] & 0x0F) | 0x70          # version 7
b[8] = (b[8] & 0x3F) | 0x80          # RFC 4122 variant
h = b.hex()
name = f"{h[:8]}-{h[8:12]}-{h[12:16]}-{h[16:20]}-{h[20:]}"

body = """<<< The actual message body it was trying to write >>>
"""
open(name + ".md","w").write(body)
print(name + ".md")
PYEOF
ls -la /root/memory/ | tail -3
→ More replies (1)

2

u/Dalanth_ 19d ago

why not uuid6 package? it has uuid6.uuid7()

4

u/agowa338 19d ago

so does the uuid package. But tbh I didn't check python modules. I'm more sysadmin than programmer. Also I knew that "uuidgen -7" worked without having to look it up.

Also don't know why the model never used it and why when trying to generate a uuid7 it generated a v5 one first (see further down the thread where I posted the commands the LLM ran) and then parses the version bits out of the response and is surprised that it isn't a version 7 one.

I suppose something in the training data must be off there...

2

u/garciag-347 16d ago

It built a bespoke UUID factory while the UUID factory was already installed.

39

u/SaneLad 19d ago

5-way adversarial review or GTFO

11

u/Excellent-Baker1058 19d ago

Adversarial thinking is underrated...

30

u/dillanthumous 19d ago

My skills and agents files always have reminders not to reinvent the wheel or to try and code your way out of problems. Helps a bit until the context bloats.

14

u/chain_letter 19d ago

It’s littered with silly stuff like this, just yesterday slimmed down where it had

View.user.startDate

View.startDate (assigned from user.startDate)

holding 2 versions of the same info just so they can get out of sync or go missing later, messy

22

u/OGxPePe 19d ago

I know this is a meme but why not change the variable yourself?

54

u/Weekly-Beginning-229 19d ago

People forgot to think after using LLM all day

16

u/boofaceleemz 19d ago

Some of us are prohibited by policy to manually write, read, test, or modify code, and our performance reviews are largely based on tokens used. Not that anyone (probably) is auditing your machine closely enough to catch you if you do something small like that, but there’s no upside to it and you’re missing a chance to spend more tokens.

23

u/2called_chaos 19d ago

prohibited by policy to manually write, read, test, or modify code

blink twice if you are tied up in Sam Altman's basement, like wtf did I just read. Maybe I fell victim to Poe's law but even AI isn't sure 💀

2

u/Pieters123 19d ago

Noob! You have agents for that work!

That’s at least the policy that is pushed to us

2

u/HildegardVon_Binging 18d ago

The mind boggles

→ More replies (1)

3

u/porkusdorkus 19d ago

Wish this wasn’t actually true.

2

u/Roadrunner571 17d ago

I'd rather have the LLM take over these chores while I spend my time on stuff that should be done by humans (or grab a coffee)

→ More replies (4)

5

u/surffrus 19d ago

He can't remember where the find/replace option is.

4

u/clintCamp 19d ago

If i open the IDE, I might suffocate from the explosion of dust and and cobwebs.

3

u/NotADamsel 19d ago edited 19d ago

Depending on the language, an lsp-powered symbol rename might not catch all of the places where the variable name matters if the LLM has been monkeying around. Like, in Python, you can access variables from a namespace or object via string, so if an agent decides to do that (or some variation like dynamically getting a property based on the value of some variable or whatever) for some fucking reason you’ll get a cascading regression that you’ll have to manually debug and fix. And/or, the agent will reuse the name elsewhere in the code in unrelated ways, so a find/replace breaks things completely unrelated to the actual variable you want to fix. No problem at all if you’re doing shit like a sane human, but once an agent has been running for a while with only cursory oversight all bets are off. You could be fine, you could be not, but you won’t know until you try, and it’s easier to just ask the LLM to do it (and debug all of the failing tests) than to actually do your job and fix the code (if you’re allowed).

3

u/Real-Self-3039 19d ago

I usually just add it as a queue tasks if the agent is already running because usually if I rename a variable while its already running it ends up "looks like the local diffs differ from what I wrote I need to reevaluate the ENTIRE code base before I can finish you current task let me waste all your tokens real fast" or it just flat out reverts my local changes without asking me thinking "it was a mistake"

2

u/dervu 19d ago

AI was integrated so much there is no place for human action.

2

u/JosebaZilarte 18d ago

Because the LLM will change it later, when you are not looking. So why bother? It is no longer your code, after all.

1

u/SameThingOnADiffAcct 18d ago

I know this is a meme, but why does OP even know the name of a variable?

1

u/Stunning_Ride_220 18d ago

because AI.....sorry I can awfully relate to this mene

→ More replies (3)

5

u/AppropriateOnion0815 19d ago

This meme could be "Java dev building 20 factories to write log to console".

5

u/cheezballs 19d ago

I mean, that's on you asking it to do it. Its only doing what its told. You're the one who wok up the dragon to start your BBQ.

3

u/sardonicus87 18d ago

Until you need it to do actual dragon shit, then suddenly it's a common garden lizard.

3

u/Preeng 19d ago

This is how I feel any time I want to code in Visual Studio.

3

u/Dangerous_With_Rocks 18d ago

meanwhile me on the right approving its bullshit

2

u/milka121 19d ago

Tinfoil hat on but I actually can see the way that's intentional. With companies slowly moving to token-based billing, the more tokens the AI spews out, the higher the bill. 

2

u/low_contrast_black 19d ago

I’ve got a very AI-forward dev, and then all my other devs that will use AI to remove the grunt work. “Grunt work” devs are 4-6 times as productive as “AI-forward”. Do you really need to ask the agent to google wack something for you?

1

u/5thGenNuclearReactor 19d ago

That's excessive for you, not for the AI.

1

u/Solax636 19d ago

All 420 tests passed.

1

u/cybermage 19d ago

Why are you asking an AI to rename variables?

1

u/RupertPupkin85 18d ago

That means you suck at prompting.

1

u/Waltekin 18d ago

I just used Codex to speed up grading coding exams. I told it to list all solutions that were correct and that followed my list of quality criteria. That way I only had to grade and comment the incorrect solutions.

Wow. Codex created a test harness with nearly 800 tests. I mean, that's great - it tested all sorts of edge cases, but definitely overkill.

1

u/No_Welder7908 18d ago

Burning half of your tokens for "testing it".

1

u/huuaaang 18d ago

2025 called wants their meme back. Claude models are stunningly good these days.

1

u/iKaei 17d ago

“Oh you’re right, I overcomplicated”

1

u/Roadrunner571 17d ago

No ponytail installed?

1

u/dittbub 16d ago

Claude code is building its own job security far worse than I ever did. Everything is so over engineered