feat-ish: Grocery bag of improvements - #114
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR optimizes video shard accumulation and control-stream responsiveness by reducing copies/allocations, caching AES-GCM state across packets, and improving input/touch handling and ENet channel configuration.
Changes:
- Replace shard-batch extension with an ownership-based API to enable move/append semantics and remove packetizer timing instrumentation.
- Update control-stream encryption/decryption to use a cached AES-128-GCM cipher keyed by key rotation id; increase ENet channel count and channel buffer sizes.
- Improve PS5 touchpad handling by using explicit Moonlight touch lifecycle events and track active touch pointers.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| moonshine-core/src/session/stream/video/shard_batch.rs | Switch shard batch extension to move/append to avoid copies in common cases. |
| moonshine-core/src/session/stream/video/packetizer.rs | Use new shard batch extension API; remove per-block timing instrumentation. |
| moonshine-core/src/session/stream/control/mod.rs | Cache GCM cipher, increase channel_limit, drain feedback bursts, and adjust peer targeting + parse behavior. |
| moonshine-core/src/session/stream/control/input/mod.rs | Increase channel capacity to reduce input/control backpressure. |
| moonshine-core/src/session/stream/control/input/gamepad.rs | Use touch lifecycle event types and track active touch pointers for CancelAll. |
| moonshine-core/src/crypto.rs | Introduce GcmCipher to reuse AES-GCM initialization across packets and encrypt/decrypt in place. |
| dist/60-moonshine.rules | Change udev rules for Moonshine devices, including permissions/seat environment. |
Comments suppressed due to low confidence (1)
moonshine-core/src/session/stream/control/mod.rs:1
- The loop no longer records which peer connected/disconnected, but later sends control messages (feedback/HDR/termination) anyway. Combined with the
PeerId(0)hardcode, this makes outgoing delivery depend on an implementation detail (peer slot assignment). Track thepeer_idfromEvent::Connect(and clear it on disconnect) and use that for outbound sends.
use std::net::SocketAddr;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
937a395 to
251919e
Compare
|
will wait for #116 |
251919e to
851a36b
Compare
|
still in draft until i can fully test it myself. there seems to be 2 regressions from main with detecting HDR (at least on Spiderman 2) and Forza Horizon 6 just being a black screen - might have something to do with #93 ). until i get that sorted out and am able to use Moonshine for a bit I can't really 100% back it. (most of the commits r fine just some that effect input handling I want to see how it compares to main). |
this is kind of a grocery bag of stuff i've been using locally:
Fixes #38.
personally tried this out on Spider-Man, and the touchpad felt better as well as responsiveness.