serval is a prototype web engine derived from Servo, inspired by Blitz, and rebuilt on the Linebender ecosystem (vello, parley, peniko, kurbo, taffy). It keeps Servo's Rust foundation and the Stylo CSS cascade, while removing the SpiderMonkey scripting stack and the heavy multiprocess Servo subsystems, then layers its own modular layout, scripting, and rendering paths on top.
The workspace is a development monorepo, not a published library set. Every
crate is publish = false. The default workspace member is ports/pelt, a
reference browser and validation viewer (the serval-side analogue of
servoshell).
Made with AI
- Scripting. SpiderMonkey (
mozjs) and the SpiderMonkey-backedcomponents/script/script_bindingsare deleted from the build graph (cut 2026-05-20; git history is the reference for the eventual rebuild). Scripting is now an engine-neutral seam (script-engine-api) with pluggable backends: Nova (script-engine-nova, the primary native engine, 64-bit only), Boa (script-engine-boa, pure Rust, the wasm backend and conformance oracle), and Piccolo (script-engine-piccolo, a stackless-Lua option backend for mod-scripting). Seedocs/2026-05-20_serval_script_engine_plan.mdanddocs/2026-05-25_js_execution_strategy.md. - Layout.
serval-layoutis a profile-neutral engine that consumes anyLayoutDom-shaped DOM and emits aServalPaintList. Its box tree is laid out by Taffy throughstylo_taffy, styled by the Stylo cascade, with text shaped by parley. Seedocs/2026-05-17_serval_layout_planes_architecture.mdanddocs/2026-06-16_serval_layout_roadmap.md. - Rendering. serval emits a paint list that netrender (a vello-based
renderer in a sibling repo) lowers into a
netrender::Scene. The lowering and paint-list contract crates (paint_list_api,paint_list_render) live in the netrender workspace; serval is a consumer. - Crypto / build environment.
aws-lc-rswas removed so the default build needs no NASM. The in-processipc-channelfork drops the multiprocess IPC transport, which serval's single-process embedding does not use.
components/ engine crates (layout, rendering, DOM providers, script engines, shared traits)
ports/ runnable hosts and the WPT runner (pelt, pelt-core, pelt-desktop, serval-wpt)
examples/ standalone smoke binaries (netrender_smoke)
docs/ dated design docs and plans (current state lives here)
support/ vendored patches (taffy, gpu-allocator, ipc-channel) and profile-gate scripts
tests/ unit tests and the vendored web-platform-tests checkout (tests/wpt)
resources/ bundled runtime resources (UA assets, fonts, prefs)
serval-layout— profile-neutral layout engine; styled DOM to fragment tree toServalPaintList. The engine of the project (~21k LOC across 27 modules,box_tree.rsis the core).serval-render— host render-driver: aScriptedDom/LayoutDomtonetrender::Sceneassembly (cascade, layout, paint emit, scene), plus host spatial queries (hit-test, fragments, caret / selection rects) and accessibility-tree emission. GPU-free; separate from presentation.serval-static-dom— script-free static DOM provider for the low profiles.serval-static-html— static HTML profile witness for the profile ladder.serval-scripted-dom— mutable scripted-DOM provider (LayoutDom+LayoutDomMutover aNodeIdarena, recordingDomMutations for layout invalidation).serval-scripted— the scripted tier: binds a script engine toserval-scripted-domso JS mutates the DOM viaNodeIdreflectors.serval-winit-host— shared serval-on-winit plumbing: a wgpu surface + netrender renderer (boot / resize / rasterize / acquire) and winit-to-serval input mapping. Consumed by pelt and by sibling hosts.script-engine-api— engine-neutral scripting backend contract (names capabilities only; engine-native types stay inside each backend).script-engine-nova/script-engine-boa/script-engine-piccolo— the three backends behind the seam.script-runtime-api— browser host surface (global scope,console,location,localStorage,window.history,element.style,getComputedStyle) built on top of the engine-neutral VM primitives.xilem-serval— axilem_corebackend that diffs a Xilem view tree into serval's mutableScriptedDom.xilem-coreis a vendored verbatim mirror of upstream xilem'sxilem_coreso a bare clone needs no fork checkout.serval-layout's neighbors:paint,xpath,webgl-wgpu,webgl-essl,webgpu,webxr,fonts,media, plus the inherited Servosharedtrait/api crates.
pelt— the reference browser / validation viewer. Default workspace member; plaincargo build/cargo runtarget it.pelt-core— host-shell core contracts (chrome, platform integration, protocol UI, automation routing, kept distinct from the hosted engine).pelt-desktop— desktop host contracts (winit windows, input translation, native dialogs, present backends).serval-wpt— serval-native web-platform-tests runner over a selectable subset oftests/wpt. Phase 1 is a crash-smoke (load each test throughserval_static_dom::parse+serval_layout::render, no GPU, no JS).
serval builds with cargo on the pinned toolchain (rust 1.95.0, set by
rust-toolchain.toml; rustup applies it automatically). The default member
set builds on a stock Windows toolchain (no NASM, MOZILLABUILD, clang-cl, or
vcvars).
# Build the default member (pelt).
cargo build
# Open the serval-native on-screen document viewer.
# Accepts file://, a bare path, and data: URLs out of the box.
cargo run -p pelt -- --engine static <url-or-file>pelt is feature-gated by profile. The default features are
viewer-netrender. Additional run modes:
# Chrome demo: wrap the viewer in a xilem-serval omnibar + back/forward strip.
cargo run -p pelt --features chrome -- --chrome <url>
# Tile demo: split the window into per-document tiles.
cargo run -p pelt --features tiles -- --tiles <url>...
# Scripted profile (V4): run a page's inline <script> on a JS engine and
# render the mutated DOM. Boa by default; add scripted-nova for Nova.
cargo run -p pelt --features scripted -- --engine scripted <file>
cargo run -p pelt --features scripted-nova -- --engine scripted <file> --js nova
# Headless reftest harness (V3): GPU-free scene snapshot, or a PNG with
# the png-reftest feature.
cargo run -p pelt -- --engine headless --out <file>.scene
cargo run -p pelt --features png-reftest -- --engine headless --out <file>.png
# Remote (http(s)) loading is opt-in behind the netfetch feature.
cargo run -p pelt --features netfetch -- --engine static https://example.com
# Present-backend smokes (platform-gated):
cargo run -p pelt --features windows-present -- --windows-present-smoke
cargo run -p pelt --features macos-present -- --macos-present-smoke
cargo run -p pelt --features linux-present -- --wayland-present-smokepelt --help lists every profile, flag, and smoke runner.
Note: --engine viewer (the Masonry-era CPU-readback Xilem viewer) was retired
2026-06-12; --engine static is the live on-screen viewer.
# Workspace unit/lib tests (serval-layout carries ~205 inline tests).
cargo test --workspace
# WPT crash-smoke over a subset of tests/wpt.
cargo run -p serval-wpt -- run <subset> # e.g. css/CSS2/floatsCapabilities are tiered so each build pulls only what its profile needs (see
docs/2026-05-12_serval_profile_ladder_plan.md). pelt exposes the tiers as
--engine modes: static (on-screen document viewer), scripted (live,
script-driven DOM), and headless (GPU-free snapshot / reftest harness). The
browser and viewer profile names are accepted by the CLI for compatibility.
Active prototype. The current state of each subsystem is tracked in docs/,
named by date; the most recent docs are authoritative. Notable anchors:
docs/2026-06-16_serval_layout_roadmap.md— the layout-engine map and the two open threads (real-web layout fidelity; element view + scripted tier).docs/2026-06-14_engine_capability_audit.md— the current hit-testing and browser-readiness capability ledger, grounded against file:line.docs/2026-05-16_workspace_audit_snapshot.md— workspace shape, the SpiderMonkey re-enable cost, and the dead-on-disk component list.
Layout, hit-testing (including inline boxes and pointer-events), document and
nested element scrolling, selection / caret / find-in-page, focus and Tab order,
and the external-texture element view are landed and tested. Open threads
include real-web layout fidelity (UA stylesheet, tables, float text-wrap,
engine-rendered form controls) and the scripted-tier consumer wiring.
- netrender (
github.com/mark-ik/netrender) — the vello-based renderer serval emits into. Pulled as a git dependency (branch = "main"), and it owns the engine-agnosticpaint_list_api/paint_list_rendercrates. - Forks consumed as git deps:
nova_vm(mark-ik/nova,serval-embedderbranch) andboa_engine/boa_gc(mark-ik/boa,servalbranch), each carrying additive reflector-liveness patches. The Stylo crates track the servo/stylo v0.18.0 release tag by git rev. - serval is consumed as the engine/host layer by Mark's
mereworkspace (meerkat chrome shell, orrery host). The dependency direction is one-way: those consume serval, serval does not depend on them.
serval is a derivative of Servo and is licensed under MPL-2.0. Upstream Servo: servo.org, book.servo.org.