Repository navigation
docs: ghostty_surface_host_frame's present needs an explicit CATransaction lock span with no draw in it (#71 follow-up) - #72
Conversation
…ction lock span with no draw in it Review of #71 (Claude, at 3163f4b), should-fix 3: the call-site rule also allowed "one Core Animation layout or display pass of the commit". Whether Core Animation holds [CATransaction lock] in those passes is not known, and a display pass of a surface with nothing shown draws on main (drawFrame(true) waits for a free frame, which the GPU completion thread frees only after it took the lock). The rule now allows only an explicit lock span, and names the draws that must not run in it. The example call site is a main run-loop observer just before Core Animation's commit (what cmux does), not a layer display. The commit-order test's comment now says that it counts commits only (the off-main present calls no flush). Comments only: no code change.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Review (codex): SHIP at db8627d Codex review ( No blocking findings.
|
The release line moved after the first merge. Keep its head an ancestor of main.
Summary
ghostty_surface_host_frame(present: true)said "in one[CATransaction lock]span (or one Core Animation layout or display pass of the commit)". It is not known whether Core Animation holds the lock in a layout or display pass. Also, a display pass of a surface with nothing shown draws on main:drawFrame(true)waits for a free frame, and the GPU completion thread frees that frame only after it took the lock.ghostty_surface_draw, or a first-frame display pass).TerminalFramePresenterdoes), not a layer that Core Animation displays.7d43bb68b, the renderer: an off-main present never commits while it holds the Core Animation lock (embedder-mode deadlock from #70) #71 merge).Testing
git diff 7d43bb68b...db8627d95 -- src/changes only//lines.Observed / Not run
Changelog
none
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Follow-up to #71's review: tightens the locking rule for
ghostty_surface_host_frame(present: true). The rule previously accepted either an explicit[CATransaction lock]span or a Core Animation layout or display pass; only the explicit lock span is valid now, since it's unknown whether Core Animation holds the lock in those passes and a display pass of a surface with nothing shown draws on main and can deadlock. The docs now also forbid drawing in the span, the example call site is a main run-loop observer just before Core Animation's commit (what cmux'sTerminalFramePresenterdoes) instead of a displayed layer, and the commit-order test's comment now says it counts commits only. Comments only: no code, test, or workflow changes, so cmux does not need to move its pin.Written for commit db8627d. Summary will update on new commits.