Skip to content

Audit — 2026-11-24 ​

On this page ​

The second pass, over the code the 2026-11-13 audit predates: 164 commits, of which the substance is the extension ecosystem (wallpaper, widget and notification hooks and their shell-side loaders), the OLED batch (the idle dim ramp, the drifting focus border, the drive-budget guard), the runtime config.* setters' late additions, the shell's blur metadata, and the ICC work around the transform the fuzz harness had to itself. Four subsystem sweeps (setters/overlay/save, extension loaders, blur and background effect, vcgt/ColorManagement), every finding traced in the current tree and fixed on this branch — FIXES.md #66–#71, one commit per finding. Ranked by how much a session can lose to each one.

The gate this was audited against: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace, the JavaScript shell suites, and both wpe configurations — all green at 4b75e40c, and the pre-commit hook ran the same gate on every fix commit. Line numbers below are at 4b75e40c, the tree as audited; each finding names the commit that fixed it.

F1 — The vcgt calibration ramp is gated behind the colour pipeline it is documented not to need ​

Crates: crates/viewport. Effort S, risk low. Behavioural.

load_output_icc (state/outputs.rs:995) reads two things from a profile named by outputs.<name>.icc: the vcgt calibration ramp and the display transform. The if !self.cm_enabled early return sits at :1011 — above the crate::icc::vcgt(&bytes) parse at :1048 — so with render:cm_enabled: false the key loads nothing at all: no transform, and none of the calibration. Three contracts say the ramp is independent of the pipeline, and the code contradicts all three:

  • the icc key's own doc, config.rs:52-56: "The vcgt tag is applied as a gamma ramp under whatever a night-light client asks for, which is the one part of ICC support that does not need a colour-management engine";
  • docs/configuration.md:3317-3318, describing exactly this switch: "an ICC profile's transform is not applied — its calibration ramp still is, because that is a KMS gamma ramp rather than part of the pipeline";
  • the comment inside the gate itself (outputs.rs:1012-1015): "the calibration ramp above still applies" — describing a ramp the return sat above.

A user who turns the pipeline off (its documented purpose: no wp_color_management_v1, every client sRGB) silently loses their monitor's calibration with it, and the debug log they get — "the profile's transform is not used" — actively misleads: it says transform, implying the calibration was applied.

How it was verified. Read load_output_icc and both call paths into it (apply_output_config, state.rs:3553-3555, and the reload through config_file_settled); confirmed gamma_vcgt has exactly one writer (outputs.rs:1054) and it is below the gate; grepped every cm_enabled use in the tree and classified each.

Fix. db136d6, FIXES #68 — the ramp is read and stored before the gate, and the gate's own exit programmes it. Pinned by the_calibration_ramp_is_read_before_the_pipeline_gate, the source-order test style the modeset promise in the same file already uses, because neither a profile load nor a ViewportState can be built in a unit test.

F2 — config.save drops five settings the runtime tier announces ​

Crates: crates/viewport. Effort S, risk low. Behavioural.

