Files
Will C. 50d0da493f PANDEMONIUMv5.25.0:
"And after a little there was a darkness, borne downward, which had come to be
 in one part, fearful and hateful, coiling as it ended, so that I seemed to see
 the darkness changing into a kind of moist nature, unspeakably troubled,
 giving off smoke as from fire, and making a sound, an inexpressible wailing."
— Hermes Trismegistus, "Poimandres," Corpus Hermeticum I.4

v5.25.0 removes the domain overflow. Every runnable task waits on one CPU's
own queues, a seat for wakes and a lane for requeues, and a steal priced by
how long a queue's head has waited carries the work conservation the shared
queue held. Four wake-path defects montauk read off traced captures close with
it: A cut preempted its own wakee, a live handoff pair lost its CPU to its own
lane, a wake that may not cut waited out a resident that never sleeps and a
resident a cut displaced requeued behind a fork storm. Deadline misses read
0.1-0.4% at every width where the 12C cell read 3.4% and 4.0%, and 12C pipe
round-trip p99 reads 34us against 143us. The three R_eff walks are functions
the verifier reads once, which returns the scheduler to the 6.13 verifier.

The Adaptive Layer writes on evidence. It reads burstiness off the arrival
stream and persistence off lane depth, over windows that span time, and a knob
is written only when its derivation has moved more than twice its own spread
from the value last written: 7, 7 and 8 writes at 2C, 8C and 12C where it
wrote 250, 43 and 16. A domain's tail wait and its critical slowing lower its
rescue threshold, its slice and standing hold only ever shorten, and a waker
that leaves seats its partner. Over five iterations that seat separates the
layer from the BPF arm on eventfd and sem at every width, p99 17.2-36.2us
against 33.2-178.8us (p 0.008).

The README's tables are the release's own. Of the 34 cells they publish, the
BPF arm reads ahead of v5.24.0's on 24 and the adaptive arm on 27, its wakeup,
burst and long-run p99 at 13-29us at every width where v5.24.0's read
65-1,808us. The source names the works it rests on at the sites that use them,
and the User Guide is in its second edition.

BPF, THE DOMAIN OVERFLOW IS REMOVED: src/bpf/main.bpf.c, src/bpf/intf.h,
src/bpf_intf.rs, src/scheduler.rs, src/topology.rs, src/tuning.rs,
src/adaptive.rs, src/main.rs
- The domain overflow is gone: Its DSQs, drains, tier and clocks, STEP 5's
  cross-domain take and codel_starve_ns. Each CPU has a seat for wakes and
  handoff partners (DSQ cpu) and a lane for its own requeues (DSQ nr_cpu_ids +
  cpu), each with a queue clock of its own. The shape is scx_panda's v0.2.8
  removal, ported onto this program's own paths.
- Dispatch runs the sweep, then the CPU's own lane when it has waited past
  codel_target_ns and longer than the seat (unless a live pair holds the seat
  and the lane is under the lag cap), its own seat, a peer's seat, its own
  lane, a peer's lane, and last keeps prev.
- The steal is work conservation priced by the age of a queue's head. A busy
  CPU takes a peer's head once it has waited phi_base_cost_ns plus the peer's
  reff_frac share of codel_target_ns plus the pair hold. A CPU about to idle
  pays the base cost alone and walks the whole rank, except a far lane past
  the busy budget, which still pays its distance. A move lost to a racing CPU
  is counted (nr_steal_lost).
- The starvation bounds are per CPU. The tick preempts its own resident once
  its lane has waited past codel_target_ns, paced by the lane's judge, and the
  sweep acts on any seat or lane past lag_cap_ns. A rescue is a lane served
  past codel_target_ns (nr_rescue), the oscillator's impulse as before.
- Enqueue's tier 3 seats a task on its own CPU through allowed_seat, the seat
  for a wake and the lane for a requeue, with a priced kick. A wake that may
  not cut skips the warm hold, takes an idle CPU anywhere on the node first
  and is seated at tier 2 otherwise.
- Wakeups may be queued (SCX_OPS_ALLOW_QUEUED_WAKEUP). enqueue then runs on
  the wakee's CPU, so select_cpu stamps the waker's pid in the task context
  and the pair ledger reads it there.
- longrun_mode, longrun_preempt_shift, burst_slice_ns and batch_sojourn_ns are
  gone, and with them the swap of every task's slice under a sustained
  backlog. A task's slice is the layer's slice_ns, or the batch slice once it
  stands.
