Repository navigation
fix(host): await shared renderer readiness before widget launch - #85
Conversation
|
@greptile please review the latest head f78ffa3. Follow-up adds failed-send reply-right cleanup with a red/green saturated-queue regression, plus missing-renderer readiness invalidation coverage. Local host tests/build pass; no Native SDK code changed. |
|
|
@greptileai Please re-review exact head
The T-Rex Linux execution limit is valid as a limit on that runner, but it does not mean macOS execution remains unperformed. Please assess the code and current macOS receipts, and identify any remaining actionable defect. Existing-worker fallback recovery remains explicitly outside this startup-only repair. |
Widget workers can start before the shared renderer accepts its first handshake. A supported canvas then falls back to software, and Native SDK's stable-pixel fallback can keep it there after the renderer becomes available. Wait for a valid renderer hello reply before launching fresh or replacement workers.
The host polls without blocking its supervision loop, keeps pending widgets in their existing starting/backoff state without consuming restart attempts, and resets readiness when its renderer exits. It releases the probe's session rights immediately and uses the pinned Native SDK protocol header; no SDK code changes. The renderer process also explicitly clears the inherited client-renderer flag so it can initialize its own Metal backend.
Reproduction and validation:
85fda8c: delay only the renderer executable by one second, then run the unchanged supported synthetic widget. Worker logs show the renderer initially unavailable, a later connection, and permanentbackend=software reason=shared-pixel-stable retry_ms=none. Waiting for readiness before worker exec keeps the same widget on GPU.expected starting, found backoff). After the fix: 62 passed, 9 skipped. The new Mach fixture proves that service registration alone does not unlock launches, a valid hello does, malformed replies fail, and accepted/rejected/cancelled probes release their rights. A saturated-queue regression also failed before reply-right cleanup (61 passed, 9 skipped, 1 failed) and now passes without changing the process's port-name count. Supervision coverage includes pending status/reason, launch after readiness, invalidation after a missing/reaped renderer, replacement waiting, and the automation bypass.DEVELOPER_DIR=/Library/Developer/CommandLineTools zig build test -Doptimize=ReleaseFast --sysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk --summary allinhost: passed. The corresponding production build passed all 14 steps;codesign --verify --deep --strict zig-out/Weaverd.app, Zig formatting, andgit diff --checkpassed.f78ffa3: the original one-second renderer delay, no external launch gate and no DYLD injection, now stays on GPU. Host logs record waiting followed by readiness; worker logs show a connection without the permanent software latch. On this M5 Pro/macOS 27 run, one 15-second sample after five seconds of warmup measured 9.260% total CPU, versus 64.576% in the original software repro. The earliere28fba8candidate also passed (8.042%). These are illustrative single samples under changing desktop load; the backend correction is the decisive result./tmp/weaver-startup-repro-20260924/run.py,/tmp/weaver-startup-repro-20260924/run_fixed_final.py,/tmp/weaver-startup-repro-20260924/receipts/fixed-final-f78ffa3-delayed-renderer-gate0-r1/, and/tmp/weaver-readiness-{queue-red,final-tests,final-build}.log.Existing workers keep their state during renderer restarts. An already-running worker can still latch software during an outage or a later packet/presentation refusal, including with a live renderer; restoring GPU in those cases needs a separate Native SDK recovery change. This repair addresses the cold-start trigger by gating new launches, without forcing worker restarts or introducing a startup timeout.
Current-head CI and review: all seven platform jobs passed in run 36066803462, including the macOS host build and Mach fixtures. Greptile reviewed
f78ffa3twice, reported no reproduced code defect and no review threads, but its check remains failed (3/5) because its T-Rex worker is Linux and cannot execute native macOS tests. The follow-up supplies the passing hosted macOS job, local red/green tests, and original-workflow retest. This is an unresolved reviewer-infrastructure limitation, not a claim of an all-green review. No required status checks or branch protection are configured; the PR remains open and unmerged.