notes

What the session measured, 2026-09-04

Name: provisional, minted 2026-10-11 (UTC) by lane/ten-longest-notes.

An appendix to notes/footprint-perturbation.md, which keeps the conclusions. This file holds the session's tables and the reasoning behind each reading: E3, why its sign matters, where it left milestone 188 (the IPC fastpath), E1 and E4.

The session

Six boots on radon, interleaved unpadded/padded, one card written six times, exactly the order the procedure required. Every boot printed bench: cntfrq 4000000 (the board, not QEMU virt), bench: cycles_per_tick 250.00 (the riscv64 PMU of milestone 74 (cycle counters) reading real cycles), and bench: done. Nothing self-skipped, so E1 and E4 produced full sweeps as well. They are below because they are the more decisive half of the session.

The static check of step 1 was taken first, on the exact commit flashed: riscv64 ipc_call_reply 5,936 unpadded, 11,070 padded, 1.87x. The card was verified byte-for-byte against the built image before each of the six ejections, because nothing on the card says which build it carries.

E3: three non-overlapping separations, and one of them points the wrong way

Ticks at 4 MHz, so one tick is 250 ns. Boots 1, 3, 5 unpadded; 2, 4, 6 padded.

row unpadded (3 boots) padded (3 boots) delta per round trip
ipc_rtt (1000 iters) 4259 · 4259 · 4259 4311 · 4310 · 4310 +1.21% +12.8 ns
call_reply (1000 iters) 5015 · 5013 · 5013 5088 · 5089 · 5088 +1.49% +18.7 ns
ipc_rtt_el0 (5000 iters) 128606 · 128626 · 128615 124958 · 124391 · 124903 -3.01% -193 ns

The measurement is as clean as this instrument can be. ipc_rtt returned 4259 three times out of three. The unpadded call_reply band is 2 units wide across three boots, and the padded one is 1. The gap between them is 74, which is roughly 37x the within-condition spread. single_hart did what it was built for. The fifteenfold placement lottery of notes/soak.md cannot appear on a card with one core, and the boot-to-boot spread collapsed accordingly.

And the third row is the finding, not the first two. The padded build is 3% faster on the round trip that crosses EL0, reproducibly, with no overlap. The effect is 193 ns, where the kernel-side one is 19 ns. It is an order of magnitude larger than the cost it is supposed to be paying, and it has the wrong sign.

Why that sign matters more than the magnitude

Adding 5 KB of resident dead code cannot make anything faster. The padding is never executed: kernel/src/fastpath_pad.rs is reached through core::hint::black_box, on a compare-and-branch that is never taken. Whatever produced a 193 ns improvement is therefore not the footprint, because the footprint has no mechanism by which to produce one.

What it is, almost certainly, is code layout. The padded build is not "the same kernel plus dead bytes". It is the same kernel at different addresses, with different cache-line boundaries, different set indices in a 32 KB 2-way L1i, and different branch-predictor aliasing. A lucky layout can be worth more than 5 KB of dead text costs, and here it was.

This is the effect Mytkowicz, Diwan, Hauswirth and Sweeney named in Producing Wrong Data Without Doing Anything Obviously Wrong (ASPLOS 2009). Changing a link order or a UNIX environment variable size, which alters no instruction, moves measured performance by more than the optimization under study. E3's design has exactly the shape they warn about. It varies one Cargo feature, and reads the difference as an effect of that feature. A Cargo feature that inserts a symbol changes the layout of everything after it.

So the +1.49% on call_reply cannot be attributed to footprint either. We have one unpadded layout and one padded layout, and we have just watched layout move a number by 3% in a direction footprint cannot explain. The +1.49% is a real, reproducible difference between these two binaries. It is not evidence that it is a difference between these two footprints.

It is not a null result, and should not be filed as one. A null would be "padding changed nothing". What happened is that padding changed three things, one of them impossibly. That says the instrument is confounded, rather than that the hypothesis is false.

Where that leaves milestone 188 phase 4, and what would actually decide it

The routing table offered four rows, and the capture matches none of them, because all four assume the only variable is footprint.

