SDL 3.2.26 macOS Screen Sharing warp-compensation error: reproducer and measurements

GitHub’s public SDL issue page currently indicates that new issue creation is restricted. I am posting this reproducible defect and focused design question in SDL Development for maintainer triage. If confirmed, could a maintainer open or link the appropriate GitHub tracking issue?

Environment observed: macOS 27.0.1 host, Apple’s built-in Screen Sharing, official SDL release-3.2.26 Cocoa backend. Runtime behavior on the latest SDL release/main has not been retested; the game investigation targets its bundled version.

Apple’s built-in Screen Sharing reproduces incorrect relative-motion vectors in SDL 3.2.26’s Cocoa backend. A physical mouse behaves normally in the earlier local controls. The investigation uses a standalone reproducer, instrumented measurements and experimental source diffs; this post summarizes the findings and does not claim a production-ready fix.

The measured backend calculation is:

emitted delta = incoming delta + cached previous cursor - latest warp target

Screen Sharing’s original coordinate changes and incoming deltas are coherent in the recorded cases. Adding the cached-cursor offset produces spikes and direction reversals. A genuine cold-start example has raw (0,-1), compensation offset (+64,+34) and output (+64,+33). The source is already verified as the actual Apple event-producing agent on that first event, but there is no preceding movement sample.

Reproduction

Use official SDL release-3.2.26 on macOS over Apple Screen Sharing. Open a focused window, enable relative mode and constrain it to its center. Compare ordinary capture, false→true recapture every 500 ms, and explicit SDL_WarpMouseGlobal recentering every 500 ms. Use four seconds still, four seconds one direction, four reverse, four still; repeat horizontally and vertically. For a cold run, launch from the keyboard and make no preparatory mouse movement inside the app.

A reduced stock-SDL source example and build/run instructions have been prepared but are not attached to this post. This source-only extraction has not been separately built or run. It logs SDL output only. The preserved instrumentation patches and portable source copies of the original observer describe the full native/backend/queue/poll measurement path. Those portable copies have only output-path/app-metadata adaptations and removal of a D inspection-only command; they have not been rebuilt. The reduced example alone cannot award a delivery pass.

Recorded comparison

Backend Normal incorrect vectors H / V Recapture incorrect vectors H / V Explicit recenter incorrect vectors H / V Intended movement lost
A: source stock 1 / 1 16 / 16 17 / 17 None in valid remote cases
B: adapted SDL2 activation discard 0 / 0 0 / 0 15 / 15 37 nonzero movements across six cases
C: verified-source consecutive-coordinate coherence 0 / 0 0 / 0 0 / 0 Zero; all 1,495 native movements preserved
D: automatic backend source identification, same strict coherence Cold horizontal: 1 incorrect of 184 movements; vertical untested Untested Untested Zero in the 184-event cold case

C’s six recordings preserve all 1,495 events, including 67 pending-warp decisions, with zero incorrect vectors, component reversals or motion discards. Identity/history was established before capture in those cases. C still uses application assistance to verify/allow the source, so it is not a drop-in game library.

D removes that assistance. It resolves the source PID from event metadata and checks Apple’s agent signing identity, protected executable path and process lifetime; no temporary PID is configured. PID metadata and signing are used for compatibility classification, not cryptographic event authentication. Caching is lifetime-aware, with periodic signature refresh. Physical, unknown or incoherent input retains stock handling.

D’s genuine cold run has zero preceding idle movement events. It verifies the source on event one but emits (64,+33) for native (0,-1) because strict coherence has no preceding coordinate sample. All later 183 vectors are correct; all 184 movements arrive once and in order. The user did not notice a subjective jump, but the objective first-event failure is preserved.

Delivery, physical controls and timing limits

All eighteen compared A/B/C recordings and the D recording pass explicit native/backend and queued/delivered/flushed accounting. A prior A recapture attempt had incomplete zero-control-flush instrumentation and its original live FAIL is retained privately; the table uses its corrected repeat. Expected synthetic zero control motions flushed inside SDL’s recapture routine are distinguished from actual user input. Empty streams never pass.

Earlier local physical controls behaved normally while the corresponding remote capture/recenter conditions were erratic. Physical raw deltas can include the warp displacement that compensation is meant to remove; a raw-to-SDL difference is therefore not itself a physical defect. Live physical C/D regression, reconnect/restart and source-switch coverage remain pending. Historical physical replay and offline lifecycle fixtures are not substitutes.

C host source-to-poll medians are 1.28–1.50 ms; the largest delay is 4.63 ms. D cold median is 1.39 ms, maximum 4.015 ms; its first source verification takes 3.93 ms. These are host timings, not network/render latency. C and D have no incoming or SDL movement in their initial still intervals. A’s vertical normal-capture case has one incoming movement during that cue, amplified by the same compensation defect; it is not movement generated without input. All nineteen compared recordings have no SDL movement in settled final seconds 13–16. Brief incoming movement tails exist at the start of final cues. Native input gaps remain, so there is no end-to-end stutter-free claim.

Related issue and requested review

SDL #7918 addresses an older activation anomaly by dropping the first event. Our B port fixes recapture spikes but loses real movement and does not correct explicit recentering. See the SDL 3.2.26 Cocoa source for the compensation path under review.

A targeted first-event bootstrap is technically plausible: verify the producer, require a known pending own warp and a valid independent pre-warp reference, check event_position - reference == incoming_delta, then preserve that delta only for the unseeded event. All 136 pending-warp events from valid A/C/D records satisfy this relation against their recorded cache state. This is supporting evidence, not proof of a permanent producer contract. The same first-event observables can in principle admit warp-independent or warp-inclusive interpretations; the current strict D patch deliberately does not implement the exception.

Please advise whether SDL should recognize the verified Screen Sharing producer’s delta semantics, how to handle that bootstrap safely, and what physical/OS regressions are required. A separate, preserved first-motion review explains the ambiguity and a bounded validation plan. The candidate diffs are review artifacts, not a merge-ready PR. No game binary or bundled library has been modified.

No ZIP or source files are attached: this forum account cannot upload attachments. The source-only reduced example, portable measurement observers and matching ABIs/build recipe, exact existing research diffs, sanitized aggregate measurements and experimental first-motion review are preserved. Please advise an accepted maintainer review route for these materials. No new input test was run to prepare this report.