File size: 4,340 Bytes
68eeb00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Population-Scale Evaluation — Roadmap

Trustworthy foundation for population-level intelligence on Sensorflow Studio.  
**Rule:** extend MegaEval + LabelEval; no parallel stores, auth, or browser ML.

Canonical code: `hf-space/`. Shared perception modules also live under root `sensorflow/`.

---

## Non-goals (all phases)

- Rebuild from scratch or replace MegaEval cube/runs
- New microservice fleet or second database
- Second auth system
- Sync browser-side ML inference
- Hard-coded safety thresholds (use config / policy JSON)
- Silent overwrite of evaluation / regression history
- Full ODD combinatorics, VLM mining, or distributed executors before their phase

---

## Phase 1 — Foundation (this session)

**Extend:**
- `sensorflow/evaluation/records.py` concepts (do not fork store)
- `sensorflow/megaeval/{runs,analysis,api,cube}.py`
- `quality_gate.py`, `launch_gate_evaluator.py`
- React MegaEval / Evaluation / Quality pages

**Create:**
| Artifact | Path |
|----------|------|
| Inventory | `docs/PLATFORM_INVENTORY.md` |
| This roadmap | `docs/POPULATION_SCALE_ROADMAP.md` |
| Platform package | `hf-space/sensorflow/platform/` |
| UI hooks | `hf-space/src/components/platform/`, service `platform.ts` |
| Tests | `hf-space/tests/test_platform/` |

**Deliverables:**
1. Schema entities with versioning/provenance
2. `AggregateLevel` evaluation abstraction (frame→…→population)
3. Metric engine: container PRF/IoU + verification rates
4. Container quality profile API
5. Model compare API (A/B/C) wrapping MegaEval compare
6. Routes: `/api/evaluations`, `/api/containers`, `/api/models/compare`, `/api/gates`
7. UI: container quality table, model compare panel, multi-gate skeleton
8. Evidence package JSON export stub
9. Tests run green

**Hooks left for later (TODO markers):** multi-grader vectors, embedding/VLM mining, SSAM conflict engine, ODD coverage, distributed reduce.

---

## Phase 2 — Multi-grader consensus & label trust

**Extend:** `evaluation/graders.py`, `triage.py`, `reporting.py`  
**Add:** consensus vectors, disputed/auto-accept rates into container profiles  
**UI:** GraderDisagreement + Command Center quality tab  
**Do not:** replace triage policy store

---

## Phase 3 — Rare-event & embedding mining

**Extend:** `evaluation/rare_events.py`, MegaEval `embeddings.npz` / `sketches.py`  
**Add:** VLM/embedding similarity search APIs (async jobs)  
**UI:** RareEventDashboard + InvestigationTab  
**Do not:** sync browser embeddings

---

## Phase 4 — Safety / SSAM conflict engine

**Extend:** SSAM routes in `app_backend.py`, `SSAMSafetyDashboard`  
**Add:** DRAC / DeltaS conflict entities (`Conflict`), EvidencePackage links  
**Config-driven thresholds only**  
**Do not:** hard-code severity cutoffs in UI

---

## Phase 5 — ODD combinatorial coverage

**Extend:** `ODDDefinition` / `ODDObservation` stubs from Phase 1  
**Add:** coverage matrix over dims (weather×lighting×road×scenario…) via MegaEval cube  
**UI:** Coverage gate fills multi-gate skeleton  
**Do not:** new OLAP store — use cube queries

---

## Phase 6 — Release / regression / HITL orchestration

**Extend:** `evaluation/regression.py`, review queue, launch gate  
**Wire:** Regression + Safety + Release gates to real metrics  
**Preserve:** full regression history (append-only)

---

## Phase 7 — Distributed scale

**Replace stand-ins** documented in `hf-space/ARCHITECTURE.md`:
| Today | Target |
|-------|--------|
| npz partitions | Parquet / Iceberg |
| ThreadPoolExecutor | Spark / Flink / Ray |
| QueryRouter cache | Pinot / Druid / ClickHouse |
| JSON EvalStore | Keep for control-plane metadata; lakehouse for facts |

Keep API contracts from Phases 1–6 stable.

---

## Aggregate ladder (canonical)

```
frame → clip/sequence → scene → drive → container → dataset/population → cohort → fleet/population aggregate
```

Implemented in Phase 1 as `AggregateLevel` + `EvaluationScope`; MegaEval already materializes population/cohort/container; LabelEval owns frame/annotation.

---

## Observability checklist (carry forward)

- Every query: `source`, `cache_hit`, `latency_ms` (MegaEval pattern)
- Every gate: config path + threshold values in result
- Every evidence package: model/dataset versions + compute usage + provenance
- No silent history overwrite