Skip to content

feat(analysis): integrate same-tree move focus - #449

Draft
qiyi71w wants to merge 8 commits into
wimi321:mainfrom
qiyi71w:feat/414-move-focus
Draft

feat(analysis): integrate same-tree move focus#449
qiyi71w wants to merge 8 commits into
wimi321:mainfrom
qiyi71w:feat/414-move-focus

Conversation

@qiyi71w

@qiyi71w qiyi71w commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implement point evaluation inside the foreground KataGo search tree,
so targeted research feeds directly into ordinary candidates and saved
analysis.

  • Separate root visits, candidate visits, edge allocation, and engine
    ranking across analysis, display, budgets, cache admission, and SGF.
  • Replace the exclusive allow-based tracking workflow with same-tree
    move focus, using equal weights and a fixed focus probability of 0.5.
  • Treat explicit point evaluation as permission for the current search
    tree to update the node's analysis, while preserving ordinary cache
    protection outside this action.
  • Render evaluated points as ordinary candidates with optional dynamic
    quality outlines. Reaching the visit target removes the extra search
    priority while retaining the watched-point outline.
  • Preserve evaluation context across identical ReadBoard frames and
    restore admission after returning to the accepted position without
    requiring another helper frame.
  • Probe focus support once per engine incarnation under controlled
    startup/idle ownership. Unsupported engines retain ordinary analysis.

Verification

  • Ticket 01: full Java suite — 4,031 tests, zero failures/errors,
    21 skipped; additional focused regression and native Swing checks
    recorded afterward.
  • Tickets 01/02 integration: 505 focused tests, zero failures/errors.
  • Ticket 02: native Windows/Fox navigation away and back succeeded
    while helper output was suspended, proving readmission without
    another helper frame.
  • Ticket 03: full suite — 3,872 tests, zero failures/errors, 15 skipped;
    a subsequent admission-snapshot repair passed 22 focused regressions.
  • Real Leelaz queue/writer/reader integration against KataGo commit
    efb7450b0478094fb9561f3a8858edaa2dd226fc, using Eigen CPU and the b6
    test network, passed ordinary → single-point → multipoint → remove
    → clear transitions with retained search statistics.
  • Native window observations covered ordinary candidate rendering,
    retained outlines after completion, outline toggling, pause,
    cancellation, multipoint clearing, and rectangular-board coordinates.
  • Dynamic outline recoloring was not exercised in the native observation
    because the leading candidate did not change. This coverage gap was
    explicitly accepted for Ticket 03; it is not reported as a native pass.
  • Shaded-JAR build, localization parity, and line-ending checks passed
    in the recorded implementation verification.

These are recorded implementation checks, not completed final release
acceptance.

Draft gates

  • Integrate the latest upstream main and verify the affected
    cross-regressions.
  • Verify an official KataGo release providing compatible move-focus
    semantics and complete the supported/unsupported runtime matrix.
  • Integrate the independently reviewed [Bug] fix(engine): hand off restart confirmation authority #445 fix and verify that the
    real restart final numbered name fence is sent and consumed.
  • Complete the remaining fixed-candidate Windows integration and
    release acceptance.

This PR is for early review and is not ready to merge or release.
The experimental commit above must not be interpreted as support in
every binary reporting KataGo v1.18.2.

Related issues

Upstream engine work

Maintainer integration (2026-09-09)

  • Merged main fe95700, resolved conflicts, and preserved user pause intent through probing and deferred initialization. Added four pause regression cases.
  • Fixed a synchronous fake-reader deadlock in rollback tests; delivered responses on an independent serial reader and explicitly drained late acknowledgements. Repeated predecessor-failure and undo-timeout cases ten times each without weakening production locking, assertions or deadlines.
  • Final head e0dd755: local portable verification 26/26 gates passed; 3916 JUnit tests, zero failures/errors, 38 skipped; Maven verify/package passed with a clean worktree.
  • Non-headless targeted regression: 144 tests, zero failures/errors/skips (overlapping coverage, not Windows desktop acceptance).
  • Linux and Windows CI both passed: https://github.com/wimi321/lizzieyzy-next/actions/runs/34318650827
  • Real official Metal 1.18.1 rejects focus while ordinary analysis remains usable. An isolated Eigen build of upstream efb7450 passed ordinary/single/multiple/remove/clear protocol transitions with retained root visits 111/240/361/466/591.
  • Official-engine capability, independent [Bug] fix(engine): hand off restart confirmation authority #445 and final Windows/visual acceptance remain blocking. The experimental build was not installed into release packages. Keep Draft; do not merge a cutover that would remove legacy tracking from currently supported official engines.