The saved tier's contract is docs/configuration.md:240-243: settings.json "holds whatever the runtime tier was last asked for... This is what makes a change from the settings panel stick." Five keys arrived after that sentence was written, and the round trip drops all five:

  • game_mode and wallpaper_options have no field on the overlay at all (settings.rs:75-251), so config_save (apply.rs:2422-2508) cannot write them. Game mode is what the config.game_mode setter, the bind and the panel's toggles all move; the wallpaper options are the write-back path the wallpaper-extension section of the settings panel uses — the flow docs/roadmap.md describes as "writing each change back through the new config.wallpaper_options runtime setter".
  • border.animated, idle.dim_after and idle.dim_floor are carried by the wire shapes the overlay already uses (event::Border:1280, event::Idle:1348-1350), so a save writes them into settings.json — but settings::apply copies those blocks with only the fields they carried when it was written (settings.rs:502-512 drops animated, :668-681 drops the dim pair), reading the file correctly and then throwing half of it away. The same dropped-copy disease the motion tree had (the 11-13 audit's F13), caught one key-generation later.

So a panel that sets any of the five and presses Save loses them at the next start, reverting to whatever the hand-written file says.

How it was verified. Enumerated every Request::Config* arm's fields against the overlay struct and settings::apply (a full inventory, one row per setter); read config_save's overlay construction field by field; traced each of the five keys through both halves of the round trip.

Fix. a771866, FIXES #66 — the overlay carries the two missing keys, the merge copies all five. Pinned by every_late_arriving_field_survives_the_overlay and the round-trip assertions in a_saved_overlay_reads_back_whole_through_apply, the twins of the tests that pinned the motion tree's copy of this.

F3 — config.layout_extensions validates the path and then stores the message's own value ​

Crates: crates/viewport. Effort S, risk low. Behavioural.

The socket's ConfigLayoutExtensions arm (apply.rs:1551-1615) runs the config file's own resolver — layout_extension_path (config.rs:1446-1477), which refuses a remote URL, resolves a relative path beside the config file and hands back the file:// URL the shell loads — but only for its error (:1585-1594). The resolved URL is dropped and the message's raw url stored (:1596-1612), which is the exact shape the comment above the loop claims cannot happen: "Resolved beside the config file so the file:// the shell receives is the same encoding both paths produce" (:1560-1563).

A relative path over the socket — the shape the config file takes — reaches the shell as a bare wave.js, and a script.src resolves against the page, not the config directory: the extension never loads, with the same silent could-not-load failure a missing file already logs, for a file that is right there. config.save then writes the raw value into the overlay (apply.rs:2443-2454), a document no path ever resolves again, so every restart after that carries the broken value.

How it was verified. Read the arm against the resolver's signature (it returns Result<String>, not Result<()>); confirmed the stored value is the request's own by reading the event construction; checked no existing test pinned the raw-value behaviour (control_socket.rs pins only the refusals); sent a relative path over the socket and read the announced config event back.

Fix. a805cce, FIXES #67 — the resolver's answer is what is stored. Covered by a_relative_layout_extension_is_resolved_on_the_socket_too (tests/control_socket.rs), which sends wave.js and asserts the event carries file://…/wave.js.

F4 — A profile load never draws the frame that would show the cube it just changed ​

Crates: crates/viewport. Effort S, risk low. Behavioural.

The two halves of a profile move at different speeds: the vcgt ramp is programmed into the CRTC and shows the moment apply_effective_gamma runs (outputs.rs:1061), while the baked cube reaches the screen only through a frame the renderer draws, handed (token, &cube) per frame (udev.rs:3863-3864). Nothing in load_output_icc marks a frame (:1018-1060, no needs_render anywhere in the function), and apply_output_config doesn't either. A config reload that changed nothing but the profile — the reload the call-site comment exists for (state.rs:3548-3551: "so a reload picks up an edited profile") — leaves the two halves of one profile in visible disagreement on an otherwise still desk: the calibration visibly moves, the transform that compensates for it waits for whatever happens to draw next. The reverse has the same shape: a profile that stops describing a transform removes the cube (:1045-1046) while the old cube's pixels stay on screen.

How it was verified. Grepped every needs_render writer and every caller of apply_output_config; confirmed config_file_settled's arms set needs_render only for the keys that changed; traced the cube's consumption to the per-frame render path, which draws nothing unless something asks for a frame.

Fix. ca6a449, FIXES #69 — needs_render is marked when the cube map changes, both directions. Pinned by a_cube_change_marks_a_frame beside the vcgt source-order test.

F5 — Unplugging a monitor orphans the widgets mounted on its bar ​

Crates: data/shell. Effort S, risk low. Behavioural.

The removal loop in outputs.js:208-243 is otherwise exhaustive, each step with its own comment for why: the film is stopped (:211-214), the wallpaper extension cleared (:216-219), the calendar closed (:220-228), the OSD dropped, the notifications rehomed, the overlays forgotten — and then output.el.remove() (:229) takes the bar's widget elements with every custom widget still mounted in them. No widget's destroy ever runs, and unplug is the one removal path that never revisits the element: the bar's re-sync walks only the outputs that remain.

destroy is the hook the contract itself sells (docs/custom-widgets.md:107-111): "It is where a widget undoes anything mount did that outlives the element — a timer, an observer, a live subscription." A widget that took that advice keeps all of it after the monitor goes; a replug mounts a fresh instance (syncCustomWidget's key includes the element's identity) beside whatever the old one left running, compounding per unplug/replug cycle. The wallpaper twin two lines up is cleared for exactly this reason.

How it was verified. Read the whole removal loop and every clearCustomWidget caller (bar.js:954-968, 1001, 1056, 1082, 1091, 1107 — all re-sync paths); confirmed none is reachable from the removal loop; drove the lifecycle from the shell harness with a probe descriptor and counted destroys across an unplug.

Fix. 3e0f7aa, FIXES #71 — the output's widget slots are walked through clearCustomWidget before the element goes. The shell test pins both directions: unplug destroys exactly the instance that went, and the surviving monitor's widget is untouched.

F6 — The typed CLI cannot send three fields the setters accept ​

Crates: crates/viewport. Effort S, risk very low. Not behavioural in the compositor (the arms were always correct; the reach to them was not).

The config.border CLI row lists only radius, width, smart (msg.rs:586) and config.idle only lock_after, blank_after, lock_delay, lock_command (msg.rs:777) — so viewport msg -t config.border --animated true and viewport msg -t config.idle --dim_after 120 --dim_floor 0.25 are refused with "has no field" (msg.rs:1197-1204) before anything is sent, while the compositor's arms have handled all three since they landed (apply.rs:1045 stores animated, :1858-1863 and :1876-1887 store the dim pair) and --raw could always reach them. docs/ipc.md's rows (:221, :250) don't name them either, and the docs that do promise them: docs/configuration.md:357 — "Both keys ride config.idle at runtime like the deadlines."

The drift stayed silent because the check that would have caught it covers types, not fields: the_offered_types_are_the_whole_request_set derives from Request (FIXES #56's fix), but nothing ties a row's field list to the variant — the #56 story one level down.

How it was verified. Diffed every Type's fields against its Request variant's fields (the same sweep that found #56, applied one level down); confirmed the refusal path by reading msg.rs:1188-1207; sent the three fields and read the errors.

Fix. e9eceff, FIXES #70 — all three in the field lists, the hints, and the docs/ipc.md rows, pinned by examples in config_shell_setters_build_their_fields.

Considered and rejected ​

Each was suspected, traced, and cleared. Keeping the list so the next audit does not re-open them.

  • The shell.overlay blur/hits/keep-focus lists bypass the 4096 rectangle cap (frame_barriers.rs:585-600 caps only rects). They cannot: all three are subsets of rects, filtered out of it in the apply arm (apply.rs:432-451), so the cap covers them by construction. The per-frame shell_overlay_blur.contains(rect) (render_frame.rs:716) is O(overlays × blur) but bounded by the same 4096s, and the sender is the trusted shell.
  • config.rules only tightens capture, never relaxes (apply.rs:1704-1717). Deliberate, and the file path is identical (config_apply.rs:178-201): a window with an explicit answer keeps it, and a reload re-resolves through the shell anyway.
  • config.motion's ease is unvalidated over the socket while the file goes through validated_ease. The file's own validation only drops an empty string (config_apply.rs:1508-1515); both paths accept any other text, and the shell owns what it does with --ease. The divergence is an empty-string nit, not a defect.
  • config.idle's lock_command cannot be cleared at runtime. It can: the empty string is the documented take-it-away, the same as the file (lock.rs:70-71, "an empty or whitespace-only lock_command is the built-in screen").
  • config.keyboard and config.input merge over the socket while the file replaces. Documented and deliberate ("Only the fields given change" — docs/ipc.md's setter rows); the file's whole-block apply is the file's own shape, and the overlay's per-key merge is FIXES #14's fix working as designed.
  • The settings overlay's group/opacity/magnify merges write None over file values (settings.rs:574-578, 663-666, 775-778). The overlay is only ever written by config_save from the full merged state, and the file path carries every field into that state (config_apply.rs:355-364 builds all four group fields; :366-386 merges opacity onto the current copy) — so no write can carry None where the file carries Some. The overlay-wins rule is the documented design.
  • The ICC bake runs synchronously on the event loop and every hotplug replays it for every configured head. Bounded: the hostile-profile rules (f5d9d08f) cap CLUT stages at four and clamp NaN, the normal bake is ~75 ms, the profile is a config-named file the user chose, and the alternative (a bake thread) is a larger change than the stall it would remove.
  • vcgt's table-offset heuristic accepts a misread ramp whose top entry is dim (icc.rs:97-102 — the ≥ 30 000 test is a preference, not a requirement, and the offset-20 read is returned as fallback). Every real calibration reaches near full scale — that is what a ramp is — and the heuristic exists precisely because two writer camps disagree about two reserved bytes. A profile dark enough to trip it is not one a monitor shipped with.
  • output_removed leaves gamma_vcgt/icc_cubes keyed by a name that may come back (outputs.rs:232-283 reaps only the client controls). The entries are what restore_gamma needs after a VT switch, and the name-keyed association is the config's own (outputs.<name>.icc): a replug of the same name replays apply_output_config, which re-reads the profile the config names for that name. The one stale case — a config that stopped naming an icc for a name it used to — is the file's own absent-key semantics (no outputs key removal undoes its running state), not a leak anyone promised to collect.
  • The extension loaders have no timeout, and the registries are append-only (commands.js:670-890, state.js:336-497). Deliberate: a manifest script is a file the user named in their config, an infinite loop in it is the page's problem (the compositor's loop is untouched), the registries are bounded by distinct names per page lifetime, and the page reload that clears them is a message the compositor already sends (shell.reload).
  • An extension re-applied while game mode is on is paused only by the CSS class, not its pause hook (commands.js:930-932's comment claims the class covers re-applied ones). True only of JS-driven drift in a hook-declaring extension re-applied mid-game — the comment says so in as many words, the cost is one extension's drift for the rest of the game, and the fix would be three lines in the wrong place (re-calling pause after apply would double-pause CSS-driven ones). Documented behaviour, not a defect.

Compositor licensed under GPL-3.0-or-later · Protocol, shell, bridges and renderer licensed under MIT.