Skip to content

Add classic acceleration exponent#115

Open
SimoneMariaRomeo wants to merge 1 commit into
Gnarus-G:mainfrom
SimoneMariaRomeo:codex/maccel-classic-exponent
Open

Add classic acceleration exponent#115
SimoneMariaRomeo wants to merge 1 commit into
Gnarus-G:mainfrom
SimoneMariaRomeo:codex/maccel-classic-exponent

Conversation

@SimoneMariaRomeo

@SimoneMariaRomeo SimoneMariaRomeo commented May 15, 2026

Copy link
Copy Markdown

Summary

  • add a CLASSIC_EXPONENT kernel parameter for the existing linear/classic curve
  • expose it through the Rust CLI/TUI parameter list and NixOS module as classic-exponent / classicExponent
  • preserve current behavior by defaulting to exponent 2, while allowing values above 2 for a more classic-style curve

Validation

  • git diff --check
  • not run: cargo fmt, cargo test, driver tests, or kernel-module build because this Windows environment has no Cargo/Rust/C toolchain and Docker is not running

Fixes #111.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a new classicExponent parameter for the linear acceleration curve. Default value is 2, ensuring backward compatibility. Exponent values greater than 2 adjust the curve shape near the acceleration offset and at higher input speeds.

Review Change Stack

@vercel

vercel Bot commented May 15, 2026

Copy link
Copy Markdown

@SimoneMariaRomeo is attempting to deploy a commit to the gnarusg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 54c0f922-10b0-4d84-a8db-edb2e3b9f633

📥 Commits

Reviewing files that changed from the base of the PR and between c7c1369 and 070fb51.

📒 Files selected for processing (11)
  • README.md
  • README_NIXOS.md
  • crates/core/src/context.rs
  • crates/core/src/params.rs
  • crates/core/src/persist.rs
  • crates/core/src/sens_fns.rs
  • driver/accel/linear.h
  • driver/accel_k.h
  • driver/params.h
  • driver/tests/accel.test.c
  • module.nix

📝 Walkthrough

Walkthrough

This PR adds a configurable classic_exponent parameter to the linear acceleration model, enabling classic-style curves where exponent values greater than 2 produce steeper sensitivity curves. Changes span the Rust parameter system, kernel driver implementation, NixOS configuration, and test coverage with validation and documentation updates.

Changes

Classic Exponent Implementation

Layer / File(s) Summary
Rust parameter definition
crates/core/src/params.rs
Added ClassicExponent enum variant to Linear mode parameters, mapped to kernel name "CLASSIC_EXPONENT", display name "Classic Exponent", with description noting that exponent 2 preserves existing behavior; validation rejects non-positive values.
Rust parameter propagation
crates/core/src/context.rs, crates/core/src/persist.rs, crates/core/src/sens_fns.rs
Parameter is captured in params_snapshot, persisted to sysfs via set_all_linear, and forwarded to the sensitivity function's acceleration calculation pipeline.
Kernel linear acceleration implementation
driver/accel/linear.h
linear_curve_args struct gains classic_exponent field; linear_base_fn accepts exponent and computes power using fast-path square for exponent 2 or general fpt_pow; __linear_sens_fun logs exponent and clamps non-positive values to 2 before passing to linear_base_fn.
Kernel module parameter wiring
driver/params.h, driver/accel_k.h
Module parameter CLASSIC_EXPONENT defined with architecture-dependent fixed-point defaults; collect_args initializes the parameter from PARAM_CLASSIC_EXPONENT when using linear mode.
NixOS configuration
module.nix
Added hardware.maccel.parameters.classicExponent option (nullable float, > 0.0); wired to kernel module parameter string generation via fixed-point encoding.
Tests and documentation
driver/tests/accel.test.c, README.md, README_NIXOS.md
Linear test setup extended to pass exponent value; new unit test test_classic_exponent_changes_linear_curve asserts that exponent 3 produces higher sensitivity than exponent 2; parameter documented in README with default and qualitative curve effects; NixOS Quick Start example includes classicExponent = 2.0;.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A hop through acceleration's might,
Where exponents dance and curves take flight,
From Rust to kernel, the parameters flow,
Classic style now has a dazzling show,
Configuration tames the power below!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change—adding a classic acceleration exponent parameter to the linear acceleration curve.
Linked Issues check ✅ Passed The PR fully implements the objective from issue #111 by adding a configurable exponent parameter to the linear acceleration formula with a default value of 2.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the classic acceleration exponent feature; no out-of-scope modifications were detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Classic" Style Accel

1 participant