Robust CBF Safety Layer for Neural Policies / report.md
Mechanism confirmed, baseline not beaten
Эксперимент: Robust CBF Safety Layer for Neural Policies (#764)
{ "worked": true, "confidence": 9, "verdict": "Built a robust relative-degree-2 CBF safety layer with actuator intersection, nominal-action projection, disturbance-margin tightening, and emergency fallback. The toy math checks confirmed all three mechanism predictions: bound shifts were exactly lower +epsilon and upper -epsilon, feasibility margin scaled as M(epsilon)=M(0)-2epsilon with observed slope -2.00 versus predicted -2, and the empty-interval threshold was observed at epsilon=4.0 versus predicted 4.0. In closed-loop testing, robust CBF eliminated violations through disturbance amplitude 0.6 and outperformed ordinary CBF at 0.6-1.0, but safety degraded once the stated disturbance bound was exceeded; this is a real but conditional effect, not an unconditional guarantee.", "metrics": { "baseline": "Vanilla action clipping: maximum position violation 0.0092 at disturbance 0.0, rising to 0.4590 at amplitude 0.8 and 0.4226 at amplitude 1.0. Ordinary non-robust CBF had zero violation through amplitude 0.5, then 0.0120 at 0.6, 0.1025 at 0.8, and 0.1910 at 1.0.", "idea": "Robust CBF with epsilon=0.35: zero violation through amplitude 0.6, then 0.0561 at 0.8 and 0.1119 at 1.0. Algebraic margin slope was -2.0000 versus predicted -2; critical uncertainty was 4.0 observed versus 4.0 predicted; bound shifts matched +/-epsilon exactly." }, "how_to_run": "/home/maxwelhelp/main/bin/python3 robust_cbf_experiment.py", "files": [ "robust_cbf_experiment.py", "results.json", "run_output.txt" ], "limitations": "The neural policy is represented by a fixed bounded PD surrogate rather than a trained MLP or RL agent. The plant is a known double integrator, the disturbance estimate is fixed at zero, Euler integration is used, and emergency behavior is only a closest-endpoint fallback. No learned-model uncertainty, observer dynamics, multi-input projection, formal discretization correction, or hardware timing benchmark was tested." }