Repository navigation
fix: end six crate flakes from product budgets, inherited git settings and a Windows Node warm-up - #1863
Merged
Conversation
… handles The job counts a process out before the system closes the handles it held and signals its object, so a capture that ended its tree on the job's count returned while the helper it ended still held its pipe, and is_alive, which now waits on the object, read the helper alive. The end now holds each process the job lists before it terminates the job, and the tree has ended only once each of them is signalled.
A list of the job read once at the end missed a process started after it and one that had just ended on its own, and both could still hold a file when the end was confirmed. The job now announces each process on a completion port set before the child starts, each is held until it is signalled, and the notices are counted against the job's own count, so a missed notice is an error rather than a confirmed end. A wait or exit-code read that fails in is_alive keeps the process counted and is logged.
macOS does not hold back a fork made by a parent the group kill has not stopped yet, so the new process kept running and a capture never confirmed its tree's end. While the end is confirmed, a member still running has the group signalled again; on Windows the job is ended again while it counts a process running.
The Windows is_alive wait, the job's tree end and their tests and documentation return to main's; the Windows tree end, with-hide/hide-private#327, moves to a pull request of its own.
yansfil
added a commit
that referenced
this pull request
Oct 30, 2026
…et go of what it held (#1872) Closes with-hide/hide-private#327 ## Summary On Windows a capture or run said a process tree had ended while a process in it still held a file, so removing the folder right after was refused. Windows takes a process off its job's count, and sets its exit code, before it closes what the process held. Now every process a child's job runs is followed from its start, and the end is answered only once each one has let go; `is_alive` waits for the same signal. On every system, a process the tree starts while it is being ended is ended too; on macOS it used to keep running. 스크린샷 없음: no screen changes. ## Review - **운영자 결정 (2026-10-30)**: the kernel's completion-port queue is owned by Windows and has no limit Hide can set; it is accepted as a known limit, not capped. One thread per hided/hide process (`hide-job-notices`) reads every child's job notices from that port for the life of the process, and notices wait in the queue only while the children's processes start and end faster than it reads them. What Hide owns is capped, and crossing a cap is a failure the caller sees: each notice costs the thread a fixed amount of work, at most 1,024 jobs are followed at once (a child past it is refused at its start), and at most 4,096 processes are held per job (past it, every question about that job's end answers with the reason). `docs/ARCHITECTURE.md` records the same. - **조심해서 볼 파일**: - `hide-platform/src/process.rs` `Followed::notice`, `let_go_of_signalled` - each notice checks the next two held processes in turn; one not yet signalled goes behind the rest, so a process slow to end holds up no other, and one whose exit notice never came is let go on its turn. - `hide-platform/src/process.rs` `Members`, `Notices::stop`, `left_running` - failure path: a process that cannot be held, a failed wait, past 4,096 held, or the thread stopping is kept as the reason and every later end answers it; held handles are never dropped on an error. When the thread stops, each job's notices are taken off the port; if the system refuses that for a job, it is only logged (`process.job_notices_left_set`) and that job's notices keep reaching the unread port. - `hide-platform/src/process.rs` `capture_until`, `capture_run`, Unix `tree_ended` - the leader is reaped only after the tree's end is confirmed, so a second group signal cannot reach a reused group id. - `hide-platform/src/process.rs` Windows `is_alive` - a failed wait or exit-code read keeps the process counted and logs `process.alive_unconfirmed`. - **비용 검토**: every notice costs one port read and at most two zero-timeout waits on held processes, however many are held. A process joining a job adds one `OpenProcess`, one `IsProcessInJob` and one wait. Since each held process came with a notice that checked two, checks outpace holds even when exit notices are lost, and every ended process is let go within one turn of the held ones; the owner lets go of all ended ones whenever it asks about the end. The thread blocks on the port and does nothing otherwise. - **질문**: Microsoft does not guarantee job notices arrive; a missing one leaves the end owed until the caller's deadline (never confirmed). Is that the outcome you want, rather than an immediate error? ## Evidence - **확인한 것**: - The earlier form of this change ran in #1863: Windows OS contract 256/256 first try with the signal-based `is_alive`, after the job-count end failed both capture tests every time (runs 40996135782, 40996147032). - `an_ended_process_is_let_go_behind_one_slow_to_end_without_its_exit_notice` (Windows unit test): three held objects not yet signalled ahead of one signalled whose exit notice never comes; the signalled one is let go within one turn while the oldest one's exit is announced over and over, and the slow one is let go once it signals. - `a_job_followed_before_the_notices_stopped_answers_why_and_none_joins_after` and `a_child_past_the_followed_jobs_cap_is_refused_and_an_ended_one_frees_its_place` (Windows unit tests, real empty jobs and a port) cover the stop and the job cap. - CI on 30b4409 (run 41016473655) green on every lane: Windows OS contract 260 passed, 5 skipped, with the stop and job-cap tests passing on the first try. - Local macOS: `hide-platform` 310 passed, 2 skipped; `clippy --all-targets -D warnings` clean for `hide-platform` on macOS and on the Windows target (`x86_64-pc-windows-msvc`), with the new Windows test compiled. - The race test failed 5 of 8 local macOS runs before the second group signal (a holder forked during the kill kept running); after it, 22/22 in #1863 and 10/10 here under load. - **확인하지 못한 것**: - Windows and Linux run only on this PR's CI; this Mac cannot run them. - `a_capture_waits_for_a_holder_started_while_the_tree_ran_and_one_that_ended_before_its_end` orders the starts and the ending against the end, but when the system closes a handle is its own timing, so the test can pass without the fix too. - A lost job notice, a refused hold and a process whose handles take long to close are not driven end to end; the rotation is proved with event objects standing in for process objects. - The kernel queue's growth under heavy process churn was not measured.
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.
Closes with-hide/hide-private#331
Closes with-hide/hide-private#332
Closes with-hide/hide-private#333
Closes with-hide/hide-private#338
Closes with-hide/hide-private#329
Summary
Six flaky tests in five crates came from three causes, and each is fixed once for its class.
A Memory read now has no deadline of its own (the 100 ms stays in the hook alone), and the usage store's tests hold its clock still.
gitread the account's settings, so a commit failed whenever the commit-signing agent did not answer; the fixtures now read no global or system git file.--version, which skips most of Node's start, so the guarded run still paid the slow first start; the warm-up now runs the same script.Per issue:
MemoryStore::retrievehas no deadline; memory_hook tests useanswer_untilwith a still clockretrieve_with_expiry, which no longer adds a wall clock of its ownGIT_CONFIG_GLOBAL=/dev/null,GIT_CONFIG_NOSYSTEM=1; four other fixtures with the same inheritance too--versionThe Windows process end (with-hide/hide-private#327) was in this pull request and moved to a pull request of its own; its commits here are taken back out, so
hide-platform,hide-ai's omp test and its documentation are as on main.스크린샷 없음: no screen changes.
Review
hide-memory/src/store.rs,hide-memory/src/hook.rs-RetrievalQuery.deadlineis removed. The product's only Memory reader is the hook (hook::context_forandherdr_core::memory_hook::answer, both throughhide_memory::hook::within_hook_budget, which adds the 100 ms); everyretrievecall left is in a test.herdr-core/src/usage_ledger/store.rs-Storecarriesclock: fn() -> Instant;openpassesInstant::now, so product timing is unchanged.hide-host/src/worktrees.rsand four test fixtures - git runs with no global or system configuration file.SystemRoot), not its start time. If a cold first start is ever the operator's own concern, that is a separate product issue.Evidence
hide-memory --lib205/205 four times (the parallel run that failed in withhide.dev에 Hide 소개 사이트 구축 #338),hide-host --lib154/154,herdr-core --libusage_ledger, memory_hook, project_memory, memory_analysis and real_agent_trust 135/135,hide-agent-hooksadapter_contract and codex_binary 6/6.windows checkpassed, including the hide-kit Node test (Agent 탭이 마크로 접히기 전에 세 단계로 연속해서 줄어듭니다 #329).clippy --all-targets -D warningsclean for hide-memory, herdr-core, hide-host, hide-kit, hide-agent-hooks, hide-ai on macOS.windows checkfailures seen on this branch were outside its diff: two web unit tests timing out at 5 s together (open with-hide/hide-private#354, commented there) and a web unit suite that could not rename a fixture program another worker built (filed as with-hide/hide-private#371).