- The stats carry nr_rescue in place of nr_overflow_rescue, and nr_steal_lost.
  The cross-domain counters keep their eight positions, two of them retired,
  so archived prom labels still read. The depth ring's domain field becomes
  the lane's depth, the Adaptive Layer's domain series sums its CPUs' lane
  depths, and the 32-domain cap and MAX_NODES go. Both verbose lines drop the
  LONGRUN label and the BPF arm's drops sjrn.

BPF, A CUT NEVER PREEMPTS ITS OWN WAKEE: src/bpf/main.bpf.c
- seat_cut inserts the wakee at its seat's local head with SCX_ENQ_PREEMPT,
  then kicks the seat SCX_KICK_PREEMPT. When the seat rescheduled before the
  kick landed, the kick zeroed the wakee's own slice; the wakee requeued to
  the lane behind the resident it had displaced and waited out the next tick.
  montauk read eight such stalls at 988-996us in one traced 12C burst capture,
  on both arms.
- A cut stamps its task, and a requeue within CUT_SELF_KICK_NS (50us) of that
  cut, on the CPU it was cut onto, returns to the CPU's local head with its
  slice and no new kick.
- Over two scale runs on both arms, deadline misses read 0.1-0.4% and jitter
  p99 73-206us at every width, where the 12C cell read 3.4% and 4.0% misses at
  1,069-1,273us on the adaptive arm and 8C and 12C read 1.2% and 1.3% on the
  BPF arm. Burst p99 reads 17-86us where single cells read 1,059us and
  1,072us.

BPF, A LIVE HANDOFF PAIR KEEPS ITS CPU: src/bpf/main.bpf.c
- A 1:1 pair keeps its CPU busy, so the task it displaced stands in that CPU's
  lane. Kicked once the lane passed codel_target_ns, the CPU entered dispatch
  with its seat empty, the own-lane step served the displaced task, and the
  pair lost a tick and usually its CPU, once every few ticks. montauk read it
  off traced 12C ipc captures: Wake-to-run held at p99 5-17us on every
  primitive, while the pipe pair's 20,000 round trips were interrupted 187
  times against v5.24.0's 41 and moved 583 times against 60.
- tick()'s lane self-preempt now answers to lag_cap_ns on a CPU carrying a
  live handoff pair, a partner seated there within one live target, the rule
  dispatch()'s aged-lane serve already held.
- 12C pipe round-trip p99 reads 34us against 143us without it, socket 38-39us
  against 62us, and 8C and 4C pipe 36us and 28us against 144us and 180us. The
  pipe phase reads 31 interruptions and 12C floored wakes fall from 332 to 78;
  two runs agree.
- A task displaced by a live pair waits up to lag_cap_ns, the starvation
  bound: Its longest wait in the 12C capture is 13.8ms against v5.24.0's
  16.0ms, and its p99 stays about 1ms.

BPF, A WAKE THAT MAY NOT CUT TAKES A RESIDENT THAT NEVER SLEEPS:
src/bpf/main.bpf.c, src/bpf/intf.h, src/scheduler.rs, src/adaptive.rs
- wake_cuts keeps a fan-out or non-partner sync wake off its seat's resident,
  which may be the work it serves, so frame contended's jobs waited out
  whatever held their last CPU, a background hog as often as not. On the same
  capture montauk read scx_bpfland issuing 52.0k preempt kicks against
  PANDEMONIUM's 11.9k, its job wakes at p50 18.8us against 106us.
- A task's sleepless ledger counts consecutive stops that left it runnable,
  reset by one that blocks, and resident_sleepless marks each CPU whose
  resident has kept running through its last eight (PAIR_OBS_MIN), set in
  running() and cleared in stopping(). A TIER 2 wake that may not cut walks
  its domain in R_eff order from its last CPU for such a resident past its
  first target and takes that seat by the cut. The standing ledger cannot draw
  this line: Render and the job workers run a full target and then block, so
  they read as standing and never as sleepless.
- nr_sleepless_cut and nr_sleepless_miss count the walk's outcomes on the
  KNOBS line, beside steal_lost, which was counted and never emitted. Frame
  contended reads 47-50k cuts against 56-60k misses a run, the misses where
  every cuttable hog already waits in its lane.
