---
title: "SRBC Core Patch v0.8：Dependency Effect Typing、Atomic Incremental Recompute 與 Differential-Oracle Boundary"
version: "v0.8"
date: "2026-09-23"
status: "Round 08 parent-aware incremental-runtime patch candidate"
---

# SRBC Core Patch v0.8

Round 08 將 Round 07 的「affected-set routing」推進成真正 incremental recompute runtime。

本輪最重要的結果不是效能，而是一個差點造成假陽性的 verifier blind spot：

> 第一版 incremental engine 與 full rebuild 都把 derivational child 寫成獨立 evaluator，因此兩者即使共同忽略 parent 語義，也可以做到 5000/5000 differential match。

因此：

$$
\boxed{
\text{incremental}=\text{full rebuild}
}
$$

只證明兩條實作路徑一致，

不自動證明：

$$
\boxed{
\text{兩者的 dependency semantics 都正確}.
}
$$

Round 08 corrected r2 因此先重新審計 dependency effect，再重跑全部 transaction。

---

# 1. Dependency Effect Type

Round 07 只有：

```text
derivational
contextual
```

仍不夠。

至少需要：

$$
\boxed{
E_{\mathrm{dep}}
\in
\{
\text{semantic-derivation},
\text{proof-support},
\text{contextual}
\}.
}
$$

## 1.1 Semantic Derivation

parent 的語義結果直接生成 child 的語義結果。

形式上：

$$
R_c
=
f(R_p,\theta_c).
$$

parent semantic mutation 後必須：

1. 重算 child result；
2. 重算 child semantic digest；
3. 重算 child evidence digest；
4. 再向 downstream 傳播。

Round 08 現有四條：

- MH-C1 → MH-C2；
- MH-C1 → MH-C3；
- MH-C1 → MH-C4；
- BER-C1 → BER-C2；

全部屬此類。

## 1.2 Proof Support

child proposition 本身固定，但 proof 使用 parent theorem。

parent 變動後：

$$
R_c
$$

不應被自動改寫，

但：

$$
E_c
$$

必須 stale，等待重新證明。

目前 14 張 benchmark certificates 沒有真正的 proof-support edge，因此 v0.8 先保留型別接口，不假裝有實測樣本。

## 1.3 Contextual

只作背景、來源或 provenance reference。

不傳播 proof staleness。

---

# 2. Parent-Aware Evaluator

semantic-derivation child 必須真正使用 parent result。

例如：

$$
MH\text{-}C1
$$

從：

$$
\frac{\ell_2p_2}{\ell_1p_1+\ell_2p_2}
$$

被 mutation 成：

$$
\frac{\ell_2p_2}
{\ell_1p_1+\ell_2p_2+\ell_3p_3}.
$$

則 MH-C2/C3/C4 不能繼續沿用舊 $2/3$、$1/2$ 與 $1/(1+\alpha)$。

若 child frame 沒有提供：

$$
p_3,\ell_3,
$$

corrected runtime 輸出：

```yaml
status: UNRESOLVED_DERIVATION
free_symbols:
  - p3
  - l3
```

而不是偷偷保留舊答案。

---

# 3. Differential Testing 的獨立性邊界

Round 08 第一版曾出現：

$$
5000/5000
$$

incremental/full differential pass，

但 parent dependency 實際沒有進 child evaluator。

所以新增：

$$
\boxed{
\text{Differential agreement}
\neq
\text{semantic correctness}
}
$$

除非：

1. full rebuild semantics 已獨立驗證；
2. parent/child dependency effect 已被明示；
3. evaluator 真正消費 dependency input；
4. 有 mutation 可證 parent change 真的改到 child。

v0.8 closure gate 應保存：

```yaml
differential_oracle:
  independent_semantics_audit: passed | missing
  dependency_consumption_test: passed | missing
```

---

# 4. Recompute Plan

對 transaction：

$$
\mu
$$

定義：

$$
\boxed{
\mathcal P(\mu)
=
(
S_{\mathrm{sem}},
S_{\mathrm{proof}},
S_{\mathrm{evidence}},
S_{\mathrm{meta}},
\prec
).
}
$$

其中：

- $S_{\mathrm{sem}}$：要重跑 claim / semantic evaluator；
- $S_{\mathrm{proof}}$：只需重新驗證 proof-support；
- $S_{\mathrm{evidence}}$：evidence metadata / digest refresh；
- $S_{\mathrm{meta}}$：nuisance / artifact metadata；
- $\prec$：topological execution order。

不是所有 affected certificate 都執行同樣工作。

---

# 5. Topological Scheduling 是 Correctness Condition

對：

$$
C_p\rightarrow C_c,
$$

semantic derivation 必須先完成：

$$
C_p'
$$

再執行：

$$
C_c'
=
f(C_p',\theta_c).
$$

Round 08 故意反向順序重算：

- MH-C1 family；
- BER-C1 family；

兩次：

$$
\boxed{
2/2
}
$$

都和 full rebuild 不一致。

所以 topological scheduling 不是單純效能優化。

---

# 6. Atomic Snapshot Commit

若先更新 parent，尚未更新 children，就把半成品 closure 對外公開，

closure graph 會暫時存在：

$$
\boxed{
\text{mixed-epoch state}.
}
$$

Round 08 在 MH-C1 transaction 中只更新第一個 node 就曝光 snapshot，立刻和 full rebuild 不一致。

因此 transaction 必須：

1. mutate working state；
2. mark affected；
3. staged topological recompute；
4. verify staged snapshot；
5. atomic commit new epoch。

正式 runtime 不得讓讀者看到中間 partial closure。

---

# 7. Snapshot Epoch

每一次成功 commit 建議產生：

```yaml
closure_snapshot:
  epoch: ...
  parent_epoch: ...
  transaction_id: ...
  root_digests: ...
  certificate_registry_digest: ...
```

只有整個 affected subgraph 完成後才推進 epoch。

---

# 8. Root Content Hash

Round 07 只有 ID-surrogate digest。

Round 08 改成真正對 canonical runtime fixture content 做 hash。

但必須保留 evidence boundary：

> 這些 fixture 是 Round 08 的 canonical runtime test roots，不是從歷史 Monty Hall / Bertrand 原文反向重建的 content hash。

production runtime 必須直接 hash 真正 canonical source/query/family artifact bytes。

---

# 9. Batch Mutation Coalescing

同一 transaction 可能同時改：

- source；
- query；
- family；
- local semantic parameter；
- evidence metadata。

不能每個 mutation 各重算一次。

應先取 affected / semantic sets 的 union，再只跑一次 topological schedule。

Round 08 已用 2–5 mutations / transaction 做 batch differential stress。

---

# 10. Unresolved Derivation 是合法狀態

parent mutation 後，如果 child 缺少新公式所需 binding，

不能：

- 使用舊值；
- 隨便補 default；
- 把 child 標成 false。

應標：

$$
\boxed{
\operatorname{DERIVATION\_UNRESOLVED}.
}
$$

這本質上是 dependency mutation 產生的新 query / proof obligation。

---

# 11. Incremental Closure Correctness

對 runtime state：

$$
S_t
$$

與 transaction：

$$
\mu_t,
$$

定義：

$$
I(S_t,\mu_t)
$$

為 incremental rebuild，

$$
F(S_t,\mu_t)
$$

為 full rebuild。

第一代 runtime correctness criterion：

$$
\boxed{
I(S_t,\mu_t)
=
F(S_t,\mu_t)
}
$$

比較至少包括：

- result；
- status；
- semantic digest；
- evidence digest；
- artifact digest。

但必須搭配前述 independent semantics audit，避免「兩條錯路徑一起相等」。

---

# 12. Replayability

transaction log 必須足以從 genesis snapshot 重建：

$$
S_n.
$$

Round 08 重新 replay 5,000 transaction 後 final snapshot hash 與原 incremental run 相同。

因此 transaction mutation 本身也必須是 canonical artifact。

---

# 13. 新原理

## 原理一

$$
\boxed{
\text{Affected certificate}
\neq
\text{same recomputation mode}.
}
$$

## 原理二

$$
\boxed{
\text{Semantic derivation}
\neq
\text{proof support}
\neq
\text{contextual reference}.
}
$$

## 原理三

$$
\boxed{
\text{Differential agreement}
\neq
\text{semantic correctness without oracle independence}.
}
$$

## 原理四

$$
\boxed{
\text{Topological schedule}
+
\text{atomic commit}
}
$$

是 incremental closure correctness 的必要工程條件。

## 原理五

$$
\boxed{
\text{Parent semantic expansion can turn a previously closed child into an unresolved derivation}.
}
$$
