refactor(core): address audit findings (bugfixes, dedup, dead-code, comment hygiene)#383
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThree core input-processing improvements: tilt mode now skips yaw-to-stick conversion by returning null from selectTiltAxis; macro pending-release handling removes the 32-entry tracking limit via reverse-scan logic; mapper.apply optimizes tap-release clearing and reuses stick-config computations while expanding gesture and macro/layer test coverage. ChangesInput Processing Improvements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…omment hygiene) - gyro: selectTiltAxis returns null for .yaw (was 0.0), so axis_y="yaw" in tilt mode leaves joy_y absent instead of a constant-zero stick output that spuriously suppressed the physical Y axis; add regression test - gyro: drop "vader5" origin annotation and renumber the process-step comments to a contiguous [1..5] sequence - macro_player: emitPendingReleases walks executed steps in reverse instead of a fixed 32-entry held[] stack, so macros with >32 outstanding .down steps no longer leak stuck keys on cancel/layer-switch; add regression test - macro_player: strip resolved issue #99 references from doc comments - mapper: drop dead self.injected_buttons &= ~mask in the pending-tap-release flush (injected_buttons is unconditionally zeroed before output) and fix the misleading comment - mapper: hoist effectiveStickConfig(.left/.right) so each is computed once per apply() frame instead of twice - mapper: strip resolved issue #99 reference from the axis-floor comment - mapper: add integration tests for gesture tap and gesture hold (gamepad bit persists then clears on release) through apply(), and for pause_for_release macro drain on layer deactivation test plan: scripts/padctl-docker test (EXIT=0); each new regression test proven falsifiable by reverting its production fix refs: codebase audit
ef7b9fe to
78e3ddf
Compare
Addresses a batch of codebase-audit findings across
src/core/.Changes
selectTiltAxisreturnsnullfor.yawinstead of0.0. Previouslyaxis_y = "yaw"in tilt mode produced a constant-zerojoy_y(non-null), which spuriously setsuppress_right_stick_gyroand zeroed the physical stick Y axis. Now the axis is correctly absent. + regression test.vader5origin annotation; renumbered the process-step comments to a contiguous[1..5].emitPendingReleasesnow walks executed steps in reverse to compute net-held keys, removing the fixed 32-entryheld[]cap that silently dropped releases for macros with >32 outstanding.downsteps (stuck keys on cancel / layer-switch). + regression test (40 distinct held keys all released).issue #99references from doc comments.self.injected_buttons &= ~maskin the pending-tap-release flush —injected_buttonsis unconditionally zeroed before output, so the masking had no effect; fixed the misleading comment.effectiveStickConfig(.left/.right)so each is computed once perapply()frame instead of twice.issue #99reference from the axis-floor comment.apply(), and forpause_for_releasemacro drain on layer deactivation.Skipped (verified, not changed)
timer_queue.canceltombstone rewrite — micro-perf on a <32-entry heap; tombstone-by-token risks suppressing re-armed tokens. Current rebuild is correct and simpler.gyro/stickmode[]const u8→ enum — wide cross-file refactor (runtime structs, resolve fns, ~11 call sites) for poll-rate string compares the finding itself calls harmless.layer.processLayerTriggersResolvedLayerConfig— same perf-only tradeoff, requires a parallel resolved array kept in sync.currentMappedGamepadFramededup intobuildEmitState— ~60-line refactor of intentionally-divergent logic; high behavior-change risk for a simplification.Test plan
scripts/padctl-docker test→ EXIT=0 (full suite green).refs: codebase audit
Summary by CodeRabbit
Bug Fixes