- Frame contended at four iterations, with EEVDF and scx_bpfland in the same
  run, reads the adaptive arm's average fps at +21.1% and +21.7% over EEVDF
  where it read +8.5%, against bpfland's +23.8% and +24.2%, and job wake p50
  at 26us against 106us. The 1% low (p99) reads 317.5 and 320.9 against
  bpfland's 303.8 and 311.8 and frame time p99 3.15ms and 3.12ms against
  3.29ms and 3.21ms, where montauk ranks PANDEMONIUM best. Scale holds burst
  p99 at 21-83us and deadline misses at 0.1-0.3%.

BPF, A PARTNER TAKES ITS WAKER'S SEAT ON ONE DOMAIN TOO: src/bpf/main.bpf.c
- The partner seat and the leaving-waker seat ran only with more than one L3
  domain, for a locality a monolithic L3 does not need. On one domain a
  partner's wake cut a resident instead, often the hog on the other CPU,
  paying the cut's IPI and displacing it, where the waker's own CPU frees in
  microseconds. Both seats now run on any topology.
- 2C IPC at two iterations reads pipe p99 at 22us and 28us on the adaptive and
  BPF arms, sem at 33us and 312us, eventfd at 42us and 87us and fanout at 58us
  and 74us, where they read 754us and 44us, 68us and 412us, 107us and 318us,
  and 1,760us and 1,999us. EEVDF reads 86-1,060us across them in the same run.
- Scale at 2C holds latency p99 at 59-80us and deadline misses at 0.1-0.4%,
  with compile at 51.2-51.8s against 51.8-52.4s.

BPF, A RESIDENT A CUT DISPLACES RESUMES FROM THE HEAD OF ITS LANE:
src/bpf/main.bpf.c
- A resident taken off by a cut requeued as the youngest claim on its CPU's
  lane, behind every requeue there and behind the seat a fork storm keeps fed.
  montauk read it on PipeWire's data loop through a fork storm, a plain thread
  of 48us a run on a 21.3ms period: Taken a median 38us into a run and back as
  much as 13ms later, where EEVDF has it back in 100us.
- seat_task stamps a cut's time on the seat's clock. A requeue within one live
  target of a cut onto its seat, with under one target of service since its
  wake (wake_svc_ns, zeroed in runnable(), advanced in stopping()), takes the
  head of its lane at enqueue's last tier: Every cut still runs ahead of it,
  and the lane's next serve runs it on.
- It stays out of the lane's clock. The lane records it apart (resumed_n,
  resumed_since), a steal prices that lane on the resumed task's own wait, and
  dispatch's aged-lane rule and the tick's lane act read the longer of the two
  waits.
- PipeWire counts no missed period through the storm at 12C with or without
  it, and at 2C 0 to 2 a pass against 0 to 6, traced 31 to 38 against 57 to
  109. Over four passes on the BPF arm every other wake cell reads tied under
  montauk's population mode.

BPF, THE AFFINITY RANK WALKS THE NEAREST RUNG FIRST: src/topology.rs
- build_affinity_rank orders each CPU's peers by rung first (a shared L2, then
  the L3, then the socket), then by R_eff inside a rung, with equidistant
  peers in the order they follow the CPU around the id ring. Rung first, an
  uneven part, this box's 5+3 L3s at 8C, never ranks the other L3 ahead of its
  own. With ties broken by the lowest id, every idle CPU of a rung walked the
  same victims in the same order; rotated, each CPU meets its equidistant
  peers starting at a different one.

BPF, THE THREE R_eff WALKS ARE FUNCTIONS THE VERIFIER READS ONCE:
src/bpf/main.bpf.c
- v5.24.0 moved the walks onto bpf_for for sched-ext/scx issue 3966, the 7.4
  verifier's "The sequence of 8193 jumps is too complex" on
  pandemonium_select_cpu and pandemonium_enqueue. That cut the verifier's work
  from 6.16 up and broke 6.13, which scx's CI still verifies on: With the
  walks inlined at nine sites, six of them in select_cpu, select_cpu went from
  179,109 processed instructions to the 1,000,000 limit on 6.13.12.
- find_idle_by_affinity, find_sleepless_by_affinity and find_spill_seat are
  global functions, which the verifier reads once and counts as one call from
  each site. Their loops, order, tests, bounds and budgets are unchanged. Each
  takes the task and reads its cpus_ptr, which every caller passed: A function
  verified alone must be handed a pointer the kernel vouches for. The spill
  walk asks a peer's seat wait through peer_seat_wait, which is seat_wait
  behind a call. Inlined in that loop it alone kept select_cpu over the limit
  under a real load on 6.13.
- select_cpu and enqueue verify in 18,866 and 15,614 instructions on 6.13.12,
  and in 18,911 and 11,090 on 6.16.12, 19,027 and 11,278 on 6.18.63 and 19,641
  and 11,586 on 7.3.4, where the inlined walks took 39,719 and 19,598, 41,738
  and 19,226 and 25,554 and 14,199.
- It verifies on linux-rolling-stable cff26be72d94, 6.18.y 1cdda838e847,
  6.16.y d997d33eb340 and 6.13.y 9b249e60a5a8, the four kernels scx's required
  veristat job names, and on bpf-next d346f5906967, sched_ext for-next
  f7008fb94ee0, v7.4-rc1 and bpf-next 7101b10cf281, in 8-CPU and 32-CPU
  guests. On the seven from 6.16 up it attaches and detaches at both widths,
  and it runs every load phase on 7.3.4 and 6.18.63.
- v5.24.0 was not exported (its notes are the message of commit 55d6bac in the
  PANDEMONIUM repository), so the scx tree takes it with this release, in
  place of the out-of-line, unrolled find_spill_seat its copy took in pull
  request 3982.

BPF, THE BUILD KEEPS THE COMPILED OBJECT, DROPS flate2 AND GUARDS THE EXPORT:
build.rs, Cargo.toml, export_scx.py
- The skeleton builder writes main.bpf.o into OUT_DIR beside the skeleton that
  embeds it, so montauk --static reads the instructions the verifier sees
  beside the source they came from: 0 unreachable blocks in 2,316, and
  select_cpu at 517 compiled branches against 37 in source.
- flate2 leaves [dependencies] with the five crates only it pulled into the
  dependency graph. Nothing in the tree calls it, and the scx tree's copy of
  the manifest lost it in upstream's sweep of unused dependencies (scx pull
  request 3979).
- The scx copy's --version handler was inserted before main()'s match on the
  subcommand. The subcommands are gone, so the step found nothing to anchor on
  and counted itself applied, and an export of this tree built a crate whose
  --version went on to load the scheduler; none was published. The handler
  follows the parse, and each of the patch's five steps stops the export when
  main.rs does not hold its anchor.

