RSSAmplifier

Blog

Yossi Kreinin

Worse is better

yosefk.comRSS feed ↗20 posts

Latest posts

Doing everyone else's job

I find it very useful to be able to do everyone else’s job — it helps you learn how they work and what they need, and it helps even more when you need their job done, but they won’t do it themselves. If you made something new and those you made it for can’t be bothered to start using it, go ahead and integrate it into their system. It worked for Intel back when they made their first 32-bit CPU and…

LLMs struggle with the shell, too

You used to tell people, “why are you doing all this by hand — write a script to do it!”, and then “...I meant an actual Python script, not a buggy grep | sed | crap pipeline!” This got better since some of those too lazy to write a script (or not lazy enough to avoid the harder, buggier way?) now ask an LLM for the script. But you know who doesn’t? LLMs! “Agentic LLM harnesses” seem to think it’s…

All means are fair except solving the problem

An industry veteran in my circles has recently made the rookie mistake 1 of printing a warning from his code upon misuse. Surprisingly to nobody experienced, critical workflows soon came to a screeching halt. It turned out that a program using his code prints something like “yay, done” upon exit, and scripts expect it to be the last thing it says. But now those warnings occasionally got printed…

"Enabling" C threads in a Python / Wasm environment

Scarred by bare metal programming during my formative years, I consider the speedup from multithreading worth pursuing no matter how limited a form of it you’ll get, and no matter how hideous the hacks you’ll need to make it work. In today’s quest, we shall discover the various ways in which threads don’t work in a Python, Wasm, and especially a Python on Wasm environment, and then do something…

LLMs aren’t world models

I believe that language models aren’t world models. It’s a weak claim — I’m not saying they’re useless, or that we’re done milking them. It’s also a fuzzy-sounding claim — with its trillion weights, who can prove that there’s something an LLM isn't a model of? But I hope to make my claim clear and persuasive enough with some examples. A friend who plays better chess than me — and knows more math &…

0+0 > 0: C++ thread-local storage performance

We'll discuss how to make sure that your access to TLS (thread-local storage) is fast. If you’re interested strictly in TLS performance guidelines and don't care about the details, skip right to the end — but be aware that you’ll be missing out on assembly listings of profound emotional depth, which can shake even a cynical, battle-hardened programmer. If you don’t want to miss out on that — and…

Profiling in production with function call traces

A timeline showing function call and return events is a great way to debug performance problems, especially in production . In particular, it's often much more effective than traditional sampling profilers, for reasons we’ll discuss. However, the adoption of function tracing in the industry remains uneven because of a chicken-and-egg problem. To best use a tracing profiler, you need some…

Advantages of incompetent management

What constitutes managerial competence? As a vague starting point for an answer, we could say that competent management sets achievable objectives and then achieves them, by organizing and incentivizing the necessary work. It turns out that even this near-tautological banality is enough to see why competent management puts many desirable things out of reach. This becomes apparent when looking at…

Profiling with Ctrl-C

I once wrote about how profiler output can be misleading . Someone commented that you don’t need profilers - just Ctrl-C your program in a debugger instead, and you’ll see the call stack where your program probably spends most of its time. I admit that I sneered at the idea at the time, because, despite those comments’ almost aggressive enthusiasm, this method doesn’t actually work on the hard…

A 100x speedup with unsafe Python

We're going to speed up some numpy code by 100x using "unsafe Python." Which is not quite the same as unsafe Rust, but it's a bit similar, and I'm not sure what else to call it... you'll see. It's not something you'd use in most Python code, but it's handy on occasion, and I think it shows "the nature of Python” from an interesting angle. So let's say you use pygame to write a simple game in…

The state of AI for hand-drawn animation inbetweening

There are many potential ways to use AI 1 (and computers in general) for 2D animation. I’m currently interested in a seemingly conservative goal: to improve the productivity of a traditional hand-drawn full animation workflow by AI assuming responsibilities similar to those of a human assistant. As a “sub-goal” of that larger goal, we’ll take a look at two recently published papers on animation…

Managers have no human rights

Here are some thoughts which are often basically correct: Every time I try to do the right thing here, it's like the place actively resists it. Actually, forget "the right thing" - it's whenever I try to do pretty much anything. Yesterday's "strategic" thing I toiled over just got tossed into the dumpster. And they expect me to be all excited about the new "strategy" they coughed up? My…

refix: fast, debuggable, reproducible builds

There's a simple way to make your builds all of the following: Reproducible /deterministic - same binaries always built from the same source, so you can cache build outputs across users Debuggable - gdb, sanitizers, Valgrind, KCachegrind, etc. find your source code effortlessly Fast - the build time overhead is negligible, even compared to a blazing fast linker like mold What makes it really fast…

I have risen

Hello to the readers still using RSS! I've moved the blog off WordPress to my own ugly publishing software, and will be grateful if you report any glitches you see (posts or comments look bad on device X or feed reader Y, that sort of thing.) This blog slowed down a lot in 2017, when I switched from a part-time programming position to a full-time senior management position. Between the comment…

Don't ask if a monorepo is good for you – ask if you're good enough for a monorepo

This is inspired by Dan Luu's post on the advantages of a single big repository over many small ones. That post is fairly old, and I confess that I'm hardly up to date on the state of tooling, both for managing multiple repos and for dealing with one big one. But I'm going to make an argument which I think mostly works regardless of the state of tooling on any given day: Monorepo is great if…

Patents: how and why to get them

I'm going to discuss 3 very basic things about patents: Why it's good for you to get them; Why it might be bad for your employer (and why they don't care); How to get a patent for your idea (doesn't matter which.) Some of my points are a bit naughty. But I maintain that they're based in fact and fairly widely known. So well-known, in fact, that I'm surprised to have never read it somewhere else.…

Things want to work, not punish errors

For better or worse, things want to work. Consider driving at night on unlit, curvy mountain roads, at a speed about twice the limit, zigzagging between cars, including oncoming ones. Obviously dangerous, and yet many do this, and survive. How? Roads and cars are built with big safety margins Other drivers don't want to die and help you get through Practice makes perfect, so you get good at this…

Hiring (self-driving algos, HLL compiler research)

OK, so 2 things: 1. If you send me a CV and they're hired to work on self-driving algos – machine vision/learning/mapping/navigation, I'll pay you a shitton of money. (Details over email.) These teams want CS/math/physics/similar degree with great grades, and they want programming ability. They'll hire quite a lot of people. 2. The position below is for my team and if you refer a CV, I cannot pay…

Fun won't get it done

OK, published at 3:30 AM. That's a first! So. Got something you want to do over the coarse of a year? Here's a motivation woefully insufficient to pull it off: It's fun! What could give you enough drive to finish the job? Anything with a reward in the future, once you're done : Millions of fans will adore me. It will be the ugliest thing on the planet. I will finally understand quantum neural…

The habitat of hardware bugs

The Moscow apartment which little me called home was also home to many other creatures, from smallish cockroaches to biggish rats. But of course we rarely met them face to face. Evolution has weeded out those animals imprudent enough to crash your dinner. However, when we moved a cupboard one time, we had the pleasure to meet a few hundreds of fabulously evolved cockroaches. In this sense, logical…