8000 Saturation benchmark: input to present while the machine is busy (ADR 0066) by NateIsern · Pull Request #538 · OxyHQ/OxyOS · GitHub
[go: up one dir, main page]

Skip to content

Saturation benchmark: input to present while the machine is busy (ADR 0066) - #538

Merged
NateIsern merged 7 commits into
mainfrom
perf/saturation-benchmark
Nov 10, 2026
Merged

NateIsern merged 7 commits into
mainfrom
perf/saturation-benchmark

Conversation

@NateIsern
@NateIsern NateIsern commented Nov 10, 2026 •
Copy link
Copy Markdown
Member

perf.py saturation measures what a person waits for while the machine is busy: the time from each input's device time to the first frame that shows it, under eight loads (ADR 0066, decision 1; design in #509). The other steps of ADR 0066 are measured against it.

Interactions: Settings' sidebar scrolled by a touchpad at 60 Hz; the pointer across a window that draws where it is (125 Hz); WindowProbe dragged (125 Hz; late frames counted); twenty keys at ten a second.
Loads: S0 none · S1 a process for every CPU · S2 one process, two threads per CPU · S3 a cold cargo build, again and again · S4 five hidden animating applications + one spinning JavaScript · S5 restic's full first backup + the search index built · S6 110 % of the machine's memory written again and again · S7 another user's processes on every CPU.

How. The run gets a delegated control group and builds a session's machine in it: the backup service's unit with its unit file's settings, the person's logind scope and user manager (OXYOS_CGROUP_FIXTURE), another user's slice, the machine's memory for S6. Application loads are applications the session launches (--also-launch, through oxyos_apps::Launcher), so they run wherever the session puts what it launches. Each load starts 5 s before the input, and its progress is recorded. --check holds every load's p95 to the unloaded p95 plus a refresh (16.7 ms), and a drag to no late frame. Details and commands: docs/performance.mdx, "Saturation".

Baseline on the ThinkPad (today's code, 3 runs, perf-device.sh), p95 ms, unloaded → worst:

  • typing 7.5 → 352 (S6); 27–29 under S1–S3
  • scroll 7.9 → 708 (S5), 115 (S6). The 708 is a real stall, not the harness: the compositor held Settings' GPU buffers for over a second and the host fell back to CPU drawing (no GPU buffer was released within a second), reported for a fix of its own.
  • drag 5.1 → 196 (S3, 6 late frames), 90 (S2)
  • pointer 5.9 → 28 (S2), with only 173–211 of 360 motions answered under S2/S3/S5/S6

Checks. cargo fmt --check, clippy -p oxyos-offscreen --all-targets -D warnings, the new Rust tests (launch parsing, device latencies, load.rs), check-native-boundary.py, test_saturation.py (new, in CI) all pass on seldon. The gate's run of also-launch-paced-typing (new scenario) passed. test_regress.py's test_two_runs_at_once_each_see_only_their_own is flaky on seldon under load, on main too (passed, passed, failed on main's checkout); this PR doesn't touch it.

Fixes since it was first queued (from the forks' first runs):

  • S6's memory hog wrote one byte a page, so its pages compressed to almost nothing and zswap would have made S6 free; each page is now half pseudo-random, half zeros (about 2:1 with lz4, as an application's memory).
  • A run that missed a step's deadline left its --also-launch loads running, holding regress.py's output open (one S6 run waited 22 minutes): the development compositor's session now ends what its launcher started on any exit, and the benchmark ends whatever is left in the run's session scope 3 s after the compositor is gone, and a whole run after 15 minutes.
  • A played rtkit the run's wrapper started (perf-device.sh, whose unit runs under strace's seccomp filter where sudo cannot) is used as it is.
  • S5's backup unit includes what the image's systemd generators write for it (ADR 0066 step 5's efficiency cores); a tree without generators writes nothing.

Needs from #501. perf-device.sh there needs -p Delegate=yes, -p Environment=SATURATION_TOOLCHAIN_HOME=$HOME, and the played rtkit started outside its unit for saturation to run on a device; I'll add them after #501 lands (the forks use a patched copy on the ThinkPad for now).

The original commit-by-commit history: branch wip/saturation-benchmark-history.

🤖 Generated with Claude Code

@NateIsern
NateIsern enabled auto-merge November 10, 2026 01:49
@NateIsern
NateIsern added this pull request to the merge queue Nov 10, 2026
@NateIsern
NateIsern removed this pull request from the merge queue due to a manual request Nov 10, 2026
@NateIsern
NateIsern added this pull request to the merge queue Nov 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
@NateIsern
NateIsern added this pull request to the merge queue Nov 10, 2026
@NateIsern
NateIsern removed this pull request from the merge queue due to a manual request Nov 10, 2026
NateIsern and others added 6 commits November 10, 2026 09:02
… 0066, decision 1)

perf.py saturation (saturation.py) runs four interactions (a list scrolled, the pointer over a
window following it, a window dragged, keys typed) under eight loads S0 to S7 and measures each
input from its device's time (the time it carries, as libinput's would) to the first frame that
shows it, so the compositor's own wait to run is in it. Records p50/p95/p99/max, a drag's late
frames, composing and JavaScript at p95, the compositor turn's wait to run, nice and slice, the
session's and the applications' pressure, and each load's progress (a load yields, not starves).
--check holds every load's p95 to the unloaded one's plus a refresh, and a drag to no late frame.

The run is given a delegated contr
8000
ol group in which it makes a session's machine: the backup
service's unit (its unit file's settings applied as systemd applies them), the person's logind
scope and user manager (OXYOS_CGROUP_FIXTURE), another user's slice, the machine's memory for S6.
An application's load is an application the session launches.

- oxyos-offscreen: --also-launch ID[:minimized],... and --also-launch-lead MS (applications
  started through the session's launcher before the steps, minimized when asked); --type-paced
  HZ TEXT; every paced step's device_latency_ms; --load spin|processes|memory|repeat (load.rs).
- regress.py: also_launch (a development registry of the run's own, "{offscreen}" in Exec),
  type_paced, typed.
- Probes: PointerTrackProbe, LoadAnimationProbe, LoadScriptProbe (sample/SaturationProbe.tsx).
- perf-saturation.sh: the run in a transient system unit, Delegate=yes, on CPUs no gate reserves,
  its slice at CPUWeight 1000, one run at a time. A played rtkit and the accounts' service's seat
  weights are used where the tree has them.
- scenarios/also-launch-paced-typing.json: what it stands on, in every gate run.
- docs/performance.mdx: Saturation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n's do

The memory hog wrote one byte in each page and left the rest zero, so its pages compressed to almost
nothing: zswap (ADR 0066, decision 7) would have made S6 free. Each page is now half a xorshift's bytes
and half zeros, about 2:1 with lz4, as an application's anonymous memory compresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d as it is

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the development compositor ends what it launched on an error

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ors write for it (ADR 0066, decision 6)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…loop variable, pairs of frames)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s usage keeps #529's --signal and this branch's options

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NateIsern
NateIsern added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit a90d943 Nov 10, 2026
10 checks passed
@NateIsern
NateIsern deleted the perf/saturation-benchmark branch November 10, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0