Skip to content

feat: send a held pane's screen as fragments and answer its program from the holder - #1929

Merged
yansfil merged 12 commits into
mainfrom
feat/pane-holder-screen
Oct 31, 2026
Merged

yansfil merged 12 commits into
mainfrom
feat/pane-holder-screen

Conversation

@yansfil

@yansfil yansfil commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #1917, #1918 (엔진 묶음 2의 앞 조각: hide-vt, pane holder)

Summary

pane holder가 PTY에서 나온 바이트를 그대로 넘기던 자리를, libghostty가 해석한 화면을 표시 전용 조각으로 보내는 것으로 바꿉니다.
조각은 full/delta, epoch/seq, 크기를 갖고, full은 표시 리셋으로 시작해 받는 쪽이 전에 무엇을 그렸든 같은 화면이 되며, 입력 모드를 켜거나 받는 쪽에 질문하지 않습니다.
붙여넣기, 마우스, 휠은 의미로 받아 그 순간 프로그램의 모드에 맞춰 인코딩하고, 입력 바이트는 그대로 프로그램에 갑니다.
프로그램의 질문은 노드가 붙어 있지 않아도 holder가 한 번씩 순서대로 답하고, 노드의 테마는 holder 시작 인자로 받아 프로그램의 첫 색 질문부터 답합니다.
화면 연결을 건드리지 않는 별도 연결로 최근 줄 읽기와 프로세스 정보를 답합니다.
100 MB 폭주에서 holder의 CPU와 보내는 바이트가 Herdr v0.9.5 서버보다 적습니다.
아직 어떤 제품 경로도 holder를 띄우지 않습니다(노드 쪽 시작과 기록은 뒤 조각).

스크린샷 없음: 제품 화면이 바뀌지 않습니다(holder를 띄우는 제품 경로가 아직 없음).

Review

  • 판단해 주세요: 4 MiB를 넘는 full 화면은 연결을 닫지 않고 행 경계에서 여러 조각으로 나눕니다. 닫으면 같은 화면에 다시 붙을 때마다 또 닫히기 때문입니다.
  • 판단해 주세요: Windows의 전경 프로세스는 unknown(not_on_this_system)입니다. Herdr v0.9.5의 Windows 값은 OS 사실이 아닌 추정이라 따라가지 않았고, 묶음 3의 몫으로 남깁니다.
  • 판단해 주세요: Windows에서는 ConPTY가 입력을 바꾸고 일부 질문에 스스로 답해서, 바이트 단위 입력·답 시험은 macOS/Linux에서, Windows는 답 횟수와 단위 시험으로 봅니다.
  • 묶음 3으로 남김: kitty 키보드 질의(CSI ? u)는 답하지 않습니다. 이 길은 kitty로 인코딩한 키를 보낼 수 없어 프로그램이 일반 키를 쓰게 둡니다(D-9). 키를 의미로 보내는 메시지(kitty 키)는 묶음 3의 몫입니다.
  • 판단해 주세요: 테마는 holder 시작 인자 --theme(THEME 메시지 바이트의 hex)로 받고, 이후 THEME 메시지는 변경입니다. 노드 어댑터가 pane을 시작할 때 넘겨야 하며 docs/ARCHITECTURE.md에 적었습니다. 테마 없이 시작하면 Herdr처럼 libghostty 기본색으로 답해 프로그램이 답을 기다리지 않습니다.
  • 판단해 주세요: Unicode 11 이후 문자(예: U+1FAE0)는 libghostty와 프로그램에는 2칸, 웹 셸의 xterm(unicode11)에는 1칸입니다. holder는 셀을 프로그램이 둔 칸에 놓으므로 뒤 글자는 프로그램의 칸에 남고, 글자 모양은 받는 쪽이 첫 칸에 그립니다. 시험은 프로그램 기준으로 단언합니다.
  • 판단해 주세요: 숨긴 글자(SGR 8)는 Herdr처럼 배경색으로 칠하지 않고 숨김으로 보냅니다. Herdr 방식은 받는 쪽 기본 배경에서 글자가 보였습니다.
  • 조심해서 볼 파일: hide-holder/src/holder.rs - high-frequency path. 화면은 연결의 writer가 당겨 그리고(16 ms에 한 번 이하, 동기 출력은 마지막 ?2026h부터 최대 1초 보류), PTY reader는 writer가 변화를 기다릴 때만 깨웁니다. PTY writer 하나가 입력과 답을 순서대로 씁니다. 인계는 연결 등록, full 요청, writer 시작 순서입니다.
  • 조심해서 볼 파일: hide-holder/src/answers.rs - 누가 무엇을 답하는지의 표, 18t를 질문 위치에 끼우는 7-bit 스캐너, libghostty가 모르는 픽셀을 담는 2048 크기 보고와 kitty 질의 답을 버리는 자리.
  • 조심해서 볼 파일: hide-holder-protocol/src/lib.rs - v1을 넓혔습니다. raw_output과 OUTPUT을 지우고 close code 11(output_queue_full)을 은퇴, 새 종류는 노드 0x100x18, holder 0x900x91. holder-record가 같은 크레이트를 만지므로 번호가 겹치지 않는지 봐 주세요. v1이 배포된 적이 없어 버전은 올리지 않았습니다.
  • 조심해서 볼 파일: hide-platform/src/ipc.rs, hide-holder-protocol/src/lib.rs의 open - 노드가 연 연결에 여는 데 쓴 기한이 남아, 그 기한이 지나면 화면 연결의 읽기·쓰기가 모두 TimedOut이 되던 결함(main에 있던 것)을 고쳤습니다. 여는 교환은 따로 복제한 핸들에서만 기한을 지키고, 돌려주는 연결은 새 LocalStream::clear_deadline으로 기한을 지웁니다.
  • 조심해서 볼 파일: hide-holder/src/encode.rs, screen.rs, pane.rs - Herdr v0.9.5 코드에서 가져온 부분(NOTICE와 각 파일 머리말).
  • 비용 검토: 연결이 없으면 그리지 않고, 느린 노드는 큐 대신 더 적고 큰 조각을 받습니다. 바뀌지 않은 행은 공유해 건너뛰고, 조각 바이트는 프레임에 한 번만 복사합니다.
  • 비용 검토: 상한은 입력 1 MiB(넘으면 그 연결 닫음), 답 64 KiB(넘으면 버리고 한 번 로그), 읽기 2000행/1 MiB, 프로세스 256개, 셀 텍스트 64 B, 링크 2 KiB, 테마 인자 2,070자입니다.

