# 有限活動實現與無界計算展開 v0.1
## 遞歸世界的資源受限全域計算

**Finite Active Realization and Unbounded Computational Expansion v0.1**

- 編號：EML-GCM-2026-05-v0.1
- 日期：2026-08-23
- 作者：Neo.K
- 協作：Aletheia / GPT
- 狀態：核心理論論文 / Resource-Bounded Global Runtime
- 邊界聲明：本文所稱「無界」是未預設固定有限展開深度或維度上限，不等於真實機器可同時執行無限計算。

---

## 摘要

若一個計算世界允許遞歸展開、動態增加作用域、提高解析度或生成新的局部結構，那麼其潛在表示空間可以不具有預先固定的有限深度。然而任何真實 Runtime 都受限於記憶體、算力、I/O、延遲與能源，不可能同時保持無限數量的高解析活動狀態。

本文提出：

$$
\boxed{
\text{Finite Active Realization}
+
\text{Unbounded Extensibility}
}
$$

作為這兩者之間的最小兼容原則。世界可以在概念與表示能力上持續向更深、更細、更廣的結構展開，但任一時間 $t$ 的 active computational support 必須有限：

$$
\boxed{
|\operatorname{supp}_{active}(W_t)|<\infty.
}
$$

本文區分 active、materialized、dormant、archived、potential 五種存在狀態，並提出 rolling horizon、checkpoint/seed reconstruction、adaptive refinement、working-set-like active support 與 bounded frontier 等 Runtime 結構。本文特別強調：「無界可展開」不等於「無限同時運算」；「遞歸全域性」不等於「遞歸全部展開」。

---

# 1. 無界不是無限同時活動

最常見的誤解是：

$$
\text{Unbounded}
\Rightarrow
\text{Infinite Active}.
$$

本文否定：

$$
\boxed{
\text{Unbounded Extensibility}
\not\Rightarrow
\text{Infinite Simultaneous Computation}.
}
$$

一個資料結構可以沒有預設最大深度，但任何特定時刻只訪問其中有限部分。

一個 World 也可以如此。

---

# 2. 五種 Runtime 狀態

對 World object $X$，可區分：

## 2.1 Active

$$
X\in A_t
$$

目前參與 computation。

## 2.2 Materialized

$$
X\in M_t
$$

目前細節已展開，可直接訪問或 render。

## 2.3 Dormant

存在 canonical state，但暫不執行高頻 update。

## 2.4 Archived

僅保存 checkpoint、seed、summary、history pointer 等，可在需要時重建。

## 2.5 Potential

結構尚未 materialize，但 grammar / generator / rule 允許未來生成。

因此一般：

$$
A_t,M_t,D_t,R_t,P_t
$$

不是同一集合。

---

# 3. Active 不等於 Materialized

可能：

$$
X\in A_t
$$

但：

$$
X\notin M_t,
$$

例如 hidden low-resolution solver。

也可能：

$$
X\in M_t
$$

但：

$$
X\notin A_t,
$$

例如 UI 顯示一個 frozen snapshot。

所以：

$$
\boxed{
A_t\neq M_t.
}
$$

---

# 4. 有限活動支援

定義：

$$
A_t
=
\operatorname{supp}_{active}(W_t).
$$

Runtime 最小工程要求：

$$
\boxed{
|A_t|<\infty
\quad
\forall t.
}
$$

更強的 bounded-window Runtime 可要求：

$$
|A_t|
\le
B_A
$$

其中 $B_A$ 是 resource-dependent bound。

---

# 5. 無界遞歸

令：

$$
W_0
\to
W_1
\to
W_2
\to\cdots
$$

表示 recursive lineage。

本文不要求存在固定：

$$
N
$$

使所有 lineage 都滿足：

$$
\operatorname{depth}\le N.
$$

因此：

$$
\boxed{
\sup\operatorname{depth}
\text{ need not be fixed a priori}.
}
$$

但任意時間，只操作有限 horizon。

---

# 6. Rolling Active Horizon

令目前 focus depth 為 $k$。

三層例：

$$
\mathcal H_t
=
\{W_k,W_{k+1},W_{k+2}\}.
$$

對應：

1. Focus；
2. Inner；
3. Frontier。

當進入更深：

$$
k\to k+1,
$$

active horizon 滾動：

$$
\{W_k,W_{k+1},W_{k+2}\}
\to
\{W_{k+1},W_{k+2},W_{k+3}\}.
$$

舊 $W_k$ 轉 dormant/archive。

---

# 7. Recursive Globality 不等於 Recursive Full Expansion

核心命題：

$$
\boxed{
\text{Recursive Globality}
\neq
\text{Recursive Full Expansion}.
}
$$

