Skip to content

Preserve CoreGraphics scroll delta representations - #35

Closed
KulmanD wants to merge 4 commits into
mainfrom
fix/preserve-scroll-delta-fields
Closed

Preserve CoreGraphics scroll delta representations#35
KulmanD wants to merge 4 commits into
mainfrom
fix/preserve-scroll-delta-fields

Conversation

@KulmanD

@KulmanD KulmanD commented Jul 26, 2026

Copy link
Copy Markdown
Owner

What changed

  • uses fixed-point scroll deltas as the precision-preserving transform input
  • updates integer, fixed-point, and point delta fields on each active axis
  • uses the CoreGraphics 10:1 point/fixed relationship with documented rounding rules
  • preserves existing phase, momentum, count, source, and classification metadata
  • modifies and returns the original CGEvent without reposting
  • returns disabled and non-MX pass-through events before added field work
  • skips all writes for an axis whose precise input and smoothed output are both zero
  • records the isolated performance decision in docs/performance/preserve-scroll-delta-fields.md

Why

Some applications inspect point or fixed-point scroll fields instead of the coarse integer fields. Updating only integer deltas can produce inconsistent behavior between applications.

Performance

  • release helper: 433,096 bytes, +544 bytes (+0.126%)
  • three 150-second idle runs: exactly zero CPU-time, wakeups, context switches, and syscalls
  • two persistent threads, no leaks, sockets, normal logging, timers, polling, or retained history
  • normal one-axis streams: +21.8 to +29.9 ns/event
  • mixed two-axis EMA stream: +39.4 ns/event
  • 50-million-event run remained bounded at 7.234 MiB peak RSS and 2.188 MiB peak footprint

Testing

  • swift build
  • swift build -c release
  • GitHub Actions: 36 tests, 0 failures
  • vertical/horizontal, fractional, smoothing, acceleration, clamp, rounding, phase/momentum, and pass-through coverage
  • app signing and archive integrity verification
  • lightweight archive exclusion verification

Limitations and follow-up

No MX Master was detected during measurement. Physical target-application compatibility, ratchet/free-spin feel, trackpad coexistence, and the required #24 + #25 interaction benchmark remain pending. This PR stays draft and must not merge independently yet.

Refs #25

KulmanD commented Jul 26, 2026

Copy link
Copy Markdown
Owner Author

Superseded by draft PR #40, which contains this change, its performance evidence, the complete accepted integration, and passing final CI. Closing this draft without merging avoids duplicate commits. The branch is intentionally retained for isolated comparison and deferred measurements.

@KulmanD KulmanD closed this Jul 26, 2026
@KulmanD
KulmanD deleted the fix/preserve-scroll-delta-fields branch July 27, 2026 12:51
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.

1 participant