Galaxy Shell / docs

Themes and multipass effects in Smithay

openspec/specs/themes/spec.md · Edit on GitHub ↗

On this page

Themes and multipass effects in Smithay

Purpose

Defines the effect themes of the Smithay compositor: the manifest versions, WGSL passes, workspace transition and window-close slots, and create_theme with user approval. The look of bars, panels and chat is a different setting.

Requirements

Requirement: Theme selection compiles before it persists

Selecting a theme SHALL decode PNGs, send textures to the GPU and compile every listed shader before it persists the selection. If selection or reload fails, the chain already compiled and in use MUST stay active. Full text: section Introduction.

Scenario: Broken shader on select

  • WHEN a theme is selected and one of its shaders fails to compile
  • THEN the selection is not persisted and the chain in use stays active

Requirement: Matugen colors are explicit and bounded

Colors from the wallpaper SHALL be generated only by an explicit operation, with no wallpaper watcher and no automatic CSS import when an effects theme is selected, and the core MUST never download dependencies during a conversation. The path SHALL be absolute, local and a regular file of up to 32 MiB, and the final file cannot be a symlink. Full text: section Colors from the wallpaper with Matugen.

  • WHEN the given wallpaper path is a symlink
  • THEN it is refused

Requirement: Matugen runs isolated

Matugen SHALL receive an empty configuration, cache disabled, --dry-run, hex JSON and deterministic selection of the first color, and MUST NOT load personal configuration, templates, hooks or compositor authority. It has a 30-second timeout and a 1 MiB output limit, and the image is not sent to the model or to a color service. Full text: section Colors from the wallpaper with Matugen.

Scenario: Palette generation

  • WHEN a palette is generated from an image
  • THEN the image is copied to a private temporary directory and not sent to the model

Requirement: Generated palette layer preserves the personal CSS

apply_wallpaper_theme SHALL apply through the React preview, journal, lock and recovery of style.css with a revision from read_ui, and a stale revision or a preview failure keeps the current interface. The generated block sits between the comments agent-native-wallpaper:start and agent-native-wallpaper:end, the rest of the file is preserved byte for byte, and a partially edited block MUST be refused. Full text: section Colors from the wallpaper with Matugen.

Scenario: Stale revision

  • WHEN apply_wallpaper_theme is called with a stale revision
  • THEN the current interface is kept

Requirement: Manifest v1 keys, ids and limits

The manifest SHALL accept only the documented keys. Theme and effect IDs use lowercase ASCII letters, digits and hyphens, 1 to 64 bytes, starting with a letter or digit, the name 1 to 80 UTF-8 bytes, and a manifest can have up to eight effects with distinct IDs. Folders and files MUST be regular, with no symlinks and no absolute, empty, . or .. paths. Full text: section Manifest v1.

Scenario: Ninth effect

  • WHEN a manifest lists more than eight effects
  • THEN it is not accepted

Requirement: Disabled shaders must compile

The shader of a disabled effect MUST also compile for the whole theme to be accepted. Full text: section Manifest v1.

Scenario: Disabled effect with a broken shader

  • WHEN a disabled effect has a shader that fails to compile
  • THEN the whole theme is refused

Requirement: Texture limits and atomic load

A theme SHALL have at most 8 PNGs and 4 bindings per effect, a PNG up to 4 MiB, an encoded sum up to 8 MiB, sides up to 1024 pixels and a decoded RGBA sum up to 16 MiB, and only static PNG is accepted (APNG is refused). The compositor SHALL load all images and shaders, including those of disabled effects, before it switches the theme, and an error keeps the previous runtime. Full text: section Manifest v2 and textures.

Scenario: Decode error

  • WHEN a PNG fails to decode during a theme switch
  • THEN the previous runtime is kept

Requirement: Theme CSS import is explicit

The optional shell.stylesheet SHALL be read only by the shell's authenticated tools and applied to the profile style.css only by an explicit call to import_theme_style with the current revision from read_ui. Selecting a theme MUST NOT import CSS. Full text: section Manifest v2 and textures.

Scenario: Theme with a shell stylesheet

  • WHEN a theme with shell.stylesheet is selected
  • THEN the profile style.css does not change

Requirement: Size limits of theme files

Reading theme.json, all listed CSS/WGSL files and the shell CSS SHALL have an aggregate limit of 512 KiB, the manifest up to 64 KiB and each CSS/WGSL file up to 32 KiB. There is no automatic loading of wallpaper or of images outside the list declared in v2. Full text: section Manifest v2 and textures.

Scenario: Oversized shader

  • WHEN a WGSL file exceeds 32 KiB
  • THEN the theme is refused

Requirement: Effects CSS is a strict subset

The effects CSS SHALL accept one .window rule followed by at most one .window:overview rule, numeric parameters and the supported transitions. Unknown properties and selectors, repeated rules, unsupported timing syntax, geometry-change and mixing shorthand with longhands MUST be rejected. Full text: section Manifest v2 and textures.

Scenario: Unknown property

  • WHEN an effect CSS uses an unknown property
  • THEN it is rejected

Requirement: WGSL is required for effect passes

An effect folder SHALL contain effect.wgsl, a regular file without symlink traversal, nonempty UTF-8, with no NUL, at most 32 KiB, and counted in the 512 KiB aggregate. A pack without it MUST be refused naming the pack directory and effect.wgsl, and the loader ignores effect.frag completely. The one exception is a disabled window-close pass without effect.wgsl, which is skipped. Full text: section Optional WGSL pass (F9 effect ABI v1, since 2026-11-09).

Scenario: Pack with only GLSL

  • WHEN a pack has only effect.frag
  • THEN it is refused with the pack directory and effect.wgsl in the message

Requirement: WGSL error keeps the previous runtime

check, select and reload SHALL compile every effect.wgsl of the theme, including disabled passes, before they publish anything, and a WGSL syntax, entry-point, binding, layout or pipeline error MUST refuse the whole theme while the previous runtime and selection stay. Full text: section Optional WGSL pass (F9 effect ABI v1, since 2026-11-09).

Scenario: Pipeline error in one pass

  • WHEN one pass has a WGSL pipeline error
  • THEN the whole theme is refused and the previous runtime stays

Requirement: Runtime reload validates the whole package

A reload SHALL validate the whole package, including disabled shaders, before it switches the runtime, and an error keeps the previous version. disable applies only to the current process. Full text: section Runtime commands.

Scenario: Reload with an error

  • WHEN the package has an error at reload
  • THEN the previous version stays active

Requirement: create_theme needs the user's approval

create_theme SHALL write a theme from typed values only (no free file paths, unknown keys refused), generated HTML MUST NOT get the tool, and the agent cannot activate a theme without the user's answer on the host approval card. The folder goes to the user themes root, never to the checkout, built-in names are reserved, and textures are not accepted. Full text: section Themes from a description (create_theme).

Scenario: Agent creates a theme

  • WHEN the agent calls create_theme
  • THEN the theme is not activated until the user approves on the host card

Requirement: create_theme takes WGSL only

create_theme SHALL refuse GLSL before anything reaches the compositor: an effects[] item with a fragment key, a shader text with GLSL markers outside comments, and a text that is empty, has a NUL, exceeds 32 KiB or lacks the @vertex and @fragment entry points. Full text: section Themes from a description (create_theme).

Scenario: Fragment key

  • WHEN an effects[] item has a fragment key
  • THEN the call is refused with the message that create_theme takes WGSL

Requirement: create_theme order of one call

One call SHALL run inside one core/changes.js operation of kind theme: the core validates and refuses when the compositor is not connected, theme_check compiles every shader and a compile error ends the run with no card and no change, then the host approval card shows. Esc refuses, "Aprovar e ativar" arms 1.5 s after the card shows, and a refusal, a 120 second timeout or a cancelled turn means no change. Full text: section Themes from a description (create_theme).

Scenario: Compile error in theme_check

  • WHEN theme_check reports a compile error
  • THEN the run ends with no card and no change

Requirement: Only the protected host answers the card

Only the protected host token SHALL answer the approval card, through POST /api/theme/approve with the card id, and the card shows in a modal dialog in the top layer outside the ShadowRoot so profile CSS cannot cover it. Any failure after approval MUST roll the change back from the checkpoint. Full text: section Themes from a description (create_theme).

Scenario: Failure after approval

  • WHEN installing or verifying the theme fails after approval
  • THEN the previous folder and selection are restored

Requirement: Overwrite rules of create_theme

A built-in name SHALL always be refused. A user theme with the same slug MUST be replaced only after the card (marked as a replacement) and only when its folder has exactly the managed layout, and a folder with textures, copied examples, symlinks or other files is refused. Full text: section Themes from a description (create_theme).

  • WHEN the existing folder of the slug has symlinks
  • THEN the replacement is refused