每個 local world 可以對自身 boundary 是 global，但 parent Runtime 不需要同時 fully expand 所有 descendant。

---

# 8. Frontier

Frontier 是 active horizon 的最深一層。

它可以只保留：

- skeleton；
- seed；
- major nodes；
- dependency summary；
- topology signature；
- coarse solver；
- estimated cost。

因此：

$$
W_{k+2}^{frontier}
$$

比 full $W_{k+2}$ 成本低。

---

# 9. Dormant Anchor

當 $W_j$ 離開 active horizon，可壓縮為：

$$
\boxed{
A_j^{dormant}
=
(seed,checkpoint,invariant,history\_ptr,metadata).
}
$$

這允許：

$$
A_j^{dormant}
\xrightarrow{\operatorname{Recall}}
W_j.
$$

若 deterministic generator 足夠：

$$
(seed,version)
$$

甚至可重建大部分結構。

---

# 10. Memory 不必與 Depth 線性同速增長

若每深入一層都完整保留全部 state：

$$
Memory(n)
=
\Theta(nS)
$$

其中 $S$ 是單層完整狀態。

若 archival compression：

$$
Memory(n)
=
A
+
nC,
$$

且：

$$
C\ll S.
$$

更進一步，可將舊 lineage 移入 external store。

因此 active memory 可以：

$$
\boxed{
M_{active}=O(1)
}
$$

相對 recursive depth。

---

# 11. 但 Archive 仍然會增長

重要負面命題：

$$
\boxed{
\text{Bounded Active Memory}
\neq
\text{Bounded Total Historical Storage}.
}
$$

若永久保存所有 lineage receipt，archive 仍可無界增長。

這不是 bug，而是另一個 policy 問題：

- retention；
- compression；
- deduplication；
- checkpoint interval；
- history quotient。

---

# 12. History Quotient

若多條歷史在特定 equivalence 下可視為同類：

$$
H_1\sim H_2,
$$

可只保存 representative + delta。

但 equivalence 必須明確。

不能因 endpoint 相同就自動 quotient：

$$
W_T^{(1)}=W_T^{(2)}
\not\Rightarrow
H_1\sim H_2.
$$

這與第 06 篇直接銜接。

---

# 13. Lazy Evaluation 的類比

Lazy evaluation 只在 demand 出現時進一步求值，並讓 sharing 避免重複工作。

GCM 的 recursive materialization 可借用同樣精神：

$$
\boxed{
\text{Demand}
\to
\text{Expand}
}
$$

但與語言層 lazy evaluation 不完全相同，因為 World 可能在 hidden 狀態下仍有 coarse evolution。

---

# 14. Working Set 的類比

Runtime 可估計近期真正活躍的 domains：

$$
WS_t(\Delta)
=
\{D_i:
\text{used in }[t-\Delta,t]\}.
$$

active support 可依 working-set-like policy 保留：

$$
A_t
\supseteq
WS_t.
$$

長期不活躍者降階。

---

# 15. Adaptive Refinement 的類比

Adaptive mesh refinement、adaptive wavelet methods 與 adaptive-resolution simulation 都展示：

$$
\boxed{
\text{High Resolution}
\text{ only where needed}
}
$$

例如高 gradient、局部 critical region、wavelet coefficient 高的地方才 refinement。

GCM 將此抽象為：

$$
\lambda_t:
\mathcal D_t
\to
\Lambda.
$$

---

# 16. Refinement Trigger

可定義：

$$
R_i(t)
=
F(
error_i,
risk_i,
observer_i,
gradient_i,
dependency_i,
future\_use_i
).
$$

若：

$$
R_i>\tau_{up}
$$

提高 resolution。

若：

$$
R_i<\tau_{down}
$$

降低 resolution。

為避免抖動：

$$
\tau_{up}>\tau_{down}.
$$

這就是 hysteresis。

---

# 17. Active-set Churn

若 domain 每 tick：

```text
activate
deactivate
activate
deactivate
```

則 active support 雖 bounded，但 overhead 很高。

因此需要：

$$
C_{\mathrm{churn}}.
$$

Runtime 應把：

$$
\text{activation cost}
+
\text{migration cost}
+
\text{reconstruction cost}
$$

納入 policy。

---

# 18. Bounded Semantics 不等於 Bounded Cost

這是 DGW 效能實驗最重要的負面結果之一。

早期實作已做到：

$$
|A_t|\approx constant,
$$

但每 tick 還：

- clone all dormant nodes；
- scan all relations；
- recompute all aggregates；
- render ancestor lineage。

因此：

$$
C_{tick}(depth)
$$

仍增長。

所以：

