feat(power): expose factory default / min / max power target#292
Conversation
BOS+ (and other firmwares) report the power-target the device ships with —
the value all tuning starts from — plus the accepted min/max. Surface it:
- Add DefaultPowerTarget/MinPowerTarget/MaxPowerTarget DataFields and the
matching Option<Power> fields on MinerData, with GetDefaultPowerTarget /
GetMinPowerTarget / GetMaxPowerTarget traits (default to None) wired into
the GetMinerData supertrait + blanket impl.
- Braiins v26.04: read bosminer.metadata.autotuning.powerTarget.{default,min,max}
via the existing GraphQL client and parse them in the new traits.
- All other backends get trivial (None) impls.
- Python bindings + stubs + interop fixture updated.
|
Did some talking, and I think we want to wire this up under a "new" trait subsection, struct PowerTuningCapabilites {
default: Option<TuningTarget>,
minimum: Option<TuningTarget>,
maximum: Option<TuningTarget>
}
struct HashRateTuningCapabilites {
default: Option<TuningTarget>,
minimum: Option<TuningTarget>,
maximum: Option<TuningTarget>
}
struct PresetTuningCapabilites {
default: Option<TuningTarget>,
presets: Vec<TuningTarget>
}
struct TuningCapabilities {
power: Option<PowerTuningCapabilites>,
hashrate: Option<HashRateTuningCapabilites>,
presets: Option<PresetTuningCapabilities>,
} |
Per review feedback, replace the flat default/min/max power-target fields with
a structured MinerCapabilities-style TuningCapabilities, grouped by tuning
domain (power / hashrate / presets), each reusing the existing TuningTarget:
TuningCapabilities {
power: Option<PowerTuningCapabilities>, // default / minimum / maximum
hashrate: Option<HashRateTuningCapabilities>, // default / minimum / maximum
presets: Option<PresetTuningCapabilities>, // default / presets
}
- new asic-rs-core/src/data/capabilities.rs with the four structs (pydantic-
exposed like BoardData)
- single DataField::TuningCapabilities + GetTuningCapabilities trait replace the
three power-only fields/traits
- MinerData.tuning_capabilities replaces default/min/max_power_target
- BraiinsV2604 fills power.{default,minimum,maximum} from the autotuning
powerTarget metadata; hashrate/presets left for the backends that expose them
- python bindings (.pyi, data.py, module export) + interop test updated
|
Done — reworked it into TuningCapabilities {
power: Option<PowerTuningCapabilities>, // default / minimum / maximum
hashrate: Option<HashRateTuningCapabilities>, // default / minimum / maximum
presets: Option<PresetTuningCapabilities>, // default / presets
}A couple of decisions where the sketch left room — happy to change either:
CI is green. The three flat |
| if power == PowerTuningCapabilities::default() { | ||
| return None; | ||
| } |
There was a problem hiding this comment.
I think skipping this check is OK, since returning TuningCapabilities with any of the given keys helps indicate that a miner supports that type of tuning, EG we expect braiins to support power tuning.
|
FYI you can use the files in |
…ault-guard Address review on 256foundation#292: - drop the `power == default => None` guard; presence of a populated key already signals which tuning types a miner supports - shared helpers in backends/util.rs: - power_target_capabilities(): GraphQL `bosminer/metadata/autotuning/powerTarget` (power-only envelope), used by the GraphQL backends 21.09 / 25.03 / 25.05 - tuner_constraints_capabilities(): BOS+ REST GET /configuration/constraints -> tuner_constraints, mapping PowerConstraints (watts) and HashrateConstraints (TH/s) to power + hashrate envelopes, used by the REST backends 25.07 / 26.04 - 26.04 switched from the GraphQL power-target query to the REST constraints endpoint, and now also reports the hashrate envelope
|
Done — implemented across all BOS backends, CI green:
And it's verified on real hardware, not just CI/schema: tested against my S19k Pro on BraiinsOS. I actually had to fire the miner up on battery to do it (not enough solar at the time 🙂), but Thanks for the |
Surfaces the power target a miner ships with — plus the accepted min/max bounds. On BraiinsOS this is the value the tuner starts from: when you kick off a fresh tune, the autotuner anchors on this default power target and works out from there. Exposing it lets a UI offer the factory point as the natural starting step for a fresh (re-)tune, and present a realistic range around it instead of guessing.
DefaultPowerTarget/MinPowerTarget/MaxPowerTargetdata fields and matchingOption<Power>fields onMinerData, wired in through the usualGet*traits (default toNone) so every backend keeps compiling unchanged.bosminer.metadata.autotuning.powerTarget.{default,min,max}over the GraphQL client that's already there (unauth metadata, no extra auth path). On an S19k Pro this gives 2760 / 771 / 6435 W.Noneimpls. I only wired Braiins 26.04 because that's the firmware I can test against live; the other BOS backends expose the same GraphQL field, so mirroring it later is straightforward.Happy to reshape this — e.g. group the three into a small struct, or fold it into the tuning/config model if that fits your direction better. Verified live against a BraiinsOS S19k Pro.