Repository navigation
Count an ended, unreaped process as ended in is_alive - #599
Merged
Merged
Conversation
A Unix zombie answers signal 0 until its parent, or init once it is orphaned, reaps it, so is_alive said a process run_to_end had already ended was still running, while Windows said it had ended. Unix now also reads the process state: Z or X in /proc/<pid>/stat on Linux, SZOMB from the KERN_PROC_PID sysctl on macOS, where libproc has no answer for a zombie. The contract test checks an ended child before it is reaped on all three systems. Refs #595
HyunjunJeon
pushed a commit
to HyunjunJeon/hide
that referenced
this pull request
Nov 12, 2026
Closes with-hide/hide-private#526 Closes with-hide/hide-private#599 Refs with-hide/hide-private#395, with-hide/hide-private#530, with-hide/hide-private#117, with-hide/hide-private#586 Refs with-hide/hide-private#832 ## Summary - Start the checkout PR flow on Main after its setup has focused another workspace. - Prevent Windows test browsers from losing local page or resource requests during shell startup. - Retain the failed row and pointer state for a separate, unreproduced late card-hover failure. ## Review - **Risky files**: browser-launch.cjs merges installed runner defaults; the desktop preload extends effective flags. - **Risky files**: checkout-pr.spec.ts retains discovery's connection, then resets first-run selection before Main. - **Risky files**: desktop browser.spec.ts uses the shared arguments for its plain Chromium launch and checks the applied features through CDP. - **Decide**: The narrow upstream fix uses the locked runner's internal argument API; a changed shape fails startup. - An entire runner upgrade would also replace the browser revision and is outside this stabilization change. - **Cost**: The hover observer exists only for one test phase, retains 32 transitions, and is removed on every exit. - **Cost**: Splitting the plain-browser notice from the native-view lifecycle adds one isolated fixture start so Windows CI checks that launcher too; its existing notice assertions are retained. - [Windows run 41016473655](https://github.com/with-hide/hide/actions/runs/41016473655/job/123933953907), tracked by [private with-hide#130](with-hide/hide-private#130), records the same document-load error. - [with-hide#832](with-hide/hide-private#832) tracks one later card-hover failure; this PR does not claim its cause is fixed. ## Tests - **Layer**: Unit feature merging; real browser startup and desktop recovery cross the actual host launch boundary. - The desktop plain-browser case checks the effective final disabled-feature list, retained runner defaults and the Windows loopback fix before opening the shell. - It passed its first Windows CI attempt on the final head in [the desktop lane](https://github.com/with-hide/hide/actions/runs/42860546110/job/129985854339). - Units cannot observe which feature list the launched browser applies; the startup check reads that applied state. - **Catches**: Removing the Windows feature fix failed two merge checks; restoring it passed all three. - **Repeat**: Linux/macOS: five flows x20, [100 passed each](https://github.com/with-hide/hide/actions/runs/42832076296). - Desktop recovery/relaunch: each x10 on macOS/Windows, retries 0, [40 passed](https://github.com/with-hide/hide/actions/runs/42831271844). - Final Windows: five flows x20, retries 0, [100 passed](https://github.com/with-hide/hide/actions/runs/42844846265/job/129929485236). - **Waits**: No new wait, delay, retry, timeout or threshold; the existing Main assertion follows explicit state setup. ## Evidence - **Verified**: Local startup/checkout flows, desktop recovery/relaunch, unit 3, lint, types, builds and policy checks. - **Verified**: The split desktop plain-browser and native-view flows passed locally without retries; desktop lint and typecheck passed. - **Verified**: A controlled trigger replacement preserved the original failure and captured mounts=2 before teardown. - **Verified**: [Required CI](https://github.com/with-hide/hide/actions/runs/42860546110) and independent review passed on final head c532660. - **Not verified**: The historical reference-only causes and the late hover cause. <details><summary>Failure evidence and review boundaries</summary> - with-hide#526's run 42780431716 drew Workspace while the test expected Main after setup focused its agents. - with-hide#599's run 42080456072 had an unmounted shell, a successful document and a failed entry script with ERR_NO_BUFFER_SPACE. - Private with-hide#130 is handled separately by public PR with-hide#2372; its Windows host log recorded window.load_failed ERR_NO_BUFFER_SPACE after a normal daemon start. - The test-only startup fix follows [the upstream fix](microsoft/playwright#43605) and [the browser defect](https://issues.chromium.org/issues/572515601). - The locked runner 1.63 lacks that fix. The helper reads its installed defaults rather than copying a version-specific list. - with-hide#395's run 42140863283 attached its daemon before its shell wait failed, with no page-side or failed-load signature for that exact wait. Its initial report used the retired fixture startup path; neither identifies this PR's connection cause. - with-hide#530's original failure drew Main with a failed sidebar boundary. A controlled stylesheet abort reproduced that screen and a missing CSS-token diagnostic, but the original artifact retained no asset-failure signature. - with-hide#117's latest retained record has only a whole-test timeout. Its historical lost step remains unidentified. - with-hide#586's run 42359435922 explicitly reports the loopback error, but its initial whole-test timeout and its separate focus flow were not resolved by the targeted repetitions. - For those next failures, inspect pageSide screen/project state, request status, failed requests, renderFailures and renderDiagnostics. The dump now retains failed regions and the newest eight relevant render diagnostics. Each reference-only issue has a comment with its confirmed facts, remaining gaps and next dump. - with-hide#536 was closed separately because commit 8be1505 deleted its Home collision test. The current no-project startup spec does not replace that behavior. - The first Windows repetition had 99/100 passes: checkout-pr.spec.ts:273 failed at the final light-theme hover after the shell, row, PR glyph and browser display had already drawn. - A diagnostic-only repeat at 5eefccb passed 100/100: all 20 checkout attempts retained one trigger mount, had PR facts ready and hit that row with the pointer. The card opened after its normal hover delay. This did not reproduce or establish the cause of the earlier failure. - The replacement diagnostic captures the failing state inside that step, before teardown can add a disconnected banner and move the row. It records the checkout key, mounts, pointer hit, geometry, focus, visibility, drag marks and tooltip state, preserves the original error, and reports independent cleanup failures. - The old conversation-date fixture also caused automatic sleep of the Main setup agent in the failed run. A current-clock proposal removes that sleep locally, but its relationship to the hover failure is unconfirmed. It remains an uncommitted local patch documented in with-hide#832. - No product input, runtime mutex, snapshot wire or rendering path changes. The operator's installed application was untouched. </details> <details><summary>Verification record</summary> - Final head: c532660. - Startup repeat candidate 4231d60: Linux/macOS each five flows x20, no retry. - Desktop repeat candidate ce0dffe: JSON reports on each OS show expected=20, unexpected=0, skipped=0, flaky=0, repeatEach=10 and retries=0. - Diagnostic-only Windows candidate 5eefccb: run 42838637529, five flows x20, no retry, 100 passed. The temporary early observer and trace flag were reverted. - Final Windows repeat candidate 49b560a: run 42844846265, five flows x20, retries=0, 100 passed; job log confirms the exact tested commit. - All temporary workflow changes are reverted. The repeated specs, shared startup fixtures and guide match the final Windows repeat candidate; the later desktop browser.spec.ts regression and its smaller size baseline are the only differences in those test trees. - Head 1933d66 is a source-identical verification commit after f45c106, added to regenerate the synthetic merge against the corrected base. - Review follow-up c532660 applies the shared launch settings to the desktop plain browser and separates that existing notice contract into a Windows-covered case. - Local current source: checkout hover flow passed without retries; a controlled browser replacement captured the original failure and two mounts; web lint and test-size budget passed. - Earlier unchanged-source checks: web build; web/desktop lint; desktop typecheck; startup/checkout 3; desktop recovery/relaunch 2; merge unit 3; design contract and policy checks passed. - Manual repeat dispatches that skipped every test and draft-only verify failures are excluded from verification evidence. - Independent review and required CI 42860546110 passed on c532660. - Ready run 42849933157 checked synthetic merge 83a0f35 against base 8284fb6, which predates with-hide#2398. - That merge still waited on the retired status.herdr field; current main uses status.engine. All hard web failures were at that restart boundary. One required failed-job rerun was started. - The regenerated merge f4ed9d1 includes the corrected status.engine wait. - Final run 42860546110 tests merge 6b977ba containing c532660; completed job logs confirm that checkout. - Its Linux suite has 412 passes and eight Windows-only skips, the retry-free changed-spec repeat has 80 passes, Windows web has 85 passes, and Windows desktop has 24 passes and one existing platform skip. The new plain-browser startup case passed its first attempt in 6.9 seconds. </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #595
Summary
hide_platform::process::is_alive가 Unix에서 끝났지만 아직 거두지 않은 process(zombie)를 살아 있다고 답하던 제품 결함을 고칩니다. Windows는 같은 경우 끝났다고 답했습니다.#595(Linux)는
run_to_end가 돌아온 직후 helper를 물었을 때, init으로 넘어간 helper가 아직 zombie여서 "outlived the call"로 실패했습니다./proc/<pid>/stat의Z/X, macOS는KERN_PROC_PIDsysctl의p_stat == SZOMB.proc_pidinfo(PROC_PIDTBSDINFO,PROC_PIDT_SHORTBSDINFO)는 zombie에ESRCH만 돌려pbi_status를 읽을 수 없어서 sysctl을 씁니다(ps가 읽는 곳).liveness_is_what_the_system_says: 죽인 자식을 거두지 않은 채(Unixwaitid+WNOWAIT, Windows는 handle을 쥔 채 wait) false인지 봅니다. 그 자식이 아직 signal 0에 답하는지도 확인해 경우가 실제임을 보입니다.docs/ARCHITECTURE.md플랫폼 층 process 설명에 같은 계약을 적었고, herdr-core test 메시지 "reaped"를 "ended"로 고쳤습니다.Review
hide-platform/src/process.rsmacOSis_zombie- libc에 Applekinfo_proc가 없어extern_proc앞부분(p_stat까지)을repr(C)로 적고, 전체 크기 648 byte가 채워졌을 때만 읽습니다.still_the_daemon, hide-ai codex lock)는 runtime mutex 밖이고 고빈도가 아닙니다. 호출당/proc파일 하나 또는 sysctl 하나를 더합니다. fork는 없습니다.Evidence
verify-cargo.sh nextest -p hide-platform --test process에서 34개가 통과했습니다(macOS).clippy -p hide-platform --all-targets -D warnings가 macOS,x86_64-unknown-linux-gnu,x86_64-pc-windows-msvc세 target에서 통과했습니다.is_alive를 이전처럼 signal 0만 보게 되돌리면 계약 test가 "an ended child counted as alive before it was reaped"로 실패합니다. 되돌리면 통과합니다.yesx8(기본 QoS, 기계 load average 130~155) 아래 200번 돌려 200번 통과했습니다. 새 binary를 다시 빌드한 뒤 쟀습니다.kill(pid, 0) == 0,proc_pidinfo는ESRCH, sysctlp_stat는 5(SZOMB)이고 살아 있는 process는 2(SRUN)임을 확인했습니다.