Requirement: Workspace transition package

The workspaceTransition package SHALL contain settings.json, effect.wgsl and shadow.wgsl, and the WGSL pair is both files or none (one file of it is refused). Without the package, or with it disabled, the transition uses the flat slide. Unknown settings.json fields MUST be rejected. Full text: section Manifest v3: workspace transition.

Scenario: Only one file of the pair

  • WHEN a folder has effect.wgsl but no shadow.wgsl
  • THEN it is refused

Requirement: Transition settings bounds

settings.json fields SHALL stay within the documented limits, such as durationMs an integer 80 to 1500, minScale 0.5 to 1 and dim 0 to 0.6, and parallax at most (backgroundScale - 1) / 2. A transition already started keeps its duration, curve and GPU programs until its end. Full text: section Optional WGSL pair (private Linux integration).

Scenario: Reload during a transition

  • WHEN a reload succeeds while a transition runs
  • THEN it takes effect on the next transition

Requirement: Window-close pass contract

window-close SHALL need "version": 4, at most one enabled pass per theme, and bind no textures. The event length is the longest delay + duration of its transitions and MUST be 80 to 1500 ms. The theme pass draws also while the black-hole wallpaper reports a live sink ("O tema vence"); the built-in black-hole close stays only for a theme with no close pass. Full text: section Manifest v4: window slots.

Scenario: Version 3 manifest with window-close

  • WHEN a v1 to v3 manifest declares a window-close target
  • THEN it is refused

Requirement: Only WGSL draws window-close

Only WGSL SHALL draw on a login: an enabled window-close pass with only effect.frag MUST make check, select and reload refuse the whole theme, naming the pack directory and effect.wgsl. A disabled window-close pass without WGSL is skipped. Full text: section Manifest v4: window slots.

Scenario: Disabled pass without WGSL

  • WHEN a disabled window-close pass has no effect.wgsl
  • THEN it is skipped and the rest of the theme loads

Requirement: Window-close WGSL ABI

The window-close WGSL module SHALL use the entry points vs and fs, triangle-list topology, no vertex buffers, one premultiplied RGBA target and no blending, and the layout of @group(0) is fixed: a module that declares another one fails to compile. Version 2 appends three vectors (seed, accent, ink; 144 bytes) and MUST NOT move anything before them. Full text: section Window-close WGSL ABI v2.

Scenario: A version 1 package

  • WHEN an existing close package is checked after the block grows
  • THEN it compiles and draws the same pixels

Scenario: Another group layout

  • WHEN a module declares a different @group(0) layout
  • THEN it fails to compile

Requirement: Reserved parameters ranges

In a window-close pass the compositor SHALL apply the reserved parameters itself within their ranges (--opacity 0 to 1, --scale 0 to 4, --translate-x and --translate-y -4 to 4, --margin 0 to 0.5, --sink 0 to 1, --sink-curve -1 to 1). The names --seed, --accent and --ink SHALL also be reserved: a pack that sets one as a plain parameter MUST be refused at load. A literal outside the range MUST refuse the theme at load. Full text: section Reserved parameters.

Scenario: A reserved color name

  • WHEN a pass sets --seed, --accent or --ink as a parameter
  • THEN the theme is refused at load, because the compositor supplies them

Scenario: Out-of-range literal

  • WHEN .window:closing sets --margin above 0.5
  • THEN the theme is refused at load

Status

Doc status: current contract. create_theme and the default renderer are WGSL only since 2026-11-10 (step 1 of the GLES removal, openspec/changes/archive/2026-11-10-gles-removal-plan/design.md). The effects bridge, the wgpu-effects feature and --effects-backend were removed on 2026-11-10 (step 2 of the same plan). Uncertain: the WGSL theme path says DRM enablement and product parity are pending. --renderer and AGENT_NATIVE_RENDERER were removed on 2026-11-11 (step 6): the renderer is wgpu, and a build without the wgpu renderer has no renderer since step 8 and exits at start. The GLES theme passes and F9 were removed on 2026-11-11 (step 7), and since step 8 the loaders ignore effect.frag and shadow.frag completely (not read, not validated, not counted in the 512 KiB aggregate). The built-in root and the packages office and galaxy landed on 2026-11-12 (theme-packs, phase 3, compositor side). Checked 2026-11-12. Manifest v5 and the three theme opens landed on 2026-11-13 (theme-packs phase 6, steps 6a to 6e); the Node loader web-shell/core/themes.js reads versions 1 to 5, the targets overview-f9, window-close (v4 or v5) and window-open (v5); the 80 to 1500 ms bound of an event is checked by the compositor only.

Introduction

These are the effect themes of the compositor. The look of the bars, panels and chat is the window theme of openspec/specs/ui-themes/spec.md, a different setting.

Direction of 2026-10-29: the F9 view was removed. overview-f9 passes from earlier themes are still read and validated to keep compatibility and offscreen tests, but they have no active visual target in the product. The workspaceTransition v3 package stays applied to transitions. The current overview is the workspace overview, opened by Super+S or a three-finger swipe up; see the decision.

A theme lives in ${XDG_CONFIG_HOME:-$HOME/.config}/agent-native-os/themes/<id>. AGENT_NATIVE_THEMES_DIR can replace the root, but it must be absolute and the same value must reach Smithay and the web shell. The private selection file, active-theme.json, sits next to the themes folder. Selecting a theme decodes PNGs, sends textures to the GPU and compiles every listed shader before it persists the selection. If selection or reload fails, the chain already compiled and in use stays active.

The example in the repository is at native/smithay/themes/studio. Copy the studio folder to the user's theme root. scripts/prepare-project.py includes this folder in the build fingerprint. The shaders elastic, wave and black-flame are independent effects; the theme is named Studio. Black-flame comes enabled in the example. Elastic and wave come disabled.

The shared semantic palette defines the colors used by chat, bar and controls, including the precedence of customizations and Matugen. The profile color of the user (a main color, with the tones picked by the core) sets those colors when no Matugen palette is applied; a Matugen palette wins.

Colors from the wallpaper with Matugen

The optional generator Matugen 4.2.0 extracts light and dark palettes from a local image. The integration uses colors only; components, geometry, typography, animations and effects remain specific to Galaxy Shell. It does not change the wallpaper image or the Smithay effect selection. This operation is explicit, with no wallpaper watcher and no automatic CSS import when an effects theme is selected.

Install once, without sudo:

python3 scripts/setup-matugen.py

On Linux x86_64 the setup script verifies the pinned SHA-256 of the official binary and installs it at ~/.local/share/agent-native-os/matugen/bin/matugen by atomic replacement. --from-source or other platforms use Cargo with pinned version and lockfile. Generation also accepts AGENT_NATIVE_MATUGEN_BIN or matugen on the PATH. The core never downloads dependencies during a conversation.

Through the conversation, ask to generate the colors of a local image. The agent has:

  • read_wallpaper_theme({wallpaper?, mode?}): generates the palette and CSS for inspection, without changing the interface. mode accepts dark (default) or light.
  • apply_wallpaper_theme({wallpaper?, mode?, revision}): generates and applies through the React preview, journal, lock and recovery of style.css. Get revision from read_ui. A stale revision or a preview failure keeps the current interface.
  • remove_wallpaper_theme({revision}): removes only the generated layer, through the same process. It does not require Matugen to be installed.

The given path must be absolute, local and point to a regular file of up to 32 MiB; the final file cannot be a symlink. Without wallpaper, it uses wallpaper.png from the effective profile, without assuming the data directory. The image is copied to a private temporary directory and Matugen receives an empty configuration, cache disabled, --dry-run, hex JSON and deterministic selection of the first color. It does not load personal configuration, templates, hooks or compositor authority. There is a 30-second timeout and a 1 MiB output limit. The image is not sent to the model or to a color service.

The generated layer sits at the start of style.css, between the comments agent-native-wallpaper:start and agent-native-wallpaper:end, with validated metadata and rules in @layer agent-wallpaper. The rest of the file is preserved byte for byte. Reapplying replaces only this block; removing the block restores the personal CSS. Explicit personal declarations, including fixed colors, still win according to the CSS cascade. This can make an area keep its customized color instead of the extracted color. Do not edit the generated block partially: a divergence is refused, without deleting customizations.

