The control law
The residual never replaces the base — it corrects it:a_base; the small residual head emits Δa, scaled by
α (action scale) and an optional gate. The base never receives a gradient.
env residual init: scaffold + profile
Establishes the residual architecture and dry-run profiles the head — params,
per-step latency, peak memory — before you commit to a training run. No training
happens here.
Writes
rescue-dog/residual/residual.json.
env residual train: governed PPO on the frozen base
PPO-trains the residual head against the frozen base under a perturbation
curriculum (sparse reward). The Cadenza API governs the run: it picks the
hyperparameters, decides when to stop, and returns the verdict — the client only
collects rollouts and runs the raw PPO step each round.
DEPLOY the policy is saved and promoted as the residual baseline; on BLOCK
it rolls back to the previous residual. The trained head lands at
rescue-dog/residual/residual_policy.pt.
env residual eval: govern the residual
Re-scores the trained residual on its own — success / collision / residual-sanity
/ regression — and returns DEPLOY | BLOCK | NEEDS_DATA. --promote sets it as
the baseline if it passes. See Governance.
env residual bench: residual vs full RL
A head-to-head benchmark of the current full-RL stack against cadenza-cli’s
residual RL — reporting compute, dollar cost, and accuracy, then a verdict on
whether the residual arm wins.
Distillation: a base-free onboard student
Once a residual is deployed,env distill collects teacher (base + residual)
rollouts and trains a compact student that reproduces the teacher’s behaviour
without loading the base — so it runs on CPU/MPS at the control-loop rate,
optionally quantized to int8.
The report prints the teacher→student success gap, student param count, and the
onboard latency against the 50 Hz control budget (it tells you whether the
student
meets or MISSES the floor). Artifacts land in rescue-dog/student/.
Govern the student
DEPLOY | BLOCK | NEEDS_DATA verdict, with rollback on BLOCK.