Evidence

  • 확인한 것 (화면): screen.rs, 독립 @xterm/headless 6.0.0에서 조각을 그린 화면이 프로그램 바이트를 새 xterm에 그린 것과 글자, 커서, 커서 표시·모양, 셀마다 색(반전 적용)·속성(굵게, 흐리게, 기울임, 밑줄 모양, 깜빡임, 취소선, 윗줄, 숨김)·링크까지 같음.

  • 확인한 것 (화면): 새 xterm과, 대체 화면, 스크롤 영역, origin, 문자 집합, 삽입 모드, 색, 숨긴 커서, 반전을 다른 크기로 그려 둔 xterm 둘 다에서 같고, 그리면서 아무것도 답하지 않고 마우스 모드를 켜지 않음. 결합 문자, 넓은 문자, Unicode 14 문자 뒤 글자의 칸.

  • 확인한 것 (화면): 대체 화면 들어갔다 나오기, 조각을 잃은 뒤 다시 그리기(새 epoch의 full 하나로 복구), 크기 변경과 동기 출력 중 인계. 동기 출력 보류는 시각을 주입한 단위 시험(각 ?2026h부터 1초).

  • 확인한 것 (화면): 4 MiB를 넘는 512x512 화면이 행 경계에서 나뉘고 조각마다 4 MiB 이하(단위 시험).

  • 확인한 것 (입력·답): meaning.rs, 입력 바이트 그대로, 붙여넣기 bracketed/일반(\n이 \r, ESC 제거), 마우스 SGR 누름/뗌, 추적 안 할 때 버림, 휠은 보고 또는 대체 화면 화살표.

  • 확인한 것 (입력·답): 노드 없이 둘로 쪼개진 질문과 6n, c, 18t, 14t, OSC 10, XTGETTCAP을 각 한 번, 질문 순서대로 답함(14t는 답 없음, 지원 안 하는 능력은 빼고 알림, 테마 없이 OSC 10은 libghostty 기본색). 시작 테마로 첫 질문부터 답함, 테마 변경, 프로그램 색 우선, 리셋 뒤 테마 복귀.

  • 확인한 것 (읽기·프로세스): asks.rs, 3행/2000행 읽기, 0행과 2001행은 ask_invalid. 뒤로 스크롤한 채 읽기와 프로세스 질의를 해도 다시 그린 full이 스크롤한 화면과 같고 화면 연결과 세대가 그대로.

  • 확인한 것 (읽기·프로세스): 셸 pid, 전경 그룹(셸, 그다음 sleep 이름), Windows는 unknown. truncated는 실제로 행이나 바이트가 빠졌을 때만(단위 시험).

  • 확인한 것 (게이트): macOS에서 d8819c5(main merge 뒤) verify-cargo.sh lint 통과, hakari 할 일 없음, verify-cargo.sh test 6877 통과. 실패 5개(hided mobile, socket 닫힘)와 앞선 실행의 4개(hide-agent-hooks guidance_hook, 훅 10초 기한)는 부하 평균 40~50에서 났고, 다시 돌리니 각각 100/100, 409/409 통과했습니다. holder·protocol·platform·kit 608개 통과.

  • 확인한 것 (측정): 한 pane 94x39, 빠른 소비자 하나, 무작위 16진 줄 100 MB를 같은 기계에서 Herdr v0.9.5 격리 서버와 번갈아 3회씩, 중앙값. holder가 CPU, 보낸 바이트, 표지까지 시간 모두 Herdr 서버보다 적습니다(부하 평균 17~19).

  • | | CPU | 보낸 바이트(프레임) | 표지까지 |
    |---|---|---|---|
    | Herdr 서버 | 0.84 s (0.781.25) | 1.20 MB (1.181.96 MB, 86141) | 1.62 s |
    | holder | 0.72 s (0.70
    0.75) | 378 KB (373498 KB, 6485) | 1.37 s |

  • Herdr 바이트는 서버가 클라이언트에 보낸 양(HERDR_RENDER_PROF의 렌더 카운터)으로, 조각 바이트와 같은 자리입니다. 이전 측정(holder 1.21 s, 617 KB)의 원인은 PTY 읽기마다 writer를 깨운 신호(100 MB에 약 10만 회, 대부분 sys 시간)였고, 조각 만들기·해석·셀 변환은 프로파일에서 작았습니다.

  • 키 하나에서 조각까지(holder 혼자, /bin/sh 반향): 200키 3회 p50 0.180.37 ms, p95 0.763.4 ms, 최대 7.1 ms. 1000키 p50 0.36 ms, p95 1.19 ms, p99 3.63 ms, 최대 10.5 ms.

  • 확인하지 못한 것: 입력부터 화면까지의 지연은 holder 혼자 키 하나에서 조각까지만 쟀습니다(노드와 웹 셸을 거치는 본격 측정은 accept 단계).

  • 확인하지 못한 것: Linux와 Windows는 이 PR의 CI에서 돕니다(Windows 교차 빌드는 로컬 C 의존성 때문에 불가).

  • 확인하지 못한 것: 로컬 nextest 0.9.143이 macOS에서 기존 asks 시험 하나를 LEAK로 표시했습니다. .config/nextest.toml이 적어 둔 옛 nextest의 오표시이고, CI는 0.9.145입니다.

Verification record
  • base cd8fbc3 (origin/main, merged in d8819c5), head 4bdf664
  • verify run 41196288191 success on 4bdf664; holder tests in vt lanes: macOS 80/80, Linux 80/80, Windows 79/79
  • local d8819c5: scripts/verify-cargo.sh lint exit 0; hakari no operations; test 6877 passed, 5 failed (hided mobile, load 40-50; rerun 100/100), 158 ignored
  • scripts/verify-cargo.sh nextest -p hide-holder -p hide-holder-protocol -p hide-platform -p hide-kit 608 passed; -p hide-agent-hooks 409 passed
  • flood: pinned herdr 0.9.5 isolated server (private HOME, XDG_*, HERDR_SESSION, HERDR_CONFIG_PATH, HERDR_SOCKET_PATH, HERDR_RENDER_PROF=1) vs release hide-holder built from 4bdf664, alternating, 3 pairs

…nst an independent xterm

Fragments drawn on a headless xterm after any earlier state, the alternate
screen, a redraw after lost fragments, a resize and a takeover during
synchronized output; input and paste, pointer and wheel encoding at the
program's modes; answers once each in order with no node connected and the
theme against the program's own colors; reads and process lists within their
bounds without touching the screen connection or its scroll position; a
screen past the fragment bound split between rows.
…ts run

The vt lane, the rust lane, the release test job and the Herdr update
proposal run the pane holder's screen tests, which draw on a headless xterm
under Node; `verify-web.sh install holder` installs that package alone.
…and credit the Herdr code they take

