# Validation Log

## Validation Scenario
Full GPS-Denied pipeline running on Jetson Orin Nano Super (8GB) during a 50km flight with ~1500 frames at 3fps. Two AI models active: LiteSAM for satellite matching (keyframes) and XFeat as fallback. cuVSLAM running continuously for VO.

## Expected Based on Conclusions

### If using Native TRT Engine:
- LiteSAM TRT FP16 engine loaded: ~50-80MB GPU memory after deserialization
- XFeat TRT FP16 engine loaded: ~30-50MB GPU memory after deserialization
- Total AI model memory: ~80-130MB
- Inference runs on CUDA Stream B, directly integrated with cuVSLAM Stream A pipelining
- Tensor cores fully utilized at 1020 MHz
- LiteSAM satellite matching at estimated ~165-330ms (TRT FP16 at 1280px)
- XFeat matching at estimated ~50-100ms (TRT FP16)
- Engine files pre-built during offline preparation, stored on Jetson storage alongside satellite tiles

### If using ONNX Runtime TRT-EP:
- LiteSAM via TRT-EP: ~330-360MB during execution
- XFeat via TRT-EP: ~310-330MB during execution
- Total AI model memory: ~640-690MB
- First inference triggers engine build (latency spike at startup)
- CUDA stream management less direct
- Same inference speed (in theory, per MSFT claim)

### Memory budget comparison (total 8GB):
- Native TRT: OS 1.5GB + cuVSLAM 0.5GB + tiles 0.2GB + models 0.13GB + misc 0.1GB = ~2.43GB (30% used)
- ONNX RT TRT-EP: OS 1.5GB + cuVSLAM 0.5GB + tiles 0.2GB + models 0.69GB + ONNX RT overhead 0.15GB + misc 0.1GB = ~3.14GB (39% used)
- Delta: ~710MB (9% of total memory)

## Actual Validation Results
The memory savings from native TRT are confirmed by the mechanism explanation from MSFT (Source #2). The 710MB delta is significant given cuVSLAM map growth risk (up to 1GB on long flights without aggressive pruning).

The workflow integration is validated: engine files can be pre-built as part of the existing offline tile preparation pipeline. No additional hardware or tools needed — trtexec is included in JetPack 6.2.

## Counterexamples

### Counterexample 1: MinGRU operator may not be supported in TRT
MinGRU is a simplified GRU variant used in LiteSAM's subpixel refinement. Standard GRU is supported in TRT 10.3, but MinGRU may use custom operations. If MinGRU fails TRT export, options:
1. Replace MinGRU with standard GRU (small accuracy loss)
2. Split model: CNN+TAIFormer in TRT, MinGRU refinement in PyTorch
3. Use Torch-TensorRT which handles mixed execution

**Assessment**: Low risk. MinGRU is a simplification of GRU, likely uses subset of GRU ops.

### Counterexample 2: Engine rebuild needed per TRT version update
JetPack updates may change TRT version, invalidating cached engines. Must rebuild all engines after JetPack update.

**Assessment**: Acceptable. JetPack updates are infrequent on deployed UAVs. Engine rebuild takes minutes.

### Counterexample 3: Dynamic input shapes
If camera resolution changes between flights, engine with static shapes must be rebuilt. Can use dynamic shapes in trtexec (--minShapes, --optShapes, --maxShapes) but at slight performance cost.

**Assessment**: Acceptable. Camera resolution is fixed per deployment. Build engine for that resolution.

## Review Checklist
- [x] Draft conclusions consistent with fact cards
- [x] No important dimensions missed
- [x] No over-extrapolation
- [x] Conclusions actionable/verifiable
- [x] Memory calculations verified against known budget
- [x] Workflow integration validated against existing offline preparation

## Conclusions Requiring Revision
None — all conclusions hold under validation.
