Robotics Simulation

A simulated robot learns to move, avoid obstacles, seek targets, and navigate -- all using the same sparse graph routing that powers GenesisNode's language capabilities. No policy gradients, no replay buffers, no reward function optimization. Just connection strengthening through the same BFS + intersection voting primitive used for word associations and reading comprehension.


What This Demo Shows

The robotics simulation demonstrates that a single computational primitive -- sparse graph routing with threshold-based firing -- generalizes from language to continuous control. The same mechanism that routes "cat" to "animal" through weighted connections routes "front_near" to "turn_left" through the same graph structure.

A robot in a 3D arena receives sensor readings (distances to walls and obstacles), which are discretized into tokens like front_near, left_far, and target_ahead. These tokens are routed through GenesisNode's L10 scaler nodes via BFS, and the graph's intersection voting mechanism selects a motor command: move_forward, turn_left, turn_right, move_backward, or stop.

The robot starts with zero learned behavior. A reactive heuristic (hand-coded reflex rules) provides safe initial actions. Those actions get scored by a reward function, and good outcomes strengthen connections in the graph. Over hundreds of episodes, the learned graph progressively takes over from the heuristic -- visible in real time as action sources shift from yellow ("reactive") to green ("genesisnode") in the UI.

Key properties on display:


The 4 Robot Levels

Robot capabilities are organized into four incremental levels that mirror the L1-L10 language capability levels. Each level introduces new challenges while preserving all prior learned behaviors.

R1: Movement

The robot learns to move through open space without hitting walls.

R2: Collision Avoidance

The robot learns to navigate around randomly placed obstacles.

R3: Target Seeking

The robot learns to orient toward and reach a target in open space.

R4: Full Navigation

The composition of all three prior levels -- reach a target while navigating through obstacles.


How It Works

Sensor Tokenization

Six directional rays emanate from the robot at fixed angles: front (0 degrees), front-left (-45), front-right (+45), left (-90), right (+90), and rear (180). Each ray returns a distance (up to 8.0 units), discretized into three bins:

Distance Token suffix Meaning
< 1.5 _near Immediate danger
< 4.0 _mid Caution zone
>= 4.0 _far Clear path

For R3/R4 levels, two additional target tokens encode direction (target_ahead, target_left, target_right, target_behind) and distance (target_close, target_medium, target_distant).

A 4x4 vision grid (R4 only) provides coarse spatial awareness from the robot's perspective. A camera at the robot's head casts rays through grid cells, classifying each as empty, target, obstacle, or wall, generating tokens like vis_r1c2_obstacle.

Routing Through the Graph

Each sensor token maps to a dedicated L10 scaler node (e.g., front_near_l10). These scaler nodes are isolated from L1-L9 language nodes -- robot training never touches language capabilities.

The routing pipeline:

  1. Create/find scaler nodes for each sensor token in the current state
  2. BFS along positive connections with robot: context tag filtering
  3. Intersection voting -- all sensor tokens vote independently for action nodes; the convergence exponent (^1.5) rewards agreement across sensors
  4. Action selection -- the action with the highest vote total wins

The Reactive Fallback Bootstrap

A hand-coded reactive controller provides safe initial behavior before learning takes over. This is the most interesting design decision in the robotics implementation:

  1. The robot requests an action. The server returns a reactive action (priority-ordered reflex rules: emergency reverse, collision avoidance, target seeking, default forward)
  2. The browser executes the action and computes a reward from the physics outcome
  3. At episode end, ALL steps -- regardless of source -- are sent to score_robot_episode()
  4. Good reactive decisions strengthen the corresponding sensor-to-action connections
  5. After enough episodes, learned routing takes over for trained states

This creates a bootstrapping loop: reactive provides safe actions, rewards score those actions, good actions train into the graph, the graph takes over for trained states, new levels introduce new (untrained) tokens, reactive handles those while learning catches up, cycle repeats.

Connection Training

Training happens at episode end. For each step in the episode:

score_robot_action() strengthens or weakens L10 scaler-to-action connections using robot:<action> context tags for namespace isolation.


Using the Controls

The top bar contains all simulation controls.

Action Buttons

Level Selector

Dropdown with R1 through R4. Changing the level reconfigures the environment:

Vehicle Type

Three sensor configurations are available:

The reactive fallback and learned routing both work with any vehicle configuration -- token naming follows the same {sensor}_{distance} convention regardless of sensor count.

Speed Modes

Latency Simulation

Two dropdowns control network latency simulation:

When packets are dropped or the adaptive timeout fires, the client falls back to a browser-side reactive heuristic so the robot never freezes.

Episodes

Number input (1-10000) specifying how many episodes to run when you click Train or Run.

Test Retention

Runs a diagnostic test that checks whether GenesisNode has actually learned each robot level's core behaviors. Sends canonical sensor combinations to the graph and verifies the returned actions match expectations (e.g., front_near should produce a turn, clear path with target_ahead should produce move_forward). Results appear in the Level Retention section of the side panel.


Side Panel Explained

The right-hand panel provides real-time insight into the robot's perception, decisions, and learning state.

Sensors

A grid showing each sensor's current reading with color coding:

Also shows target direction and distance when applicable (R3/R4).

Vision (4x4)

A miniature grid showing the robot's forward-facing vision classification. Each cell is colored by what the robot sees: empty (dark), target (green), obstacle (red), wall (gray). Active only in R4.

Tokens

The raw token list sent to GenesisNode for the current step. This is exactly what the graph routing receives -- e.g., front_far front_left_far front_right_mid left_far right_far rear_far target_ahead target_medium. Useful for understanding why the network makes specific decisions.

