Skip to content

fix(537): reject unavailable NVML monitoring before dispatch (C0-05, 4A) - #622

Merged
raylei50653 merged 5 commits into
mainfrom
fix/537-c0-05-4a
Oct 23, 2026
Merged

raylei50653 merged 5 commits into
mainfrom
fix/537-c0-05-4a

Conversation

@raylei50653

Copy link
Copy Markdown
Owner

#537 C0-05(D-537-4A):NVML 不可用時明確拒絕,不再發佈 FRESH NORMAL

方案紀錄:owner 在 2026-10-20 的工作 session 核准 4A(failure_degradation_537.md §4 D-537-4A、§19)。範圍只到 C0-05;合併依 #550 §0A 常設授權處理(高風險路徑:decision_relevant 檔案)。被否決的替代方案 4B(監控失敗時繼續 tracking、回報 unknown)未批准,紀錄在 §19.2。

修改

  • ResourceManager:import 與建構都不擋;NVML init、probe 失敗或 sample 無效時,get_stats() 拋 ResourceMonitorUnavailable,保留原始 cause,不再回四個 0。init 失敗不會自動重試;要恢復就換一個新的 manager。
  • AsyncDispatcher:
    • start() 在建立 writer/worker 前先做一次測量 preflight;這次 preflight 不推進 hysteresis。
    • 執行中監控失敗時,沿用 D2-AD 通道進入 FAILED,不發佈 FRESH 快照。
    • stats 新增 resource_monitor_status/resource_monitor_error;還沒有有效決策時,current_level 顯示 "UNKNOWN"。
  • run_8stream_perception.py 的 report 顯示 monitor status/error。
  • 文件:§19(核准方案)、§20(實作與證據)、architecture_degradation.md §7。

基線與 rebase

