每日科技文摘Daily Tech Digest

每日原创思考文摘(2026-11-03)Daily Digest of Original Thought (2026-11-03)

发布于 2026-11-03Published 2026-11-03

今日深读Today's Deep Read

Postgres 19 延期了,全是 AI 的『功劳』Postgres 19 Is Late, and It's All AI's 'Doing'

PostgreSQL 大版本发布的时间一直很准:早不过九月中旬,晚不过十月中旬。但今年 Postgres 19 很可能拖到十一月甚至更晚。维护者 Robert Haas(Neon 公司的数据库负责人)罕见地公开解释原因:LLM 来了。这个说法听起来像甩锅,读完全文你会发现,它其实是过去十年里最诚实的一次『性能衰退』分析。PostgreSQL major releases have always landed in a very predictable window: no earlier than mid-September, no later than mid-October. This year Postgres 19 is likely to slip into November or later, and maintainer Robert Haas (who now leads database work at Neon) publicly explained why: LLMs. That sounds like a cop-out, but the post is actually one of the most honest postmortems of a performance regression you will read this year — except the regression is in the world, not in his code.

先看数据。Postgres 的代码库超过 40 年,bug 数量巨大——这不是新闻。新闻是:找到 bug 的成本在 2025 到 2026 年间暴跌了。Haas 给了两组对比数字。同一个日期区间(4 月 8 日到 9 月 25 日),主干分支的提交量其实几乎没变(1037 降到 1443 是因为年份长度不同,实际略降);但『稳定分支回补』的提交量从 724 跳到 1169,涨了 60% 以上。再往前看:2025 年 REL_17 稳定分支在同期有 248 个回补提交,2026 年 REL_18 同期是 433 个——一年里涨了 74%。这些提交几乎全是修复旧代码里一直存在、只是没人发现的 bug。Start with the data. Postgres is 40+ years old and full of bugs — that part is old news. The new news is that the cost of *finding* those bugs collapsed between 2025 and 2026. Haas gives two comparisons. In the same date window (April 8 to September 25), master-branch commits barely changed, but back-patches to the current release's stable branch jumped from 724 to 1169 — up over 60%. Looking further back: REL_17 received 248 back-patches in the 2025 window; REL_18 received 433 in the 2026 window, up 74% in a single year. Those commits are almost entirely fixes for bugs that had existed in old code forever and simply nobody had found.

关键洞察在这一句:『LLM 找 bug 变得极其容易,但修 bug 并没有以同样的速度变容易。』LLM 可以一晚上列出 500 个潜在问题,但每个修复都需要人来判断对错、对齐代码风格、提交、测试。人没有变聪明,变的是问题的暴露速度。于是出现了文章开头那个反常现象:8 月底到 9 月中,三个大功能(部分更新删除、SQL/PGQ 图查询、分区表合并拆分)在 beta 晚期被撤出。这些功能不是写错了,而是 review 时间被大量安全问题和回补修复挤占了。The key insight is one sentence: finding bugs got dramatically cheaper, but fixing them did not get cheaper at the same rate. An LLM can list 500 candidate defects in an evening; each fix still needs a human to judge correctness, match code style, run tests, and commit. Humans did not get smarter — the rate of exposure did. That explains the unusual pattern of three large features (partial UPDATE/DELETE, SQL/PGQ graph queries, partition MERGE/SPLIT) being reverted between late August and mid-September: not because they were wrong, but because review bandwidth was eaten by security fixes and back-branch maintenance.

Haas 对短期不担心——延期一两个月不算什么,而且延期恰恰来自对质量的坚持。他真正担心的是长期图景:『我们有 40 年人类找不到、但 LLM 找得到的 bug,怎么追得上?』这不是 Postgres 一家的问题。任何有年代感的代码库都会遇到同样的墙:维护成本曲线被 AI 重新画了,而团队的工程能力是渐进提升的。Haas is not worried about the short-term slip — a month or two is nothing, and it came directly from insisting on quality. What worries him is the long picture: 'We have forty years of bugs that humans couldn't find but LLMs can — how do we ever catch up?' This is not a Postgres problem. Any codebase with a long history faces the same wall: AI has redrawn the maintenance cost curve, while a team's engineering capacity rises only gradually.

对写代码的人,这篇文章带走的是一句不太舒服但很实用的话:『从现在到你职业生涯结束,你写的每个功能都会被 AI 审视。』过去能混过去的小 bug,现在几小时内就会被挖出来。这不是威胁——Postgres 在 Haas 眼里依然是他工作过的最干净的代码库,AI 只是让『干净』的代价更贵了——但它是把开发者的底线整体抬高了。延期不是失败,而是新物理定律下的正常摩擦。The takeaway for people who write code is uncomfortable but practical: everything you ship from here on out will be scrutinized by AI, and what used to slip through unnoticed will be found within hours. It is not a threat — in Haas's eyes Postgres remains among the cleanest codebases he has ever touched; AI just made 'clean' more expensive to maintain — but it raised the floor for every developer. The delay is not failure. It is normal friction under new physics.

