Skip to content

Drive simulator fill captures from a strict GCD timer on a worker queue - #10

Merged
jkelleyrtp merged 1 commit into
mainfrom
devin/1787378631-gcd-fill-timer
Aug 22, 2026
Merged

Drive simulator fill captures from a strict GCD timer on a worker queue#10
jkelleyrtp merged 1 commit into
mainfrom
devin/1787378631-gcd-fill-timer

Conversation

@jkelleyrtp

Copy link
Copy Markdown
Member

Summary

Puts the simulator fill cadence on a strict libdispatch timer instead of a sleeping thread, because relative waits (nanosleep / pthread_cond_timedwait) get coalesced to ~100 ms on virtualised hosts, capping the thread-driven fill at ~12 fps.

  • New serial worker queue (QoS user-interactive) does the actual capture work. SimulatorKit callbacks now call trigger(force) — a cheap coalescing enqueue (pending/pending_force atomics) — instead of running capture inline on the callback queue, which the render server blocks on.
  • start_fill_timer creates a DISPATCH_TIMER_STRICT source on the worker queue via raw dispatch_source_* FFI (dispatch2 0.3 has no safe timer-source wrapper). Handler fires capture(true) only when last_capture.elapsed() + FILL_SLACK >= tick_interval, with 1.5 ms slack so timer jitter doesn't beat a 60 Hz fill down to 30 Hz.
  • The old idle thread no longer drives re-emits; it only re-wires the pipeline until the first frame lands.
  • stop() cancels/releases the timer and drains the worker with exec_sync before releasing registrations.

macOS-only code path (packages/accessibility-ios-sys/src/macos/framebuffer.rs); verified cargo fmt --check and cargo check --workspace on Linux, macOS compile relies on CI.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/e327e80d7dee497288adbc3cdc479ac7
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/e327e80d7dee497288adbc3cdc479ac7?variant=devin-insiders
Requested by: @jkelleyrtp

@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@jkelleyrtp
jkelleyrtp merged commit ccdbd7e into main Aug 22, 2026
13 of 14 checks passed
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