$$
\boxed{
\text{Bounded Active Semantics}
\neq
\text{Bounded Runtime Cost}.
}
$$

---

# 19. 真正 bounded 的條件

若希望：

$$
C_{tick}
=
O(|A_t|)
$$

則必須至少：

1. active-indexed graph；
2. structural sharing；
3. no full dormant clone；
4. no full history scan；
5. bounded observer projection；
6. cached aggregates；
7. frontier-limited dependency reconciliation。

---

# 20. Structural Sharing

世界更新：

$$
W_{t+1}
$$

不應完整 clone：

$$
W_t.
$$

若 dormant subtree 沒改：

$$
W_{t+1}^{dormant}
\equiv
W_t^{dormant}
$$

可共享 reference / immutable structure。

因此 update cost 與 changed support 更相關。

---

# 21. Incremental Aggregates

若 global metric：

$$
G_t
=
\sum_i g_i(t),
$$

只有 active subset $A_t$ 改變：

$$
G_{t+1}
=
G_t
-
\sum_{i\in A_t}g_i(t)
+
\sum_{i\in A_t}g_i(t+1).
$$

不必重新掃全世界。

---

# 22. Active Edge Index

若 graph 很大，但 active nodes 小：

$$
E_t^{active}
=
\{e=(u,v):
u\in A_t\lor v\in A_t\}.
$$

每 tick 只處理：

$$
E_t^{active}.
$$

Rebind horizon 時才重建 index。

---

# 23. Out-of-core World

若 total archive 超過 RAM：

$$
W
=
W^{memory}
\cup
W^{external}.
$$

Dormant/archive 可放：

- disk；
- object store；
- database；
- remote node。

Runtime 保留 locator。

這與 out-of-core graph processing 類似：不是整個圖都要常駐記憶體。

---

# 24. Reactivation

Archived object 重新 active：

$$
A_j
\xrightarrow{\operatorname{Materialize}}
W_j^{active}.
$$

成本：

$$
C_{reactivate}
=
C_{load}
+
C_{reconstruct}
+
C_{validate}
+
C_{catchup}.
$$

所以 archive 太激進也可能造成 thrashing。

---

# 25. Catch-up

如果 dormant 期間 world clock 前進：

$$
t_0\to t_1,
$$

重新 active 時可能有三種策略：

## Freeze

Dormant state 不演化。

## Coarse Evolution

以低成本 aggregate update。

## Replay

從 checkpoint 重播 events。

三者語義不同，必須由 domain contract 指定。

---

# 26. Resource Budget

定義：

$$
B_t
=
(B_{cpu},B_{mem},B_{io},B_{latency},B_{energy}).
$$

Active-set policy：

$$
A_t^*
=
\operatorname{SelectActive}
(W_t,B_t,priority,dependency).
$$

因此 active horizon 不必固定「三層」，三層只是 DGW MVP。

---

# 27. Budget-relative Globality

資源少時：

$$
A_t^{small}
$$

資源多時：

$$
A_t^{large}.
$$

只要兩者都維持 global constraints：

$$
\operatorname{Valid}_W(A_t),
$$

就都可視為同一全域方法論的不同 realization。

---

# 28. Approximate Global Computation

有限 budget 下：

$$
\Phi_G^{(B)}
$$

可能只是近似：

$$
\Phi_G^{(B)}
\approx
\Phi_G^{ideal}.
$$

因此應明確記錄：

$$
\epsilon_B.
$$

而不是把低解析結果假裝成 exact world。

---

# 29. Refinement Monotonicity 不保證

提高 resolution 不一定讓所有 metric 單調變好。

因為：

- solver 改變；
- coupling 改變；
- timestep 改變；
- numerical instability；
- representation bridge error。

因此：

$$
\boxed{
\lambda_2>\lambda_1
\not\Rightarrow
Error(\lambda_2)<Error(\lambda_1)
}
$$

必須實測。

---

# 30. Unbounded Descriptor Space

除了 recursive depth，也可能有 descriptor dimension 持續增加：

$$
d_t
\to
d_{t+1}.
$$

只要求：

$$
|\operatorname{supp}(descriptor_t)|<\infty
$$

於每個實際時刻成立。

因此：

$$
\boxed{
\text{finite current dimension}
+
\text{unbounded future dimensional extension}.
}
$$

---

# 31. 事件驅動展開

新的 domain 不必預先建好。

可以：

$$
event
\to
\operatorname{SpawnDomain}.
$$

這使 World structure 本身可以 dynamic。

---

# 32. Recursive Routing

當 focus 進入 child world：

$$
D_k
\to
D_{k+1},
$$

Router 重綁：

$$
A_t
\to
A_{t+1}.
$$

