Skip to content

fix(perception): report WorkbenchPool stats as unmonitored (#537 C0-09) - #624

Merged
raylei50653 merged 6 commits into
mainfrom
fix/537-c0-09
Oct 23, 2026
Merged

raylei50653 merged 6 commits into
mainfrom
fix/537-c0-09

Conversation

@raylei50653

@raylei50653 raylei50653 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

#537 C0-09:WorkbenchPool stats 明列「未接監控」,不再固定回 NORMAL

方案紀錄:依 #550 §0A 開工條件記錄在 #537 comment(候選 A/B/C,選 B)。範圍沿用 failure_degradation_537.md §19.3 的分工:只修正回報,不接上降級 controller。風險:高(dispatcher.py、run_8stream_perception.py 是 decision_relevant)。

修改

  • WorkbenchPool.get_stats():current_level 由固定的 "NORMAL" 改為 "UNKNOWN",並新增 resource_monitor_status="not_wired"、resource_monitor_error=""。欄位和 C0-05 後的 AsyncDispatcher 一致;not_wired(沒接監控)和 unavailable(監控失敗)不同。所有 pool 狀態回同一組值。
  • run_8stream_perception.py --workbench 的報告加印 monitor=<status>。
  • 不改 AsyncDispatcher、hysteresis、快照 v1、_WorkbenchWorker 或 batcher。
  • 文件:failure_degradation_537.md 新增 §21,§6/§13/§19.3 對應列指向 §21;architecture_degradation.md §7 加 WorkbenchPool 說明;docs/architecture/README.md 索引。

驗證

  • 新測試 tests/unit/test_workbench_pool_monitor_contract_537.py(3 個案例):
    • host:CPU fake 的 pool 在 CREATED、RUNNING、STOPPING、STOPPED、FAILED、失敗後 STOPPED 都回 UNKNOWN/not_wired/空錯誤;--workbench caller 報告含 level=UNKNOWN monitor=not_wired,不出現 level=NORMAL。
    • gpu:真實 WorkbenchPool/Workbench/BatchingTRTDetector 在 CUDA 上送出 3 個結果時與 stop 後都回 UNKNOWN/not_wired(只有 TRT engine 是 fake)。
  • 五個隔離 mutation 全部被抓到:level 改回 NORMAL(2 failed)、移除 status(2)、報告移除 monitor=(1)、status 改成 available(2)、只在 STOPPING 回 NORMAL(1)。
  • 相關 8 個測試檔 host:131 passed。gpu 標記(本測試 + D2-GPU-1 GPU 契約 + R-1 native smoke):16 passed(resctl gpu0,@ d34b0a6a;之後的變更只有 host 測試與文件)。
  • pre_push @ 5194852f(只有實作、沒有座標):6005 passed、4 failed。4 個失敗都是 identity 落後的預期中間態(test_runtime_identity_staleness.py 2 個、test_research_lock.py 2 個)。座標 promote 後這兩檔 60 passed;pre_push @ 座標 head 見 stacked PR。

獨立審查

  • Codex r1 @ d34b0a6a:READY-WITH-CHANGES,1 MINOR(測試漏 STOPPING)→ cd5ba0dd 補上,並新增第 5 個 mutation。
  • Codex r2(delta)@ 5194852f:READY-TO-MERGE,沒有 findings。

Runtime identity

座標由 stacked #625(base 是本分支)提供,合併進本分支後一起原子落地。

不在範圍

WorkbenchPool 仍沒有任何資源降級能力;--workbench 仍 unsupported(#538),不取得 online-service qualification、不部署。not_wired 只說明沒有監控,不是健康判定。C0-01/02、C0-10、O0、health CLI、#538 其餘項目不變。

本機原始輸出(repo 外):~/.local/state/saccade/evidence/537-c0-09/20261023T174827/,sha256 見 stacked PR。

Refs #537

🤖 Generated with Claude Code

raylei50653 and others added 5 commits October 23, 2026 17:46
… NORMAL

WorkbenchPool has no resource manager or VRAM writer, yet get_stats()
returned a fixed current_level="NORMAL" (#537 C0-09). Report
current_level="UNKNOWN" with resource_monitor_status="not_wired", matching
the AsyncDispatcher monitor fields from C0-05, and print the status in the
--workbench text report. No degradation controller is wired.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add failure_degradation_537.md §21 and the WorkbenchPool note in the
degradation contract, point the §6/§13/§19.3 rows at it, and add a GPU
case that runs the real pool on CUDA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex r1 MINOR: a STOPPING-only NORMAL would have passed. Add a STOPPING
case (batcher not released) and assert the FAILED wait succeeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fresh capture (--run-probe --require-complete, gpu0 lease) at implementation
head 5194852, clean tree.

- implementation: d04e0183a9cb36d1 -> 46d37ec50b215f21. 317 -> 317 files;
  only src/saccade/perception/dispatcher.py (WorkbenchPool.get_stats reports
  UNKNOWN/not_wired) and scripts/ops/run_8stream_perception.py (--workbench
  report prints monitor=) changed.
- decision_surface, environment, identity_semantics, runtime_inputs:
  recomputed, unchanged.
- probe re-run, not reused: behavior digest 2dabed0b unchanged. Equal probe
  output is not an equivalence claim; equivalence stays unproven.

The outgoing canonical is archived append-only as
runtime_identity.2026-10-23.d04e0183a9cb36d1.json (byte-identical to
origin/main). --mode attested exits 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raylei50653

Copy link
Copy Markdown
Owner Author

獨立審查紀錄(#550 §0A 固定格式)

Codex r1

verdict: READY-WITH-CHANGES
head: d34b0a6a22db9dd841fb69cba338e3c6d30beed4
findings:
1. MINOR — tests/unit/test_workbench_pool_monitor_contract_537.py:30: The “every pool state” test omits STOPPING. An in-memory mutation returning `NORMAL` only during STOPPING passes both host tests, leaving shutdown-time health misreporting unprotected. Add a deterministic STOPPING case using `MODE["shutdown"] = False`, assert all three monitor fields and the actual state, then retry cleanup. Also assert the failure wait succeeds before sampling FAILED.

Codex r2

verdict: READY-TO-MERGE
head: 5194852fb9458deb5366bd990d0518b463bf7d26
findings: none```

### Codex r3

verdict: READY-TO-MERGE
head: ee4db34
findings: none


### 處置

- r1 MINOR(`tests/unit/test_workbench_pool_monitor_contract_537.py`:缺 STOPPING,只在 STOPPING 回 NORMAL 的實作會漏網)→ `cd5ba0dd` 新增 STOPPING(batcher 未釋放)案例與 FAILED 等待斷言;第 5 個 mutation(只在 STOPPING 回 NORMAL)被攔住(1 failed)。§21 文字由 `5194852f` 同步。
- r2(delta `d34b0a6a..5194852f`):沒有 findings。
- r3(stacked publication `5194852f..ee4db34c`):沒有 findings。

沒有未解決的 finding。合併 head 會是 #625 併入後的 merge commit;其 tree 應等於 `ee4db34c`,合併前在 self-check 核對。

…tity

docs(runtime): republish the runtime coordinate for #537 C0-09
@raylei50653

Copy link
Copy Markdown
Owner Author

§0A merge self-check(head f0ceeeec2a174b4da757f4070b0b2654918e9477)

依 #550 §0A 合併條件逐條核對。風險層級:高(dispatcher.py、run_8stream_perception.py 是 decision_relevant)。

  • 1. 範圍與審查:範圍等於 #537 方案紀錄的方案 B。只改 WorkbenchPool stats 與 --workbench 報告,不接降級 controller,也不碰 AsyncDispatcher、hysteresis、快照、_WorkbenchWorker 或 batcher。獨立審查:Codex r1 @ d34b0a6a READY-WITH-CHANGES(1 MINOR,已由 cd5ba0dd 修正);r2 delta @ 5194852f READY-TO-MERGE;r3 publication @ ee4db34c READY-TO-MERGE(審查紀錄)。合併 head f0ceeeec 是 docs(runtime): republish the runtime coordinate for #537 C0-09 #625 的 merge commit(parents 5194852f+ee4db34c),其 tree 和 ee4db34c 位元組相同,所以審查結論適用。沒有未解決的 finding。
  • 2. CI、回歸與負控制:
    • PR CI @ f0ceeeec:8/8 SUCCESS,第一次執行就通過(CI:pytest 5851 passed/0 failed;C++ Core Build 成功)。
    • 首次失敗分類:合併 head 沒有失敗。只有實作的 5194852f CI pytest 有 4 個失敗(test_runtime_identity_staleness.py 2 個、test_research_lock.py 2 個),訊息都是 implementation moved and was not republished: published d04e0183…, recomputed 46d37ec5…,屬於 runbook §3.2 的 identity 落後中間態,座標合併後全部通過,沒有靠重跑轉綠。
    • 本機 pre_push @ ee4db34c(tree 等於合併 head):6009 passed、0 failed。
    • 負控制:五個隔離 mutation 全部被 host 案例攔住(level 改回 NORMAL、移除 status、報告移除 monitor=、status 改成 available、只在 STOPPING 回 NORMAL)。
  • 3. Runtime identity 原子落地:座標由 stacked #625 提供,已併入本分支。implementation d04e0183 → 46d37ec5,只有兩個成員變動,其餘四軸不變,probe 2dabed0b 不變,equivalence=unproven,--mode attested exit 0。實作與座標同一次落地。
  • 4. 真實環境證據:
    • gpu 標記:本 PR 的 CUDA 案例(真實 WorkbenchPool/Workbench/BatchingTRTDetector,只有 TRT engine 是 fake)、D2-GPU-1 GPU 契約、R-1 native smoke,共 16 passed(本機 RTX 5070 Ti,resctl gpu0,@ d34b0a6a;之後的變更只有 host 測試、文件和座標)。
    • 沒有用真實 TRT engine 跑完整 --workbench 串流;本切片只改回報,不涉及 GPU 資料路徑。
    • 不提升 qualification:WorkbenchPool 仍沒有任何資源降級能力,--workbench 仍 unsupported(architecture(D): audit async ownership, backpressure, error propagation and shutdown #538),不部署。
    • 證據 sha256、指令、head 見 #625 body。
  • 5. 本則 self-check:

@raylei50653
raylei50653 marked this pull request as ready for review October 23, 2026 10:44
@raylei50653
raylei50653 merged commit 4343294 into main Oct 23, 2026
8 checks passed
@raylei50653
raylei50653 deleted the fix/537-c0-09 branch October 23, 2026 11:10
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