Skip to content

Read Herdr's pane focus again when a move arrives during an unconfirmed readback - #505

Merged
yansfil merged 1 commit into
mainfrom
fix/flaky-467-readback
Oct 5, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/flaky-467-readback

Conversation

@yansfil

@yansfil yansfil commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Refs #467

Summary

Herdr의 pane focus readback이 한 번에 하나만 돌 때, 그 사이에 온 session update가 요청한 readback이 사라지던 것을 고칩니다.

  • 원인: readback 슬롯이 차 있으면 새 update는 readback을 시작하지 않습니다. 진행 중인 readback이 Herdr가 움직이기 전에 답했다면(확인 안 됨) 그대로 끝나고, 그 뒤의 외부 이동은 다시 읽히지 않아 Hide가 옛 pane에 남습니다.
  • 수정: 슬롯이 차 있을 때 readback을 요청한 update가 있었다는 것을 기억하고, 확인 안 된 답이 오면 한 번 더 읽습니다. 추가 읽기마다 새 session update가 필요하므로 반복되지 않습니다.
  • docs/ARCHITECTURE.md의 "확인 안 된 답은 다음 session update에서 다시 묻는다" 계약에, 읽는 동안 온 update도 그 다음 update라는 것을 적었습니다.

#467의 CI 기록 시그니처(199행, 타이핑한 marker가 pane 0에 닿지 않음)는 이 PR로 설명되지 않습니다. 이 PR은 같은 test를 로컬에서 반복하다 찾은 두 번째 시그니처(206행, 외부 pane focus --direction right를 따라가지 않음)의 원인입니다. #467은 열어 둡니다.

Review

  • 조심해서 볼 파일: herdr-core/src/runtime/session.rs - begin_pane_focus_readback이 슬롯 확인보다 대상 계산을 먼저 합니다(대상이 없으면 기억할 것도 없음). runtime mutex 안에서 bool 하나만 더 씁니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/tests/session_navigation.rs - 새 test는 stale layout(p2)으로 시작한 읽기 도중 실제 p2 이동이 오고, 첫 답이 확인 안 됨일 때 다시 읽어 따라가는지 봅니다.

Evidence

  • 확인한 것: 새 runtime test는 수정 전 the move that arrived during the read is read again에서 실패하고 수정 뒤 통과합니다. herdr-core lib 1419개 통과, verify-cargo.sh lint 통과.
  • 확인한 것: 수정 전 pane-focus-ordering "rapid pane clicks"를 macOS 로컬에서 56회 돌려 3회 206행 실패. 실패 run의 hided 로그에 pane.focus.stream_readback_failed(p2, Herdr는 p1) 하나만 있고 pane.focus.followed가 없습니다.
  • 확인한 것: 수정 뒤 같은 test를 CPU 부하(yes 4개) 아래 30/30 통과. 그중 10회는 readback 실패 뒤 다시 읽어 pane.focus.followed로 끝났습니다(재읽기 경로가 실제로 쓰임).
  • 확인하지 못한 것: CI 시그니처(199행)의 원인. 로컬 86회에서 한 번도 재현되지 않았습니다. CI job 로그로는 클릭 보고 40개는 모두 pane 0에 닿았고 키만 없었습니다. 별도로 조사 중입니다.
  • 확인하지 못한 것: Linux, Windows에서의 반복. CI verify run으로 봅니다.

…ed readback

A session update that shows a pane focus move while the one readback slot
is taken started no read of its own. When the outstanding read had been
answered before Herdr made that move, the unconfirmed answer ended the
readback and the move was never followed: an external pane focus right
after a burst of clicks left Hide on the old pane.

The runtime now remembers that an update called for a read while the slot
was taken, and an unconfirmed answer reads again for it. Each extra read
still needs a new session update, so it cannot loop.
@yansfil
yansfil added this pull request to the merge queue Oct 5, 2026
Merged via the queue into main with commit 6d32c69 Oct 5, 2026
28 checks passed
@yansfil
yansfil deleted the fix/flaky-467-readback branch October 5, 2026 12:40
yansfil added a commit that referenced this pull request Oct 5, 2026
## Summary

`merge_group.base_sha` is main only for the first group in the queue;
every later group starts from the commit of the group queued ahead of
it.
The plan job logs and the queue refs show it: #504's group was based on
356c5db (#503's group commit, before #503 reached main), and #506's ref
is `gh-readonly-queue/main/pr-506-6d32c697...`, #505's group commit.
So a group plans its own pull request's changes on the tree the groups
ahead make, not every queued change, as #500's docs, comments and test
story said.
This corrects them and states why that is enough; the planner itself
does not change.

## Review

- **판단해 주세요**: the safety argument now in docs/TESTING.md: each group's
run checks its own lanes on a tree that already holds every group ahead,
so a lane is checked by the run of the last group that touched its
inputs, on the same inputs as the final tree; it assumes the path rules
are right, as a pull request's plan does. The queue merges a group only
when every group ahead passed (ALLGREEN), and rebuilds the groups behind
a failed one on a new base.
- **조심해서 볼 파일**: `scripts/tests/test_ci_plan.py`: the merge queue test
is renamed to
`test_a_merge_group_plans_its_own_change_on_the_groups_ahead` and builds
group commits the way the queue does (the pull request merged onto main
or onto the group ahead), including a group rebuilt on main after the
one ahead fails.

## Evidence

- **확인한 것**: plan job logs of the queue runs
[37305523083](https://github.com/modakbul-gongbang/hide/actions/runs/37305523083)
(#504, `BASE: 356c5db...`) and
[37306383723](https://github.com/modakbul-gongbang/hide/actions/runs/37306383723)
(#506, `BASE: 6d32c69...`); #506's run planned 18 lane jobs and no
macOS job, its own change only, while #505's run on 6d32c69 ran the
macOS lanes.
- **확인한 것**: `scripts/tests/test_ci_plan.py` 35 pass; `actionlint` is
clean on `pr.yml`.
- **확인하지 못한 것**: nothing runs differently, so there is no before and
after timing.
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