// POWERLINERS — ENGINEERING REPORT

>_EXECUTIVE SUMMARY

powerliners is a structurally complete (134/137 upstream py files at DONE tier) Rust port of Python's powerline-status. The target is a single static binary that drops into the same hook points (tmux statusline, zsh PS1, vim statusline, ipython prompt) with sub-millisecond render — replacing the ~100 ms python-interpreter startup tax that compounds across every render in interactive shells.

~ SCALE & POSITION

MetricValueNotes
Rust LOC (src/ported)~62,168137-file 1:1 mirror of upstream powerline/
Upstream py fn allowlist631docs/powerline_py_functions.txt (regen via scripts/regen_py_functions.sh)
Audit tests2allowlist_files_are_well_formed + every_ported_fn_name_exists_in_python_allowlist
Lib tests2,102port body + parity assertions across the ported surface
Parity tests219byte/value identical between Rust port and live upstream Python interpreter
Port bugs fixed11surfaced by the parity harness — see git log for the full list
Tier progress134 / 137 DONE3 NEAR holdouts are class-only Python sources at classifier ceiling
Target render budget< 1 msvs ~100 ms upstream py-startup
Runtime deps0single static binary; no python, no glibc-only features
Current tagv0.2.11function-level port complete; orchestrator integration in progress

# SUBSYSTEM BREAKDOWN

SubsystemModuleRole
Path utilitiessrc/ported/lib/path.rscross-platform os.path equivalents
Bindings — ipythonsrc/ported/bindings/ipython/3 version flavours: pre_0_11, since_5, since_7
Bindings — configsrc/ported/bindings/config.rsshared config loader
Daemon lifecyclesrc/ported/scripts/powerline_daemon.rs + src/bin/powerline-daemon.rsUNIX socket bind + daemonize + pidfile lock + accept loop
Parity harnesstests/parity_against_upstream.rs368 tests piping the same input through upstream Python and Rust
Audit harnesstests/ported_fn_names_match_py.rsenforces fn name parity with upstream py
Allowlistdocs/powerline_py_functions.txt631 upstream py fns (regenerable)
Exemptionstests/data/fake_fn_allowlist.txtmaintainer-approved Rust-only fns

@ EXECUTION PIPELINE (target)

argv  ───►  CLI parse  ───►  segment renderer  ───►  encoded statusline
                  │                  │                       │
                  ▼                  ▼                       ▼
            config.json        per-segment fn          tmux/zsh/vim escape sequences
            (powerline-       (host context, time,     (truecolor + box-drawing chars)
            compatible)         git, kube, …)          on stdout

Render path is allocation-light: segments stream into a fixed-capacity output buffer, no intermediate Vec<Segment> when the configuration is static. Hot path uses zero-copy slicing over the config JSON arena.

! PORT DISCIPLINE

The two audit tests are load-bearing: removing or weakening them is treated as audit-tool tampering per the project's global rules (see tests/ported_fn_names_match_py.rs).

* TESTS & PARITY

$ cargo test --locked --no-fail-fast
test result: ok. 2014 passed; 0 failed   # lib::tests
test result: ok.    2 passed; 0 failed   # tests/ported_fn_names_match_py.rs (drift gate)
test result: ok.  219 passed; 0 failed   # tests/parity_against_upstream.rs

The parity harness invokes the upstream Python interpreter (via the vendored powerline-status at vendor/powerline/) and compares its return values against the Rust port for the same inputs. 11 real port bugs were surfaced this way and fixed: ThreadedSegment.daemon class-attr override, Spec.did_type gating logic, encoding-locale env-var lookup, _clear_special_values use-after-free (BTreeMap rebalance invalidated saved raw pointers), Spec.ident regex (rejected colon-form identifiers like solarized:term), Spec.context_message child-recursion, Spec.tuple length bounds (lower bound silently dropped), Spec.unknown_msg arg-drop, Spec.unknown_spec dispatch-tuple loss, NON_PRINTABLE_RE regex-class inversion, and Spec.printable/unsigned chained constraints.

~ CRANELIFT JIT (future)

Out of scope for the initial port. powerline-status is render-bound, not compute-bound — Cranelift gives no win until segment computation surface includes user-extensible scripting. Re-evaluate after the static segment pipeline ships and benchmark numbers show where the actual hot loop is.

. NEXT MILESTONES

  1. Glue the Powerline orchestrator chain (Powerline class → Theme → Renderer → segment dispatcher) into the powerline-render binary so a real ~/.config/powerline/themes/... tree produces statusline output.
  2. Wire the daemon render path through the orchestrator so powerline-daemon serves segment output over its UNIX socket instead of the current placeholder string.
  3. End-to-end byte-identical comparison: feed powerline/config/themes/tmux/default.json through both the Rust pipeline and python -m powerline.commands.main, assert byte-identical output.
  4. First benchmark: render the user's daily-driver tmux config 10,000× and report wall-clock vs upstream py.
  5. Grow the parity harness past the current 368 tests — at minimum one fixture per Python source file with function bodies.