Skip to content

ASB-V24

Choose a tag to compare

@krilikd krilikd released this 15 Mar 03:56
· 4229 commits to main since this release
abeb470

πŸš€ AutoSystemBoost β€” Changelog


V24 β€” Persistent Intelligence

V23 = first session-aware governor with memory.
V24 = first governor that learns from its own past and changes behavior.


🧠 Core: Persistent Decision Layer

V24 adds three feedback loops that read session history at startup and adjust governor behavior based on accumulated patterns. This is the transition from reactive governor to adaptive system with memory.

Battery Feedback Loop #1 β€” Idle Discipline

Governor reads average bat_ttd (time-to-first-DEEP_IDLE) from past battery sessions:

Historical Pattern Action Result
avg(bat_ttd) > 60s bat_fast_idle_s 15 β†’ 10 Faster sleep entry
avg(bat_ttd) > 30s bat_fast_idle_s 15 β†’ 12 Moderately faster
bat_fast_idle_s < 5 Clamped to floor 5s Safety guard

Battery Feedback Loop #2 β€” MODERATE Domination

If battery sessions historically spend >60% of tracked idle time in MODERATE (instead of DEEP/LIGHT_IDLE), wake discipline is too loose:

feedback: battery MODERATE=68% of idle time β†’ bat_fast_idle 12β†’8

Auto History-Aware Startup

If >50% of accumulated sessions degraded from burst to stable, highload_mode=auto starts directly as stable β€” skipping the futile burst phase:

feedback: 6/10 sessions degraded β†’ auto starting as stable

πŸ“Š Session History (session_history.jsonl)

Full session summaries stored as JSON Lines. Last 10 sessions, survives reboots.

Each entry contains 24 fields with schema version:

{"v":1,"ts":"2026-03-15 14:30","profile":"performance","mode":"auto","end":"screen_off",
 "gaming":3,"sustained":2,"thermal":1,"unreachable":1,
 "t_heavy":180,"t_gaming":95,"t_sustained":45,
 "avg_gap":420000,"max_temp":67,"degraded":0,
 "t2s":120,"t2th":180,"t2g":30,"eff":82,"recovery":1,"sus_pct":18,
 "bat_deep":0,"bat_light":0,"bat_mod":0,"bat_wake":0,"bat_ttd":0}

Session End Reasons

"end" Trigger
screen_off Screen turned off (natural boundary)
shutdown Governor stopped (reboot / kill)
new_session start-session:* command received
idle_boundary 30 minutes of continuous DEEP_IDLE

Atomic Write Protection

History is written to .tmp first, then rename() to final path. If governor is killed mid-write, the previous valid history is preserved.


πŸ”‹ Battery Telemetry V2

Three new FSM fields bring battery branch to the same maturity level as high-load:

Field Description
bat_time_moderate_sec Time spent in MODERATE during battery mode
bat_screen_off_count Number of screen-off events in battery mode
bat_time_to_first_deep Seconds from session start to first DEEP_IDLE entry

All fields tracked in FSM, exposed in write_state, included in session_end log and session_history JSONL.


⏱️ New Metric: ses_time_to_first_gaming (t2g)

How fast does a gaming session actually start? Recorded on first GAMING entry, visible in:

  • /dev/.asb/state as ses_t2g
  • session_end log marker
  • session_history.jsonl as "t2g"

πŸ›‘οΈ DEEP_IDLE Auto-Boundary

30 minutes of continuous DEEP_IDLE = automatic session end. Governor saves history, saves persistent stats, resets telemetry. Prevents stale metrics from accumulating during overnight sleep.


πŸ’Ύ Persistent Stats β€” Improvements

Change V23 V24
Storage path /dev/.asb/ (tmpfs β€” lost on reboot) /data/adb/.../runtime/ (survives reboot)
Save trigger Governor shutdown only Every screen-off + shutdown + start-session
Fields count, t2s, t2th, temp, gap, eff + degrade_count (sessions where auto degraded)
State file hist_sessions, hist_t2s, hist_temp, hist_gap, hist_eff + hist_deg

Critical fix: V23's cross-session memory was stored in tmpfs and silently lost on every reboot. The entire hist_* feature was non-functional. V24 moves it to /data/ partition.


🎯 Atomic Session Start

New socket command for clean test setup:

asb start-session:performance:auto

Atomically: save previous session stats β†’ save history β†’ set profile β†’ set highload mode β†’ reset telemetry β†’ log session_start marker. Eliminates dirty test data from mixed states.


πŸ“ Session Markers

Machine-readable log entries for automated analysis:

On startup / start-session:

session_start profile=performance highload=auto bat=85% temp=32

On shutdown:

session_end gaming=3 sustained=2 thermal=1 unreachable=1 t_heavy=180s t_gaming=95s t_sustained=45s avg_gap=420000 max_temp=67 auto_degraded=0 t2s=120s t2thermal=180s t2g=30s efficiency=82 recovery=1 bat_deep=0s bat_light=0s bat_mod=0s bat_wake=0 bat_ttd=0s sus_pct=18%

πŸ› οΈ New Tools

Tool Purpose
tools/asb_session_report.py Markdown report from session_history.jsonl β€” trends, battery analysis, recommendations
tools/asb_compare_sessions.py Side-by-side comparison of multiple test log files

Session Report Example Output

# πŸ“Š ASB Session History Report
Sessions: 8

## πŸ“‰ Trends
| Metric              | Average | Min | Max  |
|---------------------|---------|-----|------|
| Max temperature     | 65Β°C    | 58Β°C| 72Β°C |
| Avg cap gap         | 380 kHz | 0   | 920k |
| Efficiency          | 78%     | 45% | 95%  |

## πŸ’‘ Recommendations
- ⚠️ Auto degraded in 5/8 sessions β€” burst often non-viable

βœ… V24 Summary

Feature Status
Session history (JSONL, last 10, atomic write) βœ…
Schema version ("v":1) βœ…
4 formal session end reasons βœ…
Battery feedback loop #1 (bat_ttd β†’ idle discipline) βœ…
Battery feedback loop #2 (MODERATE domination) βœ…
Auto history-aware startup (degrade β†’ stable) βœ…
Safety floor for bat_fast_idle_s (5s minimum) βœ…
DEEP_IDLE 30-min auto-boundary βœ…
Persistent stats on /data/ (survives reboot) βœ…
Screen-off save (stats + history) βœ…
degrade_count in persistent stats βœ…
ses_time_to_first_gaming (t2g) βœ…
bat_time_moderate_sec / bat_screen_off_count / bat_time_to_first_deep βœ…
start-session:profile:mode atomic command βœ…
Session markers in log (session_start / session_end) βœ…
tools/asb_session_report.py βœ…
tools/asb_compare_sessions.py βœ…
README.md + README.ru.md rewritten βœ…

V24 makes ASB not just remember what happened β€” but change its own behavior based on what it learned.