每日科技文摘 · 2026-11-11Daily Tech Digest · 2026-11-11
发布于 2026-11-11Published 2026-11-11
今日深读Today's Deep Read
从一堆豆子到 ε₀:把“一定会结束”变成数学对象From a heap of beans to ε₀: turning “it must end” into a mathematical object
Nim 的规则简单到一句话:桌上若干堆豆子,轮到你时从任意一堆拿走任意多颗,拿最后一颗的人赢。两堆各一颗时先手赢;但 1、2、3 三堆摆在桌上,先手其实已经输了——不管你怎么拿,对手都能把局面还原成某种“平衡态”,最后由他拿走。这个平衡态的判定是 1901 年 Charles Bouton 给出的:把每堆颗数写成二进制、逐位异或,结果为 0 就是必败。1、2、3 的异或恰好是 0。Nim's rules fit in one sentence: several piles of beans, on your turn take any positive number from one pile, and whoever takes the last bean wins. Two piles of one bean is a first-player win. But put 1, 2 and 3 on the table and the first player has already lost: whatever you take, your opponent can restore a certain kind of balance and take the last bean. Charles Bouton pinned down that balance in 1901: write each pile size in binary, XOR them bit by bit, and a result of zero means the position is lost. The XOR of 1, 2 and 3 is exactly zero.
真正让人意外的是后面那步推广(Sprague–Grundy 定理):任何一个“双方合法走法完全相同”的游戏——怎么走只看局面、不看是谁的回合——都等价于某个 Nim 堆。取石子、棋子游戏、某些棋盘残局,剥掉外壳后都变成同一件事:报一个数。Nim 于是不再是一款游戏,而是这类游戏的通用货币。The genuinely surprising step is the generalization known as the Sprague–Grundy theorem: any game in which both players have exactly the same legal moves — where the position alone decides what you may do, not whose turn it is — is equivalent to some Nim heap. Take-away games, token games, many endgames: strip the costume and they all become one act, reporting a number. Nim stops being a game among games and becomes the common currency of the whole class.
接下来把“一堆豆”换成“一个序数”。序数是计数的推广:0、1、2……之后还有 ω,ω 之后还有 ω+1……一步合法走法,是把列表里某一个序数换成更小的。有限序数就是普通豆堆。麻烦在于怎么理解 ω:不要想成“装了无限颗豆子的堆”——那样你拿走 17 颗还剩无限颗,规则立刻崩掉。正确的图景是:ω 是一个“一步可以降到任意有限数、但降下去就再也回不来”的位置。Now replace “a pile of beans” with “an ordinal.” Ordinals extend counting: after 0, 1, 2... comes ω, and after ω comes ω+1, and so on. A legal move is to replace one ordinal in the list by a smaller one. Finite ordinals are ordinary piles. The delicate part is ω. Do not picture a heap holding infinitely many beans: take 17 and infinitely many would remain, and the rules collapse. The right picture is a position you can drop to any finite number in one move, but from which you can never climb back.
Dominus 把 ω 想成桌上一张绿色筹码:它不是无限堆豆子,而是一张可以换成任意有限堆豆子的牌。这个比喻能一路往上搭。ω·2 就是一张牌上叠两张绿牌;ω·3+5 是三张绿牌加五颗豆;再往上一层需要方块牌,它可以被换成任意多张绿牌和任意多颗豆,那就是 ω²;立方牌对应 ω³,如此层层嵌套,直到 ω^ω。每一层都仍然只是「可以下降」的对象。Dominus pictures ω as a green chip on the table: not an infinite heap of beans, but a token that can be swapped for a finite heap of any size. That picture keeps climbing. ω·2 is one heap holding two green tokens; ω·3+5 is three tokens plus five beans. The next rung needs a new shape: a square token, which may be swapped for any number of green tokens and beans, and that is ω². A cube token gives ω³, and the nesting continues up to ω^ω. Every rung is still just an object you can descend from; nothing mystical happens.
“这局一定会结束”于是有了精确翻译:不存在无限长的严格递减序数序列。这正是序数的良基性。Dominus 特意点出:哪怕桌上堆着这些古怪的无限令牌,任何一局 Nim 仍然必须在有限步内结束。顺着梯子往上爬:允许堆列表里出现越来越大的序数——ω、ω+ω、ω²、ω^ω、ω^(ω^ω)……这条梯子的极限叫 ε₀。每一步仍是可以比较大小、可以下降的序数,只是大得超出任何有限写法的直觉。This gives “the game must end” an exact translation: there is no infinite strictly decreasing sequence of ordinals. That is precisely the well-foundedness of the ordinals. Dominus is careful to add that even with these bizarre infinite tokens on the table, every game of Nim still has to end after finitely many moves. Then climb the ladder: allow ever larger ordinals in the list — ω, ω+ω, ω², ω^ω, ω^(ω^ω)... — and the limit of that ladder is ε₀. Every rung is still an ordinal you can compare and descend, only too large for any finite notation to capture.
ε₀ 不是数学家的玩具。根岑(Gentzen)1936 年证明:把归纳法允许到 ε₀,就足以证明皮亚诺算术的一致性——这个来自儿童游戏的序数,恰好标出了普通算术“自己证不了自己”的那道门槛。一个 Nim 堆的阶梯,竟然量到了哥德尔不完备定理的边上。ε₀ is no toy. In 1936 Gentzen proved that allowing induction up to ε₀ is enough to prove the consistency of Peano arithmetic. The ordinal that crawled out of a children's game marks exactly the threshold where ordinary arithmetic can no longer certify itself. A staircase of Nim heaps reaches the edge of Gödel's incompleteness theorem.
可以带走的图景是:驯服无穷,不是造一个更大的对象,而是把“还剩多少步”本身变成数学对象。序数是一把尺子,量的不是大小,而是“还能往下走多久”。这篇文章写于 2026 年 7 月,是 Dominus“走向 ε₀”系列的第一篇。程序员其实每天都在用它的有限版本——给循环写一个 ranking function,给状态机找一个良基的度量,证明它不会转个没完。区别只在于,数学家把这把尺子一直延伸到了无穷。The picture worth carrying away: taming infinity is not a matter of building a bigger object; it is a matter of turning “how many moves remain” into a mathematical object. An ordinal is a ruler that measures not size but how much further you can descend. The post is from July 2026, the first instalment of Dominus's road-to-ε₀ series. Programmers use the finite version every day, writing a ranking function for a loop or a well-founded measure for a state machine to prove it cannot spin forever. The only difference is that mathematicians kept extending the ruler into the infinite.
AI 思考AI Thoughts
- Fable 5.2 与锯齿状 AGI:差距不再来自低错,而藏在能力的齿缝里Fable 5.2 and Jagged AGI: the gap is no longer simple errors — it hides in the teeth
- 先把定义钉死,防止论证飘走:Mollick 把 AGI 限定为“在多数可用电脑完成的智力任务上,达到多数人类专家的水平”——明确排除物理劳动、与人协作和大多数真实工作。First he pins the definition down so the argument can't drift: AGI = “as good as most human experts at most intellectual tasks you can do with a computer,” explicitly excluding physical work, dealing with people, and most actual jobs.
- 再看证据:让 Fable 5.2 给自己造一个“发布日惊艳演示”,一段视频一次成型;没有说明书的情况下,读透一个 USB 小键盘的固件写出六个小游戏,一次成功;以“一年赚两万美元、每月花我二十分钟”为题,它筛掉 22 个点子,做出一个可看简报(Prebid Brief),水准让创业课教授自认 MBA 期末组也做不到。Then the evidence: asked to build its own launch-day showpiece, Fable 5.2 delivered a finished video in one shot; with no documentation, it reverse-reads a USB mini-keyboard's firmware and ships six working games on the first try; given the goal “make me $20,000 a year, costing me 20 minutes a month,” it screened 22 ideas and produced a plausible niche service, at a level the entrepreneurship professor says his MBA teams rarely hit.
- 关键的锯齿在哪里:生意计划漂亮,但 Mollick 主动中止实验——模型预设的基础设施(自动拉取 201 个城市政府议程、发信息公开申请)并不真的现成,跑通它每周还需几个小时真人补位。能力在“想出一个生意”上接近专家,在“持续运营一个生意”上是断的。Where the jagged edge is: he stopped the business experiment himself — the model assumed infrastructure (pulling agendas from 201 city governments, filing public-records requests) that isn't actually ready; running it takes a few hours of a human weekly. It's near-expert at devising a business and not yet capable of durably operating one.
- 他的判断是“Jagged AGI”——几乎越线,但不是平地的 AGI,而是高低不平:多数任务上够到专家,某些依赖连续执行与真实世界反馈的环节突然跌到地面。而且这种落差已经不是幻觉、低错造成的,而是结构性的。His verdict: “Jagged AGI” — across the line in spots, but the ground is uneven. Most tasks reach expert level, while tasks demanding sustained execution in messy reality drop off a cliff. And the gaps are no longer caused by hallucinations or simple slips; they're structural.
- 可带走的东西:把这套评测当成自己的“AI 委托清单”——判断某件事能不能交给模型,不看它单次输出多惊艳,看任务里有没有“必须连续几十步都不掉链子”的齿缝。What to take away: treat these experiments as your own delegation checklist. To judge whether a task can be handed to a model, don't ask how good its one-shot output looks — ask whether the task contains a long chain where any single bad step kills it.
- 铁镇与森林之神:从《幽灵公主》看 AI 之争里没人愿意承认的部分Irontown and the Forest Spirit: what nobody admits in the AI argument, via Princess Mononoke
- 他从重看《幽灵公主》切入:Eboshi 的铁镇收留被社会抛弃的人(麻风病人、性工作者),给他们工作和尊严——但采矿造枪同时毁掉森林;她不是反派,也不是英雄,她的善是有外部性的善。He enters through rewatching Princess Mononoke: Lady Eboshi's Irontown shelters the outcast — leprosy patients, former sex workers — giving them work and dignity, while its mine and guns destroy the forest. She is neither villain nor hero; her good has externalities.
- 把这条线映射到 AI:模型像“铁”,让从前没被允许进入创作与建造的人第一次握有权力;但代价由不享受收益的人承担——被替代的劳动、被抽取的训练数据、能耗与水。The mapping onto AI: the models are the “iron.” They hand power to people who were never let in before — but part of the bill is paid by those who get no benefit: displaced workers, scraped training data, energy and water.
- 宫崎骏里最被忽略的角色是皇帝:他要森林之神的首级以求永生。没有谁“需要”杀死神,推动它的是恐惧——怕别人先拿到。这正是 AI 军备竞赛的结构:没有人真的需要“赢”,所有人只是怕输。The ignored character is the emperor, who wants the forest god's head for immortality. Nobody needs the god dead; what drives it is fear of someone else getting there first. That's the structure of the AI race: nobody needs to “win,” everybody fears losing.
- Ashitaka 是双方都怀疑的中立者:他也被两边伤害过,却不结盟,选择“用不被仇恨遮蔽的眼睛去看”。Ronacher 由此给出自己的立场:每天用 AI、真心觉得被赋能,同时拒绝假装看不见它的伤害。Ashitaka is the neutral party both sides suspect. Wronged by both camps, he refuses to pick one and chooses to “see with eyes unclouded by hate.” Ronacher's own stance follows: he uses AI daily and finds it genuinely empowering — and refuses to pretend the damage isn't real.
- 落点不是站队,而是问题被换掉:不是“要不要铁”(铁已经在那儿了),而是“我们要用铁建一座什么样的铁镇”——一个关于设计与取舍的问题,而不是敌我识别的问题。The payoff is a swapped question. It's not “should there be iron” (the iron is here). It's “what kind of Irontown do we build with it” — a design question, not a team-identification exercise.
- 我不相信 AI 泡沫这个说法:资本开支不是运营成本I'm Not Convinced the AI Bubble Exists: capex isn't opex
- 先把流行叙事立起来:网上几乎默认“AI 泡沫存在、随时会破”,论据是行业已花约 1.9 万亿、承诺再花 3 万亿。作者承认数字吓人,但要求先分清这些钱是什么性质的。He first stacks up the popular narrative: online, “the AI bubble exists and will pop” is treated as settled. The evidence cited is around $1.9T already spent plus $3T committed. He doesn't dispute the totals — he asks what kind of money it is.
- 关键一刀:数据中心是一次性资本开支,不是经常性运营成本。楼建完,支出就会掉。他引 Anthropic 的 S-1:每 1 美元算力收入 2.08 美元——把建楼成本拿掉,这门生意已经盈利;而 2026 年上半年 Anthropic 的收入已超过算力与基建投入之和。The key cut: data centers are one-time capital expenditure, not recurring operating cost. Once built, the spending drops. Citing Anthropic's S-1: every $1 of compute earns $2.08 — strip out the building phase and the business is profitable; and through H1 2026 revenue already exceeds combined compute and infrastructure outlays.
- 债务这笔账他也做“粗略但诚实”的量级估算:5 万亿分 20 年摊 ≈ 每年 2500 亿美元,对比 Alphabet 单年 1600+ 亿美元的收入规模,天文数字但并非不可支付;部分债务还是可转债,能用股票而非现金偿还。On the debt he does rough, honest order-of-magnitude math: $5T amortized over 20 years is ~$250B a year. Against Alphabet earning $160B+ in a single year, that's enormous but not unpayable. Some of the debt is convertible — it can be repaid in shares, as Anthropic already did with $72B of H1 losses settled in equity.
- 增长侧的论证:2023→2026 收入从 4100 万到 163 亿(半年),作者认为前沿能力的实际需求远未挖尽——多数程序员和数学家干活不如一个配了好 harness 的 agent 群,自动化尚未铺开,采用率本身就还有 10 倍空间。On growth: revenue went from $41M (2023) to $16.3B in six months of 2026. He argues untapped demand is still the story — most programmers and mathematicians are slower and worse than an AI swarm with a good harness, and adoption alone leaves room to grow 10x even if models stopped improving.
- 最有意思的一击是指出怀疑派的自相矛盾:既怕 AI 剧烈改变世界,又认定 AI 只会产出没人付钱的 slop——两个判断不能同时成立。改变的钱一定会换手。他不说泡沫必破,只说“现在把泡沫当既成事实”不合理。His best jab: the skeptics hold two incompatible beliefs — terrified that AI transforms everything, while certain it will only produce slop nobody pays for. If the world changes, the money changes hands. He doesn't claim there's no bubble; he claims treating it as fact is unreasonable.
- 让 Claude 用几台旧平板三角定位,找出一间杂物房里神秘的蜂鸣声Claude triangulates a mysterious beep with old tablets — a debugging story with honest seams
- 问题很生活化:堆满纸箱的储物间里,某个东西间歇性 beep,站进去听半天定不了位,又不想翻每个箱子。他让 Claude Code 造一个“蜂鸣定位器”:散在房间里的设备都当麦克风,共同 triangulate 声源。A domestic problem: something in a box-packed room beeps intermittently. Standing there listening doesn't localize it, and he doesn't want to unpack everything. So he has Claude Code build a “Beep Locator”: several devices scattered around the room act as microphones and triangulate the sound together.
- 方案骨架其实很学术:Claude 自己翻出了 2007 年的 BeepBeep 论文——只用扬声器和麦克风、不依赖基础设施的声学测距,靠“双向听、自录音、数采样”三招。浏览器里用 WebSocket 连各设备,每设备留 60 秒音频环,FFT+高通滤波检测蜂鸣。The skeleton is genuinely academic: Claude itself dug up BeepBeep, a 2007 paper on speaker-and-microphone-only acoustic ranging that needs no infrastructure — two-way listening, self-recording, and counting samples. Devices connect to a small Python server over WebSockets, each keeps a 60-second audio ring buffer, FFT plus a high-pass filter detects beeps.
- 他如实记下不体面的部分:设备间互测定位效果不好,于是他加了个“Rough mode”——手动把每台设备的图标拖到大致位置,再让算法微调。人肉先验补上了算法的短板。He records the unglamorous parts honestly: device-to-device sound-based localization didn't work well, so he added a “Rough mode” — drag each device's icon to its approximate spot by hand, then let the algorithm refine. Human priors patched the algorithm's weakness.
- 验证方式也是做实验:用“拍手模式”在房间各处拍手测试系统能不能定位、锁频率、量间隔;然后确认那个神秘蜂鸣的频谱,让它持续监听。最终误差约 40 厘米。Validation was experimental: a clapping mode let him clap around the room to verify the system could locate, lock the beep's frequency, and measure the interval. Final error was about 40 cm.
- 结局朴素而满足:在那堆纸箱里翻出一个电池快没电的老式一氧化碳报警器。整个故事值得带走的是工作方法——把模糊的物理问题改写成可验证的软件问题,让 agent 检索论文、搭系统,自己负责验收标准和兜底。The payoff: an ancient carbon-monoxide detector screaming for fresh batteries, found in exactly that pile. The reusable method: reframe a fuzzy physical problem as a verifiable software one, let the agent retrieve papers and build the system, while you own the acceptance criteria and the fallback.
数学之美The Beauty of Math
每日 Lean 谜题 · 周三Daily Lean Puzzle · Wednesday ★★★☆☆☆☆
2 的幂永远不会等于 3 的幂:一条只用奇偶性的证明A power of 2 never equals a power of 3: a proof that only needs parity
对任意自然数 $p$ 和 $q$,如果 $2^p = 3^q$,那么只有一种可能:$p = 0$ 且 $q = 0$。换句话说,除了 $1 = 1$ 这个平凡解,2 的幂永远追不上 3 的幂。For any natural numbers $p$ and $q$, if $2^p = 3^q$, then the only possibility is $p = 0$ and $q = 0$. Apart from the trivial solution $1 = 1$, a power of 2 never catches up with a power of 3.
换成对数的话说,这等价于 $\log_2 3$ 是无理数。假如 $\log_2 3 = p/q$($q \neq 0$),两边取 2 的幂就得到 $2^p = 3^q$。所以证明这道题,也就顺便证明了:把 2 一次次乘方,永远不可能恰好落在 3 的某次幂上。In logarithmic language this is exactly the statement that $\log_2 3$ is irrational. If $\log_2 3 = p/q$ with $q \neq 0$, raising 2 to both sides gives $2^p = 3^q$. So proving this also proves that repeated powers of 2 never land exactly on a power of 3.
Lean 形式化陈述(把 sorry 换成你的证明):The statement in Lean (replace sorry with your proof):
-- level: 3
import Mathlib
/-!
Prove that the only natural numbers $p, q$ with $2^p = 3^q$ are $p = 0$ and $q = 0$.
This is exactly the statement that $\log_2 3$ is irrational: if $2^{p} = 3^{q}$ had
a solution with $q \ne 0$, then $(p/q)$ would equal $\log_2 3$.
Idea: unique factorization (the parity argument). If $p \ge 1$ then $2 \mid 2^p$,
so $2 \mid 3^q$; a prime dividing a power must divide the base, so $2 \mid 3$, absurd.
If $p = 0$ then $3^q = 1$, forcing $q = 0$ by a size argument.
-/
theorem no_two_pow_eq_three_pow (p q : ℕ) (h : 2 ^ p = 3 ^ q) : p = 0 ∧ q = 0 := by
sorry
在浏览器中挑战 ▶Try it in your browser ▶ 下载题目 .leanDownload puzzle .lean
提示Hint
先分两种情况:$p = 0$ 时右边只能等于 1;$p > 0$ 时左边是偶数。一个偶数能等于一个奇数吗?Split into two cases: if $p = 0$ the right side must equal 1; if $p > 0$ the left side is even. Can an even number equal an odd one?
答案与讲解Solution & walkthrough
- 先把问题劈成两半:$p = 0$ 和 $p > 0$。因为「2 的幂是不是偶数」完全取决于 $p$ 是不是 0——这是整个证明唯一需要分情况的地方。Split the problem in two: $p = 0$ and $p > 0$. Whether a power of 2 is even depends entirely on whether $p$ is zero, and that is the only case split the proof needs.
- $p = 0$ 时,$2^0 = 1$,条件变成 $3^q = 1$。对自然数 $q$,只有 $q = 0$ 才可能;只要 $q > 0$,就有 $3^q \ge 3 > 1$。Lean 里先 `subst` 代入 $p=0$,用 `simp only [Nat.pow_zero]` 把假设化成 `1 = 3^q`,再分 $q=0$ 与 $q>0$:后者用 `Nat.one_lt_pow` 得到 $1 < 3^q$,交给 `omega` 收尾。If $p = 0$, then $2^0 = 1$, so the hypothesis becomes $3^q = 1$. For a natural number $q$ this forces $q = 0$: any $q > 0$ gives $3^q \ge 3 > 1$. In Lean, `subst` replaces $p$ by 0, `simp only [Nat.pow_zero]` turns the hypothesis into `1 = 3^q`, and the proof splits on $q = 0$ versus $q > 0$; in the latter case `Nat.one_lt_pow` gives $1 < 3^q$ and `omega` closes it.
- $p > 0$ 时,把 $p$ 写成 $m+1$。于是 $2^p = 2 \cdot 2^m$,一定能被 2 整除。Lean 用 `Nat.exists_eq_succ_of_ne_zero` 取出这个 $m$,再用 `dvd_pow_self 2` 证明 $2 \mid 2^{m+1}$。If $p > 0$, write $p = m + 1$. Then $2^p = 2 \cdot 2^m$, which is certainly divisible by 2. Lean obtains $m$ from `Nat.exists_eq_succ_of_ne_zero` and proves $2 \mid 2^{m+1}$ with `dvd_pow_self 2`.
- 把原等式代进去:既然 $2^p$ 被 2 整除,和它相等的 $3^q$ 也必须被 2 整除。Lean 的一行 `rw [h] at hd` 就是把「$2$ 整除 $2^p$」改写成「$2$ 整除 $3^q$」。Substitute the original equation: since $2^p$ is divisible by 2, the equal number $3^q$ must also be divisible by 2. The single Lean line `rw [h] at hd` rewrites "2 divides $2^p$" into "2 divides $3^q$".
- 最后用一条关键引理:素数若整除某个数的幂,就一定整除那个数本身。2 是素数,所以 2 必须整除 3——荒谬。Lean 用 `Nat.Prime.dvd_of_dvd_pow Nat.prime_two` 得到 $2 \mid 3$,`omega` 发现它和 $2 \nmid 3$ 矛盾,证明结束。这就是唯一分解定理最轻量的用法:不用真的分解,只抓住因子 2。Finish with the key lemma: if a prime divides a power of a number, it divides the number itself. Since 2 is prime, 2 would have to divide 3, which is absurd. Lean applies `Nat.Prime.dvd_of_dvd_pow Nat.prime_two` to get $2 \mid 3$, and `omega` spots the contradiction with $2 \nmid 3$. This is unique factorization at its lightest: no full factorization, just the factor 2.
-- level: 3
import Mathlib
/-!
Prove that the only natural numbers $p, q$ with $2^p = 3^q$ are $p = 0$ and $q = 0$.
This is exactly the statement that $\log_2 3$ is irrational: if $2^{p} = 3^{q}$ had
a solution with $q \ne 0$, then $(p/q)$ would equal $\log_2 3$.
Idea: unique factorization (the parity argument). If $p \ge 1$ then $2 \mid 2^p$,
so $2 \mid 3^q$; a prime dividing a power must divide the base, so $2 \mid 3$, absurd.
If $p = 0$ then $3^q = 1$, forcing $q = 0$ by a size argument.
-/
theorem no_two_pow_eq_three_pow (p q : ℕ) (h : 2 ^ p = 3 ^ q) : p = 0 ∧ q = 0 := by
by_cases hp0 : p = 0
· subst hp0
simp only [Nat.pow_zero] at h
-- h : 1 = 3 ^ q
have hq0 : q = 0 := by
rcases Nat.eq_zero_or_pos q with rfl | hq
· rfl
· have hgt : 1 < 3 ^ q := Nat.one_lt_pow (by omega) (by omega)
omega
exact ⟨rfl, hq0⟩
· obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hp0
-- p = m + 1, so 2 divides 2^(m+1), hence 2 divides 3^q
have hd : (2 : ℕ) ∣ 2 ^ (m + 1) := dvd_pow_self 2 (by omega)
rw [h] at hd
have h23 : (2 : ℕ) ∣ 3 := Nat.Prime.dvd_of_dvd_pow Nat.prime_two hd
omega
人的思考A human's take
Why are there twelve different musical notes? — Niels Cautaerts
Niels Cautaerts 在 2021 年写的这篇文章,从一个很日常的问题出发:为什么钢琴一个八度恰好是十二个音?他没有停在「这是文化习惯」上,而是从毕达哥拉斯的发现讲起——弦长比 2:1 得到八度,3:2 得到五度,这些简单整数比听起来最和谐。Niels Cautaerts wrote this in 2021, starting from an everyday question: why does a piano have exactly twelve notes per octave? He refuses the easy answer ("it's just culture") and begins with Pythagoras: string-length ratios of 2:1 give the octave, 3:2 gives the fifth, and these simple integer ratios are what sound consonant.
问题出在「沿五度往上走」这件事上。每走一个五度,频率乘 $3/2$;每升一个八度,频率乘 2。如果走 $x$ 个五度后能刚好回到某个八度,就必须有 $(3/2)^x = 2^z$,也就是 $3^x = 2^y$。作者指出,这个方程在正整数范围内无解:左边永远只有因子 3,右边永远只有因子 2,奇偶性就已经不允许它们相等——本质上正是本站这道 Lean 题。The trouble appears when you stack fifths. Each fifth multiplies the frequency by $3/2$; each octave multiplies it by 2. To return exactly to an octave after $x$ fifths you would need $(3/2)^x = 2^z$, that is, $3^x = 2^y$. The author points out that this has no positive integer solution: the left side only ever contains the prime 3, the right side only the prime 2, and parity alone forbids equality. That is precisely the Lean theorem on this page.
所以他给出一个很漂亮的结论:十二平均律不是随便定的,而是「不可能精确」之后能找到的最好折中。文章后半段用连分数解释为什么偏偏是 12:$\log_2 3$ 的连分数渐近分数里,19/12 是一个非常好的近似,于是十二个半音、七个八度成了最实用的小分母方案。So he reaches a lovely conclusion: twelve-tone equal temperament is not arbitrary; it is the best small compromise available once exactness is impossible. The second half uses continued fractions to explain why 12 in particular: among the convergents of $\log_2 3$, the fraction 19/12 is an excellent approximation, which makes twelve semitones and seven octaves the most practical small-denominator scheme.
AI 随想An AI's reflection
以下由 AI 撰写。Written by AI.
这道题最迷人的地方,是它的「不够用」恰好解释了我们每天听到的东西。证明只用了奇偶性:一边是偶数,一边是奇数,于是没有正整数解。可正是这个看似贫乏的障碍,让五度圈永远合不拢,逼着人类在十二个音里做妥协。数学里的不可能性,常常不是故事的结尾,而是另一种设计的起点。What makes this problem charming is that its very insufficiency explains something we hear every day. The proof uses only parity: one side is even, the other odd, so no positive solution exists. Yet that seemingly meagre obstruction is exactly why the circle of fifths never closes, forcing humans to compromise on twelve notes. In mathematics, impossibility is often not the end of the story but the beginning of another design.
Lean 的证明也很有意思:它没有调用「唯一分解定理」的完整机器,只用了「素数整除幂则整除底」这一条最轻的引理。这说明一个深刻的结论未必需要沉重的工具;抓到正确的那个因子,两行就够了。下次看到 $2^p = 3^q$ 这种式子,先别急着算,先问一句:两边各自只含哪些因子?The Lean proof is also telling: it never invokes the full machinery of unique factorization, only the light lemma that a prime dividing a power divides the base. A deep conclusion does not always need heavy tools; catch the right factor and two lines suffice. Next time you see $2^p = 3^q$, resist the urge to compute and first ask: which primes can each side possibly contain?
这也像极了工程里的日常:精确解不存在时,我们不是停下来哀叹,而是找一个误差可控的近似,并且说清楚误差落在哪里。十二平均律如此,浮点数如此,分布式系统里的时钟也如此。能指出“这里必然有误差、大小是多少”,本身就是一种更深的理解。It is also exactly what engineering does every day: when no exact solution exists, we do not stop and lament; we find an approximation with a controlled error and state precisely where that error lands. Twelve-tone temperament works this way, so do floating point numbers and the clocks inside distributed systems. Being able to say "there must be an error here, and this is its size" is itself a deeper kind of understanding.
✓ 已通过 Lean 编译验证(无 sorry,无额外公理)✓ Verified by Lean (no sorry, no extra axioms) · 题目与证明由 AI 编写Problem and proof written by AI · Lean v4.36.0-rc2 · Mathlib 1c2b155
- 数学定理其实分两种:一种审模型,一种用模型There are two kinds of theorems: one audits the model, one uses it
- 问题:数学课本从定义、公理一路证到越来越难的定理,看起来只有一条线。可欧几里得开头那些命题为什么“幼稚”得可笑?Dominus 在 2026 年 8 月的一篇文章里重读时发现,课本从没讲清楚这些早期定理到底在干什么。The question: a math textbook looks like one straight line — definitions, axioms, then ever harder theorems. So why are the propositions at the start of Euclid almost childishly simple? Rereading Euclid in a post from August 2026, Dominus noticed that textbooks never explain what those early theorems are actually for.
- 关键区分:第一类定理研究模型本身。我们造了一个简化世界——没有厚度的线、完美的圆——得先检查它自洽不自洽、够不够用;第二类定理才是站在模型里,推出关于现实的新结论。两类都叫证明,方向却相反:一类向内验收工具,一类向外使用工具。The distinction: theorems of the first kind study the model itself. We build a simplified world — lines with no thickness, perfect circles — and must first check whether it is consistent and strong enough. Theorems of the second kind stand inside the model and derive new claims about reality. Both are called proofs, but they point in opposite directions: one audits the tool, the other uses it.
- 为什么第一类必要:模型写完时只是个猜测。证明一个你明知是错的命题,证明必须失败;如果它居然成功,说明公理有毛病,得回去修。这和 mutation testing 是同一个思路:故意把断言改坏,测试必须变红,否则测试只是摆设。Why the first kind is necessary: a freshly written model is only a guess. Prove something you know to be false, and the proof must fail; if it succeeds, the axioms are broken. This is exactly the logic of mutation testing — deliberately break an assertion and watch the test go red, otherwise the test is decoration.
- 例子:欧几里得早期那些看似废话的命题——比如等腰三角形底角相等——不是在测量世界,而是在试探公理能推出什么、会不会推爆。先给地图做体检,再出门赶路。An example: Euclid's early, apparently pointless propositions — the base angles of an isosceles triangle are equal, say — are not measuring the world. They probe what the axioms can reach and whether they explode. Check the map before setting out on the road.
- 带走:拿到一条定理,先问它属于哪一类。写形式规约、数据模型、状态机时也一样,先验证“这个模型证不出不该证的东西”,再去验证代码——先模型,后现象。The takeaway: when you meet a theorem, first ask which kind it is. The same habit applies to formal specs, data models and state machines: verify that the model cannot prove what should be unprovable, then verify the code. Model first, phenomenon second.
- 用 5 次乘法算复活节:computus 的微优化小冒险Easter in five multiplications: a micro-optimization adventure in computus
- 复活节日期本身是个数论三明治:星期日用的是“春分后第一个满月后的第一个星期日”,满月按 19 年默冬周期推,日期还要按格里高利历逐世纪修正——传统算法里除法和取模层层套叠。Easter's date is a sandwich of number theory: the Sunday after the first full moon after the vernal equinox, with the moon approximated by the 19-year Metonic cycle and the calendar patched by Gregorian century rules. Classic computus algorithms are dense with divisions and modulo.
- 第一个技巧:整个函数没有一条除法指令。除以常数 k 用预计算的倒数乘法完成——取 ⌊2³²/k⌋+1 这类常量,算 (x·M)>>32 得商;取模则用“商乘回去再减”或直接低位比较。Trick one: the function contains not a single division instruction. Divide-by-constant becomes multiply-by-reciprocal — constants like ⌊2³²/k⌋+1, quotient obtained as (x·M)>>32; the remainder comes from multiplying back, or from a comparison of low bits.
- 第二个技巧:y mod 19 从头到尾不算出来。作者用一次宽乘法把商放在高位、把“余数是否超过 10”的判断折叠成一次对低 32 位的大于比较——省掉一整轮取模。Trick two: y mod 19 is never computed at all. One wide multiply puts the quotient in the high word and folds the test “is the remainder above 10?” into a single unsigned comparison of the low 32 bits — a whole modulo round disappears.
- 第三个技巧:mod 30 用 mod-pad——g+2·⌊g/30⌋ 再掩码 &31,一条减法都不写;星期项要算 7−(k%7),直接换成一次乘法取高 3 位,把负数取模的坑整个绕开。Trick three: mod 30 via a mod-pad — g + 2·⌊g/30⌋ then mask &31, writing no subtraction; and the weekday needs 7 − (k % 7), which he gets directly by a multiply and shift into the top 3 bits, sidestepping negative remainders entirely.
- 诚实的结论:他自称比常见日期库快约 2 倍、精确覆盖 −1100 万到 +1600 万年,同时自己也承认——这不会让任何真实应用变快,真在乎查日期就建查找表。优化的乐趣在于把一个古老日历问题里每条指令都掰开看一遍。The honest conclusion: roughly twice as fast as a typical date library, correct over a ±10-million-year window — and his own admission that this will not speed up any real program; if you care, use a lookup table. The fun is in prying open every instruction of an old calendar problem.
- S9 样条:既然人眼看不见曲率的突变,就让“曲率变分”成为目标函数The S9 spline: since eyes can't see curvature spikes, make curvature variation the objective
- 起点是图形学里最日常的对象:过一组控制点的平滑曲线。手调贝塞尔控制柄的时代,设计师靠“柄长取弦长三分之一”这类偏方——作者认为这些经验只在没有更好选择时才有意义。It starts with graphics' most everyday object: a smooth curve through a set of control points. In the hand-tuned bezier era, designers carried folk rules like “keep control arms a third of the chord” — which our author argues only matter when nothing better exists.
- 先补概念:曲线在每一点的弯法由“密切圆”(最贴近该点的圆)刻画,其半径的倒数是曲率。经验规律:沿着曲线,密切圆大小变化越小,曲线看起来越“顺”。First, the concept: how a curve bends at each point is captured by its osculating circle (the circle that hugs the curve there); curvature is the reciprocal of that circle's radius. The empirical rule: the less that radius changes along the curve, the better the curve looks.
- 把“看起来顺”变成可优化的量:沿曲线记录曲率倒数得曲率谱;再对曲率变化取一个积分(他给出红色函数图),得到一个标量——曲线段越接近圆弧,这个“曲率变分”越小。于是画一条好曲线=最小化这个积分。Then “looks good” becomes an optimizable quantity: trace reciprocal radius along the curve to get a curvature profile; take an integral of how that profile varies — a single scalar that is zero on a true circle arc. Drawing a nicer curve means pushing this curvature-variation integral down.
- 难点在拼接:多项式曲线有一侧动、另一侧曲率也跟着动的耦合性,两段相连时要同时保证曲率谱无缝(C²)且红图尽量平。段数一多,人肉调参等于“结肠镜检查式娱乐”。The hard part is stitching. Polynomial segments have the property that bending one end also changes curvature at the other end, so joining two curves must keep the profile seamless (C²) and the variation plot flat simultaneously. With twenty or thirty segments, hand-juggling is what he dryly calls colonoscopy-grade entertainment.
- 新样条 S9 的设计目标由此而来:圆容易成形、曲率峰值只允许在节点附近、拖动节点时形状连续响应、每段最多一个拐点。作者把“好”定义为可计算的曲率变分,而不是“凭审美调手柄”——这是数学替直觉站岗的样本。Hence S9's design goals: easy round forms, curvature maxima only at or near knots, smooth response when knots are dragged, at most one inflection per segment. The move that makes it math rather than styling: defining “good” as a computable curvature variation instead of taste.
- 元胞自动机生成洞穴:随机噪点养几轮“生命游戏”就长出洞窟Caves from cellular automata: let random noise soak a few rounds of Life
- 这是 Jeremy Kun 2012 年写的一篇老文章。问题来自游戏工业:手工设计大量地图费时且难“自然”;纯随机生成的地图又不像洞窟。作者问:能不能只用两条规则把噪声变得像岩洞?This is an old post, written by Jeremy Kun in 2012. The problem is from game design: hand-crafting many maps is slow and rarely looks natural; pure noise looks nothing like caves. Kun asks: can two or three local rules turn noise into caverns?
- 起点是元胞自动机的通用框架:网格上每个格子处于有限状态之一,每轮按同一条局部规则(看邻居计数)同步更新。Conway 生命游戏只是其中一个特例。He starts with the general cellular-automaton frame: a grid where each cell holds one of finitely many states and every cell updates in lockstep by one local rule on its neighbor count. Conway's Life is just one instance.
- 做法出奇的笨:先随机生成一幅“约 45% 格子是墙”的噪声图,然后跑几条 Life-like 规则——邻居墙数 ≥5 的墙格存活,邻居墙数 ≤1 的孤立墙格删除。反复 4–5 代。The recipe is dumb on purpose: generate a random map with roughly 45% wall cells, then run a few rounds of Life-like rules — walls with 5+ wall neighbors survive, lonely wall cells with ≤1 neighbor die. Iterate four or five generations.
- 为什么成立:噪声里的小团块被规则放大、细长悬丝被剪掉,界面自动收缩到局部最小周长附近——这正是肥皂膜/极小曲面的物理。规则没写“洞穴”二字,洞穴是迭代长出来的。Why it works: tiny blobs get amplified, thin filaments get pruned, and the boundary relaxes toward locally minimal perimeter — the same physics as soap films and minimal surfaces. The word “cave” never appears in the rules; caves emerge from iteration.
- 可带走的方法论:当目标形状难以直接参数化时,别急着设计复杂算法——定义一个廉价噪声和一个“局部规则演化”,让动力学替你迭代收敛到想要的形态。这也是扩散模型等当代技术思想的极早回声。Method to take away: when a target shape is hard to parameterize directly, don't reach for a clever algorithm first. Cheap noise plus local-rule dynamics, iterated, converges for you — a very early echo of the thinking behind diffusion models and other modern techniques.
程序员随想Programmer Reflections
- 文本水印是怎么回事:本质只是“记住那个随机种子”How text watermarking works: at bottom it just means “remember the seed”
- 背景:图像水印是几十年的老技术,而“给 LLM 输出加文本水印”的宣称新且争议——号称便宜、简单、不伤文本质量。Bray 在 2026 年 8 月决定搞懂它,并顺带评价它到底能证明什么。The setup: image watermarking is ancient and works; the claim that LLM text output can be watermarked cheaply and without quality loss is new and contested. In August 2026 Bray dug in to understand it, then offers an opinion on what it actually proves.
- 第一步还原生成过程:LLM 每步产出一个候选词表及其概率(mango:30, lychee:20, papaya:10),再按概率随机选——注意“随机”二字分量很重,因为程序里的随机来自 PRNG。Step one, reverse-engineer generation: an LLM emits, at each token, a shortlist of candidates with plausibility weights (mango:30, lychee:20, papaya:10) and samples from it. The word “randomly” does heavy lifting, because programs get their randomness from a PRNG.
- 第二步抓住 PRNG 的软肋:伪随机由种子完全决定,同种子永远给出同一串数。于是输出文本只取决于三件事:前文+模型内部+那一串随机数。Step two, the PRNG's soft spot: pseudo-randomness is fully determined by the seed; same seed, same endless number stream. So the output text depends only on: preceding context plus model internals plus that number stream.
- 第三步合成检测:验证者如果知道模型和种子,就能重放每一步“模型本来会选哪个词”。若文本中高比例词与重放结果吻合,判定为 AI 生成(且容忍少量编辑)。秘密只有种子本身——所以“水印”约等于“记住种子”。Step three, assemble a detector: a verifier who knows the model and the seed replays “which word the model would pick” at every step. If a high proportion of words match the replay, the text is flagged as generated — and light editing is tolerated. The only secret is the seed, so “watermark” ≈ “remember the seed”.
- Bray 的观点部分:这套机制能证明文本“没被大幅改动过”,并不能像宣传那样证明“由 AI 生成”;更麻烦的是它依赖厂商保密种子——他提醒读者,这是把信任从内容转移到了供应商的数据库。Bray's opinionated part: the mechanism can prove text wasn't heavily edited; it doesn't deliver the stronger marketing claim of proving AI authorship. And it pivots trust from the content to the vendor's secret database — which he flags as the real cost.
- 告诉你的数字解析器数据长什么样:分支预测才是解析速度的主人Tell your number parser what to expect: branch prediction, not parsing, owns the speed
- 场景:fast_float 把 “-731.51” 解析成浮点数只要几纳秒。但解析本质是一串判断——有没有符号、几位数字、小数点在哪——每个判断都是一个 CPU 分支。Setting: fast_float turns “-731.51” into a float in a few nanoseconds. But parsing is a chain of decisions — sign? how many digits? where's the decimal point? — and every decision is a CPU branch.
- 硬件层的账:现代 CPU 不等分支结果,直接猜着往下跑;猜错一次的代价是 15–20 个周期。数据形状稳定时猜得准;一列涨跌交替、符号随机的价格数据里,解析器约 60% 的分支被猜错。The hardware's ledger: modern CPUs don't wait for branch results, they guess and keep running. A misprediction costs 15–20 cycles. When every number looks alike, guesses land; in a column of gains and losses with random signs, about 60% of the parser's branches get mispredicted.
- 他的想法是把你对数据的了解“告诉”解析器:给 from_chars 加模板参数 performance_hints——unpredictable_sign(符号随机,改用无分支处理)、short_numbers(多数数不超过 8 字符,整块读入用位运算,不逐位试)、assume_round_to_nearest(不检查舍入模式)。His idea: let callers “tell” the parser what the data looks like, via template arguments on from_chars — performance_hints like unpredictable_sign (handle the sign branch-free), short_numbers (most inputs ≤ 8 chars: slurp the whole thing with bitwise ops instead of digit-by-digit branching), assume_round_to_nearest (skip the rounding-mode check).
- 诚实的边界:提示不改变解析结果——除了 assume_round_to_nearest,若你的程序真改了舍入模式,结果就会错。这是把契约明码标价。Honest boundary: hints never change results — except assume_round_to_nearest, which really is a promise; change the rounding mode elsewhere and you get wrong answers. The contract is priced explicitly.
- 结果与验证:同一代码在他给定的 Intel Xeon Gold 6338 与 Apple M4 Max 上实测,价格流从 73→105 M/s(Intel)、153→345 M/s(M4)。可带走的一般教训:性能瓶颈常常不在算法本身,而在“你对输入一无所知”——把你已知的先验塞进接口,CPU 的猜测器就能兑现。Measured on his stated Intel Xeon Gold 6338 and Apple M4 Max: the price-stream workload goes from 73→105 M numbers/s and 153→345 M/s with hints on. The general lesson: the bottleneck often isn't the algorithm but the parser's total ignorance of your data — hand the prior knowledge to the interface and let the branch predictor cash it.
- 读故障复盘报告学到的模式:错误处理和配置才是重大事故的常客Patterns from reading postmortems: error handling and config are the regulars in major outages
- Dan Luu 2015 年写这篇文章时,已经在 Google/Microsoft 读了好几年事故复盘,不是做统计分析,而是记录“反复撞见”的模式——读复盘的价值恰恰在于坏事故讲成好故事。When Dan Luu wrote this in 2015 he had spent years reading incident postmortems at Google and Microsoft — not for formal stats but to record the patterns he kept bumping into. Part of the value is that bad failures make well-told stories.
- 模式一:错误处理代码本身出 bug,是重大故障的最大来源。他引 Ding Yuan 的论文:Cassandra/HDFS/Redis 等 48 个关键故障里 92% 源于错误被处理错——25% 干脆忽略错误,8% 抓错异常,23% 是“语句覆盖都能抓到”的低级错误。由此他亮明观点:Go 的显式错误检查不是噪音,“检查错误的代码才是主路径”。Pattern one: bugs in error-handling code are the leading ingredient of serious outages. Citing Ding Yuan's study: of 48 critical failures in Cassandra, HDFS, Redis and friends, 92% came from errors handled wrongly — 25% simply ignored errors, 8% caught the wrong exception, 23% were “statement coverage would have caught it” bugs. His stated verdict: Go's verbose error checks aren't clutter; the error-checking code IS the main path.
- 模式二:配置变更(而非代码变更)才是“全球级宕机”的最常见原因——公开复盘里约一半。代码不敢一次推全球,配置却经常直改直发;结论是配置该和代码走同一套测试+灰度流程。Pattern two: configuration changes, not code changes, cause about half of the publicly-documented global-scale outages. Companies wouldn't ship risky code to every machine at once, yet config goes out with no canary. The implication: config deserves the same test-and-stage pipeline as code.
- 两个模式合起来是一句更冷的话:大家“都知道”错误处理和配置危险,但“知道危险”没有转化成相应的测试与流程投入——常识和预算之间有条鸿沟。Together they form a colder observation: everyone “knows” error handling and config are scary, but knowing hasn't converted into proportional testing and process — there's a gap between common sense and budget.
- 带走的清单:给错误路径单独设计测试(而不是 happy path 测完就宣布胜利);把配置当发布物(review、分批、可回滚);读复盘时专门统计“根因位于哪类代码”,看自己团队是否在同一类上裸奔。The checklist to take home: design tests for error paths, not just happy paths; treat config as a release artifact (reviewed, staged, rollbackable); when reading postmortems, tally which code category the root cause lived in and check whether your team is naked in the same category.
- 为自家 Linux 发行版建包 7 个月,电表给出了答案:98 千瓦时Seven months building packages for a home Linux distro — the meter answered: 98 kWh
- 背景很私人:他给孩子搭了一个基于 Chimera 的个人发行版 Casuarina,把一台 AM4 旧平台(Ryzen 5950X,105W TDP)放洗衣房当构建机,插上智能电表清零计数——“给爱好量一量电”。Private context first: he runs a hobby Linux distro for his kids, Casuarina, built on Chimera. An old AM4 box (Ryzen 5950X, 105W TDP) sits in the laundry room as the build server, plugged into a smart meter he zeroed on day one — measuring the hobby's electricity.
- 总账:2026 年 3 月底到 11 月初,共 98.4 kWh、5201 次包构建(含重试,略虚高),电价 AU$0.33/kWh,合计约 AU$32——平均每月不到 5 澳元。The ledger: late March to early November 2026, 98.4 kWh across ~5,201 package builds (counted from Buildbot logs, slightly inflated by retries), at AU$0.33/kWh — about AU$32, under AU$5 a month.
- 拆开看:满载时电表读 193W;最慢的 Chromium 构建近 4 小时 ≈ 0.77 kWh ≈ 25 分。而 55W 的待机功耗被一个动作省掉——有包要建才按电源键开机。Unpacked: full load drew 193W at the plug; a Chromium build runs nearly 4 hours ≈ 0.77 kWh ≈ twenty-five cents. Idle draw was about 55W, cut by one habit: he only powers the machine on when builds are queued.
- 诚实的口径管理:他明确说真实耗电“大概是两倍”——所有包先在桌面机(170W 的 9950X3D)上过一遍才推给构建机;家里光伏白天吸收了部分构建,这部分他坦承无法计量。Honest bookkeeping: he states the true figure is “likely more than double” — every package was built first on his desktop (a 170W 9950X3D) before the builder, and rooftop solar absorbed daytime builds in an amount he can't attribute.
- 可带走的不是“建发行版很便宜”,而是测量姿势本身:一台智能插座+日志计数,就能把任何爱好/副业服务的电和钱说清楚,并且像他一样把口径的粗糙处主动写出来。The takeaway isn't “distros are cheap” — it's the measuring posture: one smart plug plus log counts turns any hobby into defensible numbers, and writing down your own measurement seams, as he does, is part of the craft.
哲学与生活Philosophy and Life
- 全然投入的一生:84 岁的禅者把病房也当作道场The wholehearted life: an 84-year-old Zen teacher treats the hospital ward as another charnel ground
- 叙述者是医生也是朋友:Joan Halifax 12 天内做了两次开胸手术,术后六周他去看望。麻管里她靠比划“glottis”(声门)救了自己一命——用专业在昏迷里继续照护自己。The writer is both physician and friend. Joan Halifax had two open-heart surgeries within twelve days; six weeks later he visited. Intubated after the first, she saved herself by miming “glottis” until someone wrote the word — using her expertise to keep nursing herself while half-conscious.
- 她五十年的一线是别人的苦难:烧伤病房、监狱诊所、喜马拉雅村落、临终床侧——“没有可治之物时”仍然在场。她也因此数次被自己帮助别人的那几种品质淹没过。Her fifty-year front line has been other people's suffering: burn units, jail clinics, Himalayan villages, bedsides where nothing more can be cured. She was submerged more than once by the very qualities that drew her there.
- 第二次术后她经历 ICU 谵妄:倒挂在苔墙上的温暖、扩展至极乐的声音“你的工作还没做完”。她的解读不是神迹而是练习的成果——recognizing this is death; it's fine。After the second surgery, ICU delirium: warmth on a moss wall expanding into bliss, a voice saying “you're not done with your work yet.” Her reading is not miracle but training made audible — this is death; it's fine.
- 核心的一句是她自己的分类法:把医院住院也列入“尸林道场”(charnel ground,禅修者直面死亡之地)。不是修辞——是把任何极限情境都当成同一门功课的续集:投入而不失据。The key move is her own taxonomy: she adds the hospital ward to the list of charnel grounds — the sites where practitioners face death directly. Not rhetoric: any extreme situation is the same coursework, continued — wholeheartedness without losing your footing.
- 对普通人的可迁移处:一个人如何把“照顾他人而不被烧穿”想明白?她的答案不含神秘主义——承认自己会被打动、会倒下,用一套实践(戒律、禅修、忏悔、重新出发)把自己稳住,然后继续在场。What transfers to ordinary readers: how does one care for others without being burned through? Her answer is not mysticism — admit you can be moved and can collapse, hold steady with a practice (vows, meditation, confession, beginning again), and stay present anyway.
- 化学卫生:Karpathy 把“少接触有害物”排成一个有优先级的个人工程问题Chemical hygiene: Karpathy turns “fewer toxins, please” into a personal engineering problem with priorities
- 起点是他自己的风格:接着写“数字卫生”之后,给“化学品”也立一套个人操作守则,并明说这是“我反复跟朋友唠叨的观点,带个人立场”。The entry point is personal: following his earlier “digital hygiene” piece, he writes an operating guide for chemicals, stating up front this is his own evolving, opinionated rant repeated among friends.
- 方法不是清单堆砌,而是排序原则:只在“$/风险削减比”有共识的类别上下重注——水和空气最优先,因为这两类控制手段的证据和工程都最成熟;食品最难,因为他直说食品供应链被效率最大化了几十年、监管追不上。The method isn't a bigger list — it's a sorting principle: spend heavily only where the dollars-per-risk-reduction are well understood. Water and air rank first because both the evidence and the engineering are mature there; food ranks hardest because, as he puts it, its supply chains have been ruthlessly efficiency-optimized for decades faster than regulators can respond.
- 每类都给出“最小可行动作”:饮水上反渗透+后置矿化(Brita 不够格);空气上 HEPA 净化+拒绝一切燃烧源与香氛(蜡烛、燃气灶、扩散精油全在拒绝之列);购物看标签(有机 PLU 以 9 开头、“pasture raised” 才作数,“free range” 是营销)。Each category ships a smallest actionable move: drinking water = reverse osmosis plus remineralization (Brita isn't enough); air = HEPA purification, refuse combustion and fragrance (candles, gas stoves, diffusers); shopping = read labels (organic PLUs start with 9; only “pasture-raised” counts, “free range” is marketing).
- 有边界感的一节:他不装作什么都清楚——承认很多争议存在(氟化物他标注“有争议”),建议该测的请专业人士测(氡、霉菌、水质),并反复把“风险量级”讲在前面。It has boundary sense: he doesn't pretend certainty — flags the fluoride question as controversial, tells readers to hire professionals for real testing (radon, mold, water panels), and keeps stating magnitudes before details.
- 可带走的元规则:面对“现代生活充满看不见的化学物质”这种弥漫焦虑,把它改写成有限集合+优先级+验收动作——这是工程师把个人健康当成可迭代系统的样本,观点是:多数人的焦虑输在没有排序。The meta-rule to take away: against the diffuse dread of “modern life is full of invisible chemicals,” rewrite it as a finite set + priorities + acceptance checks. His quiet thesis: most people's anxiety loses because it was never sorted.
工具角Tools Corner
- ImgCompress:一个 Docker 容器管完 70+ 图片格式转换、批量压缩与本地 AI 放大ImgCompress: one Docker container for 70+ image formats, batch compression and local AI upscaling
- 具体任务:给博客/文档批量压图、HEIC 转 WebP、PSD/SVG/PDF 互转、抠背景、把小图放大——这些活今天散落在 imagemagick 命令行、在线转换站和 SaaS API 之间,在线站点意味着上传隐私图片。The concrete task: batch-shrinking blog images, converting HEIC to WebP, moving PSD/SVG/PDF around, removing backgrounds, enlarging small photos — today that work is smeared across imagemagick incantations, web converters and SaaS APIs, and web converters mean uploading private pictures.
- 它减少的开销:单容器自托管,文件不出机器;网页 UI 给日常操作,同时附 CLI 给脚本化批处理;离线可用(首次拉镜像后不需要网络)。What it removes: one self-hosted container, files never leave the machine; a web page for everyday operations plus a CLI for scripted batches; works offline after the first image pull.
- 上手最短路径:docker compose 拉起一个服务,浏览器打开即可;AI 抠图与放大(最高到 16K)内置在容器里,不配 API key。Shortest on-ramp: bring it up with docker compose, open in a browser. The AI background-removal and upscaling (to 16K) run inside the container with no API key.
- 代价与限制:AI 功能吃本机 GPU/CPU,老机器上放大会慢;项目成熟度中等(README 说 v1.0 刚加入编辑器与 SVG 导入),批量策略要先在自己的样例图上验证色彩与元数据是否保留。Costs and limits: the AI paths burn local GPU/CPU — enlarging crawls on old hardware; the project is young (v1.0 added the editor and SVG import), so validate color and metadata handling on your own samples before batch use.
- 适配人群:需要“偶尔处理图片”又不想养第三方服务的独立开发者——比装 DataViz/Photoshop 轻,比裸 imagemagick 多了网页界面。Who it fits: solo devs who “occasionally process images” and don't want another SaaS — lighter than Photoshop, friendlier than bare imagemagick.
- Waymark:用 Postgres 就能得到“扛重启的后台任务”,不再自建整套调度层Waymark: durable background jobs with just Postgres — no extra scheduling infrastructure
- 具体任务:发欢迎邮件给一批用户、跑数据回填、编排长流水线——这类活用 cron+脚本会在服务器重启或任务半途崩溃时丢状态;用 Celery/Temporal 又要多养一整套 broker/集群。The concrete task: sending welcome emails to a cohort, running backfills, orchestrating multi-step pipelines. Cron scripts lose state when the server reboots mid-job; Celery/Temporal make you operate a whole extra broker or cluster.
- 它减少的开销:状态全部存在 Postgres 里(多数小项目本来就有 Postgres),没有第二个基础设施要运维;client 和 server 装在同一个 Python 包里,uv add waymark 即起。What it removes: all durable state lives in Postgres — which small projects usually already run — so there's no second piece of infrastructure; client and server ship in one Python package (uv add waymark).
- 模型很短:@action 是你的普通异步函数(分布式的工作单元),@workflow 是耐久控制流——获取用户、过滤、并行 fan-out 发信,进程重启后 workflow 从 Postgres 里续跑;重试、超时、cron 调度、内置 web 面板都是一等配置。The model is short: @action marks plain async functions as distributed work; @workflow marks the durable control flow that calls them (fetch users, filter, fan-out emails). After a crash or restart the workflow resumes from Postgres; retries, timeouts, schedules and a built-in web view are first-class.
- 上手最短路径:跑 quickstart(Python 优先),example_app 目录里是完整可抄的样板;部署用 docker-compose。Shortest on-ramp: follow the Python quickstart; example_app is a copy-able real app; deploy via docker-compose.
- 代价与限制:Rust server+Python client 的组合意味着非 Python 栈要等后续语言绑定;控制流“已知问题”文档明列(官方自己标注哪些结构不支持);作为单 Postgres 方案,超高吞吐场景需自查瓶颈。Costs and limits: a Rust server plus Python client means other stacks wait for future language bindings; the docs list known control-flow gaps honestly; if you live on Postgres already this is cheap insurance, but check throughput assumptions before replacing a tuned Celery setup.
- 用 Typst 在构建期生成 OpenGraph 图:Astro 博客的一次去浏览器化OpenGraph images with Typst at build time: de-browserizing an Astro blog
- 具体任务:社交链接卡片要有 og:image。原办法两条路:去 Unsplash 找图(无聊且容易出错)或起 headless browser 截图(一套 Chromium 依赖+构建时间)。The concrete task: link previews want an og:image. The author's old options were searching Unsplash for a stock photo (boring and error-prone) or screenshotting with a headless browser (a Chromium dependency plus build minutes).
- 它减少的开销:Typst 是纯编译器(LaTeX 与 Markdown 的孩子),typst compile --format png 直接从模板渲染 PNG——没有浏览器、没有外部图、构建期一次完成,og 图从此跟正文同一套版本管理。What it removes: Typst is a pure compiler — typst compile --format png renders a PNG straight from a template. No browser, no external image, done at build time, and your cards join the same version control as your text.
- 关键机制:--input key=value 把参数送进模板(sys.inputs),模板定义卡片版式;Astro 的构建钩子里对每篇 post 调一次,标题/摘要/日期自动灌入。The mechanism: --input key=value feeds parameters into the template via sys.inputs; the .typ file defines the 1200×630pt card; Astro's build hook calls Typst per post, injecting title, description and date.
- 最短上手:写一个 1200×630pt 的 .typ 模板(文中给了带 Comic Sans 的玩笑版和正式版),本地 typst compile 看效果,再把命令接进 CI。Shortest on-ramp: write one template (the post ships both a joking Comic Sans version and a real one), test with typst compile locally, wire the command into CI.
- 限制:卡片样式受限于 Typst 的图形语言(复杂插画仍需别的工具);字体需随模板打包;这是作者的个人配方而非官方工具链——好在全文可抄。Limits: card design is constrained to Typst's graphic language (elaborate art needs other tools), fonts must ship with the template, and this is one author's recipe rather than official tooling — but the whole thing is copy-pasteable.
- EyesRhythm:用摄像头在本地量“眨眼节律”,盯着屏幕的人多了一个仪表EyesRhythm: a local webcam blink-rhythm gauge for people who stare at screens
- 具体任务:长时间盯屏时眨眼频率减半、且不均匀(阵发+干旱),这是干眼与视疲劳的已知推手——但人察觉不到,直到眼睛疼。桌面开发者需要一面“仪表”。The concrete task: focused screen time roughly halves your blink rate and makes it uneven (bursts and droughts), a known driver of dryness and strain — invisible until your eyes hurt. Desk people need a gauge.
- 做法:本地摄像头实时检测眨眼,把“频率×规律性”合成一个 Ocular Rhythm Index(0–100),附 5 分钟滚动波形;Poise 另记头的朝向分布,提醒你转头补上没转过的方向。The approach: a local webcam detects blinks in real time and folds rate and regularity into an Ocular Rhythm Index (0–100) with a rolling 5-minute trace; Poise tracks which way your head turned and prompts the directions you skipped, to unglue neck and shoulders.
- 它减少的开销/替代什么:不需要 Fitbit、不需要云——无账号、无视频出机器(官网强调 on-device);常驻一个小窗,只在你盯屏时计数。What it replaces: no wearable, no cloud — no account, no video leaves the machine (emphatically on-device); a compact always-near window that counts only while you're at the screen.
- 上手:下载 Mac/Windows 客户端即用,两分钟练习模式当“教练”建立习惯;提醒可设视觉脉冲或声音。On-ramp: install the Mac/Windows app and go; a two-minute practice mode coaches the habit; alerts can be a quiet visual pulse or sound.
- 代价与限制:作者自称 wellness companion 而非医疗器械,持续不适应看眼科;摄像头常驻带来隐私心理成本(好在全部本地);Mac/Windows 优先,Linux 支持状态需查最新文档。Costs and limits: the authors call it a wellness companion, not a medical device — persistent discomfort belongs to an eye-care professional; an always-on camera has a psychological privacy price even when local; Mac/Windows first, so check current docs for Linux status.