Skip to content

Run the focus ordering spec on the DOM terminal renderer - #405

Merged
yansfil merged 4 commits into
mainfrom
fix/rapid-click-focus-order
Oct 4, 2026
Merged

yansfil merged 4 commits into
mainfrom
fix/rapid-click-focus-order

Conversation

@yansfil

@yansfil yansfil commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: Fixes #397. #398이 이 테스트에 붙인 @flaky 태그와 issue annotation을 이 PR에서 지워, macOS와 Windows @platform job에서 다시 required로 돕니다.

Summary

macOS rapid-click focus e2e가 간헐 실패한 원인은 테스트 환경의 renderer 정지였습니다. 제품의 focus 요청 합치기는 정상이었습니다.
테스트는 첫 pane.focus 요청을 소켓에서 붙잡고 40번 클릭합니다. core는 그 요청에 실제 5초 budget을 줍니다.
headless Chromium은 software compositing이라 xterm WebGL canvas가 바뀌는 프레임마다 page main thread에서 동기 readback(GLES2::ReadPixels)을 합니다. 이 정지가 클릭과 snapshot 수신을 늦춰, 테스트가 요청을 풀기 전에 5초가 지나 pane.focus.unknown이 됐습니다.
이 spec만 --disable-webgl로 띄워, 셸이 이미 갖고 있는 xterm DOM renderer fallback을 쓰게 했습니다. retry, timeout, 클릭 수, 기대값은 그대로입니다.

붙잡은 요청을 푼 시점 (첫 focus 기준, 로컬 6회)
main(WebGL)            951-5034 ms, 1회 실패 (5034 ms -> unknown -> confirmed false)
--disable-webgl        212-258 ms, 6회 x 2 테스트 모두 통과

Review

  • 판단해 주세요: 이 spec의 두 @platform 테스트는 더 이상 WebGL renderer를 붙인 채 focus와 입력을 검사하지 않습니다. 이 테스트의 assertion 중 renderer에 의존하는 것은 없습니다(focus는 xterm textarea, 입력은 PTY input log, data-focused는 snapshot). 이 trade-off가 괜찮은지 봐 주세요.
  • 조심해서 볼 파일: web/e2e/pane-focus-ordering.spec.ts - 파일 단위 test.use({ launchOptions })라 이 파일만 별도 browser로 뜹니다. 다른 spec에는 영향이 없습니다.
  • 질문: 나머지 headless web e2e도 같은 readback 비용을 냅니다. suite 전체로 넓힐지는 범위 밖이라 issue 초안으로만 남겼습니다.

Evidence

  • 확인한 것: CI 실패 3건의 원인을 구분했습니다.
    • 40/14 (2c27355): hided 로그에 pane.focus.requested 40개가 모두 있고, 5초 뒤 pane.focus.unknown이 기록됐습니다. 단계별 시간으로는 첫 diagnostic 수신에 2.5초, 클릭 처리에 2.3초가 걸렸습니다.
    • confirmed false (59c947a, 이전 spec 버전): hided는 마지막 focus를 정상 확인했지만, 그 snapshot이 5초 안에 page에 도착하지 않았습니다.
    • 30초 timeout (987778a, 단계 계측 이전 spec): 단계 시간이 없어 원인을 판별할 수 없습니다.
  • 확인한 것: 붙잡은 창의 로컬 Chrome trace에서 long task 500/502/482/372/291ms가 모두 BeginMainFrame > Commit > DoUpdateLayers > GLES2::ReadPixels > CommandBufferHelper::Finish 안에 있었습니다. WebGL renderer는 SwiftShader였습니다.
  • 확인한 것: main 코드 그대로 로컬에서 같은 실패를 재현했습니다(6회 중 1회, 해제 시점 5034ms). 수정 후에는 파일 전체 6회와 리뷰 반영 후 1회가 모두 통과했습니다(load avg 약 30/14 cores).
  • 확인한 것: web/src/terminals.ts의 p1 focus intent를 버리는 결함을 심으면 DOM renderer에서도 spec.ts:278(마지막 pane 확인)에서 실패합니다.
  • 확인한 것: verify-web.sh web typecheck/lint/build, check-no-workstation-identity.sh, check-harness-ignore-anchor.sh, script suite가 통과했습니다.
  • 확인하지 못한 것: 첫 CI 실행은 Quarantine the repeated main failures and keep the original Windows fixture error #398 머지 후의 merge ref라 이 테스트가 @flaky로 빠져 있었습니다. 격리를 지운 head의 macOS·Windows @platform 결과로 확인합니다. Linux와 Windows에서는 로컬로 돌리지 않았습니다.
  • 확인하지 못한 것: 수정 전에 실패하고 수정 후에 통과하는 결정적 테스트는 두지 않았습니다. 실패가 runner 부하에 따라 달라지는 타이밍이라, 결정적으로 재현할 수 있는 경계가 없습니다.

Headless Chromium composites in software, so each frame of xterm's WebGL
canvas is read back synchronously on the page's main thread. Those
250-500 ms stalls delayed clicks and snapshot frames while the test held a
pane.focus request against Herdr's real five-second budget, and the burst
ended unknown on loaded macOS runners.
@yansfil
yansfil merged commit fe55125 into main Oct 4, 2026
28 checks passed
@yansfil
yansfil deleted the fix/rapid-click-focus-order branch October 4, 2026 23:02
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.

macOS에서 rapid pane clicks focus 순서 e2e가 간헐적으로 실패한다

1 participant