mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Every reconcile pass walked up from every live task to the root to find cancelling owners, and owned live work, idle scopes, chain loads, reservation, finalization, and failFast checks each scanned all live tasks. A chain of n held tasks cost about n^3 steps: 500 took 12 s, 20,000 never finished. The ownership semantics are unchanged; in-memory indexes, rebuilt at open, hold each pass's candidates: - #below: the ownership tree downward around live work; owned live work, idle scopes, and conversation aborts walk down from one node. Ended tasks stay while walks pass through them (conversation owners, chain loads, owners of known tasks), so loaded chains stay loaded. - #intent: cascades walk down from tasks with cancellation intent, not entering another such task, so the nearest cancelling owner still decides the reason; upward checks return at once when it is empty. - #unloaded: only tasks whose chain is not loaded are loaded, and count as inside every scope until then. - #finalizeChecks: finalize is a worklist in rounds from the nearest live holder of ended work. - #runnable and #waiters: reservation and failFast candidates. No walk recurses. Chain of 500 held tasks: 12.3 s -> 50 ms; 20,000: 1.5 s. 8000 parallel nested calls: 18.8 s -> 9.2 s (bench:scheduler-fanout); the rest is document copying of the nested-call index. |
||
|---|---|---|
| .. | ||
| agent | ||
| ai | ||
| chord | ||
| client | ||
| codemode | ||
| coding-agent | ||
| durable | ||
| env | ||
| evals | ||
| mcp | ||
| protocol | ||
| server | ||
| telemetry | ||
| tui | ||