ADAPTIVE, BURSTINESS READS THE ARRIVALS AND THE LAYER WRITES ON EVIDENCE:
src/adaptive.rs, src/chaos.rs
- Each domain's burstiness reads its CPUs' pooled arrivals per bucket, the
  arrival process the lens is a statistic of, where it read the domain's lane
  depth. Kim-Jo takes the counts through kim_jo_counts_priced (the gaps' CV as
  the square root of the counts' Fano factor, n the arrivals in the window)
  and sets the batch ceiling.
- Persistence stays on the domain's lane depth: Veitch-Abry over it sets the
  rescue threshold, lower where the depth persists and higher where it
  reverts, centred on H = 0.5. Fed the arrivals instead, the derivation
  lowered the rescue threshold on every workload and lost the 8C deadline-miss
  win the layer held over the BPF arm.
- The depth windows span time: 1.608s, 256 buckets of the 12C reference, at
  every width and never under 64 samples, the bucket rate measured from the
  ring's epochs between drains. At 2C the window spanned 25.7s and now spans
  about 6.4s.
- A derived slice, batch ceiling or rescue threshold is written only when it
  has moved from the value last written by more than twice its spread over its
  last 16 derivations. While the oscillator is responding the rescue threshold
  alone holds its written value; slice and batch write through.
- Pecora-Carroll coupling recomputes n pairs a tick in rotation and carries
  the rest. It was the tick's whole cost, 0.48ms at 12C and 229ms at 256 CPUs.
  The quiescence gate is decided before the graph, which it does not read, and
  a frozen tick builds the graph only for a regime change.
- One scale run on both arms, with both lenses then on the arrivals, read the
  layer writing 7, 7 and 8 times at 2C, 8C and 12C where it wrote 250, 43 and
  16, and burstiness at +0.28 to +0.47 on arrivals where lane depth read -0.29
  to -0.04. Burst recovery p99 read 81, 64 and 79us against the BPF arm's 103,
  86 and 170us, and 8C deadline misses 0.4% against 1.2%.

ADAPTIVE, THE RING CARRIES THE QUEUE CLOCK, THE ARRIVALS AND THE SHORTEST
WAIT: src/bpf/intf.h, src/bpf/main.bpf.c, src/scheduler.rs, src/adaptive.rs,
src/chaos.rs
- Per-CPU queue depth read empty under load: The hand-off seats tasks on local
  DSQs the depth sample never saw. Each ring slot now carries the local DSQ's
  depth beside the depths it held, three sums running() adds as each task
  starts (the run, whether it ended a wake and the queue wait it ended, in
  microseconds) and the shortest queue wait the bucket's runs ended. The wait
  sum is the queue clock, alive in every bucket the CPU runs anything in, and
  a slot reads absent only where the CPU neither ticked nor ran. The slot
  grows from 24 to 48 bytes and the ring from 12,296 to 24,584 per CPU.
- The graph's nodes read the queue clock and the arrivals: Each CPU's mean
  wait, the Fano burstiness and Fano-slope Hurst of its arrivals per bucket,
  and the lag-1 autocorrelation of its queue clock. Each domain carries its
  CPUs' waits pooled by run. chaos.rs gains the two Fano lenses, priced like
  the rest: B = (sqrt(F) - 1) / (sqrt(F) + 1) from the Fano factor of the
  counts, and H from the growth of F across bucket widths.
- The shortest wait is CoDel's standing-queue test per bucket: A CPU whose
  shortest wait stays above the target holds a task behind a resident, and one
  whose shortest wait falls to zero is a backlog that drains. A domain's
  starvation share is the fraction of its CPUs' buckets over the last second,
  of those that ran anything, whose shortest wait stayed above the CoDel
  equilibrium BPF applies. The graph prom carries its mean.
- The share moves no knob. QUALIFIED_RESCUE_LIVE, which lets it scale
  persistence's lowering of the rescue threshold, is false: Fielded on as a
  second build over five iterations of scale, it bought 2C burst p99, 23.6us
  against 34.8us (p 0.032), and cost 12C's, 24.8us against 21.8us (p 0.008).

ADAPTIVE, THE REGIME LENSES READ THE RING BUCKET BY BUCKET: src/adaptive.rs,
src/chaos.rs, src/tuning.rs
- HVG, Bandt-Pompe and RQA-DET read one machine-wide sample per ring bucket
  where they read one a second: The idle-hit share of the bucket's runs for
  HVG and RQA-DET and its wakes for Bandt-Pompe, over the 1.608s every graph
  series spans, 64 to 256 samples. The regime's memory is 1.6s where it was 16
  seconds, and the lenses read a series long enough to tell order from noise.
  A bucket no CPU ran in gives no idle share, and its wakes are the zero the
  machine received.
- RQA-DET reports from 64 samples, and the 16-sample window it shared with HVG
  and Bandt-Pompe never reached that, so RQA never voted. It keeps a window of
  its own, the newest 64 buckets of the idle-hit share, and the quiescence
  gate's corroboration carries it. Once it voted, the gate froze 16 of 540
  ticks on a quiet box whose idle% jitters, where it froze 151, since DET
  reads the jitter as not steady.

ADAPTIVE, THE REGIME SETS THE SLICE, AND THE TAIL AND CRITICAL SLOWING LOWER
THE RESCUE: src/tuning.rs, src/adaptive.rs
- scaled_regime_knobs sets each regime's slice, Light 2ms, Mixed 1ms and Heavy
  4ms, ahead of the tau cap (0.15 tau within 0.5-8ms) and the 1ms cap at 4
  cores or fewer, so above 4 cores the regime moves a knob where it moved
  none. The BPF arm's base stays Mixed's.
- The written rescue threshold is the least of persistence's, the tail's and
  critical slowing's, and the last two only lower it. Lane depth gates the
  slice alone, so a domain with no lane depth still prices its batch ceiling
  and rescue threshold.
- A domain's tail is the largest of its per-bucket mean waits over the last
  second of its queue clock. Where the tail reaches past the base rescue
  threshold the domain is rescued sooner in proportion, base over tail, down
  to half at a tail of twice the base. Of fifteen sensors scored against a
  domain's next second of tail wait, the tail itself predicts best (median
  |rho| 0.74).
