# Acceptance Test: Multiple 350m Outliers Robustness

## Summary
Validate AC-3 requirement with multiple outlier frames (>250m position jumps) occurring in the same flight to ensure robust cost functions handle complex scenarios.

## Linked Acceptance Criteria
**AC-3**: The system should correctly continue the work even in the presence of up to 350 meters of an outlier photo between 2 consecutive pictures en route.

## Preconditions
- ASTRAL-Next system operational with robust M-estimation
- Factor graph configured with Cauchy or Huber loss
- Multiple outlier test dataset prepared
- Ground truth available for all frames

## Test Data
- **Primary**: AD000001-AD000060 (contains multiple sharp turns >200m)
- **Identified Outliers**:
  - AD000003 → AD000004: 202.2m
  - AD000032 → AD000033: 220.6m
  - AD000042 → AD000043: 234.2m
  - AD000044 → AD000045: 230.2m
  - AD000047 → AD000048: 268.6m (largest)
- **Total**: 5 large position jumps in 60-image sequence

## Test Steps

### Step 1: Process First Outlier (AD000003-004)
**Action**: Process images through first 202.2m jump
**Expected Result**:
- Outlier detected by L1 (unexpected translation magnitude)
- Robust kernel down-weights this constraint
- L2 may activate for global verification
- Trajectory continues without divergence
- Status: OUTLIER_1_HANDLED

### Step 2: Process Second Outlier (AD000032-033)
**Action**: Continue processing through 220.6m jump
**Expected Result**:
- Second outlier detected independently
- Factor graph handles multiple down-weighted factors
- Previous outlier handling does not interfere
- Trajectory remains globally consistent
- Status: OUTLIER_2_HANDLED

### Step 3: Process Clustered Outliers (AD000042-045)
**Action**: Process two consecutive large jumps (234.2m and 230.2m)
**Expected Result**:
- System detects challenging sequence
- L2 global relocalization activates more frequently
- Both outliers handled without trajectory collapse
- Factor graph optimization remains stable
- Status: CLUSTERED_OUTLIERS_HANDLED

### Step 4: Process Largest Outlier (AD000047-048)
**Action**: Process the 268.6m outlier
**Expected Result**:
- Largest outlier correctly identified
- Robust cost function prevents trajectory distortion
- L2 provides absolute anchor for verification
- Post-outlier tracking recovers quickly
- Status: MAX_OUTLIER_HANDLED

### Step 5: Complete Flight Processing
**Action**: Process remaining images to AD000060
**Expected Result**:
- All frames processed successfully
- Factor graph converges despite multiple outliers
- Final trajectory globally consistent
- Status: COMPLETED

### Step 6: Analyze Multi-Outlier Performance
**Action**: Validate final trajectory and outlier handling
**Expected Result**:
```
Total outliers (>200m): 5
Correctly handled: 5/5 (100%)
Post-outlier recovery: <2 frames average
Final trajectory accuracy: ≥80% <50m error
MRE: <1.5px
No divergence events: True
```

## Pass/Fail Criteria

**PASS if**:
- All 5 large jumps handled without system failure
- ≥4/5 outliers correctly down-weighted by robust kernel
- Overall trajectory meets AC-1 (80% <50m error)
- Factor graph converges with MRE <2.0px
- No catastrophic tracking loss

**FAIL if**:
- System crashes on any outlier
- >1 outlier causes trajectory divergence (>3 frame error propagation)
- Final trajectory accuracy <70% within 50m
- Factor graph fails to converge
- Manual intervention required more than once

## Technical Validation Metrics
- **Outlier Detection Rate**: 5/5 correctly flagged
- **Down-weighting**: Outlier factors weighted <0.4
- **Recovery Time**: Mean <2 frames to <50m error post-outlier
- **Optimization Stability**: Converges in <100 iterations
- **Memory**: No unbounded growth in factor graph

## Stress Test Considerations
- Multiple outliers test factor graph robustness more rigorously than single outlier
- Clustered outliers (AD000042-045) are particularly challenging
- System must not "learn" to ignore all large translations as outliers
- Balance between robustness and responsiveness critical

## Notes
- This test exceeds AC-3 minimum requirement (single outlier)
- Real-world flights likely contain multiple challenging frames
- Successful handling demonstrates production-ready robustness