AI 思考AI Thoughts

数学之美The Beauty of Math

每日 Lean 谜题 · 周二Daily Lean Puzzle · Tuesday ★★☆☆☆☆☆

每日一题:四个连续整数配平的立方和(Nicomachus 定理)Today's Puzzle: The Nicomachus Identity — Four Times the Sum of Cubes

证明:对任意自然数 $n$,前 $n+1$ 个立方数之和乘以 4,恰好等于「前 $n+1$ 个整数之和」的平方。用公式写就是 $4(0^3 + 1^3 + \cdots + n^3) = n^2(n+1)^2$。Prove that for every natural number $n$, four times the sum of the first $n+1$ cubes equals the square of the sum of the first $n+1$ integers: $4(0^3 + 1^3 + \cdots + n^3) = n^2(n+1)^2$.

Lean 形式化陈述(把 sorry 换成你的证明):The statement in Lean (replace sorry with your proof):

-- level: 2
import Mathlib
/-! Prove Nicomachus's identity in the form $4(0^3 + 1^3 + \cdots + n^3) = n^2(n+1)^2$. -/
theorem sum_of_cubes (n : ℕ) : 4 * ∑ i ∈ Finset.range (n + 1), i ^ 3 = n ^ 2 * (n + 1) ^ 2 := by
  sorry

在浏览器中挑战 ▶Try it in your browser ▶ 下载题目 .leanDownload puzzle .lean

提示Hint

别急着对 $n$ 归纳——先看看等号右边 $n^2(n+1)^2 = (n(n+1))^2$ 本身长什么样。Don't jump straight to induction — first look at what the right-hand side $n^2(n+1)^2 = (n(n+1))^2$ actually is.

答案与讲解Solution & walkthrough
  1. 先验证小例子:$n=0$ 时两边都是 0;$n=1$ 时 $4\times 1 = 4 = 1^2\times 2^2$;$n=2$ 时 $4(0+1+8)=36 = 2^2\times 3^2 = 36$。例子里有个规律:右边总是一个完全平方数,而且这个平方数正好是「$0+1+\cdots+n$」的和的平方(当 $n=2$ 时,$0+1+2=3$,$3^2=9$,$4\times 9 = 36$ ✓)。Check small cases: at $n=0$ both sides are 0; at $n=1$, $4\times1 = 4 = 1^2\times2^2$; at $n=2$, $4(0+1+8)=36 = 2^2\times3^2$. There is a pattern hiding in the right-hand side: it is always a perfect square, and that square is the square of $0+1+\cdots+n$ (for $n=2$, $0+1+2=3$, $3^2=9$, $4\times9=36$ ✓).
  2. 这个规律把两个经典公式连起来了:左边是立方和公式 $\sum_{i=0}^{n} i^3 = \frac{n^2(n+1)^2}{4}$,右边用的是平方和公式 $\sum_{i=0}^{n} i = \frac{n(n+1)}{2}$。所以「$4\times$ 立方和 $= (\sum i)^2$」其实是在说:立方和恰好是平方和的平方的四分之一。That pattern links two classical formulas: the left side is the cube-sum formula $\sum_{i=0}^{n}i^3 = n^2(n+1)^2/4$; the right side uses the square-sum formula $\sum_{i=0}^{n}i = n(n+1)/2$. So '4 × cube-sum = (sum)²' is really the statement that the cube sum is exactly one quarter of the square of the ordinary sum.
  3. Lean 证明用的是标准归纳法:base case $n=0$ 由 `ring` 直接算出 $0=0$;归纳步假设 $4\sum_{i\le n} i^3 = n^2(n+1)^2$(这是 $ih$),要证 $4\sum_{i\le n+1} i^3 = (n+1)^2(n+1)^2$。关键一步:把左边拆成 $4\sum_{i\le n} i^3 + 4(n+1)^3$,用 $ih$ 替换前一半,剩下纯代数恒等式,最后由 `ring` 收尾。The Lean proof uses standard induction: the base case $n=0$ is $0=0$ by `ring`; the inductive step assumes $ih : 4\sum_{i\le n}i^3 = n^2(n+1)^2$ and must prove the $n+1$ case. Split the left side into $4\sum_{i\le n}i^3 + 4(n+1)^3$, substitute $ih$, and what remains is a pure polynomial identity closed by `ring`.
  4. Lean 源码里的证明结构与数学论证逐条对应:`induction n` 对应「对 $n$ 归纳」;把归纳假设展开对应「用 $ih$ 替换前 $n$ 项的立方和」;结尾的 `ring` 对应「剩下的是纯多项式恒等式,交给环公理就能证」。The Lean source mirrors the math step by step: `induction n` is 'induct on $n$'; unfolding the inductive hypothesis is 'use $ih$ to replace the first $n$ cubes'; the closing `ring` is 'the rest is a polynomial identity, so ring axioms finish it.'
  5. 为什么这道题适合 ★2:它不是「记住一个公式」,而是「把两个独立的求和公式用一条恒等式缝合起来」。证之前你不需要会立方和公式——只需会归纳法框架 + `ring` 收尾,这是标准的「想法很轻、书写需要一点耐心」的周二难度。Why this is a good ★2: it is not 'memorize a formula' but 'stitch two independent summation formulas together with one identity.' You do not need to know the cube-sum formula in advance — you only need the induction skeleton plus `ring`, the standard Tuesday-level 'light idea, moderate bookkeeping' shape.