ARCHITECTURE's pane holder section carries the fragments, the pull model and
its bounds, input meaning, the answers table's owner and the asks; TESTING
says how the screen is checked against an independent xterm. NOTICE and the
files' headers name the Herdr v0.9.5 code the encoder and the capture take,
and hide-vt/PATCHES.md the parser functions added for the holder.
A PTY read marked the screen changed and woke the connection writer every time, about 100,000 wakes for a 100 MB flood, while the writer only waited out its 16 ms interval. The writer now says when it waits for a change, as Herdr's render signal does, and a fragment's bytes are copied once into its frame.
The holder takes the screen connection before it asks for the first full screen, restarts the synchronized output bound at each start, marks a read truncated only when rows or bytes were left out, leaves the kitty keyboard query unanswered since this path sends no kitty keys, takes the node's theme as a start argument and answers a color with no theme with libghostty's default, logs why a foreground group could not be listed, hides the cursor after the soft reset that shows it, and sends hidden text as hidden.
The xterm harness reports each cell's colors, attributes and link, the screen tests compare them, and cover combined characters and a character newer than xterm's Unicode 11 table. A step is waited on by drawing the fragments, the timing-dependent hold assertion is gone, and the start theme is checked before any node connects.
The stream the protocol's open answered kept the connect deadline, so every read and write on a node's screen connection failed with TimedOut once the opening's deadline had passed. The opening is now bounded on a handle of its own and the stream's deadline is cleared with a new LocalStream::clear_deadline.
# Conflicts:
#	docs/ARCHITECTURE.md
#	hide-holder/src/holder.rs
#	hide-holder/src/main.rs
#	hide-holder/tests/it/main.rs
#	hide-holder/tests/it/role.rs
#	hide-platform/tests/it/process.rs
@yansfil
yansfil merged commit 8ee62ac into main Oct 31, 2026
68 checks passed
@yansfil
yansfil deleted the feat/pane-holder-screen branch October 31, 2026 11:54
yansfil added a commit that referenced this pull request Oct 31, 2026
…pment switch (#1934)

Related: 엔진 교체 묶음 2의 다섯 번째 PR. 선행 #1917, #1918, #1927, #1929 (모두 main에
있음).

## Summary

보관 프로그램(pane holder)은 지금까지 혼자서만 시험됐고, hide-node가 그것을 띄우고 다시 찾아 붙는 길이
없었습니다.
이 PR은 개발 스위치 `HIDE_DEV_PANE_HOLDER=1`이 켜진 로컬 노드가 pane을 보관 프로그램으로 시작·끝내고,
지금 터미널 서비스로 화면을 붙이게 합니다.
노드가 다시 뜨면 기록으로 살아 있는 보관 프로그램을 찾아 64개에 화면을 붙이고, 나머지는 살려 둔 채
`attach_limit`으로 보고하며, 없던 동안 끝난 pane은 기록된 이유로 pane마다 한 번 보고합니다.
다른 노드가 인계하면 재시도하지 않고, 가장 오래된 지원 버전보다 오래된 보관 프로그램은 끝내지 않고 "지원하지 않는 버전"으로
보고합니다.
스위치가 꺼져 있으면 지금 Herdr 세션 길 그대로이고 보관 프로그램을 하나도 띄우지 않습니다.

스크린샷 없음: 화면 변경 없음 (앱은 이 묶음에서 보관 프로그램 pane을 보여 주지 않음).

## Review

- **판단해 주세요**: 이 묶음은 로컬 노드만 보관 프로그램을 띄웁니다. 기기 노드는 스위치가 켜져도 진단
로그(`pane_holder.device_node_unsupported`)를 남기고 Herdr 길로 돕니다. OwnedChild
작업 묶음에 BREAKAWAY_OK를 더하는 일과 그 계약 시험은 묶음 3에서 기기 kit과 함께 넣습니다(Conductor
결정).
- **판단해 주세요**: 다시 붙을 때 크기는 코어가 레이아웃을 갖는 묶음 3 전까지, 한 번 붙어 Welcome이 알려 주는
보관 프로그램의 지금 크기를 그대로 씁니다(Resize를 보내지 않음). 같은 크기 resize는 보관 프로그램이 PTY를 다시
맞추고 프로그램에 신호를 보내므로 보내지 않습니다.
- **조심해서 볼 파일**: `hide-node/src/terminal/session.rs` - Herdr 길이 지나는 곳.
세션의 읽기·쓰기를 transport trait으로 나눴고, Herdr transport는 같은 NDJSON 줄을 같은 순서로
씁니다(아래 Evidence의 기존 시험).
- **조심해서 볼 파일**: `hide-node/src/terminal/mod.rs` - failure path. 닫힘이 문자열
대신 구조화된 category를 받고,
`taken_over`·`program_exited`·`terminated`·`unsupported_holder_version`은
재시도하지 않습니다(`final_close`). Herdr 닫힘은 지금처럼 `closed_category`로 읽습니다.
- **조심해서 볼 파일**: `hide-kit/src/panes.rs` - 끝내기 연결이 Closed 없이 EOF로 끊기면 보관
프로그램이 살아 있는 동안 20초 안에서 다시 붙어 terminate를 보냅니다. 시작 요청에 테마(필수, 시작 키에는 미포함)를
실어 `--theme`으로 넘기고, ready 줄의 `job=`을 `pane_holder.started`에 남깁니다.
- **비용 검토**: 화면 조각 배달 경로에 복사나 잠금을 더하지 않았습니다. 보관 프로그램 조각의 바이트는 그대로
frame으로 옮겨지고(NDJSON·base64를 거치지 않음), 서비스 잠금 아래에서는 pane 이름 조회
하나(`keeps_own_size`, 경로 복제 없이 `contains_key`)만 늘었습니다. redraw는 쓰개 명령 하나로
resize와 같은 값을 치릅니다. 키 입력은 잠금 아래에서 base64 줄을 만들던 것이 바이트 복사로 바뀌고 인코딩은 쓰개
스레드로 옮겨졌습니다.
- **조심해서 볼 파일**: `hide-node/src/terminal/holder.rs` - 같은 크기 resize는 보관
프로그램에 보내지 않으므로, 서비스가 전체 화면을 다시 달라고 하던 곳(redraw, 같은 크기 view, frame 유실)은
`SessionWriter::redraw`로 묻습니다. Herdr는 지금처럼 같은 크기 resize 줄을 쓰고, 보관 프로그램은
`ClientMessage::Redraw`를 받습니다.
- **조심해서 볼 파일**: `hide-holder-protocol/src/lib.rs` - `ask`가 버전을 받고, 노드는
pane 기록의 `protocol`로 묻습니다. 줄의 바이트는 같습니다(v1 fixture 통과).
- **조심해서 볼 파일**: `hided/src/env.rs` - `HIDE_DEV_PANE_HOLDER`를 등록해 데몬 점검이
잘못된 값을 다른 키와 함께 보고합니다. 기기 노드는 잘못된 값이면 터미널 시작이 실패하고, `1`이면 진단 로그를 남기고
Herdr 길로 돕니다.

## Evidence

