Repository navigation
fix(resource): refuse out-of-domain usage before deciding (#537 O0) - #626
Merged
Merged
Conversation
T7's three O0 rows recorded observed behavior only (NaN holds, negative recovers one level, >100 escalates). T8 now pins the chosen contract (#537 comment 6363972851, option A): usage outside 0..100, NaN, infinities and non-comparable values raise ResourceMonitorUnavailable with a ValueError cause and leave the level untouched; refusals do not advance hysteresis. A dispatcher case checks the 4A failure channel when a replaced get_stats() yields invalid usage mid-run. Against the current implementation these 38 cases fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
decide_degradation_level() trusted VRAMStats.usage_percent. A replaced get_stats() could feed NaN, negative or >100 values that were taken as a real decision (a negative sample recovered EMERGENCY one level). Usage outside 0..100 is now an unavailable measurement, the same rule 4A applies to raw NVML samples: it raises ResourceMonitorUnavailable with a ValueError cause, keeps current_level and takes the existing dispatcher failure channel. Production get_stats() cannot produce such a value. Docs: failure_degradation_537.md §22 (plan, evidence, mutations) and architecture_degradation.md §5/§7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… r1) Codex r1 (NOT-READY, head 9e17133): Decimal("NaN") makes the range comparison raise decimal.InvalidOperation, which escaped the TypeError/ValueError handler; the dispatcher then failed with the monitor still reported as available. Require numbers.Real before comparing, so str, None and Decimal are refused without evaluating their comparisons; numpy scalars and Fraction stay in domain. T8 adds Decimal("NaN")/Decimal("50") and other real types; the dispatcher case runs with -1 and Decimal("NaN"). 9 cases fail against 9e17133. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fresh capture (--run-probe --require-complete, gpu0 lease) at implementation head 4f3f4b3, clean tree. - implementation: 46d37ec50b215f21 -> ab1bc4ea82d70131. 317 -> 317 files; only src/saccade/resource/resource_manager.py (decide_degradation_level refuses usage that is not a real number in 0..100) 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.46d37ec50b215f21.json (byte-identical to origin/main). --mode attested exits 0. A capture at the round-1 head 9e17133 was discarded unpublished after review changed resource_manager.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
獨立審查紀錄(Codex,§0A 高風險)
Publication #627 的審查(r3 @ |
docs(runtime): republish the runtime coordinate for #537 O0
Owner
Author
Self-check(#550 §0A 合併條件 1–5)head:
剩餘 OPEN:#537 的 C0-01/02、C0-10、health CLI;dispatcher 啟動 probe 不經過 O0 檢查(§22 已記錄,production 不可達);#538 其餘項目;不取得 online-service qualification、不部署。 Rollback/拒絕路徑:revert 本 PR 的 merge commit,再依 runbook 重新 capture 並出版座標(不直接恢復舊 canonical 冒充 current)。Owner 可否決方案 A,依此路徑回退。 合併指令(需 owner 執行): |
raylei50653
marked this pull request as ready for review
October 23, 2026 12:49
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#537 O0:拒絕非法 usage,不再當成一次有效決策
方案紀錄:依 #550 §0A 開工條件記錄在 #537 comment(候選 A/B/C,選 A)。風險:高(
resource_manager.py是decision_relevant)。修改
ResourceManager.decide_degradation_level():決策前要求usage_percent是numbers.Real且在 0~100(含端點)內。NaN、±inf、超出範圍、非實數型別(字串、None、Decimal)都拋ResourceMonitorUnavailable,cause 為ValueError;current_level不變,也不算一次決策。dispatcher 走 4A 的既有通道(unavailable/UNKNOWN/FAILED、不寫新快照)。get_stats()在 4A 後只會回 0~100 的有限值,所以只有被替換的get_stats()會走到這條路徑。get_stats()的 sample 驗證、門檻、D-537-2、R0/F0、快照 v1、dispatcher.py。已知缺口(寫在 §22):dispatcher 的啟動 probe 直接呼叫get_stats(),被替換的get_stats()回非法值時,要到第一次 batch 決策才失敗。failure_degradation_537.md新增 §22,§6/§8/§19.3 對應列指向 §22;architecture_degradation.md§5/§7 改成拒絕契約。驗證
test_resource_degradation_hysteresis_537.py:T7 的 3 個 O0「觀察」列改成 T8 契約(86 → 133 個案例)。4 個級別 × 11 個非法值都拒絕並保留 level;連續拒絕不推進遲滯;int、np.int64、np.float64、Fraction有效。test_resource_monitor_dispatcher_contract_537.py:+2 個案例(-1、Decimal("NaN")),驗證 worker FAILED、stats 為 UNKNOWN/unavailable、快照只有先前的 EMERGENCY。9e17133e有 9 個失敗。六個隔離 mutation 都被抓到:移除驗證(47)、上界< 100(15)、移除下界(14)、改拋ValueError(47)、驗證移到寫入 state 之後(36)、移除numbers.Real(17)。resctl gpu0,@4f3f4b30):真實 sample 2.3% 決策為 NORMAL;level 設為 EMERGENCY 後,NaN/-1/101/Decimal("NaN")/None 都被拒絕,EMERGENCY 保留;之後的真實 sample 只降一級到 FAST_PATH。pre_push@4f3f4b30(只有實作、沒有座標):5952 passed、4 failed,都是 identity 落後的預期中間態(test_runtime_identity_staleness.py2 個、test_research_lock.py2 個)。座標 head 的pre_push見 stacked PR。獨立審查
9e17133e:NOT-READY,1 MAJOR:Decimal("NaN")的InvalidOperation沒被 catch,dispatcher FAILED 但 stats 仍報available→4f3f4b30改成先檢查numbers.Real,並補 T8/dispatcher 回歸案例。4f3f4b30:READY-TO-MERGE,沒有 findings。Runtime identity
座標由 stacked PR(base 是本分支)提供,合併進本分支後一起原子落地。在
9e17133e做的 capture 因 review 改了resource_manager.py而作廢,沒有出版。不在範圍
不跑完整 online service,不取得 online-service qualification、不部署。C0-01/02、C0-10、health CLI、#538 其餘項目不變。
本機原始輸出(repo 外):
~/.local/state/saccade/evidence/537-o0/20261023T194743/,sha256 見 stacked PR。Refs #537
🤖 Generated with Claude Code