Repository navigation
fix(power): never dim the strip as the budget rises past the baseline (#5139) - #5159
Conversation
…#5139) #5153 gave budgets at or under the MCU + dark-current baseline the classic ratio, but one milliwatt above the baseline the headroom answer took over and was far smaller. On hardware (ESP32-C6, 100 WS2812B, baseline 625 mW) 625 mW lit the strip at 11 and 626 mW blanked it; 1000 mW gave 6. The limiter now floors its above-baseline answer at what a budget at the baseline gets, so brightness is monotone in the budget. Until the headroom answer overtakes the floor the modeled draw is over budget by up to controllable * baseline / full, the same excess a baseline budget has; the public docs and tests state that bound. AutoResearch gains --max-power-mw (runSingleTest maxPowerMw): one run per budget with dithering off, comparing every captured wire byte against the source scaled by the limiter's brightness, plus host checks of the policy on the measured wire scale.
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Memory usage (this PR vs. its merge base)Change in
|
Follow-up to #5153 (#5139). Adds a hardware power-limit test to AutoResearch, and fixes the limiter cliff that test found.
What the hardware found
#5153 works as described for budgets at or under the baseline (MCU + dark current). Those budgets now get the classic ratio instead of a blank strip, on both the legacy
addLedspath and the Channel API. Just above the baseline, though, the headroom answer took over and was much smaller:ESP32-C6, 100 WS2812B over RMT, baseline 625 mW, frame 0 (full demand 13427 mW):
Fix
Above the baseline, the limiter returns at least the classic answer for a budget at the baseline, so brightness never falls as the budget rises.
Trade-off: until the headroom answer overtakes the floor, at a budget of about
baseline + controllable * baseline / full, the modeled draw exceeds the budget by up tocontrollable * baseline / full. That is the same excess a budget at the baseline already has. The range can be wide: with fixed = controllable = 5 W, budgets from 5001 to about 7490 mW all return 127.power_mgt.hand the tests now state this bound.Test harness
bash autoresearch <env> --rmt [--legacy] --max-power-mw 50,400,625,626,700,1000,2000,4000,1000000runs onerunSingleTestper budget with dithering off.ci/autoresearch/power_check.pychecks the policy against the brightness measured on the wire: unlimited is 255; at or under the baseline the classic ratio; above it, never dimmer than at the baseline and within budget once past the floor. It also fails if a budget was sent but the firmware returned no power frames.MaxPowerUnsupportedConfig.Evidence
bash test power_mgt(quick and--debug, no sanitizer findings),fastled_core,power_prepass,power_estimation: all pass. New test: "raising the budget never dims the strip". The 64-bit reference model is updated to the same rule.bash lint: clean.Not covered
calculateFramePowerPlan/managedShowBrightness), which still returns flux 0 under the baseline. That path was not exercised here, so 3.10.9 on ESP32-S3 lights no pixels if set_max_power_in_milliwatts(1000) is called at startup #5139 may still apply to colour-managed strips.Summary by CodeRabbit