- **확인한 것 (macOS, 실제 hide-node 코드와 빌드된 hide-holder)**:
`hide-holder/tests/it/node.rs` 7개 통과.
- redraw: 보관 프로그램 pane에 redraw와 같은 크기 view를 보내면 각각 새 전체 frame이 오고, 그 뒤
프로그램이 찍은 줄이 보관 프로그램 읽기에 있고 그 뒤 frame에 그려짐.
- Windows에서 이 시험이 두 번 실패한 원인은 시험 줄이었습니다(제품 결함 아님). `print_node`가
Windows에서 `set B=<word>& call echo %B%-node`를 쳤는데, cmd는 줄을 읽을 때 `%B%`를
먼저 펼치고 그다음에 `set`을 실행합니다. 그래서 한 셸에서 두 번째 단어를 치면 앞 단어가 다시 찍힙니다("viewed"
대신 "redrawn-node"). 근거: d2c291c(run 41207004565)에서는 첫 단어 "redrawn"이
화면에 그려지고 두 번째 "viewed"만 실패했고, d3e18c813에서는 보관 프로그램 읽기에도 "viewed-node"가
끝내 없었습니다. 한 셸에 두 단어를 찍는 시험은 이것이 처음입니다. 이제 줄은 `echo <word>^-node`(캐럿이 친
줄에 그 글자가 생기지 않게 함)이고, 실패하면 pane 글자를 함께 보여 줍니다. d3e18c813에서 잠깐 느슨하게 바꾼
확인(frame 수만 봄)은 되돌렸습니다. 보관 프로그램 쓰개의 redraw를 같은 크기 resize로 되돌리면 이 시험이 "a
full frame after the ask never happened"로 실패함을 확인.
  - 스위치 꺼짐: Attach가 Herdr attacher로 가고 버전 폴더·소켓·기록이 하나도 생기지 않음.
- 켜짐: 시작 후 첫 전체 frame, 입력 바이트가 셸에 닿음(읽기로 확인), 같은 요청 재시작은 Existing이고 같은
incarnation·holder, terminate 뒤 holder가 사라지고 기록은 `terminated`.
- 강제 종료: `node` 역할 프로세스가 66개 pane을 띄운 뒤 kill. 새 노드가 65개를 찾아 이름순 64개에 첫
전체 frame, 65번째는 `unavailable`/`attach_limit`으로 보고되고 붙지 않고 살아 있음, 노드가 없던
동안 찍힌 줄이 첫 전체 frame에 있음, 끝난 pane은 `program_exited`로 한 번만 보고, 모든
holder·program pid와 시작 시각이 이전과 같음. 66개 시작 4.1초, 다시 찾아 64개 그리기 0.14초(전체
5.2초).
- 인계: 잘못된 첫 메시지 뒤에도 첫 노드 입력이 닿음. 두 번째 노드 인계 뒤 첫 노드는 `taken_over`,
`retry_decision: none`, 7초 동안 다시 뺏지 않음. 인계 뒤 첫 노드가 친 줄은 셸에 닿지 않음.
- 버전: 바이트로 고정한 v1 fixture(`fixture_v1.rs`)에 기록으로 붙어 화면·입력·크기·redraw·기록
버전으로 읽기·끝내기, 모르는 kind 0개, hello는 버전 1을 포함. protocol 0 기록은
`unsupported_holder_version`으로 보고되고 프로세스와 버전 폴더가 남음.
- **확인한 것 (B1)**: hide-node의 기존 Service 시험(`terminal/tests.rs`,
`device_tests.rs`)은 한 줄도 바꾸지 않고 통과. hide-node + hide-kit 417개 통과.
`session.rs` 자체 단위 시험은 쓰개 명령 타입이 바뀐 세 줄만 고쳤고 단언은 그대로.
- **확인한 것**: 9a6508269에서 `scripts/verify-cargo.sh lint` 통과,
`scripts/verify-cargo.sh test` 6,890개 통과 0개 실패(macOS), `cargo hakari` 변경
없음, `check-engine-boundary.py` 통과.
- **확인한 것 (리뷰 1회차, d2c291c, 시험 수정 0854c31)**:
`scripts/verify-cargo.sh lint` 통과. hide-holder, hide-holder-protocol,
hide-node, hide-kit, hided 1,182개 통과(macOS). `hided` env 시험이
`HIDE_DEV_PANE_HOLDER=yes`를 다른 잘못된 키와 함께 보고함을 확인.
`check-engine-boundary.py` 통과.
- **확인한 것 (CI run 41201429951, 9a65082)**: vt 레인 Linux·macOS·Windows에서
`node::` 6개 모두 통과. 66개 pane 강제 종료 시험은 Linux 3.7초, macOS 10.0초, Windows
10.9초. rust workspace, windows check, os contract 3 OS, verify 통과.
- **확인하지 못한 것**: 실제 앱과 hided에서 스위치를 켠 실행은 하지 않았습니다(이 묶음은 화면이 없음).
Windows ARM64와 실제 Windows PC는 묶음 3 범위입니다.

<details><summary>Verification record</summary>