Only the known semantic tokens, validated hex colors and the icon mode/contrast derived from the enumerated mode of this block are rebuilt in /theme.css for the protected controls, bar and panels. Personal selectors and CSS stay exclusively in the ShadowRoot. Chat and bar reload the shared sheet when the palette revision changes; quick settings update on the next query/reopen. The preview uses the conversation; the protected controls only get colors after the commit. Recovering an earlier revision also recovers the matching palette, with no second state file that could diverge from the journal. The translucent material keeps its gradients and filters; the backgrounds get the palette colors and keep respecting solid mode and reduced transparency. Earlier Matugen blocks are recognized and adapted for rendering only; saved revisions and CSS are not rewritten. New generations use the shared semantic tokens, with no duplicated color families per component. Elements with their own fixed colors are not automatically recolored. Compositor window frames and shaders do not get an implicit mutation.

Manifest v1

{
  "version": 1,
  "id": "studio",
  "name": "Studio",
  "shell": { "stylesheet": "shell/style.css" },
  "effects": [
    {
      "id": "elastic",
      "path": "effects/elastic",
      "target": "overview-f9",
      "enabled": true
    },
    {
      "id": "wave",
      "path": "effects/wave",
      "target": "overview-f9",
      "enabled": false
    }
  ]
}

Only these keys are accepted. Theme and effect IDs use lowercase ASCII letters, digits and hyphens, between 1 and 64 bytes, starting with a letter or digit. The name accepts 1 to 80 UTF-8 bytes. A manifest can have up to eight effects with distinct IDs. The array order defines the composition order. Each listed folder contains effect.css and effect.wgsl (see Optional WGSL pass below), which the default renderer requires, and optionally effect.frag, the GLSL source of GLES composition only, which stays until GLES is removed (openspec/changes/archive/2026-11-10-gles-removal-plan/design.md, step 7); a folder with neither shader file is refused with the pack directory and effect.wgsl as the missing file; folders and files must be regular, with no symlinks and no absolute, empty, . or .. paths. The shader of a disabled effect must also compile for the whole theme to be accepted.

Manifest v2 and textures

Smithay also accepts v2. V1 stays valid and gets no bindings. In v2, textures lists static PNGs with id, path, filter (linear or nearest), wrap (clamp or repeat) and an optional atlas (columns, rows, frames, fps). Each effect can have textures as a map from the GLSL alias to the listed ID. For {"flame":"n64-fire"}, the shader declares sampler2D u_tex_flame; the compositor also provides u_tex_flame_size as vec2 and, for an atlas, u_tex_flame_atlas as (columns, rows, frames, fps). The alias and all derived names must be unique. CSS cannot use the reserved prefix --tex-*.

Limits: 8 PNGs per theme, 4 bindings per effect, PNG up to 4 MiB, encoded sum up to 8 MiB, sides up to 1024 pixels and decoded RGBA sum up to 16 MiB. The manifest/CSS/WGSL keeps its own separate aggregate of 512 KiB. Files must be regular, with no symlinks, and are read with an effective limit. Only static PNG is accepted; APNG is refused. RGBA, RGB, grayscale and grayscale-alpha become RGBA8 with premultiplied alpha. Repeat requires power-of-two dimensions for GLES2; an atlas uses clamp and sampling with a half-texel margin. The compositor loads all images and shaders, including those of disabled effects, before it switches the theme. A decode, upload or compile error keeps the previous runtime.

The status exposes effects.textureSupport.maxManifestVersion, loadedManifestVersion, loadedCount and decodedBytes. list and inspect validate the manifest, IDs and path structure, without decoding PNGs and without proving GPU compilation. The shell's read_theme_style validates PNG headers, limits and references for the explicit import operation; this is not the same as acceptance by the compositor's decoder/GPU.

The Studio example uses the 6×5 N64 Fire atlas and a separate CC0 turbulence texture. Sources, license, hashes and the atlas transformation are in assets/README.md. After the first installation of a compositor build with texture support, changing a PNG, manifest, CSS or WGSL only needs a reload (GLSL is no longer drawn, step 7 of openspec/changes/archive/2026-11-10-gles-removal-plan/design.md).

The optional CSS shell.stylesheet is read only by the shell's authenticated tools. It is applied to the profile's style.css only by an explicit call to import_theme_style, with the current revision obtained from read_ui. The import uses the React preview and the same journal, lock and recovery flow the shell already uses. Selecting a theme does not import CSS.

Reading theme.json, all listed CSS/WGSL files and the shell CSS has an aggregate limit of 512 KiB. The manifest can be up to 64 KiB and each CSS/WGSL file up to 32 KiB. The compositor reserves up to 32 F9 thumbnails per frame, each up to 320×200 pixels. Each thumbnail uses a pre-composition texture and two ping-pong targets: up to 24,576,000 bytes (23.4375 MiB) of textures in total. In addition, the runtime can keep up to 16 MiB of decoded PNG in the current theme and up to another 16 MiB during a transactional reload. There is no automatic loading of wallpaper or of images outside the list declared in v2.

The effects CSS is a strict subset of parameters and transitions, not browser CSS. It accepts one .window rule followed by at most one .window:overview rule, numeric parameters (--name: number) and transition or the transition longhands supported in CSS window effects. Unknown properties and selectors, repeated rules, unsupported timing syntax, geometry-change and mixing shorthand with longhands are rejected. Parameters become uniforms u_<name>, with hyphens replaced by underscores. Shaders can also read u_time (seconds since compilation) and u_size (thumbnail dimensions in pixels). GLSL is trusted GPU code, not a sandbox; there is no GPU timeout guarantee.

The effects apply only to eligible application thumbnails in the Smithay F9 overview, where the selection click is already consumed. The web workspace overview is separate and is not changed. Application pixels outside F9 stay on the original path. While F9 is open, the compositor recomposes the enabled passes continuously to allow shaders with u_time; disable the theme or the effects to reduce motion.

Optional WGSL pass (F9 effect ABI v1, since 2026-11-09)

An effect folder contains effect.wgsl. Since 2026-11-10 (step 1 of the GLES removal) it is the file that the default renderer requires. Since 2026-11-11 (step 8) the loader ignores effect.frag completely: it is not read, not validated and not counted in the 512 KiB aggregate, so an old pack that has both files loads as before (the .frag beside the WGSL is ignored), and the nine shipped .frag files are deleted (openspec/changes/archive/2026-11-10-gles-removal-plan/design.md). A pack with only GLSL is refused, with the pack directory and effect.wgsl in the message. The one exception is a disabled window-close pass without effect.wgsl: it is skipped, so the rest of the theme loads (the core does the same; the skipped pass is not listed by inspect). effect.wgsl must be a regular file without symlink traversal, nonempty UTF-8, with no NUL, at most 32 KiB, and it counts toward the 512 KiB aggregate. A pack without it is refused with a message that names the pack directory and effect.wgsl ("Effect pack <dir>: effect.wgsl is missing"). A pack with only WGSL is what create_theme writes. (Until 2026-11-11 a build without the wgpu renderer refused it with "has only WGSL, which GLES composition ... cannot compile".) The Studio passes elastic, wave and black-flame ship one, and native/smithay/effects/elastic keeps a copy identical to the Studio elastic pass.

Under the default renderer, check, select and reload compile every effect.wgsl of the theme, including those of disabled passes, and upload the PNGs that those passes bind, before they publish anything. A WGSL syntax, entry-point, binding, layout or pipeline error refuses the whole theme, and the previous runtime and selection stay (the plain scene, native/smithay/src/plain_theme.rs). A build without the wgpu renderer has no renderer since step 8 and does not start, so there is no theme request to answer there. Until 2026-11-10 (step 2 of the GLES removal) a wgpu-effects build compiled the WGSL for the GLES scene through an effects bridge, until 2026-11-11 (step 7) GLES composition drew its GLSL passes and the F9 thumbnail chains, and the reduced fallback scene answered every theme request with one error (FALLBACK_THEME_ERROR) until step 8; the bridge, the feature, --effects-backend, the GLSL passes and that scene were removed (openspec/changes/archive/2026-11-10-gles-removal-plan/design.md).

The ABI v1 uses the entry points vs and fs, triangle-list topology, no vertex buffers, one sample, one premultiplied RGBA target and no blending inside the pass. The fragment covers the whole thumbnail; the example passes take the pixel center from @builtin(position) (top-left origin) and divide it by the size, which matches the v_coords of the former GLSL passes better than a coordinate interpolated over the triangle. Group 0 has an explicit layout:

Binding Resource
0 the source: the window, or the previous pass, as a filterable 2D float texture
1 the source sampler: linear, repeat (the wrap of the former GLES offscreen target)
2 a 208-byte uniform block, below
3 + 2i texture i of the pass, a filterable 2D float texture
4 + 2i its sampler, with the filter and wrap of the manifest

The textures i = 0..3 follow the byte order of their aliases, the same order as the sampler units of the former GLSL passes. A pass without textures has only bindings 0 to 2. The uniform block, in WGSL:

