Skip to content

Conversation

@neon-nyan
Copy link
Member

@neon-nyan neon-nyan commented Dec 21, 2025

Main Goal

This PR updates the RPC submodule which contains CPU cycles fix on idle. This switches the loop-based routine on reading RPC frames to timer-based routine. Both previous loop-based and new timer-based routine uses the same Poll rate for 1000ms each. We also switched the buffer allocation to rent-based buffer.

The difference between these two methods are, loop-based uses WaitHandleEvent to Sleep on background threads with endless loop routine, thus continuously wasting thread time on each poll rate (every 1000ms) while performing RPC update. Timer-based routine instead, uses Timer to trigger the RPC update on each poll rate (every 1000ms) and will end the thread once it's done.

The behavior shouldn't be affected as it only switching the loop routine with timer and the poll rate for frame reading is still the same.

image

PR Status :

  • Overall Status : Done
  • Commits : Done
  • Synced to base (Collapse:main) : Yes
  • Build status : OK
  • Crashing : No
  • Bug found caused by PR : 2 (per commented)

Templates

Changelog Prefixes
  **[New]**
  **[Imp]**
  **[Fix]**
  **[Loc]**
  **[Doc]**

@neon-nyan neon-nyan marked this pull request as ready for review December 21, 2025 11:26
@neon-nyan
Copy link
Member Author

@sentry review

@neon-nyan neon-nyan self-assigned this Dec 21, 2025
@neon-nyan neon-nyan added Enhancement New feature or request Area: Runtime Issue labeled for runtime, Hi3Helper.Core and other libraries used by Collapse Priority: Low Size: Small labels Dec 21, 2025
@bagusnl
Copy link
Member

bagusnl commented Dec 21, 2025

Need check behavior on arrpc based clients.
Will do

@bagusnl
Copy link
Member

bagusnl commented Dec 21, 2025

arrpc client works
image

@bagusnl
Copy link
Member

bagusnl commented Dec 21, 2025

Bug found

  1. RPC fails to reconnect on Discord client restart. Both in arrpc and official client

Repro step:
Start Discord -> Start Collapse -> Stop Discord -> Observe log -> start Discord -> Observe log -> Switch Collapse pages (do not switch Game/region)

image
  1. Stuck client did not get disposed/cleared on game switch

Repro step:
Start Discord -> Start Collapse -> Stop Discord -> Observe log -> start Discord -> Observe log -> Switch Collapse game

image

@neon-nyan
Copy link
Member Author

@bagusnl The issue mentioned above should have been fixed with the commit above. Can you confirm it at your end?

@neon-nyan neon-nyan merged commit 0611ec7 into main Dec 26, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Runtime Issue labeled for runtime, Hi3Helper.Core and other libraries used by Collapse Enhancement New feature or request Priority: Low Size: Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants