Skip to content

Add a sub-45 BC student controller#40

Closed
teerthsharma wants to merge 4 commits into
commaai:masterfrom
teerthsharma:codex/bc-student-sub45
Closed

Add a sub-45 BC student controller#40
teerthsharma wants to merge 4 commits into
commaai:masterfrom
teerthsharma:codex/bc-student-sub45

Conversation

@teerthsharma

Copy link
Copy Markdown

What changed

This PR adds bc_student, a compact behavioral-cloning controller backed by a Torch MLP and a small saved checkpoint.

The short version: the earlier PID/topology experiments got close enough to be educational, but not close enough for the leaderboard cutoff. I switched to the idea that has clearly been winning this challenge: optimize good actions offline, then distill that behavior into a fast student policy. The resulting controller keeps the runtime simple: build the same state/future/past-action feature vector every step, run one CPU Torch forward pass, and clip the steering command into the simulator range.

Score

Full 5,000 segment local evaluation:

controller   lataccel_cost   jerk_cost   total_cost
bc_student   0.525043        17.537342   43.789511

That is below the strict <45 target and below the <50 range requested for leaderboard consideration.

Why this feels worth submitting

I did not want to send another clever-looking controller that only wins a small smoke test. This one got the full 5k pass before opening the PR. It is more direct, less hand-tuned, and much closer to the current leaderboard style: let offline trajectory optimization teach a policy, then submit the policy as the controller.

Validation

python -m py_compile controllers/bc_student.py
pytest -q test_bc_student.py
python -u eval_segment_action_replay.py --model_path ./models/tinyphysics.onnx --data_path ./data --num_segs 5000 --controller bc_student --workers 4 --chunksize 10 --output ./runs/bc_student_eval_5000.csv

The committed test covers model loading, finite/clipped actions, short future-plan padding, and model-cache reuse.

Notes

The controller depends on torch>=2.0 for inference. The checkpoint is intentionally included so the controller is self-contained for evaluation.

Integrated AETHER-Link telemetry feature extraction to solve the over-correction problem. Traditional PID controllers oscillate under high variance (high jerk). The Aether DSP continuously calculates spectral energy to dampen aggressive maneuvers dynamically.

Result curve:
[PID] -> /\/\/\ (High Jerk)
[AETHER] -> __---__ (Smooth, low Jerk)
Total cost significantly reduced (from 106.8 to 84.45) by squashing oscillation at the derivative level, and we then ask the computer to be trained on a decoupling RL to decouple the MEss and keep checking what to do.
@teerthsharma teerthsharma changed the title [codex] Add a sub-45 BC student controller Add a sub-45 BC student controller Jun 16, 2026
@teerthsharma

Copy link
Copy Markdown
Author

Superseded by #41 from the renamed Banach branch.

@teerthsharma teerthsharma deleted the codex/bc-student-sub45 branch June 16, 2026 10:43
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