5D Library › 百卷知识超图拓扑、多模态个人先验编译与自主知识帝国标度律 · English
第八章 实践:零边际成本、上升的一致性成本与校验时间表
什么能扩展,什么不能
一卷完成的数字书几乎可以零成本复制;这是「零边际成本复制」中真实的部分。写下一卷则是另一回事,因为每一卷只要与前面的卷共用原语,就必须在记号、参数与论断上与它们一致。p15 统计合成书库在增长过程中共用原语的卷对数。
推导
# Chapter 8. p15: Zero marginal cost of copies, rising marginal cost of
# consistency. A digital copy of a finished volume costs almost nothing.
# But two volumes that use the same primitive must agree on notation,
# parameters and claims; each such pair is a consistency check. Using
# the synthetic incidence of p06 (same seed), count the volume pairs
# that share at least one or two primitives among the first n volumes,
# and the new pairs that volume n adds (average of the last ten).
import random
def incidence(rng):
w = [1 / (j + 1) ** 0.8 for j in range(15)]
vols = []
for _ in range(100):
k = rng.choice((2, 2, 3, 3, 3, 4, 4, 5))
use = set()
while len(use) < k:
use.add(rng.choices(range(15), weights=w)[0])
use = sorted(use)
if rng.random() < 0.25:
use.append(15 + rng.randrange(30))
vols.append(use)
return vols
def pairs(vols, s):
return sum(len(set(vols[i]) & set(vols[k])) >= s
for i in range(len(vols)) for k in range(i + 1, len(vols)))
if __name__ == "__main__":
vols = incidence(random.Random(100))
print(" volumes pairs sharing 1+ sharing 2+ new pairs per volume")
for n in (10, 25, 50, 75, 100):
new = (pairs(vols[:n], 1) - pairs(vols[:n - 10], 1)) / 10
print(" {:7d} {:16,d} {:10,d} {:20.1f}".format(
n, pairs(vols[:n], 1), pairs(vols[:n], 2), new))
# volumes pairs sharing 1+ sharing 2+ new pairs per volume
# 10 30 7 3.0
# 25 228 68 15.0
# 50 979 344 35.4
# 75 2,024 642 46.9
# 100 3,620 1,269 68.6前 10 卷中有 30 对共用一个原语;前 50 卷中 979 对;100 卷中 3,620 对。现在每新增一卷要核对约 68.6 对,而书库还小时只有 3.0 对。副本以零成本扩展;一致性却大致随书库规模的平方增长。实际的应对正是本书库采用的办法:共享的定义、自动化的核对(每段程序都重新运行,每个印出的数字都追溯到一个输出)以及固定的体例,让核对由机器完成,而不是靠重读。
校验时间表
无声的损坏是另一项随时间增长的成本。p16 计算三份副本的档案在一个世纪内丢失的机会,取决于多久比对一次 SHA-256 校验和并替换坏的副本。
推导
# Chapter 8. p16: How often to check the checksums. Three copies of an
# archive; each copy is silently corrupted with chance 1 - exp(-r d) in
# an interval of d years (r = 0.01 a year, illustrative). At each check
# the SHA-256 sums are compared and any corrupted copy is replaced from
# a good one; the archive is lost only if all three copies go bad
# within one interval. Chance of loss over 100 years, by interval, and
# the number of checks it takes.
from math import exp
R = 0.01
def loss(d, copies=3, years=100):
p = 1 - exp(-R * d)
return 1 - (1 - p ** copies) ** (years / d)
if __name__ == "__main__":
print(" check every checks in 100 years chance of loss")
for d in (1, 2, 5, 10, 25, 50, 100):
print(" {:5d} years {:19d} {:14.6f}".format(
d, 100 // d if d < 100 else 0, loss(d)))
print(" with two copies and yearly checks: {:.6f}".format(
loss(1, copies=2)))
# check every checks in 100 years chance of loss
# 1 years 100 0.000099
# 2 years 50 0.000388
# 5 years 20 0.002318
# 10 years 10 0.008585
# 25 years 4 0.042595
# 50 years 2 0.118122
# 100 years 0 0.252580
# with two copies and yearly checks: 0.009852每年核对一次,一百年内丢失的机会是 0.000099;每五年一次是 0.002318;每 25 年一次是 0.042595;从不核对是 0.252580。只有两份副本、每年核对时是 0.009852,比三份副本差一百倍。对三份副本每年做一次校验,花费很少,却是万分之一与四分之一之间的差别。
注
每一卷的保存清单。 三份数字副本放在不同类型的基础设施上(带 DOI 的仓库、代码平台、离线硬盘);每次发布都公布 SHA-256 校验和,并每年比对;纸本至少送存两家图书馆;程序用纯 ASCII、只用标准库,并把输出印在旁边。
小结
副本是免费的;一致性不是,而且随着书库增长,每卷的一致性成本在上升。三份副本每年核对一次,能把一个世纪内丢失档案的机会保持在万分之一左右。
Fan, Y. (2026). Hundred-Volume Knowledge Hypergraphs, Multimodal Personal Prior Compilation and Autonomous Empire Scaling: Cross-Disciplinary Isomorphisms, Zero-Marginal-Cost Replication and Century-Scale Knowledge Preservation [百卷知识超图拓扑、多模态个人先验编译与自主知识帝国标度律] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090260 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).