LaurieWired Profile picture
researcher @google; serial complexity unpacker; writing https://t.co/W1SLCQMxZE ex @ msft & aerospace
7 subscribers
Mar 13 4 tweets 2 min read
Ken Thompson, upon receiving the Turing award, wrote a terrifying paper.

“Reflections on Trusting Trust” illustrates a scenario of original sin.

Because the C compiler is written in C itself, a compromised compiler can self-replicate with no trace in source code. Image If you can’t trust your compiler, you can’t trust any compiler you build with it either.

Sin in the family tree, no matter how distant, can propagate to your clean code even decades later.
Mar 10 5 tweets 2 min read
In 1960s Soviet Russia, a computer network was proposed decades before the internet.

“ОГАС” had concepts of Cloud Computing, virtual currencies, and a data-driven economy.

At a cost of $300 million, 300k operators, and a 30-year rollout, it was killed by politics. ОГАС, National Automated System for Computation and Information Processing Glushkov, the creator, envisioned technology as a tool for government optimization.

The claimed savings returns would be fivefold over a 15 year period.

Banks, factories, and offices hooked up to cities; with information further distilled to a central hub at Moscow. Image
Mar 4 5 tweets 2 min read
Modern Computing is only possible because Honeywell filed a lawsuit a few minutes early.

The invalidation of ENIAC’s patent in Honeywell vs Sperry Rand placed the invention of the digital computer into public domain.

Without it, the U.S could have easily lost tech dominance. Image Sperry Rand wanted $2.3 Billion (inflation-adjusted) from Honeywell, for infringing on “arithmetic operations using electronic circuits”.

The ENIAC patent was so broad, they could legally demand royalties for *all* general-purpose electronic computers. Image
Mar 1 4 tweets 1 min read
If most LLM output feels unimpressive, you probably dislike phatic communication, and prefer the anti-inductive.

Anti-inductive speech favors non-pattern-following responses that can’t be easily predicted...the anthesis of how LLMs function. Image Most humans prefer phatic-speech, which likely explains the popularity of CBT as the safe “default” therapy.

If you can’t stand “therapist-talk”, you likely have a cognitive style that deprioritizes EQ.
Feb 10 5 tweets 2 min read
How many tabs do you have open?

10? 50? 200+?

High numbers tell us a lot about personality. Memory offloading has always been a cognitive strategy; in the modern era it’s just more likely to happen in a browser instead of paper. Image Tab hoarders fall into a few categories:

- Browser as external memory expansion
- Loss aversion / high anxiety
- High cognitive tolerance for parallel processing
- Zeigarnik effect abusers
Jan 28 4 tweets 2 min read
Most hashing algorithms are designed to avoid collisions.

What if they weren’t?

Locality-sensitive-hashing (LSH) is a way to group similar inputs into the same “buckets” with high probability.

Collisions are maximized, not minimized. Image As a malware researcher, I’m quite experienced with fuzzy hashing. LSH algorithms are a bit different.

LSH algos specifically reduce the dimensionality of data while preserving relative distance.

Think spam filters, copyright media detection, even music recommendations. Image
Jan 28 4 tweets 2 min read
Without COW, docker would eat your harddrive.

No, not the animal.

Copy-on-Write (COW) is the perfect example of "doing nothing is faster than doing something".

COW saves billions of CPU cycles and Terabytes of storage every day; and you probably never noticed. Image
Image
It's hard to emphasise just how *slow* I/O is even on modern systems.

What takes DDR5 one second, takes an NVMe SSD 5 minutes. Any possible advantage we can get can pay huge dividends in performance.

The fastest way to write to disk, is if we didn't write at all... Image
Jan 24 4 tweets 2 min read
Is the human brain Turing-complete?

If you sit down and “think through” the steps of a Turing machine, you are conceptually simulating it in your mind.

However, such a simulation doesn't have unbounded memory; our neuronal working memory is very finite. Image
Image
Of course, we have tricks to extend this working memory.

Relying on external aids, like writing down information on paper, get's around some of our inherent limitations.

It thus becomes more of a philosophical question.
Jan 16 4 tweets 2 min read
In C++, you can use likely() and unlikely() to help the compiler with branch prediction.

likely() will generate assembly code without any jmp instruction for that path.

No jmps, means no flushing of the processor pipeline. You can see this moniker fairly often in the linux kernel, especially in relation to memory management.

With if-else statements, we occasionally know with high certainty what branch is true and which is not.

Thus, if the compiler *knows*, we can generate optimized code. Image
Jan 13 4 tweets 1 min read
What’s the difference between experience and expertise?

A 2008 research paper found an interesting distinction.

Years of work related experience didn't affect a person's susceptibility to various cognitive biases. In other words, experience didn't help at all. So what did? Image As it turned out; professionals who took specific training were much less susceptible to bias than those with extensive work experience.

“Expertise” can be defined as a person who not only has a deep understanding; but also the proper tooling for the situation.
Jan 9 6 tweets 1 min read
It's mathematically impossible to stop malware.

Due to Rice's Theorem, it's impossible to write a program that can perfectly determine if any given program is malicious.