- Critical slowing reads each domain's queue clock for its lag-1
  autocorrelation on ranks, ties broken by a fixed hash of position, whose IID
  null is N(-1/W, 1/W) whatever the series' marginal. Its rise since the
  previous built tick, priced by the null spread sqrt(2/W), lowers the
  domain's rescue threshold toward half as it runs from the one-sided 5% point
  to twice it.
- Over five iterations of scale the layer writes the rescue threshold at 4.54,
  2.10 and 1.56ms at 2C, 8C and 12C against bases of 6, 3.0 and 2.0ms. The
  slowing rescue fires on 2.0, 14.5 and 15.0% of domain-ticks and the tail on
  0, 1.7 and 1.6%. One scale run read the written slice ending at 2.77ms at 8C
  and 1.5ms at 12C where it held 1ms.

ADAPTIVE, A DOMAIN'S SLICE AND STANDING HOLD ONLY SHORTEN: src/adaptive.rs,
src/tuning.rs, src/bpf/intf.h, src/bpf/main.bpf.c
- The Adaptive Layer writes each CPU's standing hold, the CoDel targets a
  standing task may hold the CPU for, which task_slice reads where it held
  SLICE_STANDING_TARGETS (4). A domain whose queued runs wait past the
  equilibrium target, idle-seated wakes left out, holds for fewer, down to
  half; one at or under it keeps four.
- The per-domain slice from lane depth shortens a domain deeper than the
  reference to half and leaves a shallower one at the base. Lengthening either
  under a shallow queue handed frame contended's hogs the longer hold: Its 1%
  low (avg) read 224.4 against the BPF arm's 263.9 with both able to double.
- Frame contended at four iterations reads the 1% low (avg) at 263.0 against
  the BPF arm's 260.0, the 0.1% low at 249.5 (±7.9) against 226.5 (±21.2) and
  audio late p99 at 11.9us against 20.6us.

ADAPTIVE, A WAKER THAT LEAVES SEATS ITS PARTNER, AND EVERY WAKE IS JUDGED:
src/bpf/main.bpf.c, src/adaptive.rs
- waker_leaving() stamped each wake and stopping() judged only the last, so a
  wake the waker ran through was hidden by its next one. Frame's main wakes
  render, simulates 1.5ms and stops only after its broadcast to the workers,
  so it read as a waker that leaves and render was seated behind the sim:
  Heavy's 1% low read 287.6 against the BPF arm's 352.5.
- A wake still unjudged past waker_leave_ns when the next one arrives clears
  the waker's ledger, a fan-out wake never takes the waker's seat, and that
  seat, where the waker still runs, is no idle hit for the regime lenses.
  WAKER_SEAT_LIVE writes waker_leave_ns, 25us, on the adaptive arm.
- Scale at five iterations separates the seat's cells from the BPF arm at
  every width: eventfd and sem p99 read 17.2-36.2us against 33.2-178.8us (p
  0.008). At 8C they run 90.9k and 111.1k round trips a second against the BPF
  arm's 66.7k and 55.6k, and their p99.9 reads 157-190us against EEVDF's
  2,710-2,819us.
- Frame at four iterations reads heavy's 1% low (avg) at 356.9 and its 0.1%
  low at 344.6 against the BPF arm's 341.9 and 312.8, and contended's 1% low
  (p99) at 329.5 against scx_flash's 321.5 and scx_bpfland's 310.3. App launch
  p99 reads 1,523-1,538us against the BPF arm's 2,527-2,539us.

ADAPTIVE, THE LAYER READS THE TRAFFIC BETWEEN CPUs: src/bpf/intf.h,
src/bpf/main.bpf.c, src/scheduler.rs, src/adaptive.rs
- A per-CPU flow row counts, on the CPU each run starts on, where it came
  from: A wake from its waker's CPU, stamped in select_cpu, and a migration
  from the task's previous CPU. Two adds in running(), on rows the CPU owns.
- The Adaptive Layer takes each tick's deltas as two directed graphs and
  reads, per kind, the share crossing a domain, how closely the flow's own
  Fiedler cut follows the domains, the busiest tenth of pairs' share and the
  tick-to-tick change. The power iteration starts from the last tick's vector
  and stops when it settles. Coupling stays telemetry beside it.
- At 12C under scale, migration flow's cut follows the L3 boundary on 99.3% of
  CPUs and wake flow's on 88%; 16% of migrations and 44% of wakes cross an L3;
  the busiest tenth of pairs carries 29-33%, and the graph moves 21-31% from
  one second to the next.