Preserve accepted remote position evidence across local navigation and revalidate complete position semantics and the current confirmed engine incarnation before admitting a fresh evaluation.

Publish evidence after frame application, isolate stale processing epochs, and reject malformed native frames while retaining parser diagnostics and stop-boundary recovery.
@wimi321

wimi321 commented Sep 9, 2026

Copy link
Copy Markdown
Owner

感谢 @qiyi71w 对同树选点评估、root visits 语义和 ReadBoard 上下文恢复的完整实现与验收记录。维护者本轮核查确认:此 PR 仍是 Draft,且与最新 main 在 CHANGELOG.md、Lizzie.java、Leelaz.java 存在冲突;KataGo 上游 #1252 当前仍为 OPEN,官方 v1.18.2 发布说明不包含该能力;#445 的最终重启确认仍未关闭。为避免用旧 CI 或实验引擎结果替代稳定包验收,本轮保留草稿、不强行合并、不改写你的实现分支。待主线集成、支持/不支持引擎矩阵、最终编号 name 确认及 Windows 固定候选验收完成后再复审。感谢把未验证部分明确列出。

@wimi321

wimi321 commented Sep 9, 2026

Copy link
Copy Markdown
Owner

按维护者本次要求完成主线集成,保留原作者提交历史,已推送 19b6d987ae535babe0dd7554。感谢 @qiyi71w 的完整实现与既有验收记录。

本轮补齐:解决与当前 main 的冲突;能力探测前、成功/拒绝响应后和 lifecycle 延迟恢复均尊重用户暂停,新增四个回归场景。最终回归捕获测试夹具的同步响应死锁,已让对应回退场景使用独立串行 reader,并连续重复十次通过;未通过删除产品锁或削弱生命周期检查来规避。

真实隔离协议验证:官方 Metal 1.18.1 拒绝 focus 后,普通分析和 stop/quit 正常;自行构建固定上游 efb7450b0478094fb9561f3a8858edaa2dd226fc 的 Eigen+b6,普通、单点、多点、移除、清空五阶段 root visits 为 111 / 240 / 361 / 466 / 591,保留搜索统计。这是协议测试,不是 Windows UI 或官方发布支持证明。

Windows 首次 CI 的 undo 超时测试失败也已处理:超时与迟到 ACK 使用同一独立 reader,断言前等待响应消费完成,连续重复十次;未放宽失败断言或延长超时。

最终提交 e0dd7554:本机 26/26 检查通过,3916 项 JUnit 测试零失败/错误、38 项跳过,Maven verify/package 成功且工作树干净;非 headless 专项 144 项全部通过(与全量覆盖重叠)。最终 GitHub CI 的 Linux、Windows 检查均通过。

PR 继续保留 Draft:官方能力 G3、独立 #445、Windows 真机整合 G4 未解除;当前官方包没有 focus,直接替换旧实现会丢失现有点研究入口,所以本轮不强制合并。CI 的 Windows 检查不等于真机 GPU/UI 验收。

@qiyi71w qiyi71w left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 — Same-tree move-focus plus #433/#444 ReadBoard retention is implemented on e0dd755; remaining work is the stated draft gates, not a broken originating ask on this head

Reviewed e0dd75541994724ce1a18e6a3c25dae36f32f1f8 (delta from ae535bab is test-only rollback-ack serialization). Draft gates called out in the PR body are classified DEFERRED.

Standards

No findings

Spec

No IN_SCOPE findings. On this head, #414 same-tree focus, #433 identical-frame retention, and #444 navigation readmission are implemented and covered by TrackingProductionCutoverTest. Official-engine cutover, #445, Windows G4, and a pause-at-init probe hole are DEFERRED.

SPEC-D1 — scope: DEFERRED — Official binaries still reject focus; this head removes allow-based tracking, so Evaluate this point is disabled there.
Acceptance: ship a supported/unsupported matrix in which currently supported official engines keep a usable point-evaluation entry until an official KataGo with compatible move-focus is the accepted cutover.

SPEC-D2 — scope: DEFERRED — Independent restart final numbered name fence is not in this PR.
Acceptance: #445 — real b11 restart sends and consumes the final numbered name fence.

