Feature: Adaptive Frame Rate and Battery Management #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User Story
As a Marathon application user
I want the app to intelligently manage performance based on power source and thermal state
So that I can enjoy maximum performance when plugged in while preserving battery life and preventing thermal throttling when on battery power
Background
Currently, the executor runs in unbounded mode (
ControlFlow::Poll) which provides maximum performance but drains battery quickly and can cause thermal issues on laptops and mobile devices. We need adaptive behavior that balances performance with power efficiency.Acceptance Criteria
Scenario 1: Plugged In Mode - Maximum Performance
Scenario 2: Battery Mode - Efficient Operation
Scenario 3: Thermal Throttling - Prevent Overheating
Scenario 4: Power Source Change - Seamless Transition
Scenario 5: Configuration - User Control
Technical Requirements
Power Detection
Thermal Monitoring
Frame Rate Limiting
Configuration
Definition of Done
Implementation Notes
Current Code Location
The executor unbounded mode is implemented in `crates/app/src/executor.rs`:
Suggested Architecture
```rust
pub struct ExecutorConfig {
/// Frame rate cap when on battery (0 = unlimited)
pub battery_fps_cap: u32,
}
pub struct PowerMonitor {
current_source: PowerSource,
thermal_state: ThermalState,
// Platform-specific fields
}
enum PowerSource {
Battery { percent: f32 },
ExternalPower,
Unknown,
}
enum ThermalState {
Nominal,
Fair,
Serious,
Critical,
}
```
Related Issues
Assignee: @siennathesane