Skip to content

docs: PRD + plan to move FruitCake "Watch AI" to the client (M30)#22

Closed
PieterjanDeClippel wants to merge 1 commit into
masterfrom
fruitcake-client-ai
Closed

docs: PRD + plan to move FruitCake "Watch AI" to the client (M30)#22
PieterjanDeClippel wants to merge 1 commit into
masterfrom
fruitcake-client-ai

Conversation

@PieterjanDeClippel

Copy link
Copy Markdown
Member

What

Adds docs/prd/FRUITCAKE_CLIENT_AI_PRD.md and the matching M30 milestone entry in PLAN.md. Docs only — no code changes.

Why

FruitCake's "Watch AI" runs entirely server-side today: a per-connection WebSocket loop runs the C# physics + DuelingQNet + depth-3 search, streaming ~30 fps frames (FruitCakeController.Live). On the CPU-only Hetzner VPS that's a persistent per-viewer CPU cost with no admission control — N viewers saturate the cores and frame deadlines slip for everyone.

This PRD moves the whole agent into the browser (net inference, observation, physics, search), collapsing the server to static-asset + checkpoint hosting. Per-viewer standing CPU → ~0.

Key points

  • Deliberately reverses the original server-authoritative serving decision (FRUITCAKE_AI_PRD.md §4.6/§4.8) — the target shifted from "ship correctly" to "serve cheaply at concurrency."
  • Central de-risk: moving the search client-side makes C#↔TS physics parity load-bearing. The plan builds the cross-language golden-vector conformance test that §4.8 recommended but never shipped, and ships on same-column-choice parity, not bit-equality.
  • Server engine preserved (owner's ask): FruitCakeWorld/Env/Search/Controller stay for training + as the parity oracle; the WS just leaves the serving hot path (optionally flag-gated).
  • Plan G0–G7: TS net + /api/fruitcake/weights → TS observation → TS physics search surface → conformance test → TS search → Web Worker + UI cutover → ≥200-game client-vs-server validation → (stretch) generalize to Snake/MountainCar.

🤖 Generated with Claude Code

Move the FruitCake "Watch AI" agent (net inference, observation, physics,
depth-3 search) entirely into the browser, collapsing the server to
static-asset + checkpoint hosting and eliminating the per-viewer standing
CPU cost on the CPU-only Hetzner VPS.

Deliberately reverses the original server-authoritative serving decision
(FRUITCAKE_AI_PRD.md 4.6/4.8); central de-risk is the C#<->TS physics
conformance test (4.8 recommended-but-unbuilt), shipping on
same-column-choice parity rather than bit-equality. Server engine preserved
as the training path + parity oracle. Plan G0-G7 in the PRD; PLAN.md M30.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@PieterjanDeClippel

Copy link
Copy Markdown
Member Author

Superseded — closing. This docs-only PRD proposed moving FruitCake's "Watch AI" into the browser; that's now shipped:

The delivered approach differs from this draft in the good direction: rather than a bespoke TS net + /api/fruitcake/weights + hand-maintained golden-vector parity, the whole inference path is single-sourced through Polyglot (f64 both sides ⇒ parity by construction). The FRUITCAKE_CLIENT_AI_PRD.md doc / "M30" label here would also collide with the shipped M30 (big-fruit inputs). No code from this branch is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant