|
| 1 | +# S2/S12 startup diagnostic: Windows delivery window (2026-10-30) |
| 2 | + |
| 3 | +Measured on `main` at `d3d9ad209d`. This entry records what the |
| 4 | +[2026-10-04 startup diagnostic |
| 5 | +checkpoint](2026-10-04-s2-s12-startup-diagnostic.md) did not establish on |
| 6 | +Windows, and corrects the premise that produced an earlier wrong conclusion |
| 7 | +about the startup budgets. It changes no runtime behavior. |
| 8 | + |
| 9 | +## What the earlier checkpoint established, and what it left open |
| 10 | + |
| 11 | +That checkpoint records that when the managed Effect runtime cannot publish its |
| 12 | +startup locator, the failure travels through the typed startup envelope and |
| 13 | +reuses the shared filesystem/lock codes, and that a real fixture holding a |
| 14 | +live mutation lock "fails exactly once with the exact code". Its evidence |
| 15 | +was a real fixture; it did not qualify Windows, and it explicitly did not |
| 16 | +claim that Windows CI passes. |
| 17 | + |
| 18 | +## Measured |
| 19 | + |
| 20 | +The Windows lane fails intermittently on operations that start the Effect |
| 21 | +runtime and wait for it to become ready. The failing set differs per run: |
| 22 | +`test_effect_runtime_integration`'s `live_lock` case, |
| 23 | +`test_shadow_observation_retirement`, `test_chat_manager_inspection`. |
| 24 | + |
| 25 | +Across six Windows lane runs whose job logs are still retrievable, the |
| 26 | +failing file set was `test_self_update_runtime_activation` alone (three runs), |
| 27 | +that file together with `test_shadow_observation_retirement` (one run), that |
| 28 | +pair together with `test_effect_runtime_integration` (one run), and |
| 29 | +`test_chat_manager_inspection` alone (one run). |
| 30 | + |
| 31 | +The `live_lock` case failed on Windows at `1e3401591` with |
| 32 | +`assert 'runtime_startup_timeout' == 'mutation_lock_timeout'`, and passed in |
| 33 | +the later Windows runs of this entry's own measurement. It carries no platform |
| 34 | +skip, so it does run on the Windows lane. |
| 35 | + |
| 36 | +The startup cost was measured on the Windows runner at `2f544f9692` and on |
| 37 | +macOS at `d3d9ad209d`: |
| 38 | + |
| 39 | +| Host | Ready startup | Live-lock total | Diagnostic delivered | |
| 40 | +| --- | --- | --- | --- | |
| 41 | +| Windows (`nt`) | 0.406 s | 5.813 s | `mutation_lock_timeout` | |
| 42 | +| macOS (`posix`) | 0.170 s | 5.140 s | `mutation_lock_timeout` | |
| 43 | + |
| 44 | +The two revisions differ in `effect_runtime.py`, but only in the runtime-source |
| 45 | +metadata read, `_control_plane_root` and `_request_with_info`. The startup |
| 46 | +path itself — `_start_runtime`, `STARTUP_READY_TIMEOUT_SECONDS`, |
| 47 | +`_read_startup_stderr` and the `process.poll()` check — is unchanged between |
| 48 | +them, so both hosts are measured on the same startup code. |
| 49 | + |
| 50 | +The live-lock total is the ready startup plus the TypeScript mutation-lock |
| 51 | +wait, and both budgets have ample headroom: `STARTUP_READY_TIMEOUT_SECONDS` |
| 52 | +is 15.0 and `MUTATION_LOCK_TIMEOUT_MS` is 5,000. |
| 53 | + |
| 54 | +**This corrects an earlier conclusion.** The hypothesis that "node cold start |
| 55 | +plus the 5 s lock wait exceeds the 15 s ready budget on Windows" is false. The |
| 56 | +cold start is 0.406 s, and the live-lock case returned the exact |
| 57 | +`mutation_lock_timeout` code on that same run. Neither budget should be |
| 58 | +widened to explain this failure. |
| 59 | + |
| 60 | +## Where the exact diagnostic is lost |
| 61 | + |
| 62 | +TypeScript computes the typed code and publishes it: |
| 63 | +`effect_runtime_server.ts` `failStartup` writes the startup envelope to |
| 64 | +stderr with `writeSync` and then calls `process.exit`. Python reads that |
| 65 | +envelope only when a poll *inside* the ready loop shows the child has already |
| 66 | +exited (`effect_runtime.py`); after the loop it polls once more, but that |
| 67 | +poll only decides whether to terminate the child, and the function then |
| 68 | +reports the generic `runtime_startup_timeout` without reading the capture |
| 69 | +again. |
| 70 | + |
| 71 | +So the exact code is produced but not delivered whenever the parent does not |
| 72 | +observe the child's exit inside the ready loop. |
| 73 | + |
| 74 | +The lock in this path is **not** a stale lock. The fixture writes the |
| 75 | +current process's own PID as the lock owner, so the owner is alive and |
| 76 | +`reclaimStaleMutationLock` correctly refuses to reclaim it; waiting out the |
| 77 | +5 s mutation-lock budget is the intended behaviour, on every platform. The |
| 78 | +owner-liveness check in `effect_runtime_io.ts` records only a PID, so a |
| 79 | +reused PID or an `EPERM` probe result would also read as alive, but that is |
| 80 | +not what this fixture exercises and this entry does not claim it as the |
| 81 | +cause here. |
| 82 | + |
| 83 | +The measured live-lock total is 5.813 s on Windows and 5.140 s on macOS |
| 84 | +against a 15 s ready budget, and the exact code was delivered on both. So |
| 85 | +the budget is not the constraint in the measured runs. |
| 86 | + |
| 87 | +The intermittent Windows failure at `1e3401591` is a different situation. Its |
| 88 | +job log is retrievable and shows |
| 89 | +`assert 'runtime_startup_timeout' == 'mutation_lock_timeout'`. That code is |
| 90 | +produced whenever the parent does not observe the child's exit inside the |
| 91 | +ready loop, and the historical run does not distinguish two situations: the |
| 92 | +child had not published yet when the budget expired, or the child had |
| 93 | +already published and exited and the parent had not observed that exit |
| 94 | +before it left the loop. The same job's pytest step ran 439 cases in 5 min |
| 95 | +31 s, and the chunk holding the failure took two minutes against six seconds |
| 96 | +for the chunk before it, so the runner was heavily loaded. That load is a |
| 97 | +plausible contributor to a late publication, not a demonstrated cause, and |
| 98 | +this entry does not settle which situation occurred. |
| 99 | + |
| 100 | +Reading the capture at the moment the budget expires recovers the envelope |
| 101 | +in the second situation only. Tracing one child process shows the ordering |
| 102 | +directly: at one second, three seconds and five seconds the child is still |
| 103 | +running and stderr holds zero bytes, and the envelope appears only once the |
| 104 | +child exits, at about 5.8 s, together with exit code 2. The TypeScript side |
| 105 | +reaches `failStartup` only after the mutation-lock budget is spent, so a child |
| 106 | +that has not exited has published nothing; a child that has exited leaves the |
| 107 | +envelope in the capture, and the baseline leaves it unread. |
| 108 | + |
| 109 | +It can be recovered by letting the child finish first, or by reading the |
| 110 | +capture again once the child has exited. Waiting for the exit instead of |
| 111 | +terminating at the budget yields the exact code in every measured case, and |
| 112 | +the extra wait is bounded rather than open-ended: the child's exit lands at |
| 113 | +5.13 s to 5.17 s regardless of whether the ready budget was 0.5 s, 1 s or 2 s, |
| 114 | +because what the child waits for is the TypeScript mutation-lock budget. A |
| 115 | +repair would therefore give the child a bounded grace window after the ready |
| 116 | +budget, read the envelope if it appears, and report the generic timeout only |
| 117 | +when the child does not finish inside that window. Such a repair covers both |
| 118 | +situations above, so it does not depend on knowing which one the recorded |
| 119 | +failure was. That repair is not made here. |
| 120 | + |
| 121 | +## What this entry does not establish |
| 122 | + |
| 123 | +No budget change is proposed or qualified; the measurements show both budgets |
| 124 | +are sufficient. No owner-liveness change is proposed here: the lock in this |
| 125 | +path is held by a live owner, so the owner-liveness check behaves correctly |
| 126 | +for it, and changing how an owner identity is recorded would be a runtime |
| 127 | +change with its own acceptance that this measurement does not justify. |
| 128 | + |
| 129 | +The intermittent Windows failure is now attributed to a parent that did not |
| 130 | +observe the child's exit inside the ready loop; the historical record does |
| 131 | +not distinguish a child that had not published yet from a child that had |
| 132 | +published and exited unobserved, and the heavily loaded runner is a |
| 133 | +plausible contributor rather than a demonstrated cause. A bounded grace |
| 134 | +window after that budget is the repair this entry identifies, and it covers |
| 135 | +both situations, so it does not depend on knowing which one occurred. The repair itself is |
| 136 | +not made here: giving the child a grace window changes how long a failed |
| 137 | +startup blocks its caller, and that needs its own acceptance and a caller |
| 138 | +that tolerates the longer wait. |
| 139 | + |
| 140 | +Two acceptance points follow from it. The caller now waits longer, so the |
| 141 | +grace window has to be bounded by something the repository already owns |
| 142 | +rather than by a new constant. And the user-visible guidance changes with |
| 143 | +the code: `loopx/cli_commands/start_goal.py` gives `runtime_startup_timeout` |
| 144 | +its own remediation text, while `mutation_lock_timeout` falls through to the |
| 145 | +shared default, so a caller that receives the exact code would be told to |
| 146 | +repair or reinstall LoopX where it was previously told that startup timed |
| 147 | +out. That difference is the intended consequence of recovering the exact |
| 148 | +code, and it has to be read as such rather than as a regression. |
| 149 | + |
| 150 | +The delivered typed code is a diagnostic improvement, not a correctness |
| 151 | +repair: the runtime still fails to publish its locator, and the caller still |
| 152 | +fails to start. Windows CI is not qualified as passing by this measurement, |
| 153 | +and the intermittent failure set is preserved rather than reclassified. |
| 154 | + |
| 155 | +The measurement itself was a temporary diagnostic, removed after the numbers |
| 156 | +were read; it is not a qualification artifact in this repository. The commit |
| 157 | +that produced the numbers is reachable as `codex/measurement-archive` on the |
| 158 | +fork, so the two figures can be re-derived rather than taken on trust: it |
| 159 | +raises a deliberate `AssertionError` carrying the measurement, because the |
| 160 | +Windows lane runs pytest without `-s` and would otherwise capture the output. |
0 commit comments