SPEC-D3 — scope: DEFERRED — Remaining fixed-candidate Windows integration and release acceptance.
Acceptance: G4 recorded as pass on the frozen Windows candidate, including visual/outline behavior the PR does not claim.

SPEC-D4 — scope: DEFERRED — If the once-per-incarnation probe is skipped because analysis is paused (or notStartPondering) at the only init call site, later unpause/ponder never probes.
Acceptance: after that skip, unpause or the first intended analysis start on the same incarnation completes the probe on a focus-capable engine so canStartMoveFocus() becomes true without restart.

Follow-up ledger

Owned by existing tickets

  • SPEC-D2 — axis: Spec — defer_reason: OUTSIDE_FROZEN_BOUNDARYOWNED_BY_EXISTING_TICKET(#445)
    #445 already owns host-side restart confirmation: send and consume the final numbered name fence; retired receipts stay rejected; this PR’s early-review boundary excludes that independent fix.

Candidates — Fix

  • SPEC-D1 — axis: Spec — defer_reason: OUTSIDE_FROZEN_BOUNDARYCANDIDATE(kind=FIX)

    • evidence: Exclusive allow tracking is gone (TrackingProductionCutoverTest asserts commands contain no allow B). User focus requires MoveFocusCapability.SUPPORTED. Unsupported engines get a disabled menu (RightClickMenu.trackPoint.requiresCapability). Maintainer: keep Draft; do not merge a cutover that removes legacy tracking from currently supported official engines. PR body: official Metal 1.18.1 rejects focus; experimental efb7450 is not a release matrix.
    • objective acceptance condition: official supported/unsupported runtime matrix is complete, and currently supported official engines still have a usable Evaluate this point path (legacy tracking or an accepted product waiver) until official KataGo move-focus is the cutover.
    • behavior that must remain stable: ordinary analysis after a rejected probe; same-tree focus (focus VERTEX[,VERTEX] 0.5) on a confirmed supported incarnation; #433/#444 ReadBoard retention/readmission.
    • focused validation: official 1.18.x reject-focus + ordinary analysis; experimental efb7450 ordinary → single/multi/remove/clear with retained root visits; menu enabled only when canStartMoveFocus() is true.
  • SPEC-D3 — axis: Spec — defer_reason: OUTSIDE_FROZEN_BOUNDARYCANDIDATE(kind=FIX)

    • evidence: Draft gate “Complete the remaining fixed-candidate Windows integration and release acceptance” is unchecked. Ticket 03 notes dynamic outline recoloring was not exercised natively. Native #444 evidence is recorded, not G4.
    • objective acceptance condition: frozen Windows candidate completes G4 (Fox/ReadBoard, outlines, pause/cancel/multipoint, rectangular coords) as release acceptance, not only headless/cutover tests.
    • behavior that must remain stable: identical-frame retention; navigation readmission without another helper frame; old selections do not revive.
    • focused validation: the PR’s G4 Windows checklist on the accepted candidate, including a leading-candidate change if quality-outline recoloring is in G4.
  • SPEC-D4 — axis: Spec — defer_reason: NON_BLOCKINGCANDIDATE(kind=FIX)

    • evidence: The production probe is only started from engine-ready init. If that returns false because the user is paused, ponderIfAnalysisControlAllows() also no-ops. Unpause uses togglePonder() only. ponder() starts ordinary analysis whenever capability is not PROBING, so UNKNOWN never becomes SUPPORTED on that incarnation.
    • objective acceptance condition: pause/notStartPondering at the init probe still does not start a probe or ordinary analysis; when analysis is next intentionally started on that incarnation, a focus-capable engine completes the once-per-incarnation probe and canStartMoveFocus() is true without restart.
    • behavior that must remain stable: probe is not attached to every ponder() (navigation/manual continue must not insert a second stream); pause during an in-flight probe still must not restart ordinary analysis (TrackingProductionCutoverTest pause cases).
    • focused validation: paused (or notStartPondering) at startMoveFocusProbeAfterInitialization → capability UNKNOWN → unpause/first analysis start → SUPPORTED on a fake focus-capable engine; rejected-probe-once and pause-during-probe tests still pass.

Candidates — Diagnose

No entries

Closed

No entries

Open IN_SCOPE: 0
Owned: 1
Fix candidates: 3
Diagnose candidates: 0
Closed: 0

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

Labels

None yet

Projects

None yet

2 participants