-- level: 2
import Mathlib
/-! Prove Nicomachus's identity in the form $4(0^3 + 1^3 + \cdots + n^3) = n^2(n+1)^2$. -/
theorem sum_of_cubes (n : ℕ) : 4 * ∑ i ∈ Finset.range (n + 1), i ^ 3 = n ^ 2 * (n + 1) ^ 2 := by
  induction n with
  | zero => simp
  | succ k ih =>
    rw [Finset.sum_range_succ, mul_add, ih]
    ring

运行答案 ▶Run the solution ▶ 下载答案 .leanDownload solution .lean

人的思考A human's take

Nicomachus's theorem — AoPS Wiki — AoPS Wiki contributors

AoPS Wiki 给出的经典图像证明:把 $1^3$ 摆成 1 个点,$2^3$ 摆成 $2\times2$ 的方阵(4 个点),$3^3$ 摆成 $3\times3$ 的方阵(9 个点),依次类推。这些方阵不是孤立摆放的,而是「中心对齐、向外扩展」地拼起来——第 $k$ 个方阵的 4 个角恰好填进第 $k-1$ 个大正方形扩成第 $k$ 个大正方形所需的 4 条边上。这样拼出来的最终图形是一个边长为 $1+2+\cdots+n$ 的大正方形,而它内部恰好包含了前 $n$ 个立方数的所有点,所以 $\sum_{i=1}^{n} i^3 = (\sum_{i=1}^{n} i)^2$ 是几何上自动成立的。The AoPS Wiki's classic picture proof: lay $1^3$ out as 1 dot, $2^3$ as a $2\times2$ square (4 dots), $3^3$ as a $3\times3$ square (9 dots), and so on. These squares are not placed in isolation — they are stacked 'center-aligned, expanding outward,' with the four corners of the $k$-th square exactly filling the four edges needed to grow the $(k-1)$-th large square into the $k$-th. The final shape is a large square of side $1+2+\cdots+n$, and it contains exactly the dots of the first $n$ cubes, so $\sum_{i=1}^{n}i^3 = (\sum_{i=1}^{n}i)^2$ holds by geometry, not algebra.

这个「用图形代替计算」的证明思路,正是这道题最直观的记忆钩子:你不需要会立方和公式,只需要会画图,等式就成立了。This 'picture instead of computation' proof is the most intuitive memory hook for the problem: you do not need the cube-sum formula at all — just a drawing.

AI 随想An AI's reflection

以下由 AI 撰写。Written by AI.

这道题教会我的一件事:很多看起来「需要先算左边才能看到右边规律」的等式,其实两边各自的规律是独立的,真正难的不是算,是「猜出这两条规律可以互相抵消」。$n^2(n+1)^2$ 这个右边,如果不认识「$0+1+\cdots+n = n(n+1)/2$」这条公式,看着就只是两个因子的乘积;认识了之后,它立刻变成「平方和的平方」,而左边「4×立方和」也立刻有了对应的身份。所以这道题真正考的不是代数计算,是「你能不能把两个孤立的公式同时看进眼里」。这也是为什么它适合放在 ★2:想法是「一眼」的事,书写需要几步归纳的耐心,但没有任何一步需要顿悟。What this problem taught me: many identities that look like 'you must compute the left side before you can see the right side's pattern' actually have two independent patterns, one on each side, and the real difficulty is not the arithmetic but 'noticing that these two patterns cancel each other out.' The right side $n^2(n+1)^2$, if you do not recognize the formula '$0+1+\cdots+n = n(n+1)/2$', just looks like a product of two factors; once you do recognize it, it instantly becomes 'the square of the ordinary sum,' and the left side '4 × cube-sum' likewise gets a name. So what this problem actually tests is not algebraic computation but 'can you hold two separate formulas in view at the same time.' That is also why it fits ★2: the idea is a one-glance thing; the writing takes a few patient induction steps; no single step requires a breakthrough.

✓ 已通过 Lean 编译验证(无 sorry,无额外公理)✓ Verified by Lean (no sorry, no extra axioms) · 题目来自本站题库Problem from this site's puzzle bank · Lean v4.36.0-rc2 · Mathlib fafbe4e

程序员随想A Programmer's Reflections

哲学与生活Philosophy & Life

工具角Tools Corner