4.4 KiB
MovementTest Solver Timeout Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Make the observation-only MovementTest expose a 0.50-second default OSQP time budget without relaxing solver accuracy.
Architecture: TrajectoryObservationSettings owns the test-facing time-budget value and validates/copies it. The MovementTest maps its public field into those settings, and TrajectoryObservationController maps the snapshot into the per-session EM configuration. The production EM defaults remain unchanged.
Tech Stack: C# 10, .NET, existing EMPlannerVerificationHost test host.
Global Constraints
- Default test solver timeout is exactly
0.50dseconds. AbsoluteTolerance,RelativeTolerance, andStrictResidualToleranceremain1e-5d.- Do not change vehicle constraints, map construction, speed limits, or observe-only command behavior.
- Do not alter
EmPlannerConfiguration.CreateDefault(); the override belongs only to the observation test.
Task 1: Propagate the test solver budget into an EM request
Files:
- Modify:
ClumsyPilot/tests/EMPlannerVerificationHost/TrajectoryObservationChecks.cs:122-170,384-405 - Modify:
ClumsyPilot/ParkrobTrajplanner/tarjplanner_movementtest/TrajectoryObservationContracts.cs:9-49 - Modify:
ClumsyPilot/ParkrobTrajplanner/tarjplanner_movementtest/MovementTest.TrajectoryObservationTest.cs:25-70 - Modify:
ClumsyPilot/ParkrobTrajplanner/tarjplanner_movementtest/TrajectoryObservationPipeline.cs:198-214
Interfaces:
-
Consumes:
TrajectoryObservationSettings.CreateValidatedSnapshot()andTrajectoryObservationController.StartCycle(...). -
Produces:
TrajectoryObservationSettings.SolverTimeoutSeconds, copied toEmPlanningRequest.Configuration.Scheduling.SolverTimeoutSeconds. -
Step 1: Write the failing test
In VerifiesControllerBuildsSegmentZeroRequest, set a non-default observation setting and assert it reaches the request:
var settings = new TrajectoryObservationSettings
{
SolverTimeoutSeconds = 0.42d,
};
// Start one controller cycle.
Verification.NearlyEqual(0.42d, planningService.Requests[0].Configuration.Scheduling.SolverTimeoutSeconds,
"observer configured solver timeout");
Also extend VerifiesSettingsSnapshotAndVehicle to assert that a default snapshot retains 0.50d, and extend RejectsInvalidSettings with settings => settings.SolverTimeoutSeconds = 0d.
- Step 2: Run the focused verification to verify it fails
Run:
dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- trajectory-observation
Expected: FAIL because SolverTimeoutSeconds does not yet exist or its value is not propagated to the request.
- Step 3: Write the minimal implementation
Add and copy/validate the settings property:
public double SolverTimeoutSeconds { get; set; } = 0.50d;
Map it from the public MovementTest field, then set the session-local EM configuration:
configuration.Scheduling.SolverTimeoutSeconds = settings.SolverTimeoutSeconds;
Do not alter the EM default configuration or any tolerance property.
- Step 4: Run focused verification to verify it passes
Run:
dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- trajectory-observation
Expected: all trajectory-observation checks pass, including timeout propagation and invalid-setting rejection.
- Step 5: Run the related EM regression suite
Run:
dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- em-all
dotnet build ClumsyPilot/ClumsyPilot.csproj --no-restore
Expected: both commands finish successfully with no errors.
- Step 6: Commit the implementation
git add ClumsyPilot/tests/EMPlannerVerificationHost/TrajectoryObservationChecks.cs ClumsyPilot/ParkrobTrajplanner/tarjplanner_movementtest/TrajectoryObservationContracts.cs ClumsyPilot/ParkrobTrajplanner/tarjplanner_movementtest/MovementTest.TrajectoryObservationTest.cs ClumsyPilot/ParkrobTrajplanner/tarjplanner_movementtest/TrajectoryObservationPipeline.cs
git commit -m "feat: configure MovementTest solver timeout"