Scarlett Gately Moore: I love KDE too much to retire! Snap beta releases trickling in. Stay tuned.

KDE
Like my work? Consider a donation. Thank you!

KDE
Like my work? Consider a donation. Thank you!
A new release 0.2.14 of RcppCCTZ is
now on CRAN, in Debian and built for r2u.
RcppCCTZ
uses Rcpp to bring CCTZ to R. CCTZ is a C++ library for
translating between absolute and civil times using the rules of a time
zone. In fact, it is two libraries. One for dealing with
civil time: human-readable dates and times, and one for
converting between between absolute and civil times via time zones. And
while CCTZ is made by
Google(rs), it is not an official Google product. The RcppCCTZ
page has a few usage examples and details. This package was the first CRAN package to use CCTZ; by now several others
packages (four the last time we counted) include its sources too. Not
ideal, but beyond our control.
This version updates to a new upstream release, and brings some small
local edits. CRAN and R-devel
were stumbled over us still mentioning C++11 in
SystemRequirements (yes, this package is old enough for that to have
mattered once). As that is a false positive the package compiles well
under any recent standard we removed the mention. The key changes since
the last CRAN release are
summarised below.
Courtesy of my CRANberries, there is a diffstat report relative to to the previous version. More details are at the RcppCCTZ page; code, issue tickets etc at the GitHub repository.Changes in version 0.2.14 (2026-01-08)
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can sponsor me at GitHub.
Version 0.0.24 of RcppSpdlog arrived
on CRAN today, has been been
uploaded to Debian, and also been
built for r2u. This
follows an upstream release on Sunday which we incorporated immediately,
but CRAN was still closed for
the winter break until yesterday. RcppSpdlog
bundles spdlog, a
wonderful header-only C++ logging library with all the bells and
whistles you would want that was written by Gabi Melman, and also includes fmt by Victor Zverovich. You can learn
more at the nice package
documention site.
This release updates the code to the version 1.17.0 of spdlog which was released
yesterday morning, and includes version 12.1.0 of fmt. No other changes besides
tweaks to the documentation site (that was updated to using altdoc last release) have
been made.
The NEWS entry for this release follows.
Courtesy of my CRANberries, there is also a diffstat report detailing changes. More detailed information is on the RcppSpdlog page, or the package documention site.Changes in RcppSpdlog version 0.0.24 (2026-01-07)
- Upgraded to upstream release spdlog 1.17.0 (including fmt 12.1.0)
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can sponsor me at GitHub.
This post is an unpublished review for Artificial Intelligence Play or break the deckAs a little disclaimer, I usually review books or articles written in English, and although I will offer this review to Computing Reviews as usual, it is likely it will not be published. The title of this book in Spanish is Inteligencia artificial: jugar o romper la baraja. I was pointed at this book, published last October by Margarita Padilla Garc a, a well known Free Software activist from Spain who has long worked on analyzing (and shaping) aspects of socio-technological change. As other books published by Traficantes de sue os, this book is published as Open Access, under a CC BY-NC license, and can be downloaded in full. I started casually looking at this book, with too long a backlog of material to read, but soon realized I could just not put it down: it completely captured me. This book presents several aspects of Artificial Intelligence (AI), written for a general, non-technical audience. Many books with a similar target have been published, but this one is quite unique; first of all, it is written in a personal, non-formal tone. Contrary to what s usual in my reading, the author made the explicit decision not to fill the book with references to her sources ( because searching on Internet, it s very easy to find things ), making the book easier to read linearly a decision I somewhat regret, but recognize helps develop the author s style. The book has seven sections, dealing with different aspects of AI. They are the Visions (historical framing of the development of AI); Spectacular (why do we feel AI to be so disrupting, digging particularly into game engines and search space); Strategies , explaining how multilayer neural networks work and linking the various branches of historic AI together, arriving at Natural Language Processing; On the inside , tackling technical details such as algorithms, the importance of training data, bias, discrimination; On the outside , presenting several example AI implementations with socio-ethical implications; Philosophy , presenting the works of Marx, Heidegger and Simondon in their relation with AI, work, justice, ownership; and Doing , presenting aspects of social activism in relation to AI. Each part ends with yet another personal note: Margarita Padilla includes a letter to one of her friends related to said part. Totalling 272 pages (A5, or roughly half-letter, format), this is a rather small book. I read it probably over a week. So, while this book does not provide lots of new information to me, the way how it was written, made it a very pleasing experience, and it will surely influence the way I understand or explain several concepts in this domain.
. I am an intern at Outreachy and contributing to the Debian Images Testing project since October 2025. This project is Open Source and everyone can contribute to it in any way. The project uses Open QA to automatically install Operating System Images and test them . We have a community here of contributors that is always ready to help out. The mentors and project maintainers are very open to contributions. They listen to any innovative ideas and point out what they have been doing so far.
So far contributions have been in terms of:
openqa-cli api -X POST isos ISO=debian-13.1.0-amd64-netinst.iso DISTRI=debian VERSION=stable FLAVOR=netinst-iso ARCH=x86_64 BUILD=1310 #This is the test you will run on the guide
openqa-cli api -X POST isos ISO=debian-13.1.0-amd64-netinst.iso DISTRI=debian VERSION=stable FLAVOR=netinst-iso ARCH=x86_64 BUILD=1310 TEST=cinnamon #I have added a TEST variable that runs only cinnamon test suite
You can check specific test suites from the WebUI :


