Plasmate v0.2 Roadmap - The Full Engine

Vision

Plasmate v0.1 proved SOM works: 9.4x median compression across 38 real sites. v0.2 makes it a drop-in replacement for Lightpanda and Chrome headless.

Three pillars: Speed, Memory, Parallelism - all powered by SOM-native architecture.

Architecture

                    +-----------------------+
                    |     CDP Gateway       |  <-- Puppeteer/Playwright compatible
                    |  (Chrome DevTools     |
                    |   Protocol subset)    |
                    +----------+------------+
                               |
                    +----------+------------+
                    |     AWP Server        |  <-- Native protocol (SOM-aware)
                    |  (WebSocket, v0.1)    |
                    +----------+------------+
                               |
              +----------------+----------------+
              |                |                |
    +---------v------+ +------v--------+ +-----v--------+
    |  Page Runtime  | | SOM Compiler  | | SOM Cache    |
    |  (V8 via       | | (v0.1, proven)| | (new)        |
    |   rusty_v8)    | |               | |              |
    +--------+-------+ +------+--------+ +-----+--------+
             |                |                |
    +--------v-------+ +-----v--------+       |
    | DOM Mutations  | | Heuristics   |       |
    | Observer       | | Engine       |       |
    +--------+-------+ +--------------+       |
             |                                |
    +--------v---------------------------------v-----+
    |              Session Manager                    |
    |  (per-tab isolation, parallel execution,        |
    |   shared cache, resource budgets)               |
    +-------------------------------------------------+

Module Plan

1. JavaScript Execution (src/js/)

2. CDP Compatibility Layer (src/cdp/)

3. SOM Cache (src/cache/)

4. Parallel Session Manager (src/sessions/)

5. Network Layer Upgrades (src/network/)

Performance Targets (vs Lightpanda)

Metric Chrome Lightpanda Plasmate Target
100-page benchmark 25.2s 2.3s <1.0s
Memory per instance 207MB 24MB <8MB
Concurrent (8GB) 15 140 500+
Cold start 3-5s <100ms <50ms
Token output Raw DOM Markdown/Tree (bolt-on) SOM (native)
Warm page load N/A N/A <10ms (cached SOM)

Why SOM Cache Changes Everything

Lightpanda and Chrome re-render every page from scratch every time. Plasmate with SOM Cache creates a fundamentally different paradigm:

  1. First visit: Fetch -> Parse -> JS -> Compile SOM -> Cache (normal speed)
  2. Revisit (same content): Cache hit -> Return SOM (~0ms)
  3. Revisit (changed content): Fetch -> Diff -> Update cache -> Return delta
  4. Predicted navigation: Cache prewarms links from current page

For an AI agent that navigates 50 pages in a workflow, pages 2-50 are often revisits or predictable next-pages. SOM Cache makes those effectively free.

Build Order

  1. V8 integration (unblocks JS execution, biggest gap vs Lightpanda)
  2. CDP compatibility (unblocks Puppeteer/Playwright, enables benchmarking vs LP)
  3. SOM Cache (the differentiator, makes us categorically faster)
  4. Parallel session manager (proves the concurrency story)
  5. Network upgrades (polish, production readiness)

Dependencies to Add

# V8 JavaScript engine
rusty_v8 = "0.106"

# On-disk cache
rocksdb = { version = "0.22", default-features = false }

# Faster hashing for cache keys
xxhash-rust = { version = "0.8", features = ["xxh3"] }

# Memory tracking
jemalloc-ctl = "0.5"
jemallocator = "0.5"

# HTTP/2
hyper = { version = "1", features = ["http2", "server"] }