# Validation Log — Draft02 Assessment (Draft03)

## Validation Scenario 1: Factor graph initialization with first satellite match

**Scenario**: Flight starts, VO processes 10 frames, satellite match arrives for frame 5.

**Expected with Draft03 fixes**:
1. GTSAM graph starts with PriorFactorPose2 at starting GPS (frame 0).
2. BetweenFactorPose2 added for frames 0→1, 1→2, ..., 9→10.
3. Satellite match for frame 5: add PriorFactorPose2 with position from satellite match and noise proportional to reprojection error × GSD.
4. iSAM2.update() triggers backward correction — frames 0-4 and 5-10 both adjust.
5. All positions in local ENU coordinates, converted to WGS84 for output.

**Validation result**: Consistent. PriorFactorPose2 correctly constrains Pose2 variables. No GPSFactor API mismatch.

## Validation Scenario 2: Segment start with unknown heading (rotation handling)

**Scenario**: After a sharp turn, new segment starts. First image has unknown heading.

**Expected with Draft03 fixes**:
1. VO triple check fails → segment break.
2. New segment starts. No heading available.
3. For satellite coarse retrieval: DINOv2-S processes unrotated image → top-5 tiles.
4. For fine matching: try SuperPoint+LightGlue at 4 rotations {0°, 90°, 180°, 270°}.
5. If match found: heading estimated from satellite alignment. Subsequent images rectified.
6. If no match: try SIFT+LightGlue (rotation-invariant).
7. If still no match: request user input.

**Validation result**: Consistent. Three-tier fallback addresses the heading bootstrap problem.

## Validation Scenario 3: VRAM budget during satellite matching

**Scenario**: Processing frame with concurrent VO + satellite matching on RTX 2060 (6GB).

**Expected with Draft03 fixes**:
1. XFeat features already extracted for VO: ~200MB VRAM.
2. DINOv2 ViT-S/14 loaded for coarse retrieval: ~300MB.
3. After coarse retrieval, DINOv2 can be unloaded or kept resident.
4. SuperPoint loaded for fine matching: ~400MB.
5. LightGlue ONNX loaded: ~500MB.
6. Peak if all loaded: ~1.4GB.
7. ONNX Runtime workspace: ~300MB.
8. Total peak: ~1.7GB — well within 6GB.
9. faiss runs on CPU — no VRAM impact.

**Validation result**: Consistent. VRAM budget is comfortable even without model unloading.

## Validation Scenario 4: Extended satellite failure (50+ frames)

**Scenario**: Flying over area with outdated/changed satellite imagery. Satellite matching fails for 80 consecutive frames (~8km).

**Expected with Draft03 fixes**:
1. Frames 1-10: normal VO, satellite matching fails. Cumulative drift increases.
2. Frame ~10 (1km drift): warning SSE event emitted. Satellite search radius expanded.
3. Frame ~20 (2km drift): user_input_needed SSE event. If user provides GPS → anchor + backward correction.
4. If user doesn't respond within timeout: continue with LOW confidence.
5. Frame ~50 (5km drift): positions marked as very low confidence.
6. Confidence score per position decays exponentially from last anchor.
7. If satellite finally matches at frame 80: massive backward correction. Refined events emitted.

**Validation result**: Consistent. Explicit drift thresholds are more predictable than the custom GTSAM factor approach.

## Validation Scenario 5: Google Maps session token management

**Scenario**: Processing a 3000-image flight. Need ~2000 satellite tiles.

**Expected with Draft03 fixes**:
1. On job start: create Google Maps session with POST /v1/createSession (returns session token).
2. Use session token in all tile requests for this session.
3. Daily limit: 15,000 tiles → sufficient for single flight.
4. Monthly limit: 100,000 → ~50 flights.
5. At 80% daily limit (12,000): switch to Mapbox.
6. Mapbox: 200,000/month → additional ~100 flights capacity.

**Validation result**: Consistent. Session management addressed correctly.

## Review Checklist
- [x] Draft conclusions consistent with fact cards
- [x] No important dimensions missed
- [x] No over-extrapolation
- [x] Conclusions actionable/verifiable
- [x] GPSFactor API mismatch verified against GTSAM docs
- [x] VRAM budget calculated with specific model variants
- [x] Rotation handling addresses segment start edge case
- [x] Drift management has concrete thresholds

## Counterexamples
- **Very low-texture terrain** (uniform sand/snow): XFeat VO might fail even on consecutive frames. Mitigation: track texture score per image, warn when low.
- **Satellite imagery completely missing for region**: Both Google and Mapbox might have no data. Mitigation: user-provided tiles are highest priority.
- **Multiple concurrent GPU processes**: Another process using the GPU could reduce available VRAM. Mitigation: document exclusive GPU access requirement.

## Conclusions Requiring No Revision
All conclusions validated. Key improvements are well-supported:
1. Correct GTSAM factor types (PriorFactorPose2 instead of GPSFactor)
2. DINOv2 ViT-S/14 for VRAM efficiency
3. Three-tier rotation handling
4. Explicit drift thresholds in Segment Manager
5. asyncio.Queue-based SSE publisher
6. CPU-based faiss
7. Session token management for Google Maps
