Add Synchronous Gain acceleration mode - #119
Conversation
On pre-6.11 kernels the handler returns void and cannot communicate a new event count, so injecting synthetic events into the vals buffer is undefined behavior. Restrict ensure_axes_for_rotation() and the memmove injection to __cleanup_events (>= 6.11) only.
* Improve C test reporting * Handle snapshot diff pipe failures
* Add root cause analysis for divide-by-zero kernel panic in maccel_events Add three RCA documents analyzing the #DE divide-by-zero panic in maccel_events (issue #112). The documents cover the fault mechanism where consecutive EV_SYN events with identical ktime_get() timestamps produce a zero divisor in input_speed(), triggering a fatal idivq in interrupt context. Each RCA examines the call path, root causes including unguarded fixed-point divisions and missing parameter validation, and potential fix strategies. * Add tests for division-by-zero and invalid timing guards Add a test for div128_s64_s64 with a zero divisor, running it in a forked child to catch the current SIGFPE trap and assert a clean exit once the guard is implemented. Create a new test suite for acceleration functions that validates survival and correct behavior when given zero or negative time deltas, zero input DPI, and a motivity of exactly one (which produces a zero logarithm divisor). Each case runs in a forked child to prevent the current SIGFPE from killing the test runner. * Add guard tests for division-by-zero kernel panic Encode the safety invariant for maccel#112: division by zero in the fixed-point hot path (time_ms, input_dpi, motivity) must return a defined value, not trap #DE/SIGFPE. Each case runs in a forked child so the current unsafe behavior fails as an assertion instead of core-dumping the suite. Red until the guards are implemented. * Guard fixed-point division and input speed against zero/invalid divisors fpt_div and div128_s64_s64 returned undefined behavior (SIGFPE in userspace, #DE in IRQ context) on a zero divisor. input_speed also divided by time_ms without checking, and left LAST_INPUT_MOUSE_SPEED stale on early return. Return 0 on zero divisor, and return 0 / clear the published speed when time_ms <= 0 or distance calculation fails. Fixes the panic in maccel#112. * Remove outdated RCAs for divide-by-zero kernel panic The root cause analysis documents for issue #112 are no longer relevant as the fix has been implemented. These files contained duplicate and superseded analysis from multiple AI models, and keeping them in the repository would cause confusion about the current state of the fix. * Handle interrupted test child waits
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (19)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #78.
Summary
synchronous-gainas a distinct acceleration mode while preserving all existing mode ordinalsSYNC_GAIN_GAMMA,SYNC_GAIN_SMOOTH,SYNC_GAIN_MOTIVITY, andSYNC_GAIN_SPEEDparametersImplementation
4GAINboolean and its runtime branchsynchronous.handsynchronous_gain.hinto independent implementationsSYNC_GAIN_*configurationVerification
make testmake test name=synchronous_gain DRIVER_CFLAGS=-DFIXEDPT_BITS=32make buildcargo test --allcargo fmt --all --checkclang-format --dry-run --Werror driver/accel.h driver/accel/synchronous.h driver/accel/synchronous_gain.h driver/accel/mode.h driver/accel_k.h driver/maccel.c driver/params.h driver/tests/synchronous_gain.test.cNix parsing was not run locally because Nix is not installed in the development environment; release tags remain intentionally deferred while the PR is a draft.