但：

$$
\Delta epoch=0
$$

如果只是 observer/runtime rebind 而非 world event。

---

# 33. Active Support 與 Observer Support

令：

$$
A_t
=
\text{compute active support}
$$

$$
V_t^O
=
\text{observer visible support}.
$$

一般：

$$
A_t\neq V_t^O.
$$

這再次說明 observation 與 computation 分離。

---

# 34. Safety-critical Pinning

某些 domain 即使 observer 看不到，也不可 dormant。

定義：

$$
P_t
=
\text{pinned domains}.
$$

要求：

$$
P_t\subseteq A_t.
$$

例如：

- safety monitor；
- authentication；
- physical control loop；
- transaction coordinator。

---

# 35. 可驗證不變量

一個 bounded Runtime 至少可驗：

### Invariant 1

$$
|A_t|\le B_A.
$$

### Invariant 2

Pinned domains 不被 evict。

### Invariant 3

Dormant/archive state 不被 active tick 非預期 mutate。

### Invariant 4

Observer-only action 不改 world epoch。

### Invariant 5

Reactivation 後 topology/version/checkpoint 一致。

---

# 36. 可實驗命題

### 命題 A

Recursive depth 增加時，若 active horizon 固定，steady-state tick cost 應接近 active support，而不是 total lineage length。

### 命題 B

Archive compression 可降低 memory growth，但增加 reactivation cost。

### 命題 C

Adaptive refinement 在局部 structured workload 上可用更少 active cells / domains 接近 full-resolution result。

### 命題 D

過度 active-set churn 可使 bounded active Runtime 的總成本高於固定較大 active set。

---

# 37. 與既有研究的關係

Lazy evaluation、working-set locality、adaptive mesh refinement、adaptive wavelet refinement、out-of-core graph systems 都在不同領域證明了同一種工程直覺：

> 不需要讓所有可計算結構在每一時刻都以最高成本活動。

本文將這個直覺提升為 World Runtime 的一般方法論，但不宣稱這些既有技術由本文發明。

---

# 38. 最小 Runtime 演算法

```pseudo
Input:
    world W
    active budget B
    current active set A
    observers O
    dependency graph G

Loop:
    mandatory = pinned_domains(W)
    demanded = observer_and_task_demand(O, W)
    dependent = dependency_closure(demanded)

    candidates = rank(
        mandatory ∪ demanded ∪ dependent,
        by priority, risk, future-use, cost
    )

    A_new = fit_to_budget(candidates, B)

    for x in A - A_new:
        archive_or_dormant(x)

    for x in A_new - A:
        reactivate_or_materialize(x)

    update_only(A_new)
    incremental_reconcile(A_new)
    commit()
```

---

# 39. 核心定義

本文將「資源受限的無界全域計算」定義為：

> 一個 Runtime 若允許其 World representation 在深度、域數、描述維度或解析度上持續擴展，而任意實際時刻只對有限 active support 進行高成本計算，並以可驗證的 archive / summary / reconstruction 機制維持未活動部分的可恢復性，則稱其具備有限活動實現與無界計算展開能力。

形式化：

$$
\boxed{
\forall t,\quad
|A_t|<\infty
}
$$

而：

$$
\boxed{
\not\exists N<\infty
\text{ required a priori such that all future expansion }\le N.
}
$$

---

# 40. 結論

本文要防止兩個對稱錯誤。

第一：

> 因為硬體有限，所以世界結構必須預先固定有限。

不成立。

第二：

> 因為理論允許無界，所以 Runtime 可以無限同時計算。

也不成立。

正確中介是：

$$
\boxed{
\text{Finite Active Realization}
+
\text{Unbounded Extensibility}.
}
$$

再加上：

$$
\boxed{
\text{Recursive Globality}
\neq
\text{Recursive Full Expansion}.
}
$$

這使全域計算可以同時尊重世界的開放展開能力與真實機器的資源限制。

---

## 參考文獻與相關工作

1. Xia, L. et al. *Story of Your Lazy Function's Life: A Bidirectional Demand Semantics for Mechanized Cost Analysis of Lazy Programs*. 2024.
2. Adaptive mesh refinement literature, including structured and wavelet-based adaptive refinement.
3. *From adaptive resolution to molecular dynamics of open systems*. 2021.
4. Chen, D., Wang, S., & Guo, Q. *ACGraph: An Efficient Asynchronous Out-of-Core Graph Processing Framework*. 2025.
5. Zhao, C. et al. *Kaleido: An Efficient Out-of-core Graph Mining System on A Single Machine*. 2019.
6. Adaptive active-region simulation literature in multiscale physics and continuum mechanics.