ADAPTIVE, THE REFILL SENSOR PAIRS EACH TASK WITH ITSELF: src/bpf/main.bpf.c,
src/bpf/intf.h, src/scheduler.rs, src/adaptive.rs
- The sensor summed every warm stop's cross-minus-same EWMA gap, so a
  long-stint task counted once per stop and the candidate pinned at 42-100us,
  100us in 5 of 11 runs. Its same-L3 class also folded in wakes on the waker's
  own CPU.
- stopping() now appends one record per run that ended a classed wake to a
  per-CPU ring: The task, whether its waker ran across the L3 and the service
  rendered. A wake on the waker's own CPU, one raised from idle and a
  kthread's run are not classed. The Adaptive Layer pools at most 16 stints
  per class per task per tick, pairs each task holding 20 of each with itself,
  and reads the median over the paired tasks of each task's median difference.
- It reports and does not act. LIVE_BASE_COST is false, and the applied base
  cost reads tau's 6,713ns with steal_base_held 0 on every run. Frame
  contended and heavy read the paired refill at 0.67-1.27us over about 60
  tasks and fork-thread at 2.1us over 583.

ADAPTIVE, WHAT THE LAYER WRITES IS WHAT BPF APPLIES: src/bpf/intf.h,
src/bpf/main.bpf.c, src/bpf_intf.rs, src/tuning.rs, src/scheduler.rs,
src/adaptive.rs
- One rail in intf.h binds both sides, mirrored in bpf_intf.rs. The slice
  floor and the hold an unwritten standing_targets stands for move there from
  main.bpf.c, and every set the Adaptive Layer writes passes through
  TuningKnobs::applied, so the map holds what BPF applies: A slice or batch
  ceiling under the floor is written at it, an unwritten hold as four targets.
- tick() keeps tau's base cost apart from the applied one, so a 0 written
  after a value restores tau's, and a hotplug re-reads every knob's
  last-written value. nr_steal_base_held counts the heads the live cost holds
  past tau's, on the KNOBS line.
- The queued wait and the starvation share are judged against the CoDel
  equilibrium BPF applies, the written value clamped into the oscillator's
  window in apply_tau_scaling's order. On this box every width reads inside
  the window: 12C 547us in 233-665us, 8C 717us in 350us-1ms, 2C 700us at its
  floor.
- The graph prom carries each knob's run mean as written and as applied: The
  slice, the batch ceiling, the rescue threshold, the standing hold, the
  departure bound and the CoDel equilibrium. On the adaptive arm every pair
  reads identical, the hold at 2.2 targets.

ADAPTIVE, THE LAYER AT FIVE ITERATIONS AGAINST THE BPF ARM AND EEVDF:
src/adaptive.rs
- Scale at 2C, 8C and 12C and frame at 12C, five iterations each with EEVDF
  and both arms in one pass, every cell read per iteration through montauk's
  population lane.
- The Adaptive Layer separates from the BPF arm on eventfd and sem, the cells
  the leaving-waker seat moved (p 0.008-0.024). Their p99 reads 17.2 and
  17.8us against 33.2 and 38.4us at 8C, 20.2 and 21.4us against 35.0 and
  38.8us at 12C and 36.2 and 32.8us against 77.4 and 178.8us at 2C. 12C burst
  p99 reads 21.8us against 25.0us (p 0.04).
- No deadline, burst recovery, long-run, mixed, launch or compile cell
  separates the two arms; montauk puts the power those cells need at about 20
  runs an arm. The BPF arm reads ahead on 8C mixed work by 0.46% (p 0.008), on
  2C socket p99.9 at 277us against 364us (p 0.048) and on 8C's eventfd worst
  case at 2,004us against 2,544us (p 0.032).
- Against EEVDF, latency p99 reads 19-30us on both arms where EEVDF reads
  2,212, 1,448 and 254us, and deadline misses 0.16-0.30% where it reads 20.6,
  12.3 and 13.4%. The layer's fanout p99 reads 52, 108 and 861us against
  1,397, 2,675 and 2,899us. EEVDF reads ahead on the eventfd and sem medians
  at every width, on their p99 at 8C and 12C (11.8-15.8us against 17.2-21.4us)
  and on compile at 2C and 8C (51.1s against 53.3s and 28.1s against 29.1s).