原本在 main@d6724f11 實作(6cb6d121、c405c99c)。現在 cherry-pick 到 main@50aad5bd(#621 D2-GPU-1 之後):

驗證(本機,host + GPU)

  • 相關十個 unit 檔:265 passed(3 gpu deselected)。
  • pre_push(在 c1ae1fc8 上,它和最終 tree 只差一段文件):6006 passed、0 failed。
  • gpu 標記的 R-1 native smoke 與 D2-GPU-1 GPU 契約:15 passed(resctl gpu0)。
  • 修復前的 RM 契約有 21 個行為斷言失敗。9 個隔離 mutation(RM 5 個、dispatcher 4 個)全部被測試抓到,但這是在舊基線 d6724f11 上跑的,新基線沒有重跑(§20 已註明)。

獨立審查

  • Codex r1 @ 791d85d8:READY-WITH-CHANGES,1 MINOR(§20 座標段落過時)→ 已由 3d3df6f2 修正。
  • Codex r2(delta)@ 1dc31c63:READY-TO-MERGE,沒有 findings。

Runtime identity

三個 decision_relevant 檔案改了,這個 PR 單獨看會讓 staleness fail-closed。座標由 stacked PR(base 是本分支)提供,合併進本分支後一起原子落地,不會出現 identity 落後的中間態。

不在範圍

不宣稱 online-service 或 WorkbenchPool 已取得線上資格,也不部署。C0-09、C0-01/02、C0-10、O0、health CLI、#538 其餘項目都依 §19.3 分工。沒有在真實 VRAM 壓力下做故障注入。

本機原始輸出(repo 外):~/.local/state/saccade/evidence/537-c0-05-4a/runtime_identity_20261023T164120/,10-20 的 mutation/控制輸出在 worktree 的 gitignored results/537_c0_05_4a/。

Refs #537

🤖 Generated with Claude Code

raylei50653 and others added 4 commits October 23, 2026 16:38
The 4A fix (fix/537-c0-05-4a, head 791d85d) changed resource_manager.py,
dispatcher.py and run_8stream_perception.py, all decision_relevant, so the
staleness checker failed closed. This is the republication, captured on the
controlled host from a clean tree at 791d85d. The build used the independent
build/runtime_identity directory in a dedicated worktree, ran --run-probe
--require-complete under the gpu0 lease, and carried nothing over.

The delta against the outgoing canonical (#621, implementation
583ede47c5287a65) is fully accounted for:

* implementation 583ede47c5287a65 -> d04e0183a9cb36d1, 317 -> 317 files:
  ~ src/saccade/resource/resource_manager.py (named monitor error, sample
  validation), ~ src/saccade/perception/dispatcher.py (AsyncDispatcher
  preflight, monitor status, UNKNOWN level) and
  ~ scripts/ops/run_8stream_perception.py (report fields). Nothing added or
  removed.
* decision_surface, environment, identity_semantics and runtime_inputs
  unchanged; each was recomputed and compared, not assumed.

The identity probe re-ran on MOT17-09-SDP and returned the published
behavior digest 2dabed0bc05e3bc7 unchanged. Probe equality is not
equivalence and is not claimed as such; equivalence.state stays unproven.
No native source changed; the attested build/libsaccade_scan_torchop.so was
not touched (aa84cccd).

The outgoing canonical is archived as
runtime_identity.2026-10-23.583ede47c5287a65.json (append-only).
`check_runtime_identity_staleness.py --mode attested` exits 0.

Refs #537

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#621 main

Codex r1 (READY-WITH-CHANGES, 1 MINOR) found that §20 still presented the
2026-10-20 capture (8b89ca8f -> e75f0067) as this tree's coordinate. That
capture predates #621 and was never published. Record the fresh capture on
the rebased implementation (583ede47 -> d04e0183) and state which evidence
ran on the old base and which was re-run on main 50aad5b.

Refs #537

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

Copy link
Copy Markdown
Owner Author

獨立審查(Codex,§0A 高風險)

輪次 head 範圍 verdict findings 處置
r1 791d85d87edd4c688449d137cd4d97e859b1211b 50aad5bd..791d85d8(特徵測試+4A 修復,含與 #621 D2-AD/D2-GPU-1 的互動) READY-WITH-CHANGES 1. MINOR failure_degradation_537.md:965:§20 仍把 10-20 的捕捉 8b89ca8f → e75f0067 寫成本 tree 的座標 已由 3d3df6f2 修正:舊捕捉標為作廢、未出版,改記新捕捉 583ede47 → d04e0183,並註明哪些證據在舊基線、哪些在新基線重跑
r2(delta) 1dc31c632c6106592a426646c1a848d8df6ec071 791d85d8..1dc31c63(文件修正+stacked 座標發佈) READY-TO-MERGE none —

r2 自行執行 check_runtime_identity_staleness.py --mode attested(exit 0),並核對 archive 和 outgoing canonical 位元組相同、只有 implementation 軸變動、只有三個成員改變。原始輸出:codex_review_r1.md(sha256 ee602280…)、codex_review_r2.md(148f5bcc…),在 ~/.local/state/saccade/evidence/537-c0-05-4a/runtime_identity_20261023T164120/。

…dentity

docs(runtime): republish the runtime coordinate for #537 C0-05 (4A)
@raylei50653
raylei50653 marked this pull request as ready for review October 23, 2026 09:01
@raylei50653

Copy link
Copy Markdown
Owner Author

§0A merge self-check(head b5ca6834c85c8dbfd5f3c87654025f12c896e39d)

依 #550 §0A 合併條件逐條核對。風險層級:高(resource_manager.py、dispatcher.py、run_8stream_perception.py 都是 decision_relevant,屬 GPU/async 生命週期路徑)。

  • 1. 範圍與審查:範圍等於 D-537-4A(owner 2026-10-20 核准,failure_degradation_537.md §4/§19)。只修 C0-05,不碰 C0-09、C0-01/02、O0、architecture(D): audit async ownership, backpressure, error propagation and shutdown #538 其餘項目。獨立審查 Codex r1 @ 791d85d8 給 READY-WITH-CHANGES(1 MINOR,已由 3d3df6f2 修正);r2 delta @ 1dc31c63 給 READY-TO-MERGE、沒有 findings(審查紀錄)。1dc31c63 之後只多了 docs(runtime): republish the runtime coordinate for #537 C0-05 (4A) #623 的 merge commit b5ca6834,它的 tree 和 1dc31c63 位元組相同,所以審查結論適用於合併 head。沒有未解決的 blocking finding。
  • 2. CI、回歸與負控制:PR CI @ b5ca6834:8/8 SUCCESS,第一次執行就通過(CI:pytest 5849 passed/0 failed,contracts、mypy、ruff、lint-typecheck、lockfile、shipping-config-loader 全過;C++ Core Build 成功)。首次失敗分類:合併 head 沒有失敗。前一個 head 3d3df6f2(只有實作、還沒有座標)的 CI pytest 有 4 個失敗,全是 identity 落後的預期失敗,屬於 runbook §3.2 說的中間態:test_runtime_identity_staleness.py 2 個、test_research_lock.py 2 個,訊息都是 implementation moved and was not republished: 583ede47… → d04e0183…。座標合併後全部通過,沒有靠重跑轉綠。本機 pre_push @ c1ae1fc8:6006 passed、0 failed(和合併 tree 只差 §20 一段文件)。修復前的 RM 契約有 21 個行為斷言失敗;9 個隔離 mutation 全部被抓到,但這是在舊基線 d6724f11 上跑的,新基線沒有重跑(§20 註明,source 和 integration(538): D2-GPU-0 + D2-GPU-1 + runtime identity (atomic landing) #621 不重疊)。
  • 3. Runtime identity 原子落地:座標由 stacked #623 提供,已合併進本分支。implementation 583ede47 → d04e0183,只有三個成員變動,其餘四軸不變,probe 2dabed0b 不變,equivalence=unproven。--mode attested exit 0。實作和座標同一次落地,不會出現 identity 落後的中間態。
  • 4. 真實環境證據:
    • gpu 標記的 R-1 native smoke 加 D2-GPU-1 GPU 契約共 15 passed,在本機 RTX 5070 Ti、resctl gpu0 下執行。
    • 真實 NVML 的 startup preflight smoke 是在舊基線上跑的。
    • 沒有做真實 NVML 故障或 VRAM 耗盡注入,NVML 失敗路徑只用假的 NVML 驗證。
    • 這次不提升任何 qualification:online-service/WorkbenchPool 仍未 online qualified,不部署。
    • 證據摘要(sha256、指令、head)在 #623 body。
  • 5. 本則 self-check:

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