</details>
yansfil added a commit that referenced this pull request Nov 1, 2026
…st Herdr (#1952)

Related: engine bundle 2 (pane holder), the last of #1917, #1918, #1927,
#1929, #1934; with-hide/hide-private#405

## Summary

This shows that a pane keeps running, untouched, when the node that
holds it is killed and a new one takes it back, with every supported
agent's real CLI on macOS, Linux and Windows, and measures the holder
path against Herdr's.
A new lane restarts the node under each pinned CLI: 21 cells on three
systems.
Measured on macOS against Herdr v0.9.5, the holder path is faster and
within every agreed bound; one fix was needed, so a holder now gives
freed heap memory back once its screen is still.
One Windows Antigravity cell failed once in ten runs: agy read the
holder's answer to its color question as keys. The cause and the product
question are in hide-private#405; until it closes, the lane shows that
cell but does not fail on it, whatever the cause of that cell's failure.
The lane, the measurement and the probe end everything they start, by
pid and start time, however a run ends.

스크린샷 없음: 화면 변경이 없습니다(개발 스위치 아래의 노드, CI 레인, 측정 스크립트, 문서).

## Review

- **판단해 주세요**: the holder answers color questions (OSC 10/11) from the
theme whether or not a screen is attached, while Herdr with no client
answers none; that difference is what made agy open its editor once
(hide-private#405). Should a holder answer only while a screen is
attached?
- **판단해 주세요**: the memory bounds are a decision of this mission, not the
PRD's 3 MB per holder: one holder idle at most 4 MiB, attached or not,
and 6 MiB (4 MiB and the parser's 2 MiB scrollback) once a flood has
settled. 3 MB was below a holder's own floor (about 2.8 MB before it
draws anything; 3.47 MB idle with a screen attached, its connection's
buffers included) and had not counted the scrollback. Figures before the
change are under the tables.
- **조심해서 볼 파일**:
- `hide-holder/src/holder.rs` (`next_job`, `return_freed`) - the
high-frequency path: the writer waits once for 1 s after its last
fragment, then gives freed pages back and waits with no bound; a
connection's first return and one after 1 MiB of output are logged
(`holder.memory_returned`), so a pane redrawing a line every second does
not fill its log. Nothing is added to the PTY reader or the encoder but
the pane's count of bytes fed.
- `scripts/holder_owned.py` - the one end for every process the lane,
the measurement and the probe start: children as started, holders by
their pane records, everything under them by one look at the process
table; one failing end does not stop the others, and the folder goes
only once nothing runs. `scripts/tests/test_holder_owned.py` holds it
after a node restart that fails and after SIGTERM.
- `scripts/holder-restart-check.py` (`KNOWN_FAILURES`) - the Windows
Antigravity cell, keyed `antigravity` as the contract names it, is shown
as a known failure and not counted while hide-private#405 is open,
unless it leaves a process running; the other 20 cells block. The mark
hides every failure of that cell, not only #405's cause, so its reason
in the report is what tells a new one apart; a key naming no agent of
the contract stops the run, and
`scripts/tests/test_holder_restart_known_failures.py` holds the mark,
the pass and the fail. A CLI off its pin fails its cell, and the
holder's identity is checked against the process table.
- `hide-node/src/terminal/holder.rs`, `hided/src/core.rs` -
`Holders::start_local` takes the holder folders only with the switch on
(`Option<HolderFolders>`).
- `.github/workflows/holder-restart.yml`, `scripts/ci-plan.py` - the
lane on three systems; the five extra Antigravity runs are gone.
- **비용 검토**: per output, a byte count; per burst, one wake and one heap
walk (`malloc_zone_pressure_relief`, glibc `malloc_trim`, `HeapCompact`)
a second after the last fragment; an idle holder wakes 0 times in 60 s.
The lane job took 2.7 to 6.1 minutes per system (runs 41234750464,
41237366181: build 78 to 90 s, cells 24 to 39 s, color probe about 80
s); the `holder_node` example adds 17 to 44 s per system.

## Evidence

- **확인한 것**:
- Restart lane on three systems, CI run 41250820500 on this head: 21/21
cells pass with every CLI at its pin and nothing left running (table
below).
- The comparison after a restart is text only: the first full frame,
drawn on two xterms, is compared line by line with the holder's own
read, with the cursor; colors and attributes are `screen.rs`'s to check,
not the lane's.
- Measurement, macOS release builds, 120x40: five alternating pairs at
1, 64, 100 and 128 panes, re-analyzed (not re-measured): six pairs that
saw a build process in some phase are dropped and listed, 3 or 4 pairs
are kept per count at load 1.5 to 15.1, and all 45 bounds pass (verdict
table below).
- Slow consumer, re-measured: three pairs at 64 panes with only one
pane's connection slowed (holder: a proxy on its socket reading 10 ms of
every 40; Herdr: its session client stopped 30 ms of every 40). The slow
pane drew 44 to 48 frames of a 75 MB flood against about 460 unslowed;
the echo pane's p50 stayed 0.19 to 0.24 ms against Herdr's 0.7 to 2.1;
CPU 0.07 times Herdr's; the node's own memory grew 0.04 to 0.11 MiB on
either path, so its deliveries queue did not grow.
- One holder flooded 300 MB with no screen attached: 2.72 MiB before,
5.16 MiB after, under 6 MiB.
- The 71 and 72 wakes in the 2.5 s after attach in two 128-pane rounds
(64 in the other three): three 128-pane rounds on this head woke exactly
64 times, one per attached holder, with the 64 unattached at 0; the 60 s
idle windows were 0 in every round.
- The idle and memory tests wait on state (the holder's logged return,
then the kernel's count standing still), never a fixed settle;
`memory.rs` waits for the return logged after the flood's last line and
holds the 6 MiB budget on Linux and Windows in every build, and on macOS
that the holder is within the budget or its return brought it down
(local debug, five runs: 7.20 to 9.14 MiB at the flood's end, 5.86 to
6.75 MiB after; a CI runner: 5.08 MiB at the end, 5.09 after), the
release measurement judging the bound there; a unit test shows a full 2
MiB scrollback drops its oldest rows first and keeps its size.
- Cleanup: `test_holder_owned.py` passes and fails when pane records are
ignored; a measurement round stopped by SIGTERM left no process and no
folder; `test_holder_perf_close.py` holds that a round's own failure is
raised with what its close left beside it.
- **확인하지 못한 것**:
- The Electron item is reproduced, not run: no packaged app runs in CI.
The test builds the same job flags, and the lane starts its node through
Node's spawn; the Electron binary itself was not used.
- Windows Antigravity: 1 failure in 10 runs (20c9452), cause not
proven. The probe measured one answer per question and 1.5 ms (max 4.3
ms) on Windows. Its Herdr side is a private v0.9.5 server with one pane
started by `herdr pane run` and no client attached; whether Herdr
answers while a screen is attached was not measured (hide-private#405).
- The holder's 4 MiB fragment cap was not reached by the measurement (a
120x40 frame is about 6 KB); the unit tests split a larger screen.
- The extra 7 to 8 wakes of two battery rounds are not attributed: that
run kept no per-holder count, and the final build did not repeat them.
- Freed-memory return on Windows has no effect: an 8 MB flood leaves
3.81 MiB kept and 4.20 MiB given back; on Linux glibc leaves nothing to
give (2.96 against 2.95 MiB). Only macOS gains.
- Linux and Windows have no Herdr comparison in numbers; CI holds their
boundaries (wakeups, the memory budget, input exactness, caps) only.

<details><summary>21 cells (agent x system), this head</summary>

Run 41250820500 (40248e9). Each cell: result (first turn / reattach /
second turn, s); every CLI matched its pin and no cell left a process
running.

| agent | CLI (pin) | Linux | macOS | Windows |
|---|---|---|---|---|
| claude-code | 2.1.302 | pass (0.7 / 0.01 / 0.3) | pass (1.5 / 0.07 /
0.4) | pass (2.4 / 0.08 / 0.3) |
| codex | 0.163.0 | pass (2.2 / 0.01 / 0.3) | pass (3.1 / 0.04 / 0.4) |
pass (1.3 / 0.09 / 0.4) |
| grok | 1.0.52 | pass (0.4 / 0.01 / 0.3) | pass (1.6 / 0.02 / 0.4) |
pass (2.9 / 0.11 / 0.3) |
| opencode | 2.0.29 | pass (2.0 / 0.01 / 0.5) | pass (1.7 / 0.03 / 0.5)
| pass (3.3 / 0.09 / 0.5) |
| pi | 1.0.4 | pass (0.6 / 0.01 / 0.3) | pass (0.6 / 0.02 / 0.3) | pass
(0.9 / 0.08 / 0.3) |
| omp | 18.7.0 | pass (1.6 / 0.01 / 0.3) | pass (1.5 / 0.02 / 0.4) |
pass (3.8 / 0.09 / 0.8) |
| antigravity | 1.4.8 | pass (0.6 / 0.01 / 0.3) | pass (0.7 / 0.06 /
0.4) | pass (1.0 / 0.11 / 0.3) |

Windows Antigravity, five more runs in the same job at 080c2f6 (that
step is gone from the workflow; this is its record): pass, pass, pass,
pass, pass. Through 080c2f6: 1 failure in 10 runs (20c9452,
hide-private#405); it passed at 2fca9dc and on this head.

</details>

<details><summary>Measurement tables (macOS; dropped pairs listed
first)</summary>

**Dropped pairs (a build process in some phase of either round)**

| panes | pair | build processes seen (path phase: count) |
|---|---|---|
| 1 | 5 | holder start: 2; holder idle_unattached: 3; herdr end: 2;
herdr idle_attached: 3; herdr latency_alone: 2; herdr reattach: 2 |
| 64 | 1 | herdr idle_attached: 4; herdr latency_alone: 4 |
| 64 | 5 | holder start: 3; holder idle_unattached: 3; herdr
idle_unattached: 3 |
| 100 | 2 | herdr idle_unattached: 2; herdr idle_attached: 3 |
| 128 | 4 | herdr start: 3 |
| 128 | 5 | herdr idle_unattached: 3; herdr idle_attached: 3; herdr
latency_alone: 3; herdr flood_one: 8; herdr flood_eight: 2 |

Kept pairs: 1 panes [1, 2, 3, 4], 64 panes [2, 3, 4], 100 panes [1, 3,
4, 5], 128 panes [1, 2, 3]

**Latency, key to frame at the node: each kept pair (ms; load min-max of
both rounds)**

| panes | phase | pair | load | holder p50 | Herdr p50 | holder p95 |
Herdr p95 | p50 ratio | p95 ratio |
|---|---|---|---|---|---|---|---|---|---|
| 1 | latency_alone | 1 | 2.0-7.8 | 0.26 | 19.49 | 0.65 | 21.21 | 0.01 |
0.03 |
| 1 | latency_alone | 2 | 1.7-4.5 | 0.40 | 19.99 | 0.79 | 22.20 | 0.02 |
0.04 |
| 1 | latency_alone | 3 | 2.7-8.8 | 0.33 | 19.87 | 0.69 | 22.46 | 0.02 |
0.03 |
| 1 | latency_alone | 4 | 2.4-6.3 | 0.41 | 20.11 | 0.96 | 22.51 | 0.02 |
0.04 |
| 1 | reattach | 1 | 2.0-7.8 | 0.26 | 19.97 | 0.71 | 23.64 | 0.01 | 0.03
|
| 1 | reattach | 2 | 1.7-4.5 | 0.29 | 20.44 | 1.06 | 22.58 | 0.01 | 0.05
|
| 1 | reattach | 3 | 2.7-8.8 | 0.37 | 19.61 | 0.82 | 21.46 | 0.02 | 0.04
|
| 1 | reattach | 4 | 2.4-6.3 | 0.36 | 19.43 | 1.10 | 22.60 | 0.02 | 0.05
|
| 64 | latency_alone | 2 | 1.6-15.1 | 0.24 | 3.50 | 1.22 | 3.67 | 0.07 |
0.33 |
| 64 | latency_alone | 3 | 1.5-5.3 | 0.41 | 1.15 | 0.89 | 1.28 | 0.35 |
0.70 |
| 64 | latency_alone | 4 | 2.2-8.8 | 0.39 | 0.68 | 0.98 | 0.76 | 0.57 |
1.29 |
| 64 | flood_one | 2 | 1.6-15.1 | 0.18 | 3.58 | 0.73 | 19.03 | 0.05 |
0.04 |
| 64 | flood_one | 3 | 1.5-5.3 | 0.18 | 1.20 | 0.76 | 18.82 | 0.15 |
0.04 |
| 64 | flood_one | 4 | 2.2-8.8 | 0.14 | 0.72 | 0.57 | 19.59 | 0.19 |
0.03 |
| 64 | flood_eight | 2 | 1.6-15.1 | 0.21 | 13.80 | 0.98 | 83.13 | 0.02 |
0.01 |
| 64 | flood_eight | 3 | 1.5-5.3 | 0.23 | 14.19 | 0.94 | 76.56 | 0.02 |
0.01 |
| 64 | flood_eight | 4 | 2.2-8.8 | 0.22 | 0.99 | 0.75 | 83.91 | 0.22 |
0.01 |
| 64 | reattach | 2 | 1.6-15.1 | 0.42 | 3.07 | 0.75 | 3.34 | 0.14 | 0.22
|
| 64 | reattach | 3 | 1.5-5.3 | 0.26 | 2.22 | 0.76 | 2.46 | 0.12 | 0.31
|
| 64 | reattach | 4 | 2.2-8.8 | 0.23 | 1.21 | 0.66 | 31.46 | 0.19 | 0.02
|
| 100 | latency_alone | 1 | 2.3-8.8 | 0.27 | 1.66 | 0.81 | 1.81 | 0.16 |
0.45 |
| 100 | latency_alone | 3 | 2.2-6.1 | 0.33 | 1.19 | 0.83 | 1.71 | 0.28 |
0.49 |
| 100 | latency_alone | 4 | 2.2-7.1 | 0.30 | 1.28 | 0.70 | 1.61 | 0.23 |
0.44 |
| 100 | latency_alone | 5 | 3.1-11.2 | 0.30 | 1.72 | 0.75 | 1.98 | 0.18
| 0.38 |
| 100 | flood_one | 1 | 2.3-8.8 | 0.16 | 1.77 | 0.55 | 19.13 | 0.09 |
0.03 |
| 100 | flood_one | 3 | 2.2-6.1 | 0.16 | 1.23 | 0.57 | 19.07 | 0.13 |
0.03 |
| 100 | flood_one | 4 | 2.2-7.1 | 0.13 | 1.32 | 0.58 | 20.58 | 0.10 |
0.03 |
| 100 | flood_one | 5 | 3.1-11.2 | 0.14 | 1.92 | 0.89 | 20.38 | 0.07 |
0.04 |
| 100 | flood_eight | 1 | 2.3-8.8 | 0.22 | 14.61 | 0.81 | 76.61 | 0.01 |
0.01 |
| 100 | flood_eight | 3 | 2.2-6.1 | 0.21 | 12.94 | 0.89 | 77.33 | 0.02 |
0.01 |
| 100 | flood_eight | 4 | 2.2-7.1 | 0.25 | 5.77 | 1.05 | 83.54 | 0.04 |
0.01 |
| 100 | flood_eight | 5 | 3.1-11.2 | 0.23 | 3.69 | 0.98 | 88.61 | 0.06 |
0.01 |
| 100 | reattach | 1 | 2.3-8.8 | 0.33 | 1.25 | 0.63 | 14.91 | 0.26 |
0.04 |
| 100 | reattach | 3 | 2.2-6.1 | 0.33 | 0.73 | 0.94 | 0.84 | 0.45 | 1.12
|
| 100 | reattach | 4 | 2.2-7.1 | 0.44 | 1.36 | 0.89 | 44.42 | 0.32 |
0.02 |
| 100 | reattach | 5 | 3.1-11.2 | 0.23 | 0.75 | 0.72 | 0.85 | 0.31 |
0.84 |
| 128 | latency_alone | 1 | 2.4-14.1 | 0.40 | 1.74 | 0.97 | 1.92 | 0.23
| 0.50 |
| 128 | latency_alone | 2 | 3.7-10.3 | 0.23 | 2.17 | 0.99 | 2.35 | 0.11
| 0.42 |
| 128 | latency_alone | 3 | 4.0-14.6 | 0.29 | 0.79 | 0.65 | 0.96 | 0.36
| 0.68 |
| 128 | flood_one | 1 | 2.4-14.1 | 0.16 | 1.84 | 0.72 | 19.25 | 0.09 |
0.04 |
| 128 | flood_one | 2 | 3.7-10.3 | 0.15 | 2.31 | 1.51 | 18.83 | 0.06 |
0.08 |
| 128 | flood_one | 3 | 4.0-14.6 | 0.15 | 0.82 | 0.61 | 20.84 | 0.18 |
0.03 |
| 128 | flood_eight | 1 | 2.4-14.1 | 0.23 | 3.81 | 0.98 | 82.28 | 0.06 |
0.01 |
| 128 | flood_eight | 2 | 3.7-10.3 | 0.21 | 14.65 | 1.05 | 78.88 | 0.01
| 0.01 |
| 128 | flood_eight | 3 | 4.0-14.6 | 0.23 | 4.70 | 0.96 | 84.66 | 0.05 |
0.01 |
| 128 | reattach | 1 | 2.4-14.1 | 0.29 | 1.72 | 1.00 | 2.01 | 0.17 |
0.50 |
| 128 | reattach | 2 | 3.7-10.3 | 0.28 | 0.80 | 0.77 | 0.89 | 0.35 |
0.86 |
| 128 | reattach | 3 | 4.0-14.6 | 0.31 | 2.77 | 1.58 | 3.06 | 0.11 |
0.52 |

**Latency bound: median over kept pairs of holder - (1.1 x Herdr + 0.5
ms)**

| panes | phase | pairs | p50 margin | p95 margin | pairs within (p50,
p95) | verdict |
|---|---|---|---|---|---|---|
| 1 | latency_alone | 4 | -22.05 | -24.22 | 4/4, 4/4 | pass |
| 1 | reattach | 4 | -21.96 | -24.27 | 4/4, 4/4 | pass |
| 64 | latency_alone | 3 | -1.35 | -1.02 | 3/3, 3/3 | pass |
| 64 | flood_one | 3 | -1.64 | -20.70 | 3/3, 3/3 | pass |
| 64 | flood_eight | 3 | -15.47 | -90.97 | 3/3, 3/3 | pass |
| 64 | reattach | 3 | -2.67 | -3.42 | 3/3, 3/3 | pass |
| 100 | latency_alone | 4 | -1.83 | -1.63 | 4/4, 4/4 | pass |
| 100 | flood_one | 4 | -2.06 | -21.51 | 4/4, 4/4 | pass |
| 100 | flood_eight | 4 | -10.56 | -88.01 | 4/4, 4/4 | pass |
| 100 | reattach | 4 | -1.32 | -8.49 | 4/4, 4/4 | pass |
| 128 | latency_alone | 3 | -2.01 | -1.65 | 3/3, 3/3 | pass |
| 128 | flood_one | 3 | -2.37 | -20.95 | 3/3, 3/3 | pass |
| 128 | flood_eight | 3 | -5.44 | -90.02 | 3/3, 3/3 | pass |
| 128 | reattach | 3 | -2.11 | -1.71 | 3/3, 3/3 | pass |

**Flood CPU (user+sys s of the path's processes): each kept pair**

| panes | phase | pair | load | holder CPU | Herdr CPU | ratio |
|---|---|---|---|---|---|---|
| 64 | flood_one | 2 | 1.6-15.1 | 2.03 | 10.53 | 0.19 |
| 64 | flood_one | 3 | 1.5-5.3 | 1.95 | 10.61 | 0.18 |
| 64 | flood_one | 4 | 2.2-8.8 | 2.01 | 10.56 | 0.19 |
| 64 | flood_eight | 2 | 1.6-15.1 | 51.93 | 59.64 | 0.87 |
| 64 | flood_eight | 3 | 1.5-5.3 | 54.77 | 58.35 | 0.94 |
| 64 | flood_eight | 4 | 2.2-8.8 | 55.23 | 59.87 | 0.92 |
| 100 | flood_one | 1 | 2.3-8.8 | 1.99 | 10.67 | 0.19 |
| 100 | flood_one | 3 | 2.2-6.1 | 2.00 | 10.69 | 0.19 |
| 100 | flood_one | 4 | 2.2-7.1 | 1.99 | 10.85 | 0.18 |
| 100 | flood_one | 5 | 3.1-11.2 | 1.91 | 11.02 | 0.17 |
| 100 | flood_eight | 1 | 2.3-8.8 | 55.57 | 55.55 | 1.00 |
| 100 | flood_eight | 3 | 2.2-6.1 | 55.37 | 58.68 | 0.94 |
| 100 | flood_eight | 4 | 2.2-7.1 | 48.57 | 38.32 | 1.27 |
| 100 | flood_eight | 5 | 3.1-11.2 | 49.35 | 46.80 | 1.05 |
| 128 | flood_one | 1 | 2.4-14.1 | 1.99 | 10.68 | 0.19 |
| 128 | flood_one | 2 | 3.7-10.3 | 2.11 | 10.70 | 0.20 |
| 128 | flood_one | 3 | 4.0-14.6 | 1.97 | 11.02 | 0.18 |
| 128 | flood_eight | 1 | 2.4-14.1 | 54.08 | 57.65 | 0.94 |
| 128 | flood_eight | 2 | 3.7-10.3 | 47.68 | 58.38 | 0.82 |
| 128 | flood_eight | 3 | 4.0-14.6 | 51.09 | 50.80 | 1.01 |

**Loss, wakeups and memory in every kept round**

| panes | rounds | input exact | lost on screen | idle holder wakeups
(max) | one holder idle max MiB | one holder after a flood max MiB | 64
attached: holder / Herdr |
|---|---|---|---|---|---|---|---|
| 1 | 8 | 8/8 | 0 | 0 | 2.92 | - | - |
| 64 | 6 | 6/6 | 0 | 0 | 3.17 | 5.91 | 0.73 (pairs 0.71, 0.74, 0.73) |
| 100 | 8 | 8/8 | 0 | 0 | 3.00 | 5.91 | - |
| 128 | 6 | 6/6 | 0 | 0 | 3.28 | 5.88 | - |

**Slow consumer at 64 panes: one pane's connection read 10 ms of every
40 (holder: proxy on its socket; Herdr: its session client stopped 30 ms
of 40)**

| pair | load | holder p50 / p95 ms | Herdr p50 / p95 ms | holder CPU /
Herdr CPU s | ratio | flooded holder after, still MiB | node before /
after / still MiB (holder) | node before / after / still MiB (Herdr) |
wall s holder / Herdr |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 4.6-8.9 | 0.24 / 1.31 | 0.70 / 17.43 | 0.53 / 7.42 | 0.07 | 5.63,
5.63 | 6.44 / 6.55 / 6.55 | 6.36 / 6.48 / 6.48 | 9.5 / 10.0 |
| 2 | 4.4-8.3 | 0.22 / 0.99 | 2.09 / 14.38 | 0.52 / 7.25 | 0.07 | 4.94,
4.94 | 6.59 / 6.63 / 6.63 | 6.44 / 6.58 / 6.58 | 9.5 / 10.1 |
| 3 | 4.1-13.2 | 0.19 / 1.51 | 1.66 / 22.43 | 0.52 / 7.54 | 0.07 | 4.95,
4.95 | 6.64 / 6.74 / 6.74 | 6.33 / 6.55 / 6.55 | 9.5 / 10.3 |

**One unattached holder flooded 300 MB: before 2.72 MiB, right after
5.16 MiB, still 2.5 s 5.16 MiB**

**Verdicts**

| bound | verdict | figure |
|---|---|---|
| latency latency_alone at 1 | pass | p50 -22.05 ms, p95 -24.22 ms |
| latency reattach at 1 | pass | p50 -21.96 ms, p95 -24.27 ms |
| latency latency_alone at 64 | pass | p50 -1.35 ms, p95 -1.02 ms |
| latency flood_one at 64 | pass | p50 -1.64 ms, p95 -20.70 ms |
| latency flood_eight at 64 | pass | p50 -15.47 ms, p95 -90.97 ms |
| latency reattach at 64 | pass | p50 -2.67 ms, p95 -3.42 ms |
| latency latency_alone at 100 | pass | p50 -1.83 ms, p95 -1.63 ms |
| latency flood_one at 100 | pass | p50 -2.06 ms, p95 -21.51 ms |
| latency flood_eight at 100 | pass | p50 -10.56 ms, p95 -88.01 ms |
| latency reattach at 100 | pass | p50 -1.32 ms, p95 -8.49 ms |
| latency latency_alone at 128 | pass | p50 -2.01 ms, p95 -1.65 ms |
| latency flood_one at 128 | pass | p50 -2.37 ms, p95 -20.95 ms |
| latency flood_eight at 128 | pass | p50 -5.44 ms, p95 -90.02 ms |
| latency reattach at 128 | pass | p50 -2.11 ms, p95 -1.71 ms |
| flood CPU flood_one at 64 | pass | median ratio 0.19 over 3 pairs |
| flood CPU flood_eight at 64 | pass | median ratio 0.92 over 3 pairs |
| flood CPU flood_one at 100 | pass | median ratio 0.19 over 4 pairs |
| flood CPU flood_eight at 100 | pass | median ratio 1.03 over 4 pairs |
| flood CPU flood_one at 128 | pass | median ratio 0.19 over 3 pairs |
| flood CPU flood_eight at 128 | pass | median ratio 0.94 over 3 pairs |
| loss at 1 | pass | 8/8 exact, 0 lost on screen |
| idle wakeups at 1 | pass | max 0 |
| memory idle <= 4 MiB at 1 | pass | max 2.92 MiB |
| memory: 64 attached panes' holders <= 1.5 x Herdr's | pass | median
0.73 |
| loss at 64 | pass | 6/6 exact, 0 lost on screen |
| idle wakeups at 64 | pass | max 0 |
| memory idle <= 4 MiB at 64 | pass | max 3.17 MiB |
| memory after a flood <= 6 MiB at 64 | pass | max 5.91 MiB |
| loss at 100 | pass | 8/8 exact, 0 lost on screen |
| idle wakeups at 100 | pass | max 0 |
| memory idle <= 4 MiB at 100 | pass | max 3.00 MiB |
| memory after a flood <= 6 MiB at 100 | pass | max 5.91 MiB |
| loss at 128 | pass | 6/6 exact, 0 lost on screen |
| idle wakeups at 128 | pass | max 0 |
| memory idle <= 4 MiB at 128 | pass | max 3.28 MiB |
| memory after a flood <= 6 MiB at 128 | pass | max 5.88 MiB |
| slow consumer pair 1: input exact, none lost | pass |  |
| slow consumer pair 1: flooded holder <= 6 MiB once still | pass | 5.63
MiB |
| slow consumer pair 2: input exact, none lost | pass |  |
| slow consumer pair 2: flooded holder <= 6 MiB once still | pass | 4.94
MiB |
| slow consumer pair 3: input exact, none lost | pass |  |
| slow consumer pair 3: flooded holder <= 6 MiB once still | pass | 4.95
MiB |
| slow consumer latency | pass | p50 margin -2.14 ms, p95 -18.36 ms |
| slow consumer flood CPU | pass | median ratio 0.07 |
| unattached holder after a flood <= 6 MiB | pass | 5.16 MiB |

45 of 45 pass

**Before the freed-memory return** (pair 1 of the first battery, same
method): one holder idle 3.06 MB unattached and 3.47 MB attached at 64
panes (bound then 3 MB); after a 300 MB flood 8.2 MB, and 8.4 to 8.9 MB
after 0.46 to 1.5 GB on one holder.

</details>

<details><summary>Method</summary>

`scripts/holder-perf.py` (docs/PERFORMANCE_TESTING.md, The pane holder's
path): the node is hide-node's `holder_node` example built through
`Holders::start_local`; the Herdr path is a private server of the pinned
v0.9.5 (HOME, XDG folders, HERDR_SESSION, HERDR_CONFIG_PATH and
HERDR_SOCKET_PATH its own) attached through the node's Herdr sessions,
the holder path the same node with `HIDE_DEV_PANE_HOLDER=1`, both at
120x40 running `/bin/sh` on the same Mac in alternating rounds.
Latency is a 12-letter token typed through the node's `key` until a
frame showing it reaches the node's screen sink, 200 tokens 40 ms apart
on an extra echo pane, alone, beside one pane flooding 300 MB, beside
eight panes flooding 75 MB each, and beside one 75 MB flood whose
connection alone is read slowly; memory is `phys_footprint`, wakeups
`pkg_idle_wkups + interrupt_wkups`, CPU user+sys from `proc_pid_rusage`;
the echo's log is compared token for token with what was typed.
Each phase records the load and the build processes running; a pair
either of whose rounds saw a build process is dropped.
Release binaries ran from a folder of their own, with no cargo running
in this worktree during a round.

</details>

<details><summary>Verification record</summary>

- Head: 23d54df (`test: pass a macOS holder within its budget or one
its return brought down`), main merged at 61c5e93.
- CI: run 41258509161 on 23d54df, `verify` success, `vt` and the
holder restart lane success on Linux, macOS and Windows. The 21-cell
table is from run 41250820500 on 40248e9 (21/21, none marked known
failure); 41247368773 on 2fca9dc was 21/21 too.
- Local check at 23d54df: `scripts/verify-cargo.sh lint` and `test`,
55 test binaries, 7014 passed, 0 failed, with `HERDR_*` and `HIDE_*`
unset; `python3 -m unittest discover scripts/tests` OK (21 skipped).
- `memory.rs` on macOS debug, five local runs: 7.20 to 9.14 MiB at the
flood's end, 5.86 to 6.75 MiB after its return; the macOS runner at
61c5e93 read 5.08 MiB at the flood's end and 5.09 after (job
124704224457), within the budget, which the check now passes.
- Measurement: re-analysis of the earlier battery (no new rounds) with
`analyze.py`, 45/45 bounds pass; slow consumer and unattached flood
re-measured with release binaries copied out of the worktree.
- Run artifacts stay local, under the mission's run folder, not in this
repository.


</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant