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:
- ~70 us inference -- 14,000 decisions per second from pure dictionary lookups and BFS, no matrix math
- ~4KB model size -- 20-40 L10 scaler nodes with sparse connections, deployable on a microcontroller
- Incremental skill composition -- R1 through R4 build on each other without retraining lower levels
- Latency resilience -- three-tier fallback (learned, server reactive, client reactive) handles network degradation gracefully
- Full interpretability -- every action traces back to specific sensor tokens, intermediate nodes, and connection strengths
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.
- Environment: Empty 20x20 arena, no obstacles, no target
- Sensor tokens: 6 distance readings (typically all
_far) +target_none - Rewards: +0.05 per movement step, -0.5 for wall collision (terminal)
- Success: Survive all 200 steps without collision
- What it teaches: Forward locomotion, awareness of arena boundaries, basic wall avoidance
R2: Collision Avoidance
The robot learns to navigate around randomly placed obstacles.
- Environment: 20x20 arena with 4-6 obstacles (red boxes and orange cylinders)
- Sensor tokens: Mix of
_near,_mid,_farreadings +target_none - Rewards: +0.02 per movement step, -0.03 for consecutive near readings (anti-hugging penalty), -0.5 for collision (terminal)
- Success: Survive all 200 steps
- Builds on R1: Must still move forward in open space, plus detect and steer around obstacles
R3: Target Seeking
The robot learns to orient toward and reach a target in open space.
- Environment: Empty 20x20 arena with a green glowing target sphere placed randomly at distance > 5 units
- Sensor tokens: 6 distances +
target_{direction}(ahead,left,right,behind) +target_{distance}(close,medium,distant) - Rewards: +1.0 for reaching target (distance < 0.8, terminal success), angular alignment bonus (up to +0.1), proximity improvement bonus, -0.02 for moving away while facing target, -0.5 for wall collision
- Success: Reach the target within 200 steps
- Builds on R1: Must navigate open space safely while steering toward the goal
R4: Full Navigation
The composition of all three prior levels -- reach a target while navigating through obstacles.
- Environment: 20x20 arena with 8-12 obstacles, target placed randomly at distance > 5 units
- Sensor tokens: Full sensor suite + target tokens + 4x4 vision grid tokens
- Rewards: Combines all prior reward signals -- target bonus, movement bonus, proximity tracking, anti-hugging, collision penalty
- Success: Reach target without collision
- Composition: R4 is explicitly defined as R1+R2+R3 composed. The retention test passes only if all three sub-levels also pass. The intersection voting mechanism naturally composes the separate behaviors without explicit coordination.
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:
- Create/find scaler nodes for each sensor token in the current state
- BFS along positive connections with
robot:context tag filtering - Intersection voting -- all sensor tokens vote independently for action nodes; the convergence exponent (^1.5) rewards agreement across sensors
- 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:
- The robot requests an action. The server returns a reactive action (priority-ordered reflex rules: emergency reverse, collision avoidance, target seeking, default forward)
- The browser executes the action and computes a reward from the physics outcome
- At episode end, ALL steps -- regardless of source -- are sent to
score_robot_episode() - Good reactive decisions strengthen the corresponding sensor-to-action connections
- 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:
- Terminal events (collision, target reached) train at learning rate 0.15
- Shaping rewards (movement, proximity) train at learning rate 0.03
- Near-zero rewards are ignored as noise
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
- Step -- Execute a single simulation step (useful for debugging sensor states)
- Train -- Run the specified number of episodes in training mode (actions are scored and learned)
- Run -- Run episodes in inference-only mode (no training, tests what the network has learned)
- Stop -- Halt the current training or run session
- Reset -- Reset the environment to starting conditions for a new episode
Level Selector
Dropdown with R1 through R4. Changing the level reconfigures the environment:
- R1: Empty arena, no obstacles, no target
- R2: Randomly placed obstacles, no target
- R3: No obstacles, randomly placed target
- R4: Both obstacles and target, plus vision grid
Vehicle Type
Three sensor configurations are available:
- 3x Ultrasonic (default) -- 3 front-facing sensors at 0, -45, and +45 degrees
- 8x LiDAR -- 8 rays providing denser angular coverage
- 5x IR -- 5 infrared-style sensors
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
- 1x (Visual) -- Real-time rendering with full 3D animation. Best for watching behavior and debugging.
- 5x (Fast) -- Accelerated simulation with rendering still active. Good for training runs you want to monitor.
- Headless -- No rendering, maximum training throughput. Use for long training sessions (hundreds of episodes).
Latency Simulation
Two dropdowns control network latency simulation:
- Base latency: 0ms, 5ms, 25ms, 50ms, 100ms, or 200ms
- Quality profile:
- Clean -- +/-5% jitter, 0.1% packet drop (wired LAN)
- Degraded -- +/-20% jitter, 2% drop (WiFi with interference)
- Noisy -- 50-400% jitter, 8% drop (cellular / poor connectivity)
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:
- Red (
_near) -- immediate danger, distance < 1.5 units - Yellow (
_mid) -- caution zone, distance < 4.0 units - Green (
_far) -- clear path, distance >= 4.0 units
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:
- Green (
genesisnode) -- action from learned graph routing - Yellow (
reactive) -- action from server-side reactive heuristic - Red (
drop/timeout) -- action from client-side fallback due to packet loss
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:
- Episode -- current episode count
- Success Rate -- rolling success percentage over the last 20 episodes
- Avg Reward -- rolling average episode reward over the last 20 episodes
- Avg Steps -- rolling average steps per episode (200 = survived the full episode for R1/R2; fewer indicates early collision)
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:
- Confidence (green) -- how certain the network is about its decisions; strengthens established pathways
- Uncertainty (yellow) -- triggers learning mode when high (> 0.5); the network explores more aggressively
- Surprise (red) -- spikes on unexpected outcomes; strong restructuring signal
The operating mode (Learning vs. Responding) is derived from the uncertainty level.
Network
Technical stats about the robot-specific portion of the graph:
- L10 nodes -- number of L10 scaler nodes created for robot sensor/action tokens
- Connections -- number of positive-weight connections between L10 nodes
- Episodes trained -- total episodes processed through
score_robot_episode() - Source -- whether the last action came from
genesisnodeorreactive - Chain -- the firing chain (intermediate nodes) that produced the last learned action
Level Retention
Shows pass/fail status for each robot level's retention test:
- R1 Movement
- R2 Avoidance
- R3 Target
- R4 Navigate
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:
- Save -- serialize the current GenesisNode state (all tiers, connections, context tags) to a named file. Enter a descriptive name like
r1r2-trained. - New -- reset to a fresh empty network (with confirmation dialog). Use when you want to start training from scratch.
- Model list -- previously saved models that can be loaded to restore a training checkpoint.
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
- Set Level to R1: Movement
- Set Speed to 1x (Visual) to watch the robot
- Set Episodes to 50
- 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
- Click Test Retention
- Check the Level Retention panel -- R1 should show a passing score
- 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
- Enter
r1-trainedin the Model name field - Click Save
- Switch Level to R2: Avoidance
- Set Episodes to 100
- 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
- Click Test Retention after R2 training
- Both R1 and R2 should pass -- the L10 scaler node isolation and
robot:context tags prevent cross-level interference - Save as
r1r2-trained
Step 5: Target Seeking (R3)
- Switch to R3: Target Seek
- Train 100+ episodes
- 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)
- Switch to R4: Navigate
- Train 200+ episodes
- 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
- Set Latency to 50ms and Quality to Degraded
- Run a few episodes and observe the performance overlay
- 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:
- High uncertainty (many untrained tokens, low connection strengths) triggers learning mode with higher exploration
- Surprise (unexpected reward outcomes) causes stronger connection updates
- Growing confidence (consistent correct predictions) shifts to responding mode with lower exploration
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.