About 95% of my Debian contributions this month were
sponsored by Freexian.
You can also support my work directly via
Liberapay or GitHub
Sponsors.
Python packaging
I upgraded these packages to new upstream versions:
Debian continues participating in Outreachy, and as you might have already
noticed, Debian has selected two interns for the Outreachy December 2025 - March
2026 round.
After a busy contribution phase and a competitive selection process,
Hellen Chemtai Taylor and
Isoken Ibizugbe
are officially working as interns on Debian Images Testing with OpenQA for
the past month, mentored by T ssia Cam es Ara jo, Roland Clobus and
Philip Hands.
Congratulations and welcome Hellen Chemtai Taylor and Isoken Ibizugbe!
The team also congratulates all candidates for their valuable contributions,
with special thanks to those who manage to continue participating as volunteers.
From the official website: Outreachy provides
three-month internships for people from groups traditionally underrepresented
in tech. Interns work remotely with mentors from Free and Open Source Software
(FOSS) communities on projects ranging from programming, user experience,
documentation, illustration and graphical design, to data science.
The Outreachy programme is possible in Debian thanks to the efforts of Debian
developers and contributors who dedicate their free time to mentor students and
outreach tasks, and the
Software Freedom Conservancy's administrative
support, as well as the continued support of Debian's donors, who provide
funding for the internships.
Join us and help to improve Debian! You can follow the work of the Outreachy
interns reading their blog posts (syndicated in
Planet Debian), and chat with the team at the
debian-openqa
matrix channel. For Outreachy matters, the programme admins can be reached on #debian-outreach
IRC/matrix
channel and mailing list.
$ curl -s 127.0.0.1:8080/api/v0/inlet/metrics \ > sed -n s/akvorado_inlet_flow_input_udp_in_dropped//p packets_total listener="0.0.0.0:2055",worker="0" 0 packets_total listener="0.0.0.0:2055",worker="1" 0 packets_total listener="0.0.0.0:2055",worker="2" 0 packets_total listener="0.0.0.0:2055",worker="3" 1.614933572278264e+15 packets_total listener="0.0.0.0:2055",worker="4" 0 packets_total listener="0.0.0.0:2055",worker="5" 0 packets_total listener="0.0.0.0:2055",worker="6" 9.59964121598348e+14 packets_total listener="0.0.0.0:2055",worker="7" 0
SO_REUSEPORT socket option.SO_REUSEPORT option
Tom Hebert added the SO_REUSEPORT socket option in Linux 3.9. The
cover letter for his patch series explains why this new option is better than
the two existing ones from a performance point of view:
Akvorado uses theSO_REUSEPORTallows multiple listener sockets to be bound to the same port. [ ] Received packets are distributed to multiple sockets bound to the same port using a 4-tuple hash. The motivating case forSO_RESUSEPORTin TCP would be something like a web server binding to port 80 running with multiple threads, where each thread might have it s own listener socket. This could be done as an alternative to other models:In case #1, the listener thread can easily become the bottleneck with high connection turn-over rate. In case #2, the proportion of connections accepted per thread tends to be uneven under high connection load. [ ] We have seen the disproportion to be as high as 3:1 ratio between thread accepting most connections and the one accepting the fewest. With
- have one listener thread which dispatches completed connections to workers, or
- accept on a single listener socket from multiple threads.
SO_REUSEPORTthe distribution is uniform. The motivating case forSO_REUSEPORTin UDP would be something like a DNS server. An alternative would be to receive on the same socket from multiple threads. As in the case of TCP, the load across these threads tends to be disproportionate and we also see a lot of contection on the socket lock.
SO_REUSEPORT option to dispatch the packets across the
workers. However, because the distribution uses a 4-tuple hash, a single socket
handles all the flows from one exporter.
SO_ATTACH_REUSEPORT_EBPF option
In Linux 4.5, Craig Gallek added the SO_ATTACH_REUSEPORT_EBPF
option to attach an eBPF program to select the target UDP socket. In Linux 4.6,
he extended it to support TCP. The socket(7) manual page
documents this mechanism:1
The BPF program must return an index between 0 and N-1 representing the socket
which should receive the packet (where N is the number of sockets in the
group). If the BPF program returns an invalid index, socket selection will
fall back to the plain SO_REUSEPORT mechanism.
In Linux 4.19, Martin KaFai Lau added the
BPF_PROG_TYPE_SK_REUSEPORT program type. Such an eBPF program
selects the socket from a BPF_MAP_TYPE_REUSEPORT_ARRAY map instead. This new
approach is more reliable when switching target sockets from one instance to
another for example, when upgrading, a new instance can add its sockets and
remove the old ones.
bpf_get_prandom_u32() helper function to get a
pseudo-random number.
volatile const __u32 num_sockets; // struct __uint(type, BPF_MAP_TYPE_REUSEPORT_SOCKARRAY); __type(key, __u32); __type(value, __u64); __uint(max_entries, 256); socket_map SEC(".maps"); // SEC("sk_reuseport") int reuseport_balance_prog(struct sk_reuseport_md *reuse_md) __u32 index = bpf_get_prandom_u32() % num_sockets; // bpf_sk_select_reuseport(reuse_md, &socket_map, &index, 0); // return SK_PASS; // char _license[] SEC("license") = "GPL";
bpf_sk_select_reuseport() helper to record our decision.
Finally, in , we accept the packet.
clang, you get errors due to missing headers.
The recommended way to solve this is to generate a vmlinux.h file with
bpftool:
$ bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h
#include "vmlinux.h" #include <bpf/bpf_helpers.h>
vmlinux.h is quite big: 2.7 MiB. Moreover,
bpf/bpf_helpers.h is shipped with libbpf. This adds another dependency for
users. As the eBPF program is quite small, I prefer to put the strict minimum in
vmlinux.h by cherry-picking the definitions I need.
bpf2go, a tool to compile eBPF programs and
to generate some scaffolding code. We create a gen.go file with the following
content:
package main //go:generate go tool bpf2go -tags linux reuseport reuseport_kern.c
go generate ./..., we can inspect the resulting objects with
readelf and llvm-objdump:
$ readelf -S reuseport_bpfeb.o There are 14 section headers, starting at offset 0x840: [Nr] Name Type Address Offset [ ] [ 3] sk_reuseport PROGBITS 0000000000000000 00000040 [ 6] .maps PROGBITS 0000000000000000 000000c8 [ 7] license PROGBITS 0000000000000000 000000e8 [ ] $ llvm-objdump -S reuseport_bpfeb.o reuseport_bpfeb.o: file format elf64-bpf Disassembly of section sk_reuseport: 0000000000000000 <reuseport_balance_prog>: ; 0: bf 61 00 00 00 00 00 00 r6 = r1 ; __u32 index = bpf_get_prandom_u32() % num_sockets; 1: 85 00 00 00 00 00 00 07 call 0x7 [ ]
SO_REUSEPORT option before binding:6
var ( err error fds []uintptr conns []*net.UDPConn ) workers := 10 listenAddr := "127.0.0.1:0" listenConfig := net.ListenConfig Control: func(_, _ string, c syscall.RawConn) error c.Control(func(fd uintptr) err = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1) fds = append(fds, fd) ) return err , for range workers pconn, err := listenConfig.ListenPacket(t.Context(), "udp", listenAddr) if err != nil t.Fatalf("ListenPacket() error:\n%+v", err) udpConn := pconn.(*net.UDPConn) listenAddr = udpConn.LocalAddr().String() conns = append(conns, udpConn)
num_sockets
variable, populate the socket map, and attach the program to the first
socket.7
// Load the eBPF collection. spec, err := loadReuseport() if err != nil t.Fatalf("loadVariables() error:\n%+v", err) // Set "num_sockets" global variable to the number of file descriptors we will register if err := spec.Variables["num_sockets"].Set(uint32(len(fds))); err != nil t.Fatalf("NumSockets.Set() error:\n%+v", err) // Load the map and the program into the kernel. var objs reuseportObjects if err := spec.LoadAndAssign(&objs, nil); err != nil t.Fatalf("loadReuseportObjects() error:\n%+v", err) t.Cleanup(func() objs.Close() ) // Assign the file descriptors to the socket map. for worker, fd := range fds if err := objs.reuseportMaps.SocketMap.Put(uint32(worker), uint64(fd)); err != nil t.Fatalf("SocketMap.Put() error:\n%+v", err) // Attach the eBPF program to the first socket. socketFD := int(fds[0]) progFD := objs.reuseportPrograms.ReuseportBalanceProg.FD() if err := unix.SetsockoptInt(socketFD, unix.SOL_SOCKET, unix.SO_ATTACH_REUSEPORT_EBPF, progFD); err != nil t.Fatalf("SetsockoptInt() error:\n%+v", err)
var wg sync.WaitGroup receivedPackets := make([]int, workers) for worker := range workers conn := conns[worker] packets := &receivedPackets[worker] wg.Go(func() payload := make([]byte, 9000) for if _, err := conn.Read(payload); err != nil if errors.Is(err, net.ErrClosed) return t.Logf("Read() error:\n%+v", err) *packets++ )
sentPackets := 1000 conn, err := net.Dial("udp", conns[0].LocalAddr().String()) if err != nil t.Fatalf("Dial() error:\n%+v", err) defer conn.Close() for range sentPackets if _, err := conn.Write([]byte("hello world!")); err != nil t.Fatalf("Write() error:\n%+v", err)
receivedPackets array, we can check the
balancing works as expected, with each worker getting about 100 packets:
=== RUN TestUDPWorkerBalancing
balancing_test.go:84: receivedPackets[0] = 107
balancing_test.go:84: receivedPackets[1] = 92
balancing_test.go:84: receivedPackets[2] = 99
balancing_test.go:84: receivedPackets[3] = 105
balancing_test.go:84: receivedPackets[4] = 107
balancing_test.go:84: receivedPackets[5] = 96
balancing_test.go:84: receivedPackets[6] = 102
balancing_test.go:84: receivedPackets[7] = 105
balancing_test.go:84: receivedPackets[8] = 99
balancing_test.go:84: receivedPackets[9] = 88
balancing_test.go:91: receivedPackets = 1000
balancing_test.go:92: sentPackets = 1000
SO_ATTACH_REUSEPORT_EBPF to gracefully restart an
application. A new instance of the application binds to the same address and
prepare its own version of the socket map. Once it attaches the eBPF program to
the first socket, the kernel steers incoming packets to this new instance. The
old instance needs to drain the already received packets before shutting down.
To check we are not losing any packet, we spawn a Go routine to send as many
packets as possible:
sentPackets := 0 notSentPackets := 0 done := make(chan bool) conn, err := net.Dial("udp", conns1[0].LocalAddr().String()) if err != nil t.Fatalf("Dial() error:\n%+v", err) defer conn.Close() go func() for if _, err := conn.Write([]byte("hello world!")); err != nil notSentPackets++ else sentPackets++ select case <-done: return default: ()
=== RUN TestGracefulRestart
graceful_test.go:135: receivedPackets1[0] = 165
graceful_test.go:135: receivedPackets1[1] = 195
graceful_test.go:135: receivedPackets1[2] = 194
graceful_test.go:135: receivedPackets1[3] = 190
graceful_test.go:135: receivedPackets1[4] = 213
graceful_test.go:135: receivedPackets1[5] = 187
graceful_test.go:135: receivedPackets1[6] = 170
graceful_test.go:135: receivedPackets1[7] = 190
graceful_test.go:135: receivedPackets1[8] = 194
graceful_test.go:135: receivedPackets1[9] = 155
graceful_test.go:139: receivedPackets2[0] = 1631
graceful_test.go:139: receivedPackets2[1] = 1582
graceful_test.go:139: receivedPackets2[2] = 1594
graceful_test.go:139: receivedPackets2[3] = 1611
graceful_test.go:139: receivedPackets2[4] = 1571
graceful_test.go:139: receivedPackets2[5] = 1660
graceful_test.go:139: receivedPackets2[6] = 1587
graceful_test.go:139: receivedPackets2[7] = 1605
graceful_test.go:139: receivedPackets2[8] = 1631
graceful_test.go:139: receivedPackets2[9] = 1689
graceful_test.go:147: receivedPackets = 18014
graceful_test.go:148: sentPackets = 18014
conn.Read()
until there are no more packets. A solution is to set a deadline for
conn.Read() and check if we should stop the Go routine when the deadline is
exceeded:
payload := make([]byte, 9000) for conn.SetReadDeadline(time.Now().Add(50 * time.Millisecond)) if _, err := conn.Read(payload); err != nil if errors.Is(err, os.ErrDeadlineExceeded) select case <-done: return default: continue t.Logf("Read() error:\n%+v", err) *packets++
net.ipv4.tcp_migrate_req
sysctl, the kernel automatically migrates waiting connections to a random socket
in the same group. Alternatively, eBPF can also control this
migration. Both features are available since Linux 5.14.
$ curl -s 127.0.0.1:8080/api/v0/inlet/metrics \ > sed -n s/akvorado_inlet_flow_input_udp_in_dropped//p packets_total listener="0.0.0.0:2055",worker="0" 838673 packets_total listener="0.0.0.0:2055",worker="1" 843675 packets_total listener="0.0.0.0:2055",worker="2" 837922 packets_total listener="0.0.0.0:2055",worker="3" 841443 packets_total listener="0.0.0.0:2055",worker="4" 840668 packets_total listener="0.0.0.0:2055",worker="5" 850274 packets_total listener="0.0.0.0:2055",worker="6" 835488 packets_total listener="0.0.0.0:2055",worker="7" 834479
bpf_get_prandom_u32() returns a pseudo-random 32-bit unsigned
value, this method exhibits a very slight bias towards the first indexes.
This is unlikely to be worth fixing.
<linux/bpf.h> instead of "vmlinux.h". This
makes your eBPF program dependent on the installed kernel headers.
listenAddr is initially set to 127.0.0.1:0 to allocate a
random port. After the first iteration, it is updated with the allocated
port.
setupSockets() function in fixtures_test.go.
setupEBPF() function in fixtures_test.go.
balancing_test.go
graceful_test.go
poll() both the socket and a pipe used to signal for
shutdown. When the second condition is triggered, we drain the socket by
executing a series of non-blocking read() until we get EWOULDBLOCK.
Given we ve entered a new year it s time for my annual recap of my Free Software activities for the previous calendar year. For previous years see 2019, 2020, 2021, 2022, 2023 + 2024.
git-buildpackage in trixie seems more strict about Build-Depends existing in the outside environment, and I keep forgetting I need Build-Depends-Arch and Build-Depends-Indep to be pretty much the same with a minimal Build-Depends that just has enough for the clean target) getting uploaded in December, and 1.20.0+dfsg-1, 1.20+dfsg-2 + 1.20+dfsg-3 all being uploaded earlier in the year. retroarch-assets had 1.20.0+dfsg-1 uploaded back in April. I need to find some time to get 1.22.0 packaged. libretro-snes9x got updated to 1.63+dfsg-1.
sdcc saw 4.5.0+dfsg-1, 4.5.0+dfsg-2, 4.5.0+dfsg-3 (I love major GCC upgrades) and 4.5.0-dfsg-4 uploads. There s an outstanding bug around a LaTeX error building the manual, but this turns out to be a bug in the 2.5 RC for LyX. Huge credit to Tobias Quathamer for engaging with this, and Pavel Sanda + J rgen Spitzm ller from the LyX upstream for figuring out the issue + a fix.
Pulseview saw 0.4.2-4 uploaded to fix issues with the GCC 15 + CMake upgrades. I should probably chase the sigrok upstream about new releases; I think there are a bunch of devices that have gained support in git without seeing a tagged release yet.
I did an Electronics Team upload for gputils 1.5.2-2 to fix compilation with GCC 15.
While I don t do a lot with storage devices these days if I can help it I still pay a little bit of attention to sg3-utils. That resulted in 1.48-2 and 1.48-3 uploads in 2025.
libcli got a 1.10.7-3 upload to deal with the libcrypt-dev split out.
Finally I got more up-to-date versions of libtorrent (0.15.7-1) and rtorrent (also 0.15.7-1) uploaded to experimental. There s a ppc64el build failure in libtorrent, but having asked on debian-powerpc this looks like a flaky test/code and I should probably go ahead and upload to unstable.
I sponsored some uploads for Michel Lind - the initial uploads of plymouth-theme-hot-dog, and the separated out pykdumpfile package.
Recognising the fact I wasn t contributing in a useful fashion to the Data Protection Team I set about trying to resign in an orderly fashion - see Andreas call for volunteers that went out in the last week. Shout out to Enrico for pointing out in the past that we should gracefully step down from things we re not actually managing to do, to avoid the perception it s all fine and no one else needs to step up. Took me too long to act on it.
The Debian keyring team continues to operate smoothly, maintaining our monthly release cadence with a 3 month rotation ensuring all team members stay familiar with the process, and ensure their setups are still operational (especially important after Debian releases). I handled the 2025.03.23, 2025.06.24, 2025.06.27, 2025.09.18, 2025.12.08 + 2025.12.26 pushes.
Wikipedia says An IBM PC compatible is any personal computer that is hardware- and software-compatible with the IBM Personal Computer (IBM PC) and its subsequent models . But what does this actually mean? The obvious literal interpretation is for a device to be PC compatible, all software originally written for the IBM 5150 must run on it. Is this a reasonable definition? Is it one that any modern hardware can meet?
Before we dig into that, let s go back to the early days of the x86 industry. IBM had launched the PC built almost entirely around off-the-shelf Intel components, and shipped full schematics in the IBM PC Technical Reference Manual. Anyone could buy the same parts from Intel and build a compatible board. They d still need an operating system, but Microsoft was happy to sell MS-DOS to anyone who d turn up with money. The only thing stopping people from cloning the entire board was the BIOS, the component that sat between the raw hardware and much of the software running on it. The concept of a BIOS originated in CP/M, an operating system originally written in the 70s for systems based on the Intel 8080. At that point in time there was no meaningful standardisation - systems might use the same CPU but otherwise have entirely different hardware, and any software that made assumptions about the underlying hardware wouldn t run elsewhere. CP/M s BIOS was effectively an abstraction layer, a set of code that could be modified to suit the specific underlying hardware without needing to modify the rest of the OS. As long as applications only called BIOS functions, they didn t need to care about the underlying hardware and would run on all systems that had a working CP/M port.
By 1979, boards based on the 8086, Intel s successor to the 8080, were hitting the market. The 8086 wasn t machine code compatible with the 8080, but 8080 assembly code could be assembled to 8086 instructions to simplify porting old code. Despite this, the 8086 version of CP/M was taking some time to appear, and a company called Seattle Computer Products started producing a new OS closely modelled on CP/M and using the same BIOS abstraction layer concept. When IBM started looking for an OS for their upcoming 8088 (an 8086 with an 8-bit data bus rather than a 16-bit one) based PC, a complicated chain of events resulted in Microsoft paying a one-off fee to Seattle Computer Products, porting their OS to IBM s hardware, and the rest is history.
But one key part of this was that despite what was now MS-DOS existing only to support IBM s hardware, the BIOS abstraction remained, and the BIOS was owned by the hardware vendor - in this case, IBM. One key difference, though, was that while CP/M systems typically included the BIOS on boot media, IBM integrated it into ROM. This meant that MS-DOS floppies didn t include all the code needed to run on a PC - you needed IBM s BIOS. To begin with this wasn t obviously a problem in the US market since, in a way that seems extremely odd from where we are now in history, it wasn t clear that machine code was actually copyrightable. In 1982 Williams v. Artic determined that it could be even if fixed in ROM - this ended up having broader industry impact in Apple v. Franklin and it became clear that clone machines making use of the original vendor s ROM code wasn t going to fly. Anyone wanting to make hardware compatible with the PC was going to have to find another way.
And here s where things diverge somewhat. Compaq famously performed clean-room reverse engineering of the IBM BIOS to produce a functionally equivalent implementation without violating copyright. Other vendors, well, were less fastidious - they came up with BIOS implementations that either implemented a subset of IBM s functionality, or didn t implement all the same behavioural quirks, and compatibility was restricted. In this era several vendors shipped customised versions of MS-DOS that supported different hardware (which you d think wouldn t be necessary given that s what the BIOS was for, but still), and the set of PC software that would run on their hardware varied wildly. This was the era where vendors even shipped systems based on the Intel 80186, an improved 8086 that was both faster than the 8086 at the same clock speed and was also available at higher clock speeds. Clone vendors saw an opportunity to ship hardware that outperformed the PC, and some of them went for it.
You d think that IBM would have immediately jumped on this as well, but no - the 80186 integrated many components that were separate chips on 8086 (and 8088) based platforms, but crucially didn t maintain compatibility. As long as everything went via the BIOS this shouldn t have mattered, but there were many cases where going via the BIOS introduced performance overhead or simply didn t offer the functionality that people wanted, and since this was the era of single-user operating systems with no memory protection, there was nothing stopping developers from just hitting the hardware directly to get what they wanted. Changing the underlying hardware would break them.
And that s what happened. IBM was the biggest player, so people targeted IBM s platform. When BIOS interfaces weren t sufficient they hit the hardware directly - and even if they weren t doing that, they d end up depending on behavioural quirks of IBM s BIOS implementation. The market for DOS-compatible but not PC-compatible mostly vanished, although there were notable exceptions - in Japan the PC-98 platform achieved significant success, largely as a result of the Japanese market being pretty distinct from the rest of the world at that point in time, but also because it actually handled Japanese at a point where the PC platform was basically restricted to ASCII or minor variants thereof.
So, things remained fairly stable for some time. Underlying hardware changed - the 80286 introduced the ability to access more than a megabyte of address space and would promptly have broken a bunch of things except IBM came up with an utterly terrifying hack that bit me back in 2009, and which ended up sufficiently codified into Intel design that it was one mechanism for breaking the original XBox security. The first 286 PC even introduced a new keyboard controller that supported better keyboards but which remained backwards compatible with the original PC to avoid breaking software. Even when IBM launched the PS/2, the first significant rearchitecture of the PC platform with a brand new expansion bus and associated patents to prevent people cloning it without paying off IBM, they made sure that all the hardware was backwards compatible.
For decades, PC compatibility meant not only supporting the officially supported interfaces, it meant supporting the underlying hardware. This is what made it possible to ship install media that was expected to work on any PC, even if you d need some additional media for hardware-specific drivers. It s something that still distinguishes the PC market from the ARM desktop market. But it s not as true as it used to be, and it s interesting to think about whether it ever was as true as people thought.
Let s take an extreme case. If I buy a modern laptop, can I run 1981-era DOS on it? The answer is clearly no. First, modern systems largely don t implement the legacy BIOS. The entire abstraction layer that DOS relies on isn t there, having been replaced with UEFI. When UEFI first appeared it generally shipped with a Compatibility Services Module, a layer that would translate BIOS interrupts into UEFI calls, allowing vendors to ship hardware with more modern firmware and drivers without having to duplicate them to support older operating systems1. Is this system PC compatible? By the strictest of definitions, no.
Ok. But the hardware is broadly the same, right? There s projects like CSMWrap that allow a CSM to be implemented on top of stock UEFI, so everything that hits BIOS should work just fine. And well yes, assuming they implement the BIOS interfaces fully, anything using the BIOS interfaces will be happy. But what about stuff that doesn t? Old software is going to expect that my Sound Blaster is going to be on a limited set of IRQs and is going to assume that it s going to be able to install its own interrupt handler and ACK those on the interrupt controller itself and that s really not going to work when you have a PCI card that s been mapped onto some APIC vector, and also if your keyboard is attached via USB or SPI then reading it via the CSM will work (because it s calling into UEFI to get the actual data) but trying to read the keyboard controller directly won t2, so you re still actually relying on the firmware to do the right thing but it s not, because the average person who wants to run DOS on a modern computer owns three fursuits and some knee length socks and while you are important and vital and I love you all you re not enough to actually convince a transglobal megacorp to flip the bit in the chipset that makes all this old stuff work.
But imagine you are, or imagine you re the sort of person who (like me) thinks writing their own firmware for their weird Chinese Thinkpad knockoff motherboard is a good and sensible use of their time - can you make this work fully? Haha no of course not. Yes, you can probably make sure that the PCI Sound Blaster that s plugged into a Thunderbolt dock has interrupt routing to something that is absolutely no longer an 8259 but is pretending to be so you can just handle IRQ 5 yourself, and you can probably still even write some SMM code that will make your keyboard work, but what about the corner cases? What if you re trying to run something built with IBM Pascal 1.0? There s a risk that it ll assume that trying to access an address just over 1MB will give it the data stored just above 0, and now it ll break. It d work fine on an actual PC, and it won t work here, so are we PC compatible?
That s a very interesting abstract question and I m going to entirely ignore it. Let s talk about PC graphics3. The original PC shipped with two different optional graphics cards - the Monochrome Display Adapter and the Color Graphics Adapter. If you wanted to run games you were doing it on CGA, because MDA had no mechanism to address individual pixels so you could only render full characters. So, even on the original PC, there was software that would run on some hardware but not on other hardware.
Things got worse from there. CGA was, to put it mildly, shit. Even IBM knew this - in 1984 they launched the PCjr, intended to make the PC platform more attractive to home users. As well as maybe the worst keyboard ever to be associated with the IBM brand, IBM added some new video modes that allowed displaying more than 4 colours on screen at once4, and software that depended on that wouldn t display correctly on an original PC. Of course, because the PCjr was a complete commercial failure, it wouldn t display correctly on any future PCs either. This is going to become a theme.
There s never been a properly specified PC graphics platform. BIOS support for advanced graphics modes5 ended up specified by VESA rather than IBM, and even then getting good performance involved hitting hardware directly. It wasn t until Microsoft specced DirectX that anything was broadly usable even if you limited yourself to Microsoft platforms, and this was an OS-level API rather than a hardware one. If you stick to BIOS interfaces then CGA-era code will work fine on graphics hardware produced up until the 20-teens, but if you were trying to hit CGA hardware registers directly then you re going to have a bad time. This isn t even a new thing - even if we restrict ourselves to the authentic IBM PC range (and ignore the PCjr), by the time we get to the Enhanced Graphics Adapter we re not entirely CGA compatible. Is an IBM PC/AT with EGA PC compatible? You d likely say yes , but there s software written for the original PC that won t work there.
And, well, let s go even more basic. The original PC had a well defined CPU frequency and a well defined CPU that would take a well defined number of cycles to execute any given instruction. People could write software that depended on that. When CPUs got faster, some software broke. This resulted in systems with a Turbo Button - a button that would drop the clock rate to something approximating the original PC so stuff would stop breaking. It s fine, we d later end up with Windows crashing on fast machines because hardware details will absolutely bleed through.
So, what s a PC compatible? No modern PC will run the DOS that the original PC ran. If you try hard enough you can get it into a state where it ll run most old software, as long as it doesn t have assumptions about memory segmentation or your CPU or want to talk to your GPU directly. And even then it ll potentially be unusable or crash because time is hard.
The truth is that there s no way we can technically describe a PC Compatible now - or, honestly, ever. If you sent a modern PC back to 1981 the media would be amazed and also point out that it didn t run Flight Simulator. PC Compatible is a socially defined construct, just like Woman . We can get hung up on the details or we can just chill.
A lot of the youtube channels I follow tend to involve somebody making
things, so of course one of the videos my SO and I watched a few days
ago was about walking around San Francisco Bay, and that recalled my
desire to go to places by foot. Now, for health-related reasons doing it
properly would be problematic, and thus I ve never trained for that, but
during this Christmas holiday-heavy time I suggested my very patient
SO the next best thing: instead of our usual 1.5 hours uphill walk in
the woods, a 2 hours and a bit mostly flat walk on paved streets, plus
some train, to a nearby town: Porto Ceresio, on the Italian side of Lake
Lugano.
I started to prepare for it on the day before, by deciding it was a good
time to upgrade my PinePhone, and wait, I m still on Trixie? I could
try Forky, what could possibly go wrong? And well, the phone was no
longer able to boot, and reinstalling from the latest weekly had a
system where the on-screen keyboard didn t appear, and I didn t want to
bother finding out why, so re-installed another time from the 13.0
image, and between that, and distracting myself with widelands while
waiting for the downloads and uploads and reboots etc., well, all of the
afternoon and the best part of the evening disappeared.
So, in a hurry, between the evening and the next morning I prepared a
nice healthy lunch, full of all the important nutrients such as sugar,
salt, mercury and arsenic. Tuna (mercury) soboro (sugar and salt) on
rice and since I was in a hurry I didn t prepare any vegetables, but
used pickles (more salt) and shio kombu (arsenic and various heavy
metals, sugar and salt). Plus a green tea mochi for dessert, in case
we felt low on sugar. :D
Then on the day of the walk we woke up a bit later than usual, and then
my body decided it was a good day for my belly to not exactly hurt, but
not not-hurt either, and there I took an executive decision to wear a
corset, because if something feels like it wants to burst open, wrapping
it in a steel reinforced cage will make it stop. (I m not joking. It
does. At least in those specific circumstances.)
This was followed by hurrying through the things I had to do before
leaving the house, having a brief anxiety attack and feeling feverish
(it wasn t fever), and finally being able to leave the house just half
an hour late.
And then, 10 minutes after we had left, realizing that I had written
down the password for the train website, since it was no longer saved on
the phone, but i had forgotten the bit of paper at home. We could have
gone back to take it, but decided not to bother, as we could also
hopefully buy paper-ish tickets at the train station (we could).
Later on, I also realized I had also forgotten my GPS tracker, so I have
no record of where we went exactly (but it s not hard to recognize it on
a map) nor on what the temperature was. It s a shame, but by that point
it was way too late to go back.
Anyway, that probably was when Murphy felt we had paid our respects, and
from then on everything went lovingly well!
Routing had been done on the OpenStreetMap website, with OSRM, and it
looked pretty easy to follow, but we also had access to an Android
phone, so we used OSMAnd to check that we were still on track. It tried
to lead us to the Statale (i.e. most important and most trafficked road)
a few times, but we ignored it, and after a few turns and a few changes
of the precise destination point we managed to get it to cooperate.
At one point a helpful person asked us if we needed help, having seen us
looking at the phone, and gave us indication for the next fork (that way
to Cuasso al Piano, that way to Porto Ceresio), but it was pretty easy,
since the way was clearly marked also for cars.
Then we started to notice red and white markings on poles and other
places, and on the next fork there was a signpost for hiking routes with
our destination and we decided to follow it instead of the sign for
cars. I knew that from our starting point to or destination there was
also a hiking route, uphill both ways :) , through the hills, about 5 or 6
hours instead of two, but the sign was pointing downhill and we were
past the point where we would expect too long of a detour.
And indeed, after a short while the paved road ended, but the path
continued on a wide and flat track, and was a welcome detour through
what looked like water works to prevent flood damage from a stream.
In a warmer season, with longer grass and ticks maybe the fact that I
was wearing a long skirt may have been an issue, but in winter it was
just fine.
And soon afterwards, we were in Porto Ceresio. I think I have been there
as a child, but I had no memory of it. On the other hand, it was about
as I expected: a tiny town with a lakeside street full of houses built
in the early 1900s when the area was an important tourism destination,
with older buildings a bit higher up on the hills (because streams
in this area will flood). And of course, getting there by foot rather
than by train we also saw the parts where real people live (but not
work: that s cross-border commuters country).
Soon after arriving in Porto Ceresio we stopped to eat our lunch on a
bench at the lakeside; up to then we had been pretty comfortable in the
clothing we had decided to wear: there was plenty of frost on the
ground, in the shade, but the sun was warm and the temperatures were
cleanly above freezing. Removing the gloves to eat, however, resulted in
quite cold hands, and we didn t want to stay still for longer than
strictly necessary.
So we spent another hour and a bit walking around Porto Ceresio like
proper tourists and taking pictures. There was an exhibition of nativity
scenes all around the streets, but to get a map one had to go to either
facebook or instagram, or wait for the opening hours of an office that
were later than the train we planned to get to go back home, so we only
saw maybe half of them, as we walked around: some were quite nice, some
were nativity scenes, and some showed that the school children must have
had some fun making them.
Another Christmas decoration were groups of creatures made of evergreen
branches that dotted the sidewalks around the lake: I took pictures of
the first couple of groups, and then after seeing a few more something
clicked in my brain, and I noticed that they were wrapped in green LED
strings, like chains, and they had a red ball that was supposed to be
the nose, but could just be around the mouth area, and suddenly I felt
the need to play a certain chord to release them,
but sadly I didn t have a weaponized guitar on me :D
Another thing that we noticed were some benches in the shape of books,
with book quotations on them; most were on reading-related topics, but
the one with the Constitution felt worth taking a picture of, especially
these days.
And then, our train was waiting at the station, and we had to go back
home for the afternoon; it was a nice outing, if a bit brief, and we
agreed to do it again, possibly with a bit of a detour to make the walk
a bit longer. And then maybe one day we ll train to do the whole 5-6
hour thing through the hills.
labels:
caddy_0.email: email@example.com
caddy_1: (iocaine)
caddy_1.0_@read: method GET HEAD
caddy_1.1_reverse_proxy: "@read iocaine:42069"
"caddy_1.1_reverse_proxy.@fallback": "status 421"
caddy_1.1_reverse_proxy.handle_response: "@fallback"(iocaine)
@read method GET HEAD
reverse_proxy @read iocaine:42069
@fallback status 421
handle_response @fallback
docker-compose.yaml. So now we have
labels:
caddy: service.example.com
caddy.reverse_proxy: " upstreams 3000 "
caddy.import: iocaineservice.example.com
import iocaine
reverse_proxy 172.18.0.6:3000
Note: I have not published blog posts about my academic papers over the past few years. To ensure that my blog contains a more comprehensive record of my published papers and to surface these for folks who missed them, I will be periodically (re)publishing blog posts about some older published projects. This particular post is closely based on a previously published post by Nate TeBlunthuis from the Community Data Science Blog.
Many online platforms are adopting AI and machine learning as a tool to maintain order and high-quality information in the face of massive influxes of user-generated content. Of course, AI algorithms can be inaccurate, biased, or unfair. How do signals from AI predictions shape the fairness of online content moderation? How can we measure an algorithmic flagging system s effects?
In our paper published at CSCW, Nate TeBlunthuis, together with myself and Aaron Halfaker, analyzed the RCFilters system: an add-on to Wikipedia that highlights and filters edits that a machine learning algorithm called ORES identifies as likely to be damaging to Wikipedia. This system has been deployed on large Wikipedia language editions and is similar to other algorithmic flagging systems that are becoming increasingly widespread. Our work measures the causal effect of being flagged in the RCFilters user interface.
Screenshot of Wikipedia edit metadata on Special:RecentChanges with RCFilters enabled. Highlighted edits with a colored circle to the left side of other metadata are flagged by ORES. Different circle and highlight colors (white, yellow, orange, and red in the figure) correspond to different levels of confidence that the edit is damaging. RCFilters does not specifically flag edits by new accounts or unregistered editors, but does support filtering changes by editor types.
Charts showing the probability that an edit will be reverted as a function of ORES scores in the neighborhood of the discontinuous threshold that triggers the RCfilters flag. The jump in the increase in reversion chances is larger for registered editors compared to unregistered editors at both thresholds.
The full citation for the paper is: TeBlunthuis, Nathan, Benjamin Mako Hill, and Aaron Halfaker. 2021. Effects of Algorithmic Flagging on Fairness: Quasi-Experimental Evidence from Wikipedia. Proceedings of the ACM on Human-Computer Interaction 5 (CSCW): 56:1-56:27. https://doi.org/10.1145/3449130.
We have also released replication materials for the paper, including all the data and code used to conduct the analysis and compile the paper itself.
.
There is a similar, complementary discussion in this article: crypto can help but cannot safeguard against all actors.
Public Key encryption 101
GPG, the most widely used tool for end to end email encryption and signing software releases, is based on public key cryptography. In public key cryptography you have a private key, to keep very private and a public key you share to the world. If you use SSH with key authentication you know already the concept:
$ ls -1 .ssh/id_rsa*
.ssh/id_rsa
.ssh/id_rsa.pub
Here id_rsa is the private key and id_rsa.pub the public key.
GPG private key on a hardware token
I would like to store the private part of my GPG key on a hardware token. This provides extra security compared to storing the private key on a hard disk: as the private key stays on the device, you need physical access to the device to do anything with the private key. It also eases the usage of the private key on different computers, as you just have to take the hardware token with you without creating multiple copies of the precious private key.
That is the basic, some people explains the topic better than me.
The hardware token I chose is a YubiKey because I already use such a dongle for two factor authentication on salsa, the Debian gitlab forge.
Some terminology
Understanding GPG and even worse hardware tokens, is like sailing in an endless sea of acronyms and recommendation practices. Let us navigate:
First the generic name of a GPG hardware token is an OpenPGP smart card.
Here we need to understand:
$ ykman info awk '/Applications/,0'
Applications
Yubico OTP Enabled
FIDO U2F Disabled
FIDO2 Disabled
OATH Enabled
PIV Disabled
OpenPGP Enabled
YubiHSM Auth Disabled
Since I already threw 5 acronyms on the paragraph above, I will not go in details into what OATH and PIV are.
What is important for us here, is that we have OpenPGP enabled on the device, more important we can verify that GPG sees a card with:
gpg --card-status grep -E '(Application type Manufacturer)'
Application type .: OpenPGP
Manufacturer .....: Yubico
Next steps
Now with this basic understanding, you can follow the Debian Keyring maintainer guide for key creation good practises, and the Debian Wiki smart card article on how to move the private keys to the YubiKey.
Although the article is for a different device, I also found the topic is even more better described in the NitroKey documentation.
XKCD License: https://xkcd.com/license.html
You can also comment this post via Mastodon
2026 already! The winter weather here has really been beautiful and I always enjoy
this time of year. Writing this yearly musical retrospective has now become a
beloved tradition of mine1 and I enjoy retracing the year's various
events through albums I listened to and concerts I went to.
Albums
In 2025, I added 141 new albums to my collection, around 60% more than last
year's haul. I think this might have been too much? I feel like I didn't have
time to properly enjoy all of them and as such, I decided to slow down my
acquisition spree sometimes in early December, around the time I normally do the
complete opposite.
This year again, I bought the vast majority of my music on Bandcamp. Most of
the other albums I bought as CDs and ripped them.
Concerts
In 2025, I went to the following 25 (!!) concerts:
In 2007, Martin Escardo wrote a often-read blog post about Seemingly impossible functional programs . One such seemingly impossible function is find, which takes a predicate on infinite sequences of bits, and returns an infinite sequence for which that predicate hold (unless the predicate is just always false, in which case it returns some arbitrary sequence).
Inspired by conversations with and experiments by Massin Guerdi at the dinner of LeaningIn 2025 in Berlin (yes, this blog post has been in my pipeline for far too long), I wanted to play around these concepts in Lean.
Let s represent infinite sequences of bits as functions from Nat to Bit, and give them a nice name, and some basic functionality, including a binary operator for consing an element to the front:
import Mathlib.Data.Nat.Find
abbrev Bit := Bool
def Cantor : Type := Nat Bit
def Cantor.head (a : Cantor) : Bit := a 0
def Cantor.tail (a : Cantor) : Cantor := fun i => a (i + 1)
@[simp, grind] def Cantor.cons (x : Bit) (a : Cantor) : Cantor
0 => x
i+1 => a i
infix:60 " # " => Cantor.cons
With this in place, we can write Escardo s function in Lean. His blog post discusses a few variants; I ll focus on just one of them:
mutual
partial def forsome (p : Cantor Bool) : Bool :=
p (find p)
partial def find (p : Cantor Bool) : Cantor :=
have b := forsome (fun a => p (true # a))
(b # find (fun a => p (b # a)))
end
We define find together with forsome, which checks if the predicate p holds for any sequence. Using that find sets the first element of the result to true if there exists a squence starting with true, else to false, and then tries to find the rest of the sequence.
It is a bit of a brian twiter that this code works, but it does:
def fifth_false : Cantor Bool := fun a => not (a 5)
/-- info: [true, true, true, true, true, false, true, true, true, true] -/
#guard_msgs in
#eval List.ofFn (fun (i : Fin 10) => find fifth_false i)
Of course, in Lean we don t just want to define these functions, but we want to prove that they do what we expect them to do.
Above we defined them as partial functions, even though we hope that they are not actually partial: The partial keyword means that we don t have to do a termination proof, but also that we cannot prove anything about these functions.
So can we convince Lean that these functions are total after all? We can, but it s a bit of a puzzle, and we have to adjust the definitions.
First of all, these seemingly impossible functions are only possible because we assume that the predicate we pass to it, p, is computable and total. This is where the whole magic comes from, and I recommend to read Escardo s blog posts and papers for more on this fascinating topic. In particular, you will learn that a predicate on Cantor that is computable and total necessarily only looks at some initial fragment of the sequence. The length of that prefix is called the modulus . So if we hope to prove termination of find and forsome, we have to restrict their argument p to only such computable predicates.
To that end I introduce HasModulus and the subtype of predicates on Cantor that have such a modulus:
-- Extensional (!) modulus of uniform continuity
def HasModulus (p : Cantor ) := n, a b : Cantor, ( i < n, a i = b i) p a = p b
@[ext] structure CantorPred where
pred : Cantor Bool
hasModulus : HasModulus pred
The modulus of such a predicate is now the least prefix lenght that determines the predicate. In particular, if the modulus is zero, the predicate is constant:
namespace CantorPred
variable (p : CantorPred)
noncomputable def modulus : Nat :=
open Classical in Nat.find p.hasModulus
theorem eq_of_modulus : a b : Cantor, ( i < p.modulus, a i = b i) p a = p b := by
open Classical in
unfold modulus
exact Nat.find_spec p.hasModulus
theorem eq_of_modulus_eq_0 (hm : p.modulus = 0) : a b, p a = p b := by
intro a b
apply p.eq_of_modulus
simp [hm]
Because we want to work with CantorPred and not Cantor Bool I have to define some operations on that new type; in particular the cons element before predicate operation that we saw above in find:
def comp_cons (b : Bit) : CantorPred where
pred := fun a => p (b # a)
hasModulus := by
obtain n, h_n := p.hasModulus
cases n with
zero => exists 0; grind
succ m =>
exists m
intro a b heq
simp
apply h_n
intro i hi
cases i
rfl
grind
@[simp, grind =] theorem comp_cons_pred (x : Bit) (a : Cantor) :
(p.comp_cons x) a = p (x # a) := rfl
For this operation we know that the modulus decreases (if it wasn t already zero):
theorem comp_cons_modulus (x : Bit) :
(p.comp_cons x).modulus p.modulus - 1 := by
open Classical in
apply Nat.find_le
intro a b hab
apply p.eq_of_modulus
cases hh : p.modulus
simp
intro i hi
cases i
grind
grind
grind_pattern comp_cons_modulus => (p.comp_cons x).modulus
We can rewrite the find function above to use these operations:
mutual
partial def forsome (p : CantorPred) : Bool := p (find p)
partial def find (p : CantorPred) : Cantor := fun i =>
have b := forsome (p.comp_cons true)
(b # find (p.comp_cons b)) i
end
I have also eta-expanded the Cantor function returned by find; there is now a fun i => i around the body. We ll shortly see why that is needed.
Now have everything in place to attempt a termination proof. Before we do that proof, we could step back and try to come up with an informal termination argument.
forsome to find doesn t decrease any argument at all. This is ok if all calls from find to forsome are decreasing.find to find decreases the index i as the recursive call is behind the Cantor.cons operation that shifts the index. Good.find to forsome decreases the modulus of the argument p, if it wasn t already zero.
But if was zero, it does not decrease it! But if it zero, then the call from forsome to find doesn t actually need to call find, because then p doesn t look at its argument.0 and 1 in the middle component mean that for zero modulus, we can call forsome from find for free .
mutual
def forsome (p : CantorPred) : Bool := p (find p)
termination_by (p.modulus, if p.modulus = 0 then 0 else 1, 0)
decreasing_by grind
def find (p : CantorPred) : Cantor := fun i =>
have b := forsome (p.comp_cons true)
(b # find (p.comp_cons b)) i
termination_by i => (p.modulus, if p.modulus = 0 then 1 else 0, i)
decreasing_by all_goals grind
end
The termination proof doesn t go through just yet: Lean is not able to see that (_ # p) i will call p with i - 1, and it does not see that p (find p) only uses find p if the modulus of p is non-zero. We can use the wf_preprocess feature to tell it about that:
The following theorem replaces a call to p f, where p is a function parameter, with the slightly more complex but provably equivalent expression on the right, where the call to f is no in the else branch of an if-then-else and thus has p.modulus = 0 in scope:
@[wf_preprocess]
theorem coe_wf (p : CantorPred) :
(wfParam p) f = p (if _ : p.modulus = 0 then fun _ => false else f) := by
split
next h => apply p.eq_of_modulus_eq_0 h
next => rfl
And similarly we replace (_ # p) i with a variant that extend the context with information on how p is called:
def cantor_cons' (x : Bit) (i : Nat) (a : j, j + 1 = i Bit) : Bit :=
match i with
0 => x
j + 1 => a j (by grind)
@[wf_preprocess] theorem cantor_cons_congr (b : Bit) (a : Cantor) (i : Nat) :
(b # a) i = cantor_cons' b i (fun j _ => a j) := by cases i <;> rfl
After these declarations, the above definition of forsome and find goes through!
It remains to now prove that they do what they should, by a simple induction on the modulus of p:
@[simp, grind =] theorem tail_cons_eq (a : Cantor) : (x # a).tail = a := by
funext i; simp [Cantor.tail, Cantor.cons]
@[simp, grind =] theorem head_cons_tail_eq (a : Cantor) : a.head # a.tail = a := by
funext i; cases i <;> rfl
theorem find_correct (p : CantorPred) (h_exists : a, p a) : p (find p) := by
by_cases h0 : p.modulus = 0
obtain a, h_a := h_exists
rw [ h_a]
apply p.eq_of_modulus_eq_0 h0
rw [find.eq_unfold, forsome.eq_unfold]
dsimp -zeta
extract_lets b
change p (_ # _)
by_cases htrue : a, p (true # a)
next =>
have := find_correct (p.comp_cons true) htrue
grind
next =>
have : b = false := by grind
clear_value b; subst b
have hfalse : a, p (false # a) := by
obtain a, h_a := h_exists
cases h : a.head
exists Cantor.tail a
grind
exfalso
apply htrue
exists Cantor.tail a
grind
clear h_exists
exact find_correct (p.comp_cons false) hfalse
termination_by p.modulus
decreasing_by all_goals grind
theorem forsome_correct (p : CantorPred) :
forsome p ( a, p a) where
mp hfind := by unfold forsome at hfind; exists find p
mpr hex := by unfold forsome; exact find_correct p hex
This is pretty nice! However there is more to do. For example, Escardo has a massively faster variant of find that we can implement as a partial function in Lean:
def findBit (p : Bit Bool) : Bit :=
if p false then false else true
def branch (x : Bit) (l r : Cantor) : Cantor :=
fun n =>
if n = 0 then x
else if 2 n then r ((n - 2) / 2)
else l ((n - 1) / 2)
mutual
partial def forsome (p : Cantor -> Bool) : Bool :=
p (find p)
partial def find (p : Cantor -> Bool) : Cantor :=
let x := findBit (fun x => forsome (fun l => forsome (fun r => p (branch x l r))))
let l := find (fun l => forsome (fun r => p (branch x l r)))
let r := find (fun r => p (branch x l r))
branch x l r
end
But can we get this past Lean s termination checker? In order to prove that the modulus of p is decreasing, we d have to know that, for example, find (fun r => p (branch x l r)) is behaving nicely. Unforunately, it is rather hard to do termination proof for a function that relies on the behaviour of the function itself.
So I ll leave this open as a future exercise.
I have dumped the code for this post at https://github.com/nomeata/lean-cantor.
Today and SpecifiedDate as properties. I forwarded an
issue about dates not being parsed correctly to the icalendar issue
tracker and this was fixed a
couple of days later (thanks!). I then created a 0.5.1 release containing that
fix. I also started planning to move the carl repository back to codeberg,
because Github feels more and more like an AI Slop platform.
The work on debiverse also continued. I removed the tailwind CSS framework,
and it was actually not that hard to reproduce all the needed CSS classes with
custom CSS. I think that CSS frameworks make sense to a point, but once you
start implementing stuff that the framework does not provide, it is easier if
everything comes out of one set of rules. There was also the article Vanilla
CSS is all you
need which goes
into the same direction and which gave me some ideas how to organize the CSS
directives.
I also refactored the filter generation for the listing filters and the HTML
filter form is now generated from the FastAPI Query Parameter
Model.
For navigation I implemented a sidebar, that is hidden on small screens but can
be toggled using a burger menu.
I also stumbled upon An uncomfortable but necessary discussion about the
Debian bug
tracker,
which raises some valid points. I think debiverse could be a solution to the
first point of What could be a way forward? , namely: Create a new web
service that parses the existing bug data and displays it in a rich format .
But if there is ever another way than email to interact with bugs.debian.org,
than this approach should not rely on passing on the commands via mail. If
I click a button in a web interface to raise the severity, the severity should
be raised right away - not 10 minutes later when the email is received. I think
the individual parts (web, database, mail interface) should be decoupled and
talk to each other via APIs.
Next.