Rust power HAL: module test build (dodge / OnePlus 13) What changed - android.hardware.power-service (QTI power HAL with Laminar) rewritten in Rust: same name, rc, VINTF fragment (IPower V6) and SELinux label. Sessions, Laminar CPU floors (uclamp.min), the shared GPU floor, expensive rendering, touch boost, CPU/GPU headroom and the QTI ADPF hints for game sessions are all ported. The Laminar maths is unchanged. - sm8750 mode extension (Battery Saver caps, game loading boost, idle CPU limits from thermal-engine.conf) is now a Rust crate. One worker thread replaces a detached sleeping thread per game loading request. - Fixed from the C++: - createHintSessionWithConfig with an empty thread list crashed (null session) - the expensive rendering perf lock leaked when the mode was enabled twice - close() never released a game session's task load boost perf lock - pause()/close() raised the session's threads to the reset floor (384) for 150 ms instead of dropping it - the idle timer could wipe a floor a new frame had just raised - sessions sat in global tables keyed by raw pointers, read without their lock - Less work per session (app launch): no display-config call whose result was never used, read-only perf properties read once. - 2 extra Binder threads, so one app's frame reports do not queue behind another's. Calls into the perf client are still serialized, as the C++ (single thread) did. - Dependencies dropped: libxml2, libfmq, libutils, libcutils, libbase, display config client. Sources (server1 ~/penguin-dodge, local commits, not pushed; any ROM built from this tree now includes this HAL) - vendor/qcom/opensource/power 9a25071 "power: Rewrite the HAL in Rust" - device/oneplus/sm8750-common 2b253be "sm8750-common: power: Port the mode extension to Rust" - On top of the Rust vibrator HAL (sm8750-common 2a83583, dodge e623e20), which passed. ARB: not applicable. Not a flashable zip; nothing touches firmware, boot or partitions. The test bind-mounts one file over /vendor until reboot. How to test (root needed). Not tested on a device yet. 1. Copy this folder to the phone, e.g. /data/local/tmp/power-rust 2. Baseline first, with the installed HAL: su -c sh /data/local/tmp/power-rust/jank-sample.sh com.android.systemui 15 (scroll the notification shade the same way for 15 s; repeat for an app you use, e.g. the launcher or Settings). Save the output. 3. su -c sh /data/local/tmp/power-rust/test-power-rust.sh It swaps the HAL, prints threads/memory before and after, and restarts the framework (screen goes black for a few seconds) so every app opens new hint sessions with it. If the new service does not start it puts the installed one back by itself. 4. After the lock screen is back: su -c sh /data/local/tmp/power-rust/check-power-rust.sh Scroll while it samples the GPU floor. It also turns Battery Saver on and off to check the CPU/GPU caps (it leaves Battery Saver off). 5. Repeat the jank samples from step 2 the same way. 6. Device unit tests (optional): copy the two -test binaries to /data/local/tmp, chmod 755, run them. Send me the outputs of steps 2-5. Rollback - Reboot, or: su -c sh revert-power-rust.sh (also restarts the framework) - Last known-good ROM stays published: https://unicorn.serverhive.in/saikiran/dodge/1811/g627/ Update 2026-11-18 14:30 IST (Yoga Claude): fixed and device-tested on OP13 - power e34bd09: headroom reported unsupported when the perf HAL cannot measure it (it failed CPU and answered 0 for GPU, which apps read as no headroom). Also in the old C++. - sm8750-common 7fedc74: idle CPU limits count the prime boost frequencies; before, no idle limit ever applied (also in the old C++). Touch lifts the cap, it returns 2 s later. - test-power-rust.sh stages on its own tmpfs /mnt/penguin_power: /dev is nosuid and blocked the HAL from starting. - Device result: unit 15/15; Settings jank 0.32-0.65% (C++ 0.54%), shade 1.75-2.00% (C++ 2.6-2.7%), GPU floor 525 MHz while scrolling, 160 MHz after; Battery Saver caps equal C++. Service sha256 is now ff7c078ff0c29375a92a218f2200e8fff90f842fea1d5960b0ad3f0b638fe90d.