This is because "being malicious" is a behavioral property of the program. Even if we could perfectly define what "malicious behavior" *is* (which is a huge problem in of itself), any property about what a program will eventually do is undecidable.

Security in the traditional sense is probabilistic.
Jan 8 5 tweets 2 min read
Null pointers suck.

Even Tony Hoare, the inventor of the null reference, calls it “my billion-dollar mistake”.

It’s responsible for an unmeasurable number of exploits, system crashes, and errors.

How did it start? Image Temptation.

In 1965, Hoare was writing the type system for a language called ALGOL W.

The goal was to ensure all reference use should be safe; but he “couldn’t resist putting in a null reference...it was so easy to implement.” Image
Jan 6 6 tweets 3 min read
Why are red objects so pixelated in low quality videos?

It starts with the human eye.

About 2/3s of our color receptors are dedicated to green; it's how we perceive detail.

Modern video codecs take advantage of this visual quirk; but it has some downsides. Image Most modern video codecs use a technique called chroma sub-sampling to increase compression, while minimizing detail loss.

A video frame is a combination of Brightness and Color. Because the values are encoded separately, we can use different resolutions for each.
Dec 26, 2024 5 tweets 2 min read
“My wife complains that open office will never print on Tuesdays”

A bizarre sentence; which kicked off one of the most interesting bug hunts in Ubuntu’s history.

It all starts with some goofy pattern matching. Image It’s not a bug with the printer, or OpenOffice, or the printer driver.

It’s a mistake in the way the “file” utility parses file signatures.

When printing from OpenOffice, a PostScript file is created with the creation date. Image
Dec 23, 2024 4 tweets 1 min read
Most people sort socks in O(n²) time. (Naïve Pairwise Search).

I'm going to show you how to get it down to O(n) with Hash-Based Partitioning.

Let's break it down. Image 1. Take all the socks from your basket and separate them into piles for each color.

2. Within each color pile, iterate through to separate by pattern.

3. Continue sorting the pattern-specific piles as needed by another attribute (size, material)
Dec 19, 2024 5 tweets 2 min read
In 1992, Andrew Tanenbaum made some predictions about computing.

1. Microkernels are the future
2. x86 will die out and RISC will dominate the market
3. Everyone will be running a free GNU OS.

An argument ensued between him and Linus Torvalds. But who was right? Image It's all a matter of perspective.

Microkernels never fully took off, but hybrid kernels like Windows NT, and mach derived kernels found on macOS + iOS control a ton of market share. Linux is the main exception here, being the most monolithic out of the bunch. Image
Dec 9, 2024 4 tweets 2 min read
Shutting down your PC before 1995 was kind of brutal.

You saved your work, the buffers flushed, wait for the HDD lights to switch off, and

*yoink*

You flick the mechanical switch directly interrupting the flow of power.

The interesting part is when this all changed.Image Two major developments had to occur.

First, the standardization of a physical connection in the system linking the power supply to the motherboard. (Hardware constraint)

Second, a universal driver mechanism to request changes in the power state. (Software constraint) Image
Dec 2, 2024 4 tweets 2 min read
Wiggling your mouse speeds up your computer.

There's a joke in the Win95 era that wiggling "makes the sand fall faster in the hourglass".

The crazy part? It's sort of true.

With the right mouse input, an hour-long install could be reduced to 15 minutes. Why? Windows 95 applications often use asynchronous I/O.

File operations were so slow that programs would go to "sleep" until the OS finished.

Win95 had a quirk of not waking the programs back up quickly. However, user input (e.g. a mouse wiggle) wakes the program immediately.
Nov 19, 2024 4 tweets 3 min read
CPU % usage is really complicated.

On Apple Silicon, you could use as little as 27% of the CPU's maximum frequency, yet Activity Monitor will show 100% usage of the core.

Why?

It all has to do with active residency. Image Active Residency is the % of time the CPU core is active over an interval.

The tricky part is how the OS interprets this number when a CPU has a dynamic frequency.

If the Blue line is CPU frequency, and the Red line is absolute CPU usage, what % should be shown?

50%? 80%? Image
Nov 17, 2024 4 tweets 2 min read
The internet is a *really* suboptimal communication method for live events.

Cable TV is orders of magnitude more efficient.

Broadcast, by design, is one-to-many. Each client has a guaranteed amount of bandwidth, often divvied up into multicast streams within the network. Image
Image
Most internet-based streams are overlaid on top of a point-to-point network.

Sure, we can get creative with CDNs, but it doesn't fundamentally change the unicast nature of delivery.

Bandwidth usage scales linearly with viewers. Image
Nov 13, 2024 5 tweets 3 min read
What operating system does your AirPods run?

Sounds like a weird question.

Until you realize you have the equivalent processing power of an iPhone 4 in *each* ear.

Bluetooth audio SoCs are seldom talked about, but a fascinating field. Image
Image
AirPods specifically run RTKit, a Real-time Operating system targeting small ARM chips, written mostly in C++.

RTOS(s) are often used in audio devices and peripherals, as the slightest hiccup in scheduling would be immediately (aka audibly) obvious. Timings are very tight. Image