Repository navigation
perf: answer a new tab or split on the own engine before its holder starts - #2021
Merged
Merged
Conversation
A holder start now writes its record three times instead of five (incarnations taken 64 at a time, the program and running in one write), names its version folder without hashing the holder on every start, and logs when each step of the start was reached.
…olders An engine let go while a new pane's holder starts now ends and saves at once; the holder runs on for the next restore to gather.
… own engine A new tab or split answered before its holder starts no longer vanishes when the holder fails: it stays where it was drawn with the holder's reason as its restore error, so the screen shows it could not start and offers to close it.
…flush A pane holder's start writes its record three times under one lock, and on macOS each write's F_FULLFSYNC cost about 5 ms against 0.2 ms for fsync, so a restore of 66 panes queued about a second of flushes. The full barrier stays with write_file_durable.
A new tab or split on the own engine is drawn before its holder starts, and its view attached at once: the node took the pane for a Herdr one, whose refusal wrote a failure line into the pane and reported an error. The node now knows a pane as starting while its holder starts, and an attach to it waits for that start and opens the holder.
…block a start Pane records are flushed to the device but not past its cache, so a power loss may leave one empty, cut off or older. A node that opens the state folder now sets aside records that cannot be parsed and were written before this boot, and moves the incarnation counter past every number a record holds, so the panes start again from the saved session. Waits for a file lock also try again after 1 ms, doubling up to 20 ms, so a start that meets another's brief record write does not lose 20 ms to it.
yansfil
marked this pull request as ready for review
November 2, 2026 18:01
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.
Summary
새 엔진에서 탭과 분할을 만들 때 홀더 시작을 기다리느라 화면이 늦게 나타나고, 66개 셸 복원이 느렸습니다.
요청한 자리를 먼저 그리고 홀더가 준비되면 연결하며, 기록 저장과 잠금 대기의 비용을 줄였습니다.
시작에 실패한 pane은 이유와 닫기 버튼을 가진 기존 카드로 남습니다.
스크린샷 없음: 화면 코드는 바뀌지 않고 기존 실패 카드를 사용합니다. 성능은 앞선 동일 release 빌드의 격리된 브라우저에서 비교했습니다.
Review
UntilReboot를 쓰고 일반 저장은sync_all을 유지합니다. 아래 저장 파일을 확인해 주세요.Evidence
검토 파일, 후속과 기존 기능 증거
저장 파일:
hide-platform/src/fs/atomic.rs,hide-holder-protocol/src/record.rs,hide-kit/src/panes.rs. 기록의 내구성과 용량 경계입니다.엔진·노드 파일:
herdr-core/src/engine/own/{mod,starts}.rs,hide-node/src/terminal/{engine_panes,holder}.rs. 시작·실패·정리 소유권입니다.복구 delta:
herdr-core/src/runtime/memory_analysis.rs의 테스트 모듈만 변경했습니다.노드 attach는 시작 실패를 별도 상태로 기억하지 않아 준비 기한 뒤 일반 오류를 낼 수 있습니다. 화면에는 엔진의 실패 이유가 남고 자동 재시도는 제한됩니다.
홀더와 kit의
millis중복, 폴더 정리의 버전 이름 재계산은 별도 정리 대상으로 남깁니다.읽기와 시작 허가의 대기 한도가 겹치면
holder_start_timeout이 먼저 날 수 있으며, 에이전트 resume 복원 경로의 엔진 참조 경합도 남습니다. 기존 독립 재리뷰에서는 사소한 후속으로 분류했습니다.기존 최종 성능 코드의 128 pane 복원·저장 재개방 시험, 홀더 통합 67/67, 실제 node→holder 즉시 읽기와 엔진 계약 각 1/1이 통과했습니다. 두 실행의 홀더 17개도 모두 종료됐습니다.
즉시 읽기 대기 제거와 대기 상한 9 변이는 예상 검사에서 실패했습니다. 조기 attach 소유권과 용량 경계 변이도 각각 예상 검사에서 실패했습니다.
두 측정은 동일 빌드의 H/P 순서를 교대했습니다.
운영자 결정에 따라 시작 load<12, 최고 load<=15, 빌드 0을 적용했고 제외 실행도 보존했습니다.
여유는 쌍별
P - (1.1H + 0.5ms)의 중앙값, 복원은P - 1.1H이며 0 이하면 기준 안입니다.Verification record
Recovery final head:
4250e5ce37ec92cbe2bead59340e04a833163143.Recovery delta: cherry-pick -x
4c051dd12815776664392479b5c425ea1947e32bfrom merged fix: keep memory ranking tests independent of the date #2020. Only the test module inherdr-core/src/runtime/memory_analysis.rschanged (+51/-38); the complete file matches main atc4b89aad35ba641fd7fee393740be11fc2849ce3, and production code matches the previously reviewed head.Before the fix, the exact Send local Herdr tab and pane controls through one ordered lane #438 fork-cutoff test failed on its one allowed retry at
6ce4e4d2b([3,1] instead of [3,2]). The main fix replaces fixed dates with one relative clock capture; behavior assertions remain unchanged.Final-head
scripts/verify-cargo.sh lint: exit0.scripts/verify-cargo.sh test: exit101 at holder integration after 15 targets; herdr-core 3,928 passed /0 failed /21 ignored, including Send local Herdr tab and pane controls through one ordered lane #438 and the OMP fork test.First failure:
hide-holder::it::lifecycle::a_holder_runs_its_shell_and_carries_input_and_output_across_connections, support.rs:478,ProgramExitedbefore40 100. This matches the reported signature of with-hide/hide-private#426; its root cause remains unresolved.Only that failed test was retried once on the same final head through
scripts/verify-cargo.sh test-scoped -p hide-holder --test it lifecycle::a_holder_runs_its_shell_and_carries_input_and_output_across_connections -- --exact: exit0, 1 passed /66 filtered.Continued all 23 targets in the 14 packages not reached by fail-fast with
test-scoped --tests --no-fail-fast; then all 20 workspace documentation targets withtest-scoped --workspace --doc --no-fail-fast. Both exit0. Cargo metadata, executable dependency sources and result logs account for all 38 test targets plus 20 documentation targets, with no missing or repeated passing target.Combined first attempts: 7,322 passed /1 failed /169 ignored. With the one failed-test retry: 7,323 passed /0 unresolved failures /169 pre-existing ignored. Mission check recorded PASS with
--rerun; no test or required gate was newly skipped.Independent delta review PASS at final head: original patch byte-identical, all 67 tests and 377 assertions retained; no blocker, product change or acceptance weakening. This review covers the delta from
6ce4e4d2b, whose product review remains recorded below.C1 original measurements remain pinned to
98770406f; c2 remains skipped by the operator's delegated exception (+87.7ms). No new performance run, release build or native app verification was performed.Final-head policy CI: https://github.com/with-hide/hide/actions/runs/41566242903, attempt1 SUCCESS; plan, policy and verify passed. Design contract run 41566242941 also passed.
The CI plan at final head / main
c4b89aad35ba641fd7fee393740be11fc2849ce3automatically reuses full run41501891830, verified head6ce4e4d2bde84c79aca5c1a91a1b0b0e7c085b38/ base4b61785aa02a727a2e446b90a32cd83190504324. The same fixture fix is already on main, so the effective PR change remains identical under the existing ci-plan comparison. Other lanes were skipped by that plan; this is not fresh Linux/Windows full execution at the final head.Parent will evaluate current merge order and locked premerge checks. After-push merge-order says stay on this branch, do not stack on risky test: run the e2e suite on both engines and close bundle 3's gate #2017, and merge main once after test: run the e2e suite on both engines and close bundle 3's gate #2017 lands.
Local log SHA-256: lint
35f4b464852210e9de451fbe821bc80fbe5bee8a29f67a0285355f509e3a291c, initial test349457b1a579c84edb8c86b0963de44fb4b536d7ba6c586370f7c8083785451d, failed-only retryf2b3b320cd05d45ed562cc50ac459b8fe3df439d94f150e8b7aeb56c5c5c9d1a, continuationdbce71e5dc8659e6772e234da41f5f79d15b7adb1f239c8ce7001af99f19319e, docs97a7726c2a083e330ced2577eae5b69e891fbc76a10dcba5d2f9b9fdb8f0398e.Base:
9305a846b.Previous reviewed head:
6ce4e4d2b. Previous full-run head:76097c943.Previous
76097c943:scripts/verify-cargo.sh lintexit0. Full workspace exit101, 7,320 passed /2 failed /168 ignored; Send local Herdr tab and pane controls through one ordered lane #438 fixed-date and Make Windows web e2e specs write pane commands and paths the way the product and shell expect #439 own_devices.rs:158 no engine asked the node. Holder integration67/67. Release exit0. Make Windows web e2e specs write pane commands and paths the way the product and shell expect #439 same-head focused follow-up1/1 passed; the first full-run failure remains recorded.Previous
6ce4e4d2b: strict final-SHA lint exit0, full workspace exit101: 7,322 passed /1 failed (Send local Herdr tab and pane controls through one ordered lane #438 fork cutoff) /169 ignored. Holder integration67/67. Real holder immediate-read and engine-contract tests each1/1; all17 holder PIDs gone. No new release build or performance measurement.Earlier same-source full run: 7,320 passed /3 failed /169 ignored. Failures were Send local Herdr tab and pane controls through one ordered lane #438, Flaky e2e: agent-tab-groups가 외부에서 만든 포커스 탭을 막대에 못 붙임 (Linux) #426 holder ProgramExited before expected grid output, and guarded process spawn EINVAL22 at process.rs:1897. The guarded-process focused run passed1/1 and the final full run passed that test; neither explains the first failure, which remains preserved.
Default file barrier regression: 7 passed; removing the full-sync barrier failed the expected assertion, then source restored.
Early holder attach: public ownership before registration, real holder first frame and echoed input; ownership removal failed the expected assertion, then source restored.
Holder admission: records suite 16/16; concurrent starts preserve cap128 including unreadable records, ended records preserve room and retention128. Treating all files as live at the boundary failed with Cap130, then source restored.
pairs-3 at
98770406f: 5 pairs, 20 load-valid runs, 3 discarded, accepted peak13.39, all23 runs left0 processes; new_tab/split20 samples each, no timeouts or no-Herdr errors. Row28 outside this node: echo slack p50+0.2 / p95+1.6ms, preserved for the gate owner.pairs-4 at
699f322c9: 5 restore pairs, 10 valid runs, 3 build-contaminated runs discarded, accepted peak11.09, all13 runs exit0 and left0 processes. Release hashes verified before/after. All5 own restores have66 holder starts and no terminal.session_failed/no-Herdr error.Previous adverse evidence retained: pairs-2 row22 screen p50+0.6ms, shells H633-825/P2206-2335ms; pairs-3 shells+60.3ms, front withheld because error text could satisfy its detector. pairs-4 corrected the early attach error; diag-4 was incomplete and supplied no acceptance verdict.
Earlier workspace failures remain recorded: Send local Herdr tab and pane controls through one ordered lane #438; holder lifecycle Flaky e2e: agent-tab-groups가 외부에서 만든 포커스 탭을 막대에 못 붙임 (Linux) #426 reproduced once in10 on both branch and base; four mobile socket-open failures at98770406f, a focused16/16 follow-up did not establish their cause. At699f322c9 only#438 failed (7,320 passed /1 failed /168 ignored).
Earlier draft CI aggregate failed with lanes=[] and test jobs skipped. Ready CI at76097c943: https://github.com/with-hide/hide/actions/runs/41496549250 failed the restore-save ordering test on Linux and the old-record fixture on Windows; both are addressed by this follow-up.
Previous-head CI: https://github.com/with-hide/hide/actions/runs/41501891830, attempt2 SUCCESS. Attempt1 failed Windows check (fixture lld-link15890ms), Windows web E2E (fixture clang59999ms), and Windows package window check (fixture lld-link14082ms). Only failed jobs were rerun once. All passed on attempt2; no timeout was raised and no test was weakened. Root cause of the initial fixture failures remains unconfirmed.
Independent previous-head review: PASS at
6ce4e4d2b; remaining minor follow-ups are listed under Review.