Skip to content

Goal-system rewrite: direct goal sampling (replaces Path/Waypoint)#512

Merged
vcharraut merged 27 commits into
3.0from
vcha/goals-func
Jul 16, 2026
Merged

Goal-system rewrite: direct goal sampling (replaces Path/Waypoint)#512
vcharraut merged 27 commits into
3.0from
vcha/goals-func

Conversation

@vcharraut

@vcharraut vcharraut commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What

Rewrites the target/waypoint system into a direct goal abstraction. Stacked on top of the rename PR (#), so this diff is functional-only.

  • Removes the Path/Waypoint densification layer: struct Path, struct Waypoint, MAX_NUM_WP_PATH (200-pt buffer), build_path, get_closest_waypoint_index_on_path, path_progression, closest_path_idx_wp, num_waypoints_reached.
  • New generation/regen pipeline: chain_goals, commit_goals, generate_new_goals_from_route, generate_new_goals_from_map, roll_goals, route_point_at_distance, compute_new_route.
  • Config: target_type (static/dynamic) -> goal_regen_mode (finite/rolling); goal_on_lane -> goal_source (route/map); new obs_goal_lane_distance flag.
  • Lane-graph GPS distance: LaneGraph.lane_to_graph_idx + normalized distance-to-goal-lane on lane obs rows.
  • gt_goal_* ground-truth goal pin for replay; goal reward via point-to-segment distance.

🤖 Generated with Claude Code

vcharraut and others added 2 commits July 6, 2026 22:07
Pure identifier renames ahead of the goal-system rewrite, so the
functional PR is reviewable on its own. Behavior is unchanged: builds
clean and passes the existing 3.0 golden rollout + unit tests.

  current_route_index   -> current_route_idx
  MAX_TARGET_WAYPOINTS  -> MAX_GOALS
  goal_positions_{xyz}  -> list_goal_{xyz}
  goal_position_{xyz}   -> current_goal_{xyz}
  num_target_waypoints  -> num_goals
  {min,max}_waypoint_spacing -> {min,max}_goal_spacing

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Removes the Path/Waypoint densification layer (struct Path, struct
Waypoint, MAX_NUM_WP_PATH, build_path, closest-waypoint tracking,
path_progression) and samples goals directly along the route or map.

- New generation/regen pipeline: chain_goals, commit_goals,
  generate_new_goals_from_route/_from_map, roll_goals,
  route_point_at_distance, compute_new_route.
- goal_regen_mode (finite|rolling), goal_source (route|map) replace
  target_type / goal_on_lane.
- Lane-graph GPS distance: LaneGraph.lane_to_graph_idx +
  obs_goal_lane_distance obs flag.
- gt_goal_* ground-truth goal pin for replay; goal reward via
  point-to-segment distance.
- Golden rollout/smoke data regenerated (behavior changed by design).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vcharraut vcharraut mentioned this pull request Jul 6, 2026
Base automatically changed from vcha/goals-rename to 3.0 July 6, 2026 20:29
Comment thread pufferlib/config/ocean/drive.ini Outdated
Comment thread scripts/cluster_configs/single_agent_speed_run.yaml
Comment thread pufferlib/ocean/drive/drive.h Outdated
const float seg_dx = wp_b.x - wp_a.x;
const float seg_dy = wp_b.y - wp_a.y;
const float seg_len_sq = seg_dx * seg_dx + seg_dy * seg_dy;
for (int pass = 0; pass < 2; pass++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would appreciate a comment at the top of here I think, it's not immediately obvious to me the logic of this method though I am digging into it before approving

Comment thread pufferlib/config/ocean/drive.ini
Comment thread pufferlib/ocean/drive/drive.h
Comment thread pufferlib/ocean/drive/drive.h
Comment thread tests/drive/test_drive_goals.c

@eugenevinitsky eugenevinitsky left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So as not to block, going to suggest that we merge. Please squash so that we can revert easily if it causes a regression.

@vcharraut
vcharraut merged commit 08b3016 into 3.0 Jul 16, 2026
13 checks passed
@vcharraut
vcharraut deleted the vcha/goals-func branch July 16, 2026 17:21
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.

3 participants