Phase 4 stays where it is. A hand-written fastpath is a permanent verification obligation. The case for it now rests on a 19 ns difference that a layout artifact of 193 ns sits on top of. That is not evidence a reader should be asked to buy a second IPC path with.

What would decide it is a layout control, and it is cheap. The confound is testable directly. Build several unpadded kernels that differ only in layout (a dead symbol of a different size, or a link-order change, in both cases adding no reachable instruction), and read the same three rows. That gives a layout distribution rather than a single unpadded point. E3's padded reading is then interpretable for the first time: an effect inside the layout distribution is layout, and one outside it is footprint. The same fix answers the E4 and E1 readings below, which have the same exposure.

It was written up as a proposal the day this was captured, promoted to milestone 370 (a layout control), and built on 2026-09-19. The images and the procedure are in the parent's "The next radon evening". Without it, every perturbation experiment in this tree measures footprint and layout summed together, and reports the total as footprint.

E1: the knee is real, it is where the prediction put it, and then it stops

Six boots. This sweep does not depend on the padding at all, so all six are one sample.

threads ticks/iter (range over 6 boots) ns vs 2 threads
2 4.365 to 4.719 1152 1.00x
4 4.737 to 4.795 1189 1.03x
8 5.401 to 5.628 1377 1.20x
16 7.649 to 7.903 1938 1.68x
32 7.713 to 7.919 1953 1.69x
64 7.744 to 7.974 1966 1.71x
96 7.790 to 8.026 1975 1.71x

This is the strongest result of the session, and it is not the one the session was for. IPC latency rises 68% between 2 and 16 threads, with the bend between 8 and 16, and is then flat to 96: the last four points span 1.2%. The prediction E1 was designed around, computed against radon's 32 KB by name, was a knee in the low tens. It is at 16.

The shape is a working set crossing a cache and then saturating, which is what it should look like. Once the per-thread state no longer fits, every additional thread misses anyway, and the curve has nowhere further to go. On patagonia the same sweep rose 8 to 11% across the whole range with no identifiable knee, which is the large-cache muting E1's note predicted.

What it says about design/decisions/0096-process-kernel-or-event-kernel.md. The performance input to §96 (process kernel or event kernel) is live. A per-thread kernel state that a process kernel carries and an event kernel does not is measurably expensive on the smallest cache this project targets. But read it against E2's finding that the customer path runs 4 to 8 threads, which is on the flat part of the curve, below the knee. So the honest statement is that the effect §96 worries about is real on this machine, and the workload this project has is not in the regime where it bites. That is a sharper input than §96 had, and it does not answer §96 on its own.

And this sweep has the same layout exposure as E3. It is a single build, so nothing here is a between-build comparison, and the confound does not apply to the shape of the curve. It does apply to anyone who later compares this curve against a different build's.

E4: application displacement is real and load-dependent

Percentages of throughput the application loses while IPC runs. They were identical across all six boots, except one 4k reading that split 6 and 7.

working set under IPC load under 96-thread IPC load
4 KiB 1% 6 to 7%
16 KiB 1% 7%
32 KiB 1% 8%
64 KiB 0% 5%
128 KiB 0% 5%

This is the Liedtke measurement proper, and it is the first time this tree has taken it on a machine with a small cache. Two things in it are worth more than the headline.

The peak is at 32 KiB, which is radon's L1d exactly. An application whose working set just fits the cache is the one with the most to lose when something else evicts it. Below that there is room for both; above it the application is already missing, and IPC displacement costs it proportionally less. That the peak lands on the cache size, rather than at one end of the sweep, is what makes this a cache measurement rather than a scheduling one.

Load dependence is the whole effect. At ordinary IPC load displacement is 0 to 1%, at the boundary of measurable. At 96 threads it is 5 to 8%. Liedtke's claim is about a kernel whose footprint evicts the application. The honest reading here is that it needs both a large footprint and heavy IPC before it is worth 5% of anything.

The 2026-08-22 patagonia session read 0 to 3%, and could not separate it from noise. The board reproduces it at three times the magnitude, with a clean peak at the cache size. That is E3's own argument for why the small-cache machine was worth the trip, arriving through E4 instead.