expanse analyse
Before submission. Recommends CPU, memory, GPU and walltime, with the probability the run completes.
expanse diagnose
After failure. Root cause with cited evidence, plus a prompt for your coding agent.
Resource recommendation
expanse analyse recommends what a workload will need before you submit it. It accepts a SLURM batch script, a source file, a Kubernetes workload manifest, or a Nomad jobspec.
- Terminal
- JSON
_s is seconds, _gb is memory in GiB (2^30 bytes, so an 80 GB card reads 79.6), _pct is percent. gpu_memory_peak_gb and gpu_utilisation_pct are measured on earlier runs of the same source on your compute; gpu_memory_floor_gb is the per-GPU memory the workload needs; host_ram_requested_gb is your own request, so the change is visible beside the recommendation.
completion_probability is the probability that a run of this workload completes at the recommended resources. It is computed from every recorded run of the same source on your compute, one run one observation: mean is the estimate, sigma its spread, p10 and p90 the range it most likely falls in. Four recorded successes read mean=0.90 with a wide spread; the spread narrows as your history grows. With fewer than two recorded runs the row reads unknown rather than a guess.
FAILURE RISK lists the risks at the resources you requested (none here, because every recorded run succeeded); the risk that remains once you adopt it is in the JSON as residual_failure_risk. confidence is the one confidence label on a result: low, medium or high. Runs of the same source on your compute make it high, and the score beside it is the probability that the next run fits the recommendation, counted from those runs: four runs that all fit read 0.83, ten read 0.92. EVIDENCE names the runs the numbers came from.
OPTIMISATION names the resource change analyse proposes as a class (memory_lower+walltime_raise); on an interactive terminal analyse then asks Apply the resource recommendations automatically? [y/n] and shows the diff as it applies. Analyse proposes resource changes only; it never suggests changing your code. For a workload with no history there is nothing to cite, so the recommendation comes from your source alone, flagged low confidence with explicit missing-evidence warnings rather than a fabricated history.
Patches are review-first: analyse never touches your files on its own. On an interactive terminal it asks Apply the resource recommendations automatically? [y/n]; y shows the diff and applies it, n leaves the expanse analyse diff and expanse analyse apply commands for later (--yes skips the confirmation). A patch that lowers a directive is marked review_required yes.
Failure diagnosis
expanse diagnose explains why an execution failed. It returns the root cause with the evidence it used (telemetry, logs, the captured source bundle, and similar executions of the same workload) and a prompt you paste into your own coding agent to make the change.
- Terminal output
- JSON output
PIPELINE DIAGNOSE shows what evidence the diagnosis stands on: one row per stage with done, degraded or skipped and a short note of what it found. RESOURCE SNAPSHOT uses the same names and units as expanse analyse; the GPU memory figures are per GPU, so the observed peak reads against one device’s capacity. FAILURE DETECTION carries the failure pattern, the confidence label, the root cause, and recurrence: the share of this workload’s recorded runs that failed, excluding this one, computed from every recorded run of the same source. With fewer than two other recorded runs the row is omitted rather than guessed.
Diagnose never proposes or applies a fix. The prompt is for your own coding agent, which owns the change: it carries the job, the diagnosis, the resource snapshot, telemetry peaks, code hotspots, source paths, a bounded log tail, and similar executions that succeeded, and it asks the agent to verify the root cause against your repository before changing anything. The question appears only on an interactive terminal; the JSON carries the same prompt as result.agent_prompt.
To get the prompt bare, for piping into a clipboard tool or over SSH: