Skip to content

feat(anna): Implement RL Proof of Concept with Lock-Step Sync and Gym Wrapper#74

Draft
icarito wants to merge 1 commit into
mainfrom
anna-rl-poc-2026021643756297310
Draft

feat(anna): Implement RL Proof of Concept with Lock-Step Sync and Gym Wrapper#74
icarito wants to merge 1 commit into
mainfrom
anna-rl-poc-2026021643756297310

Conversation

@icarito
Copy link
Copy Markdown
Owner

@icarito icarito commented Feb 23, 2026

This PR implements the Proof of Concept for Reinforcement Learning within the A.N.N.A. architecture. It introduces a strict lock-step synchronization mechanism in the Godot TCP bridge to allow deterministic training. A Gymnasium environment wrapper is provided, along with a PPO training script and a minimal test scene.

Key Features:

  • Lock-Step Sync: Pauses Godot physics until an action is received from the Python client.
  • RL Observation Space: 12 normalized floats (8 Proximity Rays, Target Distance, Target Angle, 2D Velocity).
  • RL Action Space: Discrete(5) (Idle, Forward, Backward, Left, Right).
  • Reward Function: Success (+100), Failure (-100), Progress (Potential-based), Time Penalty (-0.1).
  • Gymnasium Wrapper: AnnaGymEnv handles the TCP protocol and Godot process lifecycle.
  • Test Scene: A procedurally generated TestScene_RL.tscn for headless validation.

PR created automatically by Jules for task 2026021643756297310 started by @icarito

- Added `ANNA_RL_MODE` to `AnnaBridge.gd` which enables a blocking lock-step synchronization loop in `_physics_process`.
- Updated `AnnaInterface.gd` to provide a 12-float observation vector (RayCasts, Target Dist/Angle, Velocity) and integer action mapping (0-4).
- Implemented reward shaping (Success, Failure, Progress, Time) in `AnnaInterface.gd`.
- Created `AnnaGymEnv` (Gymnasium wrapper) in `core_v2/anna/client/anna_gym.py` handling TCP communication, process launching, and robustness.
- Added `train_poc.py` to demonstrate PPO training using Stable-Baselines3.
- Added `TestScene_RL.tscn` (and `DummyAnimator.gd`) as a lightweight, dependency-free test environment for headless RL training.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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