- Frame separates no PANDEMONIUM arm from another. Contended reads 420-422
  average fps and a 1% low of 314-327 against EEVDF's 346.8 and 197.3.

ADAPTIVE, THE VERBOSE LINE PRINTS ITS REGIME IN THE REGIME's FIELD:
src/adaptive.rs, src/tuning.rs, src/bpf/intf.h
- The adaptive arm's per-second line took its regime label last, after the
  graph and oscillator values its format places behind it, so every field from
  the label on printed its neighbour's value. The label is passed where the
  format reads it, and the line prints [HEAVY] graph: n=12 e=66
  cpl=0.12/0.00/0.55 osc: 0.00/469us.
- The [KNOBS] line's mwu= field printed a constant 0.0 for a weight vector the
  loop no longer computes. It is gone, with the comments that still described
  a multiplicative-weight blend.

DOCUMENTATION, THE README CARRIES THE RELEASE's OWN BENCHMARKS AND FOLLOWS THE
CODE: README.md
- The Performance tables carry the shipped tree's two arms at three iterations
  beside EEVDF from the same day's earlier pass on the same boot and kernel.
- Of the 34 cells the six scale tables and the 12C IPC table publish, the
  adaptive arm reads ahead of v5.24.0's on 27, level on 4 and behind on 3
  (mixed p99 at 2C, launch p99 at 8C and the fanout median by 1us), and ahead
  of v5.23.0's on 24, level on 3 and behind on 7. Its wakeup, burst and
  long-run p99 read 13-29us at every width where v5.24.0's read 65-1,808us,
  its deadline misses 0.1% at every width, and its 12C eventfd, sem and fanout
  p99 18us, 21us and 263us against 76us, 82us and 999us. The BPF arm reads
  ahead of v5.24.0's on 24, level on 3 and behind on 7.
- Messaging reads 16.71s on both arms against EEVDF's 15.68s. The energy
  tables carry each run's package temperature in place of a delta against
  EEVDF, whose rows come from the earlier pass: The arm that runs first runs
  hotter, 65.5C against 56.8C on the idle floor, and draws 6% more.
- Every section is read against the code: Dispatch's five steps, the placement
  tiers, the tick's lane preempt and per-CPU bounds, the distance tables by
  what reads them, and wakeup preemption with both cuts. The knob table
  carries standing_targets, waker_leave_ns and phi_base_ns, and References
  gains the twelve works the source cites, [13] to [24].
- The License section reads GPL-2.0-only, the identifier Cargo.toml carries,
  with the copyright: Copyright (c) 2026 Will Clingan.

DOCUMENTATION, THE REFERENCES ARE NAMED WHERE THE CODE USES THEM:
src/bpf/main.bpf.c, src/topology.rs, src/chaos.rs
- The comments name the works the code rests on at the sites that use them:
  Klein and Randic 1993 and Chandra et al. 1989 at the effective resistance
  and the idle search, Nichols and Jacobson's 2012 article beside RFC 8289 at
  the CoDel target, Blumofe and Leiserson 1999 at the steal walk, Marwan et
  al. 2007 at RQA determinism and Lowen and Teich 2005 at the Fano-slope
  Hurst. The idle search's reference line credited Kyng et al. for STOC 2011,
  which is Christiano, Kelner, Madry, Spielman and Teng's.
- Comments only, and main.bpf.c's keep their lines: The compiled object is the
  one the kernels verified, byte for byte.

DOCUMENTATION, THE USER GUIDE's SECOND EDITION: USER-GUIDE.pdf,
PANDEMONIUM-New-User-Guide.pdf, README.md, ROADMAP-STANDING.md, .gitignore
- The New User Guide becomes the User Guide: USER-GUIDE.pdf in the root,
  second edition, written for v5.25.0, 48 pages. The first edition's PDF
  leaves the tree.
- Seventeen chapters where there were thirteen and 9,049 words where there
  were 6,434, each concept ahead of the chapter that rests on it and every
  chapter read against the code as it ships. The Machine's Own Clock and
  Running It are new.
- The two claims the first edition rested on are restated to what the code
  does: The graph gives what no cache table holds, and placement is priced
  wherever a price can stand, the gates that remain named where they fall. The
  history is corrected, from Euler's graph to the storm experiment, which cut
  its preempts from 111k a second to 4.6k.
2026-11-18 06:36:46 -08:00
..
2026-11-18 06:36:46 -08:00