Implement the smallest learning loop. For f(x)=x², start at any x, repeatedly move against the gradient, and return the complete loss history so another engineer can inspect every update.
Required APIdef gradient_descent(start, learning_rate, steps):
return [[step, x, loss], ...]BehaviorThink through the mechanism first if you want the extra reasoning step. It never blocks the editor.
gradient_descent(2.0, 0.25, 2)the update must move downhill and record both the start and each new point
gradient_descent(3.0, 0.1, 0)zero iterations still expose the initial loss
gradient_descent(0.0, 0.5, 2)the optimum is stable under further updates
3 hidden edge tests run after the visible contract passes.
Run Tests to see the contract verdicts here.