struct Texture { size: vec4f, atlas: vec4f }
struct Params { frame: vec4f, values: array<vec4f, 4>, textures: array<Texture, 4> }

frame is (alpha, u_time, u_size.x, u_size.y). values holds the CSS parameters, at most 16, in the byte order of their CSS names (--flame-glow before --frame-width): the first is values[0].x, the fifth values[1].x. textures[i].size.xy is u_tex_<alias>_size and textures[i].atlas is u_tex_<alias>_atlas (zero without an atlas). Unused slots are zero. The values are the same numbers that the former GLSL pass got as uniforms. The atlas half-texel margin stays the job of the shader, as in GLSL. Valid compilation does not prove that a port draws like its GLSL; the GPU test compares the Studio ports.

Read-only status: effects.overviewF9 reports backend (always wgpu since step 8), wgslPackages (passes with the file), wgslCompiled (passes with a program), wgpuReady, chains, the thumbnails drawn (drawn.wgpu, and drawn.gles, a dead key that is always 0), the fallbacks (glslOnly, busy, budget) and a bounded error. As written at the top, no product view opens the F9 overview today, so the counters stay at zero in a session.

History: the parity of the ported passes with the GLSL passes was measured on an AMD Polaris (RX 560, radeonsi and RADV) through the former effects bridge, whose GPU tests were deleted with it (openspec/changes/archive/2026-11-10-gles-removal-plan/design.md, owner decision 5): at 320x200 and 183x117, elastic and wave differed from GLES by at most 1/255, black flame and the chain of the three by at most 3/255 at the fixed frames, and elastic and wave declare highp when the device has it, as black flame did, because mediump ran at half precision in GLES on that device.

Runtime commands

Use the socket of the running compositor, discovered from the current session:

scripts/smithay-effects.py --socket /path/to/control.sock status
scripts/smithay-effects.py --socket /path/to/control.sock list
scripts/smithay-effects.py --socket /path/to/control.sock inspect studio
scripts/smithay-effects.py --socket /path/to/control.sock select studio
scripts/smithay-effects.py --socket /path/to/control.sock select-builtin galaxy
scripts/smithay-effects.py --socket /path/to/control.sock check studio
scripts/smithay-effects.py --socket /path/to/control.sock reload
scripts/smithay-effects.py --socket /path/to/control.sock disable

Built-in root (theme packs, since 2026-11-12). The folders of native/smithay/themes of the release that is running (studio, office, galaxy, since 2026-11-13 ninja and, since 2026-11-16, lumen) are a second, read-only root. The compositor finds it from its executable (native/smithay/target/release/<binary>, or native/smithay/<binary>) and has no environment variable or file that overrides it; a binary with no such folder beside it has no built-in root. The typed command theme_select_builtin ({"action":"theme_select_builtin","theme":"<id>"}, select-builtin in the CLI) selects a package by id from that root only, with the same whole-package validation and compile as select, and it persists nothing: it never writes active-theme.json, because the core sends it at each connection (and after an unlock, when the connection came while locked) and on each change of uiTheme, which is the source of truth. A package that fails leaves the previous one in place and the request reports the error. A package chosen by hand holds until the next built-in selection or core connection, and reload after a built-in selection reads the built-in root again. The ids of the built-in root are reserved: the profile select refuses a profile folder with the id of a built-in folder, and the built-in command never reads the profile root. Like select, it is refused while the session is locked. office is the flat slide (180 ms, card radius 6) with a window-open pass of 160 ms and galaxy the depth transition (320 ms, radius 28) with a window-close pass of 360 ms and a window-open pass of 320 ms; Office ships no close pass. Since 2026-11-13 the root also holds ninja (theme-packs phase 5): the flat Fusuma slide (160 ms, radius 0) whose card pass draws a 2 px accent line on the leading edge of the arriving workspace (axis_alpha.w), and the Shunshin window-close pass of 280 ms, which draws no marks for a close of a burst (seed.z). Since 2026-11-13 (theme-packs phase 6, step 6e) all three are manifest v5 and ship effects/open (see Manifest v5, The three theme opens). Since 2026-11-16 the root also holds lumen (dock-theme phase 5, the app dock theme): manifest v5 with a window-open pass of 220 ms, a window-close pass of 180 ms and a flat slide of 280 ms (radius 0, no dim or shadow), all on the ease-out cubic-bezier(0.22, 1, 0.36, 1), none scaled by closeMs. Open and close use only reserved parameters (--opacity, --scale, --translate-y as a fraction of the window height: 0.02 and 0.013, about 12 px and 8 px for a window of 600 px) and a shader that draws the window as it is; over the black-hole wallpaper the theme close draws instead of the black hole.

The CLI waits for the requested generation and returns an error if another request replaces it. A successful selection or reload means the requested generation was compiled and applied. A theme with no enabled effects is valid and keeps the rendering chain inactive. disable applies only to the current process; selecting a theme enables it again. To re-enable a pass, edit theme.json and reload the whole package. list and inspect return limited metadata, without GLSL/CSS content. status.enabled means there is at least one enabled F9 pass or workspace transition package. overviewTargetActive indicates that F9 is active with that pass; it does not confirm that a specific thumbnail was drawn.

History (until 2026-11-11): an ignored EGL test of the GLES theme pipeline (egl_theme_pipeline_order_isolation_identity_and_atomic_reload, with its ANOS_THEMES_EGL_* PPM variables) drove EffectPipeline::render_window on a GL context. It was deleted with the GLES passes (step 7): the wgpu scene draws no F9, and the request side is covered by native_wgpu_renderer_theme_requests_compile_wgsl_only, native_wgpu_renderer_theme_requests_compile_a_window_close_pass and native_wgpu_renderer_workspace_theme_reload_is_atomic_and_pins_the_current_flight (wgpu_renderer_workspace_tests.rs). File parsing and validation have regular unit tests.

Themes from a description (create_theme)

The authenticated agent writes a theme from typed values with create_theme. Generated HTML does not get the tool. The agent cannot activate a theme without the user's answer on the host approval card.

Input (no free file paths, unknown keys are refused):

Field Rules
slug [a-z0-9][a-z0-9-]{0,63}. Built-in names are reserved: every folder in native/smithay/themes of the checkout, studio, legacy and the check- prefix.
name 1 to 80 bytes of printable text.
palette Optional. Keys background, surface, control, hover, selection, text, muted, accent, onAccent, border, error, errorSurface, each #rrggbb. They become the shared semantic tokens of the palette in a :root block at the start of shell/style.css.
css Optional CSS for the profile style layer. It must parse with the same check read_theme_style uses, cannot use @import, and the whole stylesheet fits 32 KiB.
effects Optional, up to 8: {id, enabled?, css?, wgsl}. wgsl is the WGSL of the F9 effect ABI v1. css follows the effect CSS subset and defaults to .window {}. Each file is at most 32 KiB. The old fragment key (GLSL) is refused.
workspaceTransition Optional: {enabled?, settings?, effect, shadow}. effect and shadow are the WGSL pair of the workspace ABI v1. settings use the bounds of the v3 table.

At least one of palette, css, effects or workspaceTransition is required. The aggregate stays within 512 KiB. The core always writes manifest v3 and picks the names: theme.json, shell/style.css, effects/<id>/effect.css|effect.wgsl and workspace-transition/settings.json|effect.wgsl|shadow.wgsl. It writes no .frag file. The folder goes to the user themes root (AGENT_NATIVE_THEMES_DIR or the XDG path above), never to the checkout. Textures are not accepted, so an F9 pass has no bindings beyond 0 to 2.

Shaders are WGSL only (owner decision of 2026-11-10, "Só WGSL"; openspec/changes/archive/2026-11-10-gles-removal-plan/design.md). GLSL is refused before anything reaches the compositor, with these messages:

  • an effects[] item with a fragment key: "effect <id>: fragment is GLSL; create_theme takes WGSL and no longer accepts GLSL (openspec/specs/themes/spec.md). Give the shader in wgsl";
  • a shader text that has, outside its comments, #version, gl_FragColor, void main or precision mediump|highp|lowp, or that has a //_DEFINES_ line: "<label> looks like GLSL (<the marker found>); create_theme takes WGSL and no longer accepts GLSL (openspec/specs/themes/spec.md)". A WGSL comment may name GLSL;
  • a text that is empty, has a NUL or exceeds 32 KiB, or has no @vertex and @fragment entry outside its comments: "<label> must declare the WGSL entry points @vertex fn vs and @fragment fn fs (openspec/specs/themes/spec.md)". This JS check is light; the compositor compiles for real in theme_check (step 2 below).

The ABI that a pass must follow, in short (the full text is in the sections the table links): every file has @vertex fn vs (a fullscreen triangle from vertex_index) and @fragment fn fs returning a premultiplied @location(0) vec4f, triangle-list, no vertex buffers, one target and no blending. An effect binds group 0 as 0 the source texture_2d<f32>, 1 its sampler, 2 the uniform Params (frame = alpha, seconds, width, height; values = the CSS --parameters in the byte order of their names; textures, unused here). The workspace effect binds 0 texture, 1 sampler, 2 a uniform of four vec4f (mapping, axis_alpha, limits, card); the shadow binds 0 a uniform of two vec4f (extent_card, radius_strength_alpha). Copy a working pass from native/smithay/themes/studio/effects/wave/ and native/smithay/themes/studio/effects/workspace/ (the CSS, effect.wgsl, settings.json and the shadow) and change the arithmetic. A minimal effect:

@vertex fn vs(@builtin(vertex_index) index: u32) -> @builtin(position) vec4f {
    let positions = array(vec2f(-1., -1.), vec2f(3., -1.), vec2f(-1., 3.));
    return vec4f(positions[index], 0., 1.);
}
struct Texture { size: vec4f, atlas: vec4f }
struct Params { frame: vec4f, values: array<vec4f, 4>, textures: array<Texture, 4> }
@group(0) @binding(0) var source: texture_2d<f32>;
@group(0) @binding(1) var source_sampler: sampler;
@group(0) @binding(2) var<uniform> params: Params;
@fragment fn fs(@builtin(position) position: vec4f) -> @location(0) vec4f {
    let uv = position.xy / params.frame.zw;
    return textureSampleLevel(source, source_sampler, uv, 0.0) * params.frame.x;
}

Order of one call, all inside one core/changes.js operation of kind theme (profile lock, journal, checkpoint):

  1. The core validates the input and refuses when the compositor is not connected.
  2. The core writes the candidate to a staging folder check-<12 hex> in the user root and sends the typed RPC theme_check with that id. The compositor loads the folder and compiles every shader on its active renderer exactly as theme_select does, then drops the result. It persists nothing and keeps the running chain, the selection and the status. A compile error comes back to the agent with the effect id (bounded to 512 bytes) and the run ends here, with no card and no change. The staging folder is removed at once; a crash can leave one, and the next run removes it.
  3. The core shows the host approval card with the theme name, a palette preview and the counts of effects. The host shows it in a modal dialog in the top layer, outside the ShadowRoot, so profile CSS cannot cover it; Esc refuses, and "Aprovar e ativar" arms 1.5 s after the card shows. A refusal, a 120 second timeout or a cancelled turn means no change. Only the protected host token can answer, through POST /api/theme/approve with the card id.
  4. After approval the core installs the folder by writing a temporary folder and renaming it into place, then sends theme_select. The compositor compiles again and persists the selection only if that succeeds. If a shader fails, the current chain stays active and the core returns the compile error to the agent.
  5. The core checks that the compositor reports the new theme and its effect ids, then commits the journal entry.

Any failure in steps 4 and 5 rolls the change back: the previous folder comes back from the checkpoint (or the new folder is removed), the persisted selection is restored when this call changed it, and the core asks for theme_reload so the runtime follows. A crash recovery at startup restores files and selection without the compositor; the runtime follows at the next reload or login.

Overwrite rules: a built-in name is always refused. A user theme with the same slug is replaced only after the card (marked as a replacement) and only when its folder has exactly the layout above, so the checkpoint holds the previous version byte for byte. A folder with textures, copied examples, symlinks or other files is refused. A folder that an older create_theme wrote with .frag files (and no WGSL) still has exactly the managed layout, so it can be replaced, and the checkpoint restores it byte for byte if the replacement fails; it cannot be selected under the default renderer (its pack has no effect.wgsl: see the messages in Manifest v1 and v3), and the replacement has only WGSL. The style layer is not applied to the profile by create_theme; the agent uses read_ui and import_theme_style for that, with their own preview and recovery.

scripts/smithay-effects.py check <id> runs the same compile check by hand on any theme in the user root.

Evidence (2026-10-31): unit tests for validation, orchestration and recovery (web-shell/test/theme-create.test.js), a synthetic core with a synthetic compositor socket (theme-create-http.test.js), and the ignored EGL test effect_pipeline::tests::egl_theme_check_reports_compile_errors_and_a_broken_select_keeps_the_old_chain that compiled a good and a broken shader on a real GL context and showed that the old chain still rendered after the broken check and the broken select (deleted 2026-11-11 with the GLES theme passes, step 7; the wgpu scene covers the request side with native_wgpu_renderer_theme_requests_compile_wgsl_only). The synthetic compositor does not compile WGSL (the evidence above predates WGSL-only create_theme). The running compositor needs the new build (next login) before theme_check exists; an older compositor makes the tool fail with a clear message and changes nothing.

Manifest v3: workspace transition

V3 keeps the v2 effects and textures and allows one optional key:

"workspaceTransition": { "path": "effects/workspace", "enabled": true }

The folder contains settings.json, effect.wgsl and shadow.wgsl (and, for the GLSL pair is ignored since 2026-11-11, step 8). The Studio example includes all five. V1/v2 are still accepted; without the package, or with it disabled, the transition uses the flat slide. There is no internal depth shader as a fallback. The package applies to the whole workspace scene, including web content and applications, with the bar/cursor fixed. It does not change the overview-f9 target.

Optional WGSL pair (private Linux integration)

The same folder can also contain both effect.wgsl and shadow.wgsl. The folder has the WGSL pair (effect.wgsl and shadow.wgsl), which the default renderer requires. The loader ignores effect.frag and shadow.frag completely since 2026-11-11 (step 8): not read, not validated, not counted. The pair is both files or none: one file of it is refused. The files must be regular files without symlink traversal, nonempty UTF-8, with no NUL, at most 32 KiB each, and every file present counts toward the theme's 512 KiB aggregate limit. A folder without the pair is refused, naming the folder and effect.wgsl. The distributed Studio pair (native/smithay/themes/studio/effects/workspace/) is the source of the WGSL workspace pair; the bridge copy that a test compared it with was removed in step 2. A WGSL-only folder loads under the wgpu renderer. (Until 2026-11-11 a build without it refused one with "has only WGSL, which GLES composition ... cannot compile".)

(Until 2026-11-10 a wgpu-effects build compiled the WGSL for the GLES scene; that effects bridge was removed in step 2 of openspec/changes/archive/2026-11-10-gles-removal-plan/design.md, and the GLSL pair was last compiled by the GLES theme pipeline removed in step 7, and the reduced fallback build that answered with one error went in step 8.) Read-only status distinguishes effects.workspaceTransition.wgslPackage from wgslCompiled.

Under the wgpu renderer (openspec/changes/wgpu-renderer-plan/design.md, Phase 3 step 6) there is no GLES pass to fall back to (none draws since step 7), so the WGSL files are required there: check, select and reload compile the WGSL pair of the workspace transition and the effect.wgsl of every F9 pass, enabled or not, before they publish anything, and a theme without them is refused with a message that names the pack directory and effect.wgsl (and shadow.wgsl for the transition), the same for an F9 pass, the transition and window-close (Manifest v4). Before step 8 the loader read an effect.frag and the message said "has only GLSL"; the words "or use --renderer gles" went with the option, step 6 of the removal plan, 2026-11-11. A WGSL error refuses the theme, and the previous runtime and selection stay. The requests, the selection file, the catalog, inspect and the snapshot fields are unchanged. The plain scene draws the depth cards and their shadow of the transition with the same settings; a pass that fails draws the flat slide for the rest of that transition and logs a warning. The F9 passes compile but draw nowhere (no product view opens the F9 overview), and their PNGs are not uploaded.

Workspace WGSL ABI v2 (v1 shaders still bind) uses vs and fs, triangle-list topology, no vertex buffers, one sample, one premultiplied RGBA color target and no blending inside the pass. The vertex shader uses vertex_index to draw a fullscreen triangle; the fragment output is @location(0) vec4f. The example UV origin is top-left. Pipeline layouts are explicit; used resources must fit these group-0 bindings:

Shader Binding Resource
effect.wgsl 0 filterable 2D float source texture
effect.wgsl 1 linear filtering, clamp-to-edge sampler
effect.wgsl 2 80-byte uniform: five vec4f values below
shadow.wgsl 0 32-byte uniform: two vec4f values below

For the card, the vectors are mapping (UV origin.xy and size.zw), axis_alpha (Gaussian axis.xy, alpha.z and, since 2026-11-13, leading in w: in the vertical stage of the arriving workspace card the edge that faces the leaving card, -1 its left edge and 1 its right edge, 0 in every other stage and card, the wallpaper card included), limits (minimum UV.xy, maximum UV.zw), card (nominal width, height, radius, dim) and, since ABI v2 (2026-11-13), accent at byte 64 (the accent of the active mode, linear RGB, alpha 1; see visual_style). The buffer is always 80 bytes, so a v1 shader that declares the first four vectors (64 bytes) still binds and draws the same. The same program runs horizontally at full input size, then vertically into the active card viewport. The horizontal stage uses full UV mapping, source card size and zero radius/dim; the vertical stage maps only the content between the bar strips. Each stage has its own uniform buffer. For the shadow, extent_card holds (shadow width, shadow height, card width, card height), and radius_strength_alpha holds (radius, strength, alpha, reserved). The shadow extends 36 px on every side. Reserved values are zero. Output capacity can exceed the active viewport, whose size follows Smithay's rounded physical geometry.

A runtime pins its compiled pair during an active transition. A successful reload applies to the next flight; textures and their programs remain alive while a scene or an in-flight transfer retains them. Queue/device/GL-stream identity is part of the program contract, not merely texture compatibility. WGSL authors must preserve premultiplication, strip handling and reduced-motion behavior; valid compilation alone does not prove visual equivalence with their GLSL. create_theme writes this WGSL pair since 2026-11-10 (see its section above); this section is the filesystem/package loading contract, with no new model or page authority. DRM enablement and product parity remain pending.

settings.json allows optional fields with these defaults and limits; unknown fields are rejected. Scales, opacity and parallax are fractions; spatial values are output pixels.

Field Default Limits
durationMs 200 integer 80 to 1500
easing [0.33333334, 1, 0.6666667, 1] four cubic-bezier coordinates between 0 and 1
minScale 0.94 0.5 to 1
maxBlur 8 0 to 24
gap 32 0 to 160
radius 16 0 to 64
dim 0.12 0 to 0.6
shadow 0.42 0 to 1
backgroundScale 1.12 1 to 1.4
parallax 0.04 0 to 0.2 and at most (backgroundScale - 1) / 2
backgroundBlur 2.5 0 to 16
backgroundDim 0.18 0 to 0.6

The parallax limit keeps the background covering the output. The tab indicator uses the duration and curve published in effects.workspaceTransition.settings. The duration, curve and GPU programs of a transition already started stay preserved until its end; a reload takes effect on the next transition.

A fragment should keep the #if defined(EXTERNAL) branch that declares samplerExternalOES tex: since clients can share GPU buffers, a YUV buffer arrives as an external texture and a fragment without the branch draws it wrong.

The texture shader uses //_DEFINES_, tex, alpha, v_coords and the uniforms u_axis, u_limits, u_uv_origin, u_uv_size, u_card_size, u_radius, u_dim. It runs in two separable passes: horizontal and vertical. The shadow shader uses u_extent, u_card_size, u_radius, u_strength and the GLSL pixel shader contract of the deleted GLES scene (history: the .frag files are gone since 2026-11-11, step 8; the WGSL pair is the drawn one). See the example sources before changing these programs.

Settings have an 8 KiB limit and each shader 32 KiB, within the 512 KiB aggregate. Paths and files do not accept symlinks. Geometry, input, reduced motion, allocation and GPU budget stay under compositor control. The six temporary targets keep the limit documented in depth of field.

After editing, use scripts/smithay-effects.py --socket /path/to/control.sock reload, discovering the socket of the current session. The reload validates the whole package, including disabled shaders, before it switches the runtime; an error keeps the previous version. There is no need to restart the host, core or compositor to adjust the theme when the compositor with v3 support is already loaded. The first engine update needs a next login; preparing the build does not update the open process.

Adaptation validation: 65 regular Rust tests (nine ignored EGL), explicit run of the depth and workspace reload EGL tests, and Clippy with no warnings, plus format:check, check/build:check and 198 Node tests. The GPU fixture changes JSON and shader, measures the real change in pixels, verifies preservation of the current transition and rejects an invalid shader, out-of-range settings and a symlink without losing the previous runtime. This proof is offscreen, with no new Wayland or Electron session; integrated acceptance on the desktop remains pending until the next login with the new engine.

Manifest v4: window slots

Status: window-close landed on 2026-11-10 (openspec/specs/window-effect-slots/spec.md, phase 2), with the reserved parameters of phase 3, and has a WGSL ABI for the wgpu renderer since 2026-11-10. The other slots of that design are proposals.

Manifest v4 is v3 plus the effect target window-close. A window-close pass is an ordinary effects entry (folder with effect.css, effect.wgsl; an effect.frag is ignored since 2026-11-11) that draws when an application toplevel is actually destroyed, from the last bounded snapshot of the black-hole close (openspec/specs/black-hole-close/spec.md), in the original rectangle of the window:

{
  "id": "dissolve",
  "path": "effects/close-dissolve",
  "target": "window-close",
  "enabled": true
}

Contract:

  • window-close needs "version": 4; v1 to v3 refuse it. A v4 manifest otherwise follows v3 (textures, workspaceTransition, shell). A compositor older than this change answers a v4 manifest with an error and keeps the previous theme.
  • At most one enabled window-close pass per theme (disabled ones still compile). It binds no textures: a textures entry is refused.
  • The CSS has one .window base rule and exactly one .window:closing rule, which may only set parameters that .window declares. .window:overview is refused here, and .window:closing is refused in an overview-f9 pass (also in the legacy AGENT_NATIVE_EFFECTS_DIR package). Each parameter goes from its .window value to its .window:closing value, with the transition of the closing rule or else the one of the base rule. A parameter with no transition jumps to the closing value at once. Values are clamped to -4..4.
  • The length of the event is the longest delay + duration of those transitions and must be 80 to 1500 ms, else the theme is refused ("window-close needs a transition of 80 to 1500 ms"). --progress is reserved.
  • Uniforms: every parameter as u_<name>, u_progress (0 to 1, linear over the event), u_time (seconds since the destruction) and u_size (drawn size in pixels). The shader keeps the premultiplied alpha of the snapshot; start from native/smithay/effects/close-dissolve.
  • Reserved parameters (phase 3, below).
  • check, select and reload compile the pass with the others before the swap, so a broken shader keeps the old runtime. A flight pins the pass it started with: a reload applies to the next close.
  • Precedence ("O tema vence", 2026-11-13): the enabled window-close pass of the active theme draws also while the black-hole wallpaper reports a live sink, at the placement that the sink gives it (--sink, --sink-curve); with no live sink it draws in place (no travel). The default close stays only for a theme with no close pass: the pass of the base pack while the sink is live, else the Rust black hole (below, The base pack). The same bounds and skips as the built-in flight apply (locked, overview, reduced motion, workspace transition, Canvas lens; at most eight snapshots of 1024x768).
  • Timing: the pass lasts the longest delay + duration of its CSS transitions (80 to 1500 ms). The closeMs of the motion timing (openspec/specs/motion-timing/spec.md) sets only the default close (the base pass and the Rust one) and does not stretch a theme pass, as it does not change a workspace transition package.
  • Renderers: the plain scene of the wgpu renderer draws it from effect.wgsl (the window-close WGSL ABI v1, below). Until 2026-11-11 the GLES scene drew it from effect.frag too; that pass was removed (step 7 of openspec/changes/archive/2026-11-10-gles-removal-plan/design.md). Only WGSL draws on a login (owner decision of 2026-11-10, "Só WGSL"): a theme made for GLES whose enabled window-close pass has only effect.frag no longer loads under the default renderer. check, select and reload refuse the whole theme, its workspace transition included, with a message that names the pack directory and effect.wgsl, and the previous runtime and selection stay. To keep such a theme, add the effect.wgsl or set the pass to "enabled": false: a disabled window-close pass without WGSL is skipped, never drawn and not listed among the compiled passes, and the rest of the theme loads. A WGSL error refuses the theme with the prefix window-close effect <id> effect.wgsl. The capability capabilities.windowEffectSlots lists ["window-close", "window-open"] (since step 6a of theme-packs phase 6, 2026-11-13), and effects.windowEffects.close and .open are {id, durationMs, source} or null. effects.textureSupport.maxManifestVersion is 5.
  • New exposure: before manifest v4 the only package GLSL that the compositor compiled was an overview-f9 pass, which no product view draws. A window-close pass runs its fragment shader on the screen at every application window close. The paths that select a theme are the same (the protected settings, a create_theme proposal approved by the user, and the control socket through scripts/smithay-effects.py), but the control socket takes select and reload from any process of the user, and the themes live in ~/.config/agent-native-os/themes, which execute_command can write. So a package can reach the screen with no approval of the protected host: the approval covers only create_theme, which generates overview-f9 passes only (in WGSL). There is no draw-time GPU budget or watchdog either: the size limits bound the source, not the run time, of a shader drawn on a quad up to the window grown by --margin and --scale (up to 8 times its width and height, clipped to the output). Whether select should refuse packages outside an approved path was decided on 2026-11-10 (yes, with approval in the protected host; not built) (openspec/changes/window-effect-slots/design.md, Open questions); see openspec/specs/self-maintenance/spec.md, What a job can still reach.

