Skip to content

feat(cloud-brain): verified laps and a leaderboard: the service drives a brain itself (X1) - #51

Merged
shaal merged 1 commit into
mainfrom
ship/x1-verified-laps
Oct 1, 2026
Merged

shaal merged 1 commit into
mainfrom
ship/x1-verified-laps

Conversation

@shaal

@shaal shaal commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

A claimed fitness is a claim; a lap the service drove is not. The game's
simulation is ported to Rust (cloud-brain/sim, checked frame by frame
against golden traces of the game's own scripts), POST /v1/verify re-drives
a held brain on the page's walls and gates, and GET /v1/leaderboard lists
the fastest verified first laps per track and physics.

  • In the brain's own context the run is its fitness (past quarantine) and
    its feedback there is measured against it; elsewhere, and for eviction,
    CB4's rules hold, so a made-up track protects nothing.
  • A run depends on the brain, the track and the context only: the canvas
    is the game's 3200 x 1800 and the service finds the start pose itself.
  • Each track key runs one geometry (the first, by SHA-256; the ten presets
    pinned at open); a work budget stops tracks made to be costly; 6 a minute
    per address, 30 for everyone, the token's quota; SQL schema 3.
  • The browser verifies a brain that drove a lap once it is sent, and the
    Memory panel shows the leaderboard and how the last verification went;
    the disclosure says the walls and gates go with a lap.

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 plan's X1 parts all exist:
      • the Rust sim crate, checked against golden traces from the game's scripts (125/125 and 2 125/2 125 identical);
      • POST /v1/verify, which re-drives the brain on the submitted geometry and records lap frames;
      • GET /v1/leaderboard?track= (maxSpeed and traction default);
      • verified brains skip quarantine.
    • The browser verifies lap brains and shows the board (browser stage 5, Chromium and WebKit).
  • To honestly score 25 I would need to: get lapping golden traces on all five presets. The game's learning loop does not lap the Oval or the Triangle within 80 generations.
  • Self-critique: "skip quarantine" now holds only in the brain's own context. This is a deliberate narrowing: the global version was a blocking trust hole in review round 1. It is documented.

Functional Robustness: 23/25

  • Evidence:
    • Hostile tracks are bounded by the work budget (25–34 ms native, 46–98 ms in Wasm).
    • Pins, the canvas pin and the context binding held under round-2 probes.
    • Wire fuzz ran 2 004 011 inputs and brain fuzz 31 018 sequences, all clean.
    • Client races are fixed and tested.
  • To honestly score 25 I would need to: give each address a share of the global 30-a-minute cap, and make the client read Retry-After.
  • Self-critique: 5 addresses can use up the minute's verifications. A user track's first-run pin is a race in theory. Both are documented limits.

Verification Evidence: 24/25

  • Evidence:
    • core verify 17, JS 33, Worker 17 over real wrangler, and browser Chromium + WebKit against the real service (fitness 6, lap frame 998).
    • learning 147 plus its browser test, the demonstration browser test, and fuzz 5 minutes per target.
    • 2 review rounds with 52 mutants. Every surviving mutant now fails a test, and I re-checked each one myself.
  • To honestly score 25 I would need to: run Firefox, which does not launch on this machine.
  • Self-critique: the Worker's timings vary 2× from run to run.

System Safety & Integration: 24/25

  • Evidence:
    • Nothing is deployed (CB5 is gated).
    • Migration 3 is tested from schema 1, including a migration cut short. A newer schema is refused.
    • Local mode is unaffected (reviewer check, learning suites pass).
    • The disclosure text is updated, and the change is reversible by squash revert.
  • To honestly score 25 I would need to: deploy-check under CB5 (needs your OK).
  • Self-critique: the per-address limiter is still untested on the deployed Worker.

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

…s a brain itself (X1)

A claimed fitness is a claim; a lap the service drove is not. The game's
simulation is ported to Rust (cloud-brain/sim, checked frame by frame
against golden traces of the game's own scripts), POST /v1/verify re-drives
a held brain on the page's walls and gates, and GET /v1/leaderboard lists
the fastest verified first laps per track and physics.

- In the brain's own context the run is its fitness (past quarantine) and
  its feedback there is measured against it; elsewhere, and for eviction,
  CB4's rules hold, so a made-up track protects nothing.
- A run depends on the brain, the track and the context only: the canvas
  is the game's 3200 x 1800 and the service finds the start pose itself.
- Each track key runs one geometry (the first, by SHA-256; the ten presets
  pinned at open); a work budget stops tracks made to be costly; 6 a minute
  per address, 30 for everyone, the token's quota; SQL schema 3.
- The browser verifies a brain that drove a lap once it is sent, and the
  Memory panel shows the leaderboard and how the last verification went;
  the disclosure says the walls and gates go with a lap.
@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: d8b552fa-dce6-46e6-85e9-c37ce5ce2563

📥 Commits

Reviewing files that changed from the base of the PR and between 7be6c6f and e952c7a.

⛔ Files ignored due to path filters (2)
  • cloud-brain/Cargo.lock is excluded by !**/*.lock
  • cloud-brain/core/fuzz/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (92)
  • AI-Car-Racer/cloud/client.js
  • AI-Car-Racer/cloud/session.js
  • AI-Car-Racer/cloud/ui.js
  • AI-Car-Racer/cloud/wire.js
  • AI-Car-Racer/graphics/state.js
  • AI-Car-Racer/learning/session.js
  • cloud-brain/Cargo.toml
  • cloud-brain/README.md
  • cloud-brain/core/Cargo.toml
  • cloud-brain/core/fuzz/Cargo.toml
  • cloud-brain/core/fuzz/fuzz_targets/brain.rs
  • cloud-brain/core/fuzz/fuzz_targets/wire.rs
  • cloud-brain/core/src/brain.rs
  • cloud-brain/core/src/wire.rs
  • cloud-brain/core/tests/fixtures.rs
  • cloud-brain/core/tests/verify.rs
  • cloud-brain/sim/Cargo.toml
  • cloud-brain/sim/src/jsmath.rs
  • cloud-brain/sim/src/lib.rs
  • cloud-brain/sim/tests/cost.rs
  • cloud-brain/sim/tests/traces.rs
  • cloud-brain/src/main.rs
  • cloud-brain/wrangler.jsonc
  • docs/plan/cloud-brain.md
  • docs/validation/cloud-brain.md
  • scripts/build-cloud-brain.sh
  • scripts/cloud-brain-fixtures.mjs
  • scripts/cloud-brain-sim-traces.mjs
  • tests/cloud-brain-browser.mjs
  • tests/cloud-brain-client.test.mjs
  • tests/cloud-brain-wire.test.mjs
  • tests/cloud-brain.test.mjs
  • tests/fixtures/cloud-brain-sim/presets.json
  • tests/fixtures/cloud-brain-sim/traces.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-bad-key.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-empty-number.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-hex.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-infinite.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-long-key.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-long-length.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-no-track.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-response-21.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-response-no-lap.json
  • tests/fixtures/cloud-brain/invalid/leaderboard-word.json
  • tests/fixtures/cloud-brain/invalid/verify-121-seconds.json
  • tests/fixtures/cloud-brain/invalid/verify-bad-token.json
  • tests/fixtures/cloud-brain/invalid/verify-brain-encoding.json
  • tests/fixtures/cloud-brain/invalid/verify-brain-not-finite.json
  • tests/fixtures/cloud-brain/invalid/verify-brain-weight-range.json
  • tests/fixtures/cloud-brain/invalid/verify-collisions.json
  • tests/fixtures/cloud-brain/invalid/verify-context-before-verify-context.json
  • tests/fixtures/cloud-brain/invalid/verify-no-context.json
  • tests/fixtures/cloud-brain/invalid/verify-no-track.json
  • tests/fixtures/cloud-brain/invalid/verify-other-schema.json
  • tests/fixtures/cloud-brain/invalid/verify-response-bad-id.json
  • tests/fixtures/cloud-brain/invalid/verify-response-bad-track.json
  • tests/fixtures/cloud-brain/invalid/verify-response-crashed-at-0.json
  • tests/fixtures/cloud-brain/invalid/verify-response-crashed-late.json
  • tests/fixtures/cloud-brain/invalid/verify-response-crashed-string.json
  • tests/fixtures/cloud-brain/invalid/verify-response-laps-mismatch.json
  • tests/fixtures/cloud-brain/invalid/verify-response-long-length.json
  • tests/fixtures/cloud-brain/invalid/verify-response-too-long.json
  • tests/fixtures/cloud-brain/invalid/verify-schema-before-token.json
  • tests/fixtures/cloud-brain/invalid/verify-token-before-vector.json
  • tests/fixtures/cloud-brain/invalid/verify-track-257-points.json
  • tests/fixtures/cloud-brain/invalid/verify-track-65-gates.json
  • tests/fixtures/cloud-brain/invalid/verify-track-before-context.json
  • tests/fixtures/cloud-brain/invalid/verify-track-far-coordinate.json
  • tests/fixtures/cloud-brain/invalid/verify-track-gate-one-end.json
  • tests/fixtures/cloud-brain/invalid/verify-track-no-gates.json
  • tests/fixtures/cloud-brain/invalid/verify-track-no-width.json
  • tests/fixtures/cloud-brain/invalid/verify-track-other-height.json
  • tests/fixtures/cloud-brain/invalid/verify-track-other-width.json
  • tests/fixtures/cloud-brain/invalid/verify-track-string-coordinate.json
  • tests/fixtures/cloud-brain/invalid/verify-track-three-numbers.json
  • tests/fixtures/cloud-brain/invalid/verify-track-two-points.json
  • tests/fixtures/cloud-brain/invalid/verify-vector-before-track.json
  • tests/fixtures/cloud-brain/valid/error-response-brain-unknown.json
  • tests/fixtures/cloud-brain/valid/leaderboard-cleaned.json
  • tests/fixtures/cloud-brain/valid/leaderboard-defaults.json
  • tests/fixtures/cloud-brain/valid/leaderboard-last-wins.json
  • tests/fixtures/cloud-brain/valid/leaderboard-nine-digit-length.json
  • tests/fixtures/cloud-brain/valid/leaderboard-response-profile-cleaned.json
  • tests/fixtures/cloud-brain/valid/leaderboard-response.json
  • tests/fixtures/cloud-brain/valid/leaderboard-zero-and-others.json
  • tests/fixtures/cloud-brain/valid/leaderboard.json
  • tests/fixtures/cloud-brain/valid/verify-at-the-bounds.json
  • tests/fixtures/cloud-brain/valid/verify-response-crashed.json
  • tests/fixtures/cloud-brain/valid/verify-response.json
  • tests/fixtures/cloud-brain/valid/verify-start-not-read.json
  • tests/fixtures/cloud-brain/valid/verify.json
  • tests/helpers/cloud-brain-fake.mjs
 ___________________________________________________________
< Did you mean to handle errors, or just *experience* them? >
 -----------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( 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.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​ryu-js@​1.0.3100100100100100

View full report

@shaal
shaal merged commit 7db2c8d into main Oct 1, 2026
9 of 11 checks passed
@shaal
shaal deleted the ship/x1-verified-laps branch October 1, 2026 04:26
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