Crescent Engine
Documentation / Spatial

Debug a spatial decision

Find the exact input behind a failed action, try a different action offline, and share a replay someone else can verify.

Run the Delivery example

Delivery evaluates two decisions. The controller first chooses a lane, then docks in the bay named by the instruction. A green order and a yellow order can produce the same camera input at the docking decision. The paired report checks that condition from the recording and measures whether the controller changed its choice and delivered both orders.

Use the 4 December Spatial Bench preview on an Apple silicon Mac running macOS 26.1 or later with Python 3.10+. Open Terminal in the extracted Crescent-Spatial-Bench directory. The scripted example deliberately returns an unsupported action at the second decision and needs no API key.

Terminal
runs=$(mktemp -d)
cat > "$runs/stops_at_dock.py" <<'PY'
from crescent_task import serve_policy

def decide(request):
    phase = request["observation"]["data"]["phase"]
    action = "take_left" if phase == "cross" else "unsupported_dock"
    return {"action": action, "args": {}}

serve_policy(decide)
PY

./spatial-bench custom-task-suite \
  --suite fixtures/control/delivery/suite.json --partition development \
  --policy "scripted=$runs/stops_at_dock.py" --output "$runs/delivery"
./spatial-bench delivery-report --run "$runs/delivery" \
  --output "$runs/paired"
open "$runs/paired/report.html"

You can also select the bundled suite in Custom Tasks → Examples → Delivery Suite and use a connected model. Pick Development while iterating. Use Evaluation to measure performance on held-out cases.

Read a failed decision

Failure review lists the order, controller, seed, decision and end reason. Open Input to see the original camera frame at that decision. When the engine applied an action, Result opens the resulting frame. A controller error such as invalid action, timeout or HTTP error leaves the episode at the recorded input.

In the green-order example, decision 2 begins at simulation tick 138. The controller returned an unsupported action. Applying dock_left from the verified input delivers the order at tick 198 with a reward of 1.

Original top-down sensor input at the docking decision
Recorded input at tick 138
Sensor result after the offline docking action moved the cargo to the green bay
Recorded alternate result at tick 198
Decision
One request for an action. Several simulation ticks can pass while an accepted action is applied.
Seed
The number used to reset the task. Keep the seed, task bundle and recording build matched when checking a specific result.
State and observation hashes
The report JSON records fingerprints for simulator state and controller input. Replay checks those fingerprints and the recorded feedback.

Continue from the error in the editor

  1. Open Experiments → Benchmark → Custom Tasks. For a just-completed single-task run, choose Try Action Offline next to the controller error. For the Delivery suite example, open Alternate Action → Choose Task Archive and select the delivery/cases/training-bay-green folder under $runs.
  2. Pick the trial and decision. The editor displays the camera input. Choose dock_left under Alternate action, then select Test Action Offline. Use Queue Action to test several decisions in order.
  3. Save the result in a new folder outside the source run. The editor presents the original controller error and the result of your plan. Open the HTML report or use Evidence Tools to verify or export it.

To produce the paired report inside the editor, choose Delivery Reports → Create from Latest Delivery Run or Create from Saved Run. Recent Reports remembers the last eight verified reports for the active project on this Mac. From there you can open the report, reveal its source run, or choose Verify Offline. Use Verify Saved Report to reconnect a report and run after moving their folders.

Continue from a terminal

Run this in the same Terminal session as the example. --step is one-based. Select the case folder within the suite and the controller ID shown in its report.

Terminal
case_run="$runs/delivery/cases/training-bay-green"
printf '%s\n' '{"action":"dock_left","args":{}}' > "$runs/dock-left.json"
./spatial-bench custom-task-counterfactual --run "$case_run" \
  --controller scripted --seed 42 --step 2 \
  --action "$runs/dock-left.json" --output "$runs/alternate"
open "$runs/alternate/report.html"

To test a longer plan from that input, pass --sequence with a JSON array of action objects. --replace-action is for a decision that has an accepted action and reuses any later recorded actions.

Verify and share the evidence

Use the same Editor or Bench build that recorded the run. The verifier reconstructs the selected input from accepted actions and checks the branch evidence against a fresh replay. The branch package carries the source case, task files, observations and alternate report together. Verification executes the included task code locally. Share and verify packages from authors you trust.

Terminal
./spatial-bench delivery-report --run "$runs/delivery" \
  --verify-report "$runs/paired"
./spatial-bench custom-task-counterfactual --run "$case_run" \
  --verify "$runs/alternate"
./spatial-bench custom-task-counterfactual --run "$case_run" \
  --package "$runs/alternate" --output "$runs/shared-branch"
./spatial-bench custom-task-counterfactual \
  --verify-package "$runs/shared-branch"

Retry the model from the same decision

Use Retry From Decision when you want the original endpoint to answer again on an interrupted single-task run. Crescent verifies the recorded prefix locally and sends the first new request at the failed decision. The retry uses the original model and response settings and writes a separate run. Use Try Action Offline to test an action you supply without sending an API request.