flak rss random

forbidden secrets of ancient X11 scaling technology revealed

People keep telling me that X11 doesn’t support DPI scaling, or fractional scaling, or multiple monitors, or something. There’s nothing you can do to make it work. I find this surprising. Why doesn’t it work? I figure the best way to find out is try the impossible and see how far we get.

more...

Posted 24 Jun 2025 17:59 by tedu Updated: 24 Jun 2025 17:59
Tagged: programming x11

vulgar gestures

I like to go on the internet and click on links, but some of the links are bad, so then I swipe right to make it go away. The problem is that when I’m running chrome on OpenBSD, the swipe gesture doesn’t seem to work like it does on other platforms. We’re not going to fix it, but we are going to make it work. (Although, I hear the younglings say they swipe right when they like something. Explains a lot, actually.)

more...

Posted 20 Jun 2025 15:37 by tedu Updated: 20 Jun 2025 15:37
Tagged: openbsd programming

pipelined state machine corruption

There are a number of network protocols that we might refer to as text protocols, where we send a line of text to the server and it sends back a response. Perhaps I should call them CRLF protocols, to distinguish from protocols where we’re blasting JSON back and forth. To speed things up, it can be tempting to have the client send multiple requests without waiting for individual responses.

more...

Posted 17 Jun 2025 03:52 by tedu Updated: 17 Jun 2025 07:56
Tagged: software

slog is aptly named

I used to use the go log package, then I switched to the slog package, and it’s been a bumpy ride.

more...

Posted 13 Jun 2025 08:10 by tedu Updated: 13 Jun 2025 08:10
Tagged: go programming

wobbly letters

Apple released “Liquid Glass” which looks a lot like a revival of UI fashion from two decades. Everything is transparent. But I doubt Apple has the courage to bring back wobbly windows. No matter, I hardly move my windows around anyway, but what does move is the text inside. So why not wobbly letters? Wobbletters. Definitely in the category of felt cute might delete later.

My original idea was to add a little spin to each letter as it scrolls. Like the letters are hanging on a backboard, and as it bounces up and down, momentum is transferred to the letters. Didn’t quite make it that far, but maybe next time.

To start, I just wanted to check I could shift the vertices around a bit. The same wobble for every vertex, no distortion.

        var wobblex, wobbley float32
        if smoothAmt != 0.0 {
            wobblex = (rand.Float32() -0.5) / 50.0
            wobbley = (rand.Float32() -0.5) / 50.0
        }
        for k := 0; k < 6; k++ {
                base := &baseverts[x+k]
                base.adj[0] += wobblex
                base.adj[1] += smoothAmt + wobbley
        }

This ended up looking much cooler than I thought. Like a faceted glass privacy screen. Apple should totally add this now. It fits with the glass theme. The sequel to liquid glass, solid glass!

Unfortunately, this renders the text unreadable while scrolling.

Video is at 30 fps, but the illusion is more complete at 90 fps. You no longer see individual letters, just transient edges as they pass by.

<video playsinline controls poster="/images/wobble.jpg">
<source type="video/mp4" src="/images/wobble.mp4">
</video>

Accidentally rebooted after installing this, so I guess it’s wacky week for a while.

Posted 10 Jun 2025 19:28 by tedu Updated: 10 Jun 2025 19:28
Tagged: software

killing X11

X11 is supposed to be dead, but people keep using it because apparently it still works. I have a plan to fix this so everyone does what I want.

It all starts with a popular toolkit library like QTK. Even if people don’t upgrade X11, if they run a browser, they’re on the upgrade treadmill.

I change the internal pixel representation from RGB to BGR and adjust the Wayland backend, but not the X11 backend because that’s community supported.

I am confused when bug reports start coming in. Weird colors on X11? Doesn’t surprise me, there’s tons of weirdness in that pile of jank. Works for me in Wayland, you should try it.

Somebody will figure it out and submit a patch. I’m sorry, but we have a release scheduled and we can’t merge anything that may cause further regressions, even though it only changes x11.c. Are we sure this is even the correct fix? Have you tested with a Voodoo2 card?

This is the internet, so after sufficient slow walking, someone is bound to say something unpleasant on the tracker. I write a blog post outlining how not only is X11 support a burden on developers, it’s literally unsafe. Just look at these death threats.

I commit the fix with a lengthy commit message fanfic story about frogs and scorpions and the Jem’Hadar.

I revert the BGR change back to RGB pixels. I write another blog post expressing regret about the lack of progress and alluding to all the cool things that would have been possible, if only we weren’t held back by legacy platform support. No need for details, people will get the message.

Users start reporting bugs on X11. Weird colors on X11? Again? How many times do we need to fix this crap? We need to get people off of X11, whatever it takes.

I devise a plan to kill X11.

Posted 09 Jun 2025 16:55 by tedu Updated: 09 Jun 2025 16:55
Tagged: rants software

modern software 2025 edition

Back in the olden times, software was hard to build and hard to use, but remarkable improvements have been made, and entire ecosystems of ergonomic languages are now available. I happen to think the old ways still have some merit, but don’t want to spend all my time staring at the cave walls.

more...

Posted 03 Jun 2025 02:42 by tedu Updated: 03 Jun 2025 02:42
Tagged: rants software

pledge with a reëxecing process

I have a web application process, which talks to strangers on the network and stores data in the filesystem. To limit the damage caused by naughty tricksters, it uses pledge and unveil so that even if somebody takes over the process, they can only corrupt this program’s data. As opposed to changing my password, for example.

Users love features, so every day I add a new feature, and then I restart the server. This causes milliseconds of downtime. We can only afford 800 milliseconds of downtime per day in order to meet our five nines availability target, and two restarts in a single day puts us very close to the limit. So I added a smooth restart feature, where sending SIGHUP to the server will cause it to reëxec itself, but with the listening socket already open. No connections are lost.

Fork and exec require additional promises to pledge. But this opens the door to trouble. What happens if the trickster wants to exec a new process? Fortunately, unveil restricts exec to only the same program, but they can still restart it with new options, like setting the log file to /etc/passwd. The command line interface offers enough flexibility to accomplish a fair bit of mischief. I spent some time convincing myself this is an unlikely attack scenario, and mostly succeeded, but using pledge suggests I care about unlikely scenarios, so I should do things properly.

As with all problems, the solution is to add another layer of abstraction. Now the main process execs a worker process, and the worker process once again loses the ability to exec. I was already using one helper process anyway, managed by the server. After shuffling some code around, our growing family now includes three processes. The result is arguably better organized, as well, since competing concerns are better split among the processes.

Posted 01 Jun 2025 19:54 by tedu Updated: 01 Jun 2025 19:54
Tagged: openbsd security

go may require prefaulting mmap

Trying to go too fast may be slow.

more...

Posted 28 May 2025 18:17 by tedu Updated: 28 May 2025 18:17
Tagged: go

quirking an openbsd laptop

I got a something old something new laptop and installed OpenBSD. And then the murders began.

more...

Posted 27 May 2025 19:46 by tedu Updated: 28 May 2025 07:07
Tagged: computers openbsd