Manifest v5: window-open (step 6a of theme-packs phase 6, 2026-11-13)

Manifest v5 is v4 plus the effect target window-open, drawn from the first committed buffer of an application window in place of the Rust reveal of the window finish.

  • window-open needs "version": 5 (v1 to v4 refuse it), at most one enabled pass per theme, and binds no textures. The CSS has one .window:opening rule that sets only parameters that .window declares: each parameter goes from its .window:opening value to its .window value, with the transition of the opening rule, else the one of .window. The event lasts the longest delay + duration and MUST be 80 to 1500 ms. A package with only an open pass is valid. A disabled open pass without effect.wgsl is refused (only a disabled close is skipped).
  • The pass uses the block of the window-close ABI v2 (below): event.x is the open progress, event.zw the current size, seed the open seed and seed.z 1 for an open that starts less than 333 ms after another (a record of its own, apart from the closes), accent and ink as of the first buffer. The reserved parameters and names are those of window-close; --sink and --sink-curve have no effect on an open.
  • The clock of a window starts at its first committed buffer and pins the pass, its length, its event and its time scale: a reload or a theme change mid-open leaves them. The pass draws from the live window at its current placement in the plain scene of each output (the clock is the window's, each output has its own target); a resize or a move follows. Previews, overview cards, the canvas cache, warp groups, captures and the close snapshot draw the finished window. Only main windows (not meta.shell, no parent) take a theme open; a dialog takes the base open (below). Declared windows and windows that cover an output get no open. At most eight windows draw an open pass at once (fixed at the map; above it the Rust reveal); a target above 8M pixels or 8192 on a side renders smaller and is stretched. A pass that fails or whose renderer is gone leaves the Rust reveal for the rest of that open.
  • The base pack (step 6c, 2026-11-13): native/smithay/themes/base is a built-in package (manifest v5, effects/open) that holds the default open: the noise-threshold dissolve of finish_shade as a pass, 700 ms, over the shape that the alpha of its source gives it, the glow and the contour taken from accent (the glow is the accent, the contour the accent towards white by 35%, as the visual style sets them). It is no theme: it has no entry in core/ui-themes.js, base is refused by name everywhere, and the compositor loads it from the built-in root at the moments that load the active theme (the start, a selection, a reload), keeping the last good one when a load or a compile fails and dropping it when the folder is gone. Precedence of the window-open slot, chosen at the first committed buffer and pinned with the clock: the enabled pass of the active theme for a main window, else the base pass (which a dialog always takes), else the Rust reveal (a shell window, the cap, no base loaded, the effects turned off). A base pass is scaled by the motion speed of the profile: its length is 700 ms times closeMs / 400, within 80 to 1500 ms, read at the map; a theme pass is never scaled. The base open reads no seed and takes no part in the open burst. The Rust reveal stays as the failure fallback, and a test of the repository keeps the two within 2/255 per channel (the measured maximum is 1/255). The snapshot reports effects.windowEffects.open as {id, durationMs, source} with source theme or base (the scaled length for base); a base open alone does not make effects.enabled true.
  • The three theme opens (step 6e, 2026-11-13; native/smithay/themes/{office,galaxy,ninja}/effects/open, all manifest v5, all drawn in the ABI v2 block, none scaled by closeMs):
    • office: a fade and a scale in 160 ms, with no shader work. --opacity goes from 0 to 1 in 130 ms and --scale from 0.95 to 1 in 160 ms, both reserved parameters that the compositor applies; the shader draws the finished window.
    • galaxy: a point of light that grows into the window, 320 ms, the Galaxy close played backwards. --grow (own, 0 to 1) and the reserved --opacity (0 to 1) run in 320 ms, the growth on the curve of the close mirrored in time and the fade quicker; the light is the same soft core and halo, and at --grow 1 the output is the window.
    • ninja: the Shunshin close in reverse, about 200 ms in three beats, with the seed, the accent and the ink of ABI v2. Zanzo, 0 to 110 ms (the slash and the streaks stand where the window will be and burn out; they come in over the first 12 ms, so no mark pops at the first frame); dash, 36 to 100 ms (the window arrives from 1.10 with its two ghosts and its smear closing up and focus lines going out); tame, from 100 ms (it settles under 1 and back, its edge lit in the accent and fading). The parameters are the reserved --margin (0.25), --opacity and --scale and the own --arrive, --edge, --lines, --slash, --smear and --split, each going from its .window:opening value to its .window value; at the end of the event the window is unchanged. An open of a burst (seed.z) draws no marks, no split and no smear. The length of a theme pass is the longest transition of its CSS, so the snapshot reports 160, 320 and 200 ms as {id: "open", durationMs, source: "theme"}. The package of the shipped themes can be read as examples of an open pass with and without a shader.
  • The base close (step 6d, 2026-11-13): base holds effects/close beside effects/open, the black-hole bend and fade of black_hole.wgsl (the same maths as black-hole-core.wgsl) as a window-close pass of 400 ms. It declares no reserved parameter: the rectangle is placed by black_hole::placement of the compositor, so a base flight is the very flight of the Rust close. Precedence of the window-close slot, chosen at the destruction and pinned with the flight: the enabled pass of the active theme (sink or not), else the base pass only while the wallpaper reports a live sink (with no sink the window closes at once, as before), else the Rust black hole (no base loaded, the effects off, or the sink with no base pass). The sink rule, the target, the lease and the placement stay in Rust. The base flight lasts 400 ms times closeMs / 400 (that is closeMs), read at the destruction, and its pass runs at 400 ms over that length, so it ends with the close; a theme pass is never scaled. A base pass that fails leaves the Rust black hole for the rest of the flight, which draws only while the sink is live (the sink gone ends the flight); a theme pass that fails ends the close at once with no effect. The Rust close stays as that fallback, and a test of the repository keeps it and the base pass within 2/255 per channel toward a fixed sink (the measured maximum is 1/255). The snapshot reports effects.windowEffects.close as {id, durationMs, source} with source theme or base (the scaled length for base). It names the pass that a close would take, so a base close is reported also while the wallpaper reports no sink, when a close ends at once; a base close alone does not make effects.enabled true.
  • An open that falls in a skip ends there (step 6b, 2026-11-13): a workspace transition, the overview, the session lock, the canvas lens, a hidden workspace or a window that no output shows (off camera), a window that covers its output or becomes full screen mid-open, or reduced motion (workspace_motion off). Its clock is spent, so the window shows its final state at once and never resumes a partial open, for a pass and for the Rust reveal. A spent window frees its slot of the cap of eight and no longer holds the wallpaper suspend. Reduced motion is workspace_motion told off; a compositor that no core has told yet has motion on for the open (the camera transition keeps its own default). The skips that read the placement wait for the first layout pass after the map, and a window that covers its output is judged once, at that pass: it includes the Immersive covering application (the Grid maximize), not only real full screen, and a first buffer that grows to cover the output later keeps its open, while a real full screen mid-open still ends it. A window is not spent as off camera while the camera of its workspace flies; it is judged once the camera has settled.
  • Until tasks 2.1 and 2.2 of window-effect-slots (approval of packages) are built, a package in the profile themes directory can draw an open on application windows, every frame of it, with no approval, as a close; the cap of eight is the only bound.

Window-close WGSL ABI v2

The WGSL twin of the GLSL pass, for the plain scene of the wgpu renderer. It is the F9 effect ABI v1 (above) with the uniform block of the GLSL pass, and since 2026-11-13 version 2 of the block. The entry points are vs and fs, triangle-list topology, no vertex buffers, one premultiplied RGBA target and no blending, so the module brings its own full-screen triangle. The layout of @group(0) is fixed, and a module that declares another one fails to compile:

struct Params { frame: vec4f, event: vec4f, values: array<vec4f, 4>, seed: vec4f, accent: vec4f, ink: vec4f }
@group(0) @binding(0) var source: texture_2d<f32>;
@group(0) @binding(1) var source_sampler: sampler;
@group(0) @binding(2) var<uniform> params: Params;

A version 1 module declares struct Params { frame: vec4f, event: vec4f, values: array<vec4f, 4> } (96 bytes) and keeps compiling and drawing the same: nothing before the new vectors moved, the buffer is always 144 bytes, and a binding may be smaller than its buffer. The three shipped packages (close-dissolve, close-flip, black-hole-close) and the galaxy close are v1; the ninja close (Shunshin) is v2 and reads the seed, the burst flag and both colors. A window-open pass (manifest v5) uses the same block, with event.x the open progress.

source is the snapshot of the window at its own size (premultiplied alpha), and the sampler is linear with REPEAT, the wrap that the former GLES snapshot textures kept. The block is 144 bytes, written by plain_close::block (the first 96 are the block of version 1):

Field Value
frame.x the alpha of the element: --opacity as the compositor applies it (alpha of the GLSL)
frame.y u_time, seconds since the destruction
frame.zw the width and height in pixels of the target that the pass covers: v_coords of the GLSL is position.xy / frame.zw
event.x u_progress, 0 to 1, linear over the event
event.y u_inset
event.zw u_size, the size in pixels of the drawn rectangle
values[i / 4][i % 4] the i-th parameter of the CSS in the byte order of its names (so values[0].x is the first name in byte order), reserved ones included, as the shader gets them in GLSL; zero after the last one
seed.x version 2, byte 96: the 32 bits of a per-event u32, to read with bitcast<u32>(params.seed.x); a new one for each flight (a hash of the window, the time and a counter) and the same on every frame of it
seed.y the same u32 mapped to [0, 1) (its high 24 bits over 2^24)
seed.z 1 when the close is part of a burst (it started less than 333 ms after the close of another window; a window on several outputs answers the same on each), else 0, since 2026-11-13; seed.w is zero
accent version 2, byte 112: the accent of the active mode, linear RGB, alpha 1
ink version 2, byte 128: the text color of the active mode, linear RGB, alpha 1
  • A pass draws the whole target, so the fragment reads its pixel center from @builtin(position) (top-left origin) as the F9 examples do, and the result is premultiplied: multiply the color by frame.x, as the GLSL multiplies by alpha. Sample with textureSampleLevel so the control flow may branch.
  • frame.zw equals event.zw unless the rectangle is larger than 8,388,608 pixels or 8192 on a side (--scale and --margin allow up to 8 times the window): then the pass covers a smaller target and the frame stretches it back, so use frame.zw for the coordinates and event.zw for anything measured in pixels (the 12 px blocks of close-dissolve).
  • accent and ink come from visual_style (the accent and the text color of the system mode, light or dark, the Matugen palette when applied; docs/smithay-development.md, Visual style from the core). Before the core sends it, or from a core that sends no ink, the accent is the sage tone of before and the ink is white over a dark background and near black over a light one. They are linear RGB: a shader that mixes them with a sampled window (premultiplied, as the source gives it) works in the same space.
  • The same placement as the former GLES pass applies: the compositor moves, scales and crops the rectangle, and the drawn target is that rectangle. No theme texture binds.
  • native/smithay/effects/close-dissolve, close-flip and black-hole-close ship an effect.wgsl that was translated line by line from their effect.frag. History: measured against the GLES scene on a Vulkan RX 550 (openspec/changes/wgpu-renderer-plan/design.md, Phase 4, The window-close slot, ported) at most 2/255 per channel; that scene and the .frag files are gone (steps 7 and 8), so no reference of the translation remains.

Reserved parameters

Only in a window-close pass (an overview-f9 pass reads every name as a plain parameter, except the names that no pass can set, below), the compositor applies these parameters itself, and also passes them to the shader as u_<name>:

Parameter Meaning Range Neutral
--opacity multiplies the alpha of the drawn element 0 to 1 1
--scale scales the drawn rectangle about its center 0 to 4 1
--translate-x, --translate-y moves the center, in fractions of the window width and height -4 to 4 0
--margin grows the drawn rectangle on every side, in fractions of the window size 0 to 0.5 0
--sink the fraction of the way of the window center toward the wallpaper sink 0 to 1 0
--sink-curve sideways offset of that way, in fractions of the distance to the sink -1 to 1 0
  • Reserved names (2026-11-13, window-close ABI v2): --time, --size, --tex-*, and now --seed, --accent and --ink cannot be set as parameters in any pass: the load refuses the pack with "parameter '--seed' is reserved for a built-in shader uniform". The compositor supplies the seed and the two colors in the block (above), the limit of 16 parameters is unchanged, and no shipped package used these names. A profile pack that did is refused at load with that diagnostic.
  • A literal outside the range, in .window or .window:closing, refuses the theme at load. A curve may overshoot: each frame clamps the sampled value to the range, and the shader gets the clamped value. A parameter that the package does not declare is neutral and costs nothing.
  • Each frame draws the last place of the window with its center moved by translate * size, at size * scale * (1 + 2 * margin) (at least 1x1). The compositor crops to the output; no opacity or a rectangle wholly off the output draws nothing. Input and the client geometry are untouched (the window is already destroyed).
  • --sink and --sink-curve need a sink target in the frame: the point of the black-hole wallpaper, in the coordinates of the output. With d the vector from the center to the target, the center becomes c + d * sink + perp(d) * curve, perp(d) = (-d.y, d.x), before --translate-*. Without a target both do nothing. Since 2026-11-13 a window-close flight has a target whenever the wallpaper sink is live: the theme pass wins over the default close (owner decision "O tema vence"; the default close draws only when the theme has no close pass; openspec/specs/window-effect-slots/spec.md, note of 2026-11-13). Until then the built-in close kept the sink and a package that set them was inert in the product (history). native/smithay/effects/black-hole-close is the Rust close as an example package (400 ms, --sink, --sink-curve, --scale and the shader of black_hole.wgsl); its curves approximate black_hole::placement within 2 px, and the base close takes the placement from the compositor instead (The base close, above).
  • Opacity is the alpha of the element itself, which reaches the shader as the alpha uniform: keep color *= alpha as in the examples, and it works even if the shader ignores u_opacity.
  • u_inset is always provided: margin / (1 + 2 * margin), 0 without a margin. The window content occupies v_coords from u_inset to 1 - u_inset of the drawn quad. A package that declares --margin must remap, uv = (v_coords - u_inset) / (1.0 - 2.0 * u_inset), and output transparent outside 0 to 1. Use highp (GL_FRAGMENT_PRECISION_HIGH) for the remap, as the examples do, or the large quad shows seams.
  • Rotation and perspective stay in the shader, with a package's own parameters. native/smithay/effects/close-flip flips the window around its vertical axis (--flip, in turns, 0.5 is a half turn) with perspective, lifts it with --scale, fades it with --opacity and uses --margin: 0.25; at progress 0 it equals the live window. Install it like the example below, with close-flip in place of close-dissolve.
  • Under wgpu the examples draw from their effect.wgsl; a package that you write needs one too (copy the three folders' files as a start), or select refuses it there.

Install and try the example in a profile, then reload as in Runtime commands:

mkdir -p ~/.config/agent-native-os/themes/closer/effects
cp -r native/smithay/effects/close-dissolve ~/.config/agent-native-os/themes/closer/effects/
# the folder holds effect.css, effect.wgsl (drawn); an effect.frag would be ignored
printf '%s' '{"version":4,"id":"closer","name":"Closer","effects":[{"id":"dissolve","path":"effects/close-dissolve","target":"window-close","enabled":true}]}' > ~/.config/agent-native-os/themes/closer/theme.json
python3 scripts/smithay-effects.py --socket /path/to/control.sock select closer

Matugen integration evidence (2026-10-29)

The official Matugen 4.2.0, with SHA-256 checked, generated the real palettes of a synthetic PNG image. The private installer was exercised in a temporary directory. Formatting, check/build:check and 212 Node tests passed after integration with the current main. The tests cover isolated generation, limits, invalid colors, symlink, exact preservation of the personal CSS, reapplication, removal, stale revision, preview rejection, persistence, restoration and history continuity. The HTTP proof uses synthetic OpenCode and Matugen, with no provider: the shared sheet only changes after authenticated acceptance. The Electron policy allows only the local module and the bounded palette revision query, keeping the refusals of external URLs.

In the browser, a core with testEnvironment, with no real socket, used the real Matugen and a synthetic OpenCode transport. Light and dark, bar, conversation and send controls were inspected. An explicit accent customization #d38fca and a width of 620 px stayed after generating another palette; the shared accent changed independently. Removing the layer restored the default shared accent, preserving the personal color, the width and the eight synthetic messages. The light variant revealed fixed glass backgrounds that were fixed with color tokens, keeping the effects and the solid fallback.

This is proof from the browser and an isolated core. It did not start an additional Electron or compositor, did not send an image or conversation to the provider and did not validate physical control of the system. Publishing the sources, preparing the active checkout and activating the runtime are separate steps. The new tools need an updated core; the new asset policy needs an updated Electron host. Applying a real palette to the user's profile remains an explicit operation through the conversation, with preview and recovery.