flak rss random

css vs webgl cubes

I wanted to conduct a little experiment, and it turned into a few experiments in one. I was watching a youtube video about creating 3D scenes purely in CSS. At first, it seems pretty ridiculous. Surely this has to be too much effort, but then as it came together, it wasn’t that difficult. CSS has more potential as a lightweight 3D rendering language than I may have suspected.

more...

Posted 20 May 2022 06:23 by tedu Updated: 20 May 2022 06:26
Tagged: programming web

parallel tree running

For the first version of where’s all the code I did a simple tree walk to find all the code, one file at a time. But I wrote it in go, a supposedly concurrency friendly language, so it seemed the obvious thing should be to walk the tree in parallel. This went great, until it didn’t, but then it ended up okay.

more...

Posted 16 May 2022 02:23 by tedu Updated: 20 May 2022 16:41
Tagged: go programming

where's all the code?

I already had a pretty good idea where all the code in the OpenBSD kernel was hiding but for the sake of comparison I wanted precise numbers. This would be easy enough to get using some scripts and builtin tools like wc and du, but I wanted a tool that would give me something like this.

. 6.93M lines 383.41M bytes
├──dev 5.69M lines 348.84M bytes
│  ├──pci 4.46M lines 308.00M bytes
│  │  ├──drm 3.99M lines 293.86M bytes
│  │  │  ├──amd 3.33M lines 273.93M bytes (6)
│  │  │  ├──i915 326.03k lines 9.21M bytes (5)
│  │  │  ├──radeon 201.19k lines 6.71M bytes (1)
│  │  │  ├──include 48.94k lines 1.56M bytes (9)
│  │  │  ├──ttm 5.46k lines 142.03k bytes
│  │  │  └──scheduler 1.86k lines 51.73k bytes
│  │  └──bktr 8.53k lines 265.29k bytes
│  ├──usb 187.58k lines 5.09M bytes (1)
│  └──(other) 1.02M lines 35.11M bytes (33)
├──arch 729.42k lines 20.46M bytes
│  ├──amd64 133.43k lines 3.98M bytes (7)
│  └──(other) 595.99k lines 16.48M bytes (20)
├──kern 83.80k lines 2.05M bytes
├──uvm 29.39k lines 816.41k bytes
└──(other) 395.30k lines 11.23M bytes (19)

Easy to see everything, without too much clutter. Importantly, let me group things my way, and toss the less interesting parts off to the side. There’s 100 du but better tools on github, but it would take as long to find one that does exactly this as it did to just write one.

And thus watc.

Another take.

Posted 04 May 2022 17:57 by tedu Updated: 23 May 2022 21:47
Tagged: software

compiling an openbsd kernel 50% faster

This is approximately as wise as taking off from Mars in a ragtop rocket, but don’t worry, the math all checks out.

more...

Posted 02 May 2022 14:38 by tedu Updated: 02 May 2022 14:38
Tagged: openbsd

on the efficacy of cosmic ray sorting

Cosmic rays are believed by some to exist, although I’ve never seen one. Have you? Are the cosmic rays in the room with us now? It has been further claimed that these cosmic rays may interact with our computers, possibly causing strange behaviors. This sounds like pseudo scientific babble from people who don’t believe in the ghost in the machine.

more...

Posted 28 Apr 2022 18:13 by tedu Updated: 28 Apr 2022 18:13
Tagged: c programming

probing my ssd's latency

My SSD is probably pretty fast, but maybe a faster one would let me compile a kernel even quicker by reducing the time spent waiting for I/O to complete. First though, I need to determine its latency, and the benchmark tool available to me, dd, measures throughput not latency. We need to go deeper.

more...

Posted 25 Apr 2022 05:39 by tedu Updated: 25 Apr 2022 05:39
Tagged: openbsd programming

the three line single binary compiler free blog

A silly experiment that quickly ended up deep in the rabbit hole.

more...

Posted 21 Apr 2022 08:17 by tedu Updated: 21 Apr 2022 08:17
Tagged: go programming

cgo does clear errno

C functions commonly, though not universally, provide information about a failure through the global variable like errno. Provide, not indicate. If there’s no error, as indicated by the function’s normal return value, the value and meaning of errno is unreliable.

more...

Posted 15 Apr 2022 17:07 by tedu Updated: 15 Apr 2022 17:51
Tagged: c go programming

two and a half bad bits

It started with a simple feature addition. It always does. And then the murders began. I don’t think I’ve ever introduced so many bugs by changing so few bits.

more...

Posted 11 Apr 2022 08:08 by tedu Updated: 11 Apr 2022 08:08
Tagged: openbsd programming

The Zephyrus G14 is not a MacBook Pro 14, and Sundry Observations and Insights, Keen and Mundane, Arising from an Inquiry into Power and Performance

Two years ago, all the cool tech influences got an Asus Zephyrus G14 laptop, and all I could think about was getting one, but then I didn’t. The ports were closed, the boat got stuck, whatever, but mostly the promised QHD screen model never seemed to materialize. Now finally it has, and it’s 16:10 even, so finally I got one.

more...

Posted 08 Apr 2022 13:47 by tedu Updated: 05 May 2022 18:44
Tagged: computers