Action Log

A scrolling log of recent actions with color-coded sources:

This provides immediate visual feedback on how much of the robot's behavior is learned vs. heuristic-driven. Watching the log shift from predominantly yellow to green over training is the clearest signal that learning is working.

Metrics

Four key numbers updated each episode:

Below the numbers, a Chart.js line chart tracks success rate (green) and average reward (blue) over time.

Emotional State

GenesisNode's emotional scoring system displayed as progress bars:

The operating mode (Learning vs. Responding) is derived from the uncertainty level.

Network

Technical stats about the robot-specific portion of the graph:

Level Retention

Shows pass/fail status for each robot level's retention test:

Updated when you click "Test Retention" in the top bar. A passing level means the graph has learned the core sensor-to-action mappings for that level and retains them even after training higher levels.

Model

Model persistence controls:

This allows incremental training: train R1, save as r1-trained, continue with R2, save as r1r2-trained, and so on.


Demo Walkthrough

Step 1: Start with R1 Movement

  1. Set Level to R1: Movement
  2. Set Speed to 1x (Visual) to watch the robot
  3. Set Episodes to 50
  4. Click Train

Watch the robot learn to move forward without hitting walls. Early episodes will show mostly yellow (reactive) actions in the action log. The robot may collide with walls frequently at first.

After 30-50 episodes, success rate should climb as the network learns front_far -> move_forward. Check the Network section to see L10 nodes and connections growing.

Step 2: Verify Learning

  1. Click Test Retention
  2. Check the Level Retention panel -- R1 should show a passing score
  3. Click Run with a few episodes to see the robot operate without training -- actions should be mostly green (genesisnode) in open space

Step 3: Save and Move to R2

  1. Enter r1-trained in the Model name field
  2. Click Save
  3. Switch Level to R2: Avoidance
  4. Set Episodes to 100
  5. Click Train

The arena now contains obstacles. Watch the robot apply its R1 movement knowledge while learning to detect and avoid obstacles. The reactive fallback handles near-obstacle situations while the graph learns open-space navigation.

Step 4: Test Retention Across Levels

  1. Click Test Retention after R2 training
  2. Both R1 and R2 should pass -- the L10 scaler node isolation and robot: context tags prevent cross-level interference
  3. Save as r1r2-trained

Step 5: Target Seeking (R3)

  1. Switch to R3: Target Seek
  2. Train 100+ episodes
  3. Watch the robot learn to orient toward the green target sphere

The untrained token detection system will initially route all target-related decisions through the reactive fallback (target tokens like target_left have no learned connections yet). Over training, these connections form and the graph takes over.

Step 6: Full Navigation (R4)

  1. Switch to R4: Navigate
  2. Train 200+ episodes
  3. This is the composition test -- the robot must reach a target while navigating through obstacles

R4 exercises all prior levels simultaneously. The intersection voting mechanism composes obstacle avoidance and target seeking without explicit coordination logic.

Step 7: Stress Test with Latency

  1. Set Latency to 50ms and Quality to Degraded
  2. Run a few episodes and observe the performance overlay
  3. Watch how the three-tier fallback handles packet drops -- the robot should remain functional even with degraded connectivity

What Makes This Different

Traditional RL vs. GenesisNode Robotics

Aspect Traditional RL GenesisNode
Core operation Policy gradient / Q-value update BFS through sparse graph + intersection voting
Training Backpropagation through neural network Reward-weighted connection strengthening
Memory Replay buffer (millions of transitions) Graph connections (~4KB total)
Inference Matrix multiplication (ms range) Dictionary lookup + BFS (~70 us)
Model size Millions of parameters 20-40 nodes, sparse connections
Interpretability Black box (activation maps, saliency) Full firing chain inspection
Incremental learning Catastrophic forgetting without special techniques Scaler node isolation + context tags, no forgetting by design
Hardware GPU required for training and often inference CPU-only, runs on microcontrollers
Exploration Epsilon-greedy / entropy bonus Emotional scoring (uncertainty drives exploration)

No Gradient, No Replay Buffer

GenesisNode does not compute gradients. There is no loss function to minimize, no backpropagation, no chain rule. Learning is connection strength adjustment: if sensor tokens led to an action that produced a positive reward, those connections get stronger. If the reward was negative, they get weaker. This is closer to Hebbian learning than to modern deep RL.

There is no replay buffer because there is no batch training over historical transitions. Each episode's steps are processed once, connections are updated, and the data is discarded. The graph itself is the memory.

Sparse Activation

At any given step, only the L10 scaler nodes corresponding to the current sensor readings are active -- typically 8-12 nodes out of thousands in the full graph. This is the "~1% active" principle from the core architecture. The inactive 99% represents knowledge from other levels, other sensor states, and language capabilities that are completely untouched during robot routing.

Emotional Scoring Drives Exploration

Rather than epsilon-greedy exploration or entropy bonuses, GenesisNode uses emotional signals:

These signals are visible in the Emotional State panel and directly affect how aggressively the network explores vs. exploits.

Same Primitive, Different Domain

The most significant claim: the robot uses the exact same routing code as language processing. process_robot_state() calls the same BFS, the same intersection voting, the same scaler node lookup as word associations (L1) or reading comprehension (L9). The only differences are the token vocabulary (sensor names instead of words) and the context tag namespace (robot: instead of rel: or qa:).

The architecture does not know it is controlling a robot. It sees tokens in, tokens out, and a reward signal. That generality is the point.