1.7 KiB
Phase 6 EPG retention test results
All mutating tests ran offline. The golden 1,742,053,376-byte snapshot remained
at SHA-256 71403743206d5082aae56c4a947f3429f5c3d54b908c4abe2eb0ca66e06694ba.
The full test used a disposable byte-for-byte copy.
Synthetic gates
python patches/epg-stale-cleanup/tools/test_epg_retention.py
PASS for empty DB, exact cutoff, just-expired row, current and future rows, 30-day and >1-year rows, duplicate timestamps spanning multiple batches, integrity and a second idempotent run.
Golden-snapshot workload
Fixed test clock: 2026-08-26 12:00:00 +02:00 (1787738400 seconds).
Seven-day cutoff: 1787133600 seconds.
| Metric | Before | After |
|---|---|---|
| Schedule rows | 3,071,250 | 7,387 |
| Rows older than cutoff | 3,063,863 | 0 |
| DB bytes | 1,742,053,376 | 4,059,136 |
| SQLite pages | 425,306 | 991 |
| Freelist pages | 0 | 0 |
The implementation committed 1,532 transactions of at most 2,000 rows. Total
runtime was 141.609 s on this PC; the slowest batch was 1,391 ms. SQLite
integrity_check returned ok. Because the stock DB has
auto_vacuum=FULL, the file shrank by 1,737,994,240 bytes without a VACUUM.
The immediate second run deleted zero rows, took effectively zero seconds and
left both size and SHA-256 unchanged. Detailed machine-readable results are in
phase6-full-snapshot-result.json.
Interpretation and release gate
This proves SQL correctness and bounded transactions for this database, not TV-runtime scheduling or lock safety. A real firmware build still needs an acquisition-contention test, standby/power-loss test, 30-day soak and the full Live TV/Guide/recording/reminder regression matrix. The production patch must not hold the provider-global monitor during the 2–3 minute legacy cleanup.