Skip to content

feat(cloud-brain): race the cloud champion: a ghost of the best shared brain (X3) - #53

Merged
shaal merged 1 commit into
mainfrom
ship/x3-cloud-champion-ghost
Oct 1, 2026
Merged

shaal merged 1 commit into
mainfrom
ship/x3-cloud-champion-ghost

Conversation

@shaal

@shaal shaal commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

In shared mode the best brain the shared pool holds for your track drives
a ghost car next to yours, simulated in the page from its weights: the
fastest verified brain the last pull brought, else the pool's best that
learned on this track. Nothing new is fetched or stored.

  • cloud/ghost.js: an AI car of car.js from the start pose, with your
    physics and the champion's profile, sensing every frame (a car.js flag),
    so it drives the lap the service verified; it restarts with your cars
    and after a crash, and a new champion waits for its next start.
  • main.js steps it with your cars while the AI trains and draws it
    translucent (flat and tilted views); the 3D studio places it.
  • The Memory panel's "Race the cloud champion" toggle (one label,
    aria-pressed), kept while champions come and go.
  • The WebKit browser test counts the loads a declined shared link cuts
    (a reload mid-boot; also on main) instead of failing.

Confidence

Verbatim from /ship's Phase 2 confidence gate — per-axis score (0–25), the
evidence used, and the self-critique. Treat anything below 20 as a known soft
spot to verify before relying on it.

Requirements Fit: 24/25

  • Evidence:
    • The champion for your track (the board's fastest held brain, else the pool's best on this track) drives a ghost next to your car, simulated locally from its weights; no trajectory is stored.
    • Browser stage 6 shows it driving the verified lap (frame 998) in both browsers.
  • To honestly score 25 I would need to: race a verified champion whose weights the pull did not bring (that needs a new route).
  • Self-critique: pressing the toggle starts the ghost from the start line at once, not level with your car mid-lap.

Functional Robustness: 23/25

  • Evidence:
    • The review's 2 bugs and 3 gaps are fixed: track-bound champion, stale wait cleared, respawn, no phase-3 ghost, the choice kept across contexts.
    • The toggle keeps one label, and the tilted view draws the ghost translucent.
  • To honestly score 25 I would need to: line the ghost up with your car's own respawn, and test the 3D studio placement.
  • Self-critique: a champion verified at other physics drives a different race than its listed lap (documented).

Verification Evidence: 24/25

  • Evidence:
    • Node: 26 client tests. The ghost reproduces the traced balanced, careful and calm runs of the evolved brain with the game's car.js and a stride of 4.
    • Browser: Chromium and WebKit assert that main.js steps, draws and restarts the ghost.
    • 7 of 8 mutants are killed; the survivor is equivalent.
    • Learning 147 plus its browser test and the demonstration test pass.
  • To honestly score 25 I would need to: cover the 3D studio path in a test.
  • Self-critique: the tilted-view drawing is not asserted.

System Safety & Integration: 24/25

  • Evidence:
    • Shared mode only; local mode creates nothing.
    • The car.js flag is inert unless set, and only the ghost sets it.
    • No service or wire change; the full app suites pass.
  • To honestly score 25 I would need to: run a manual check on a phone (touch target size is styled).
  • Self-critique: demoPresentation.drawDriver now honours pose.alpha, a small shared change.

Total: 95/100. Gate (≥95 AND no axis <15): PASS

…d brain (X3)

In shared mode the best brain the shared pool holds for your track drives
a ghost car next to yours, simulated in the page from its weights: the
fastest verified brain the last pull brought, else the pool's best that
learned on this track. Nothing new is fetched or stored.

- cloud/ghost.js: an AI car of car.js from the start pose, with your
  physics and the champion's profile, sensing every frame (a car.js flag),
  so it drives the lap the service verified; it restarts with your cars
  and after a crash, and a new champion waits for its next start.
- main.js steps it with your cars while the AI trains and draws it
  translucent (flat and tilted views); the 3D studio places it.
- The Memory panel's "Race the cloud champion" toggle (one label,
  aria-pressed), kept while champions come and go.
- The WebKit browser test counts the loads a declined shared link cuts
  (a reload mid-boot; also on main) instead of failing.
@shaal
shaal merged commit f434317 into main Oct 1, 2026
9 checks passed
@shaal
shaal deleted the ship/x3-cloud-champion-ghost branch October 1, 2026 05:57
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: da1955e9-5038-4128-a6c4-d91ce0ebaa0f

📥 Commits

Reviewing files that changed from the base of the PR and between 184c5f9 and d137378.

📒 Files selected for processing (11)
  • AI-Car-Racer/car.js
  • AI-Car-Racer/cloud/ghost.js
  • AI-Car-Racer/cloud/session.js
  • AI-Car-Racer/cloud/ui.js
  • AI-Car-Racer/demoPresentation.js
  • AI-Car-Racer/graphics/studio.js
  • AI-Car-Racer/main.js
  • docs/plan/cloud-brain.md
  • docs/validation/cloud-brain.md
  • tests/cloud-brain-browser.mjs
  • tests/cloud-brain-client.test.mjs
 _________________________
< Loose code sinks ships. >
 -------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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