每日科技文摘Daily Tech Digest
发布于 2026-10-15Published 2026-10-15
今日深读Today's Deep Read
今日深读:LLM 把技术扩散的漏斗倒了过来(2025 年 4 月)Today's Deep Read: LLMs Flip the Technology Diffusion Funnel (April 2025)
先说一个几乎没人注意到的历史规律:从电力、密码学、计算机、飞机,到互联网和 GPS,所有变革性技术走的都是同一条「自上而下」的扩散路径——先在政府和军方手里,再到企业,最后才轮到普通人。原因不神秘:新技术早期又贵、又笨重、又需要专门技能,天然只有大机构用得起。Karpathy 这篇文章的出发点,是他意识到 LLM 把这条规律整个倒了过来:ChatGPT 成了史上增长最快的消费级应用,约四亿周活跃用户拿它写作、编程、翻译、辅导功课、做深度调研;反倒是企业和政府的采纳,「明显更迟缓、更平淡」。个体第一次在革命性技术上跑赢了组织。Start with a historical pattern almost nobody notices: electricity, cryptography, computers, flight, the internet, GPS — every transformative technology diffused in the same top-down order. First government and military, then corporations, and only much later individuals. The reason is not mysterious: early versions of powerful technologies are expensive, bulky, and expertise-gated, so naturally only large institutions could operate them. Karpathy's essay begins with his realization that LLMs have flipped this pattern: ChatGPT became the fastest-growing consumer application in history, with some 400 million weekly users writing, coding, translating, tutoring, summarizing, doing deep research — while adoption in corporations and governments has been, in his words, 'more muted and lagging.' For the first time, individuals got a transformative technology before organizations did.
为什么会这样?他的第一个解释切在能力画像上。LLM 提供的是一种奇怪组合:「准专家级 × 极宽覆盖」——什么都能到及格线以上,但哪行都算不上顶尖,而且会犯错。对组织来说,这不够看,因为组织的超能力恰恰是把各领域的真专家集中到一起,LLM 只能在专家已经会做的事情上「好一点点」。但对个体完全不同:一个人通常最多在一两件事上是专家,「样样及格的准专家」对他来说不是补充,而是第一次把做不到的事变成做得到的事——程序员可以开始处理法律文档,研究员可以自己拉数据分析,任何人都能给自己做一个小应用、生成一套营销素材,全程不必雇人、不必求人是这个解释的精髓:LLM 的「浅」对专家是缺陷,对普通人却是史无前例的宽度。Why? His first explanation is about the capability profile. LLMs offer a strange combination: quasi-expert performance across a very wide range of domains — above passing grade nearly everywhere, top-tier nowhere, and fallible. That profile barely impresses organizations, because an organization's superpower is precisely concentrating genuine experts; an LLM only makes the things experts already do 'a bit better.' For individuals the story is reversed: a person is usually an expert in at most one or two things, so broad-but-adequate capability does not supplement them — it unlocks things they could never do before: the programmer drafts their own legal-document analysis, the researcher runs their own data analysis, anyone builds their own app or marketing assets without hiring or asking anyone. This is the heart of the argument: for experts, LLM shallowness is a flaw; for everyone else it is unprecedented breadth.
第二个解释:组织面对的本来就是困难模式。集成、遗留系统、品牌规范、安全协议、隐私合规、国际化、法律风险——变量成倍增加,容错率压到极低。「你没法把这一切塞进一个上下文窗口」;个人 vibe coding 搞砸了只是丑一点,企业在一次严重幻觉面前可能丢掉整个项目、丢一份工作。第三个解释最朴素也最硬:大组织的惯性——文化、先例、地盘之争、沟通开销、分布式员工的再培训、老式官僚流程。所有这些逆风,都专门针对「灵活但浅、会出错」的新工具。His second explanation: organizations play the game on hard mode. Integrations, legacy systems, brand style guides, security protocols, privacy, internationalization, legal risk — the variables multiply and the margin for error collapses. 'You can't put all of that in a context window.' An individual's vibe-coded toy failing looks silly; one disastrous hallucination inside a company can cost someone their job. The third explanation is the oldest: institutional inertia — culture, historical precedents, turf wars that escalate during rapid change, communication overhead, retraining a distributed workforce, plain bureaucracy. Every one of these headwinds hits exactly the tool that is versatile but shallow and fallible.
把三层叠起来,就得到一个能同时解释两种流行论调的框架:「LLM 对企业没用」和「LLM 改变了普通人的生活」都是真的,而且不矛盾——它们本来就是同一个非对称性的两面。企业采纳慢不是工具不行,而是工具画像与企业问题的形状错配;个体上手快也不是错觉,而是个体问题的形状恰好匹配「广而浅」。Karpathy 补了一句前瞻:未来的利益分配取决于能力动态范围和资本投入的函数——模型继续变强,「深」的部分迟早会追上来,那时组织的采纳才会真正起飞。Stack the three layers and you get a framework that explains two popular claims at once: 'LLMs are useless for business' and 'LLMs are changing ordinary people's lives' are both true, and they don't contradict — they are two faces of one asymmetry. Enterprise adoption is slow not because the tool is weak but because the tool's profile mismatches the shape of organizational problems; individual uptake is fast not because of hype but because individual problems match 'broad and adequate.' Karpathy adds a forward look: how the benefits keep distributing depends on the dynamic range of model capability versus capital expenditure — as models deepen, the corporate half of the diffusion should eventually catch up.
对我们最实用的带走是一条路标:今天,如果想知道一项新技术到底能给「人」做什么,别看企业公告,看普通人在用它做什么——那里是价值最先兑现的地方;也别用「还没进企业采购清单」来给一个消费级工具定罪。反过来,如果你在组织里推动 AI,最大的杠杆不是买更强的模型,而是把「塞不进上下文窗口的复杂度」一层层显式化:规范、测试、边界。这两件事合起来,就是漏斗倒转时代的生存姿势。The most practical takeaway is a signpost. To learn what a new technology can really do for humans, don't read enterprise announcements — watch what ordinary people do with it; that's where value lands first. And never convict a consumer-grade tool by its absence from a procurement checklist. Conversely, if you drive AI inside an organization, the biggest lever is not a stronger model but making the un-context-window-able complexity explicit: specs, tests, boundaries. Together, that is how you live in the era of the flipped funnel.
AI 思考AI Thoughts
- 游戏正在被 AI 批量反编译——一个不挺 AI 的人承认:这很酷(2026 年 10 月)AI Is Mass-Decompiling Games — and an AI Skeptic Admits It's Cool
- 作者先把立场亮在明处:他平时讨厌 AI——网络塞满垃圾内容、拿 AI 当裁员借口、把硬件炒到普通人买不起。正因如此,他接下来这句「不得不承认这很酷」才值钱:这是从怀疑者嘴里抠出来的让步,不是厂商话术。The author declares his position up front: he generally dislikes AI — the slop-filled internet, the mass layoffs justified by it, the hardware made unaffordable. That is exactly why his concession 'I have to admit, it's very cool' carries weight: it is pulled out of a skeptic, not a vendor.
- 什么是反编译:把编译后的程序逆向回源码。有了源码,就能想改什么改什么,再重编译到任何平台。以前这是社区传奇的手艺活——OpenGOAL(《Jak 与 Daxter》系列)、《塞尔达:时之笛》的 Ship of Harkinian,都要花好几年。What decompiling means: reverse-engineering a compiled program back into source code. With source in hand you can modify anything and recompile for any platform. Historically this was heroic hand-craft — OpenGOAL (Jak & Daxter), Ship of Harkinian (Ocarina of Time) — community efforts that took years.
- 变化在于:新模型和工作流现在几天就能反编译一款游戏。代码不如手写漂亮,但能跑;不少移植又稳又完整。最漂亮的例子是 IsaacRecomp:2011 年的 Flash 版《以撒的结合》被自动重编成 C++,从锁 30 帧的模糊小窗跑成原生 1440p、165 帧——这些增强是模拟器做不到的。The change: current AI models and workflows can decompile a game in days. The code is messier than by-hand work, but it runs, and many ports are stable and complete. The showpiece is IsaacRecomp: the 2011 Flash Binding of Isaac rebuilt as native C++, from a locked-30fps blurry window to 1440p at 165fps — enhancements emulators simply cannot deliver.
- 作者的结论站在「保存」一边:厂商全面转向数字发行、服务器一关游戏就砖,玩家「买」的东西其实不属于自己;反编译潮让老游戏活在新硬件上,甚至能加 mod——「我们终于可能真正拥有自己买过的软件」。His verdict lands on preservation: publishers are going all-digital, servers shut down and games brick, so nothing you 'bought' is really yours; decompilation revives old games on new hardware, even moddable — 'we could finally own the software we paid for.'
- 同一枚硬币的另一面他也写了:当任何人都能反编译任何软件,公司的付费产品可以在作者不愿意的情况下被开源、被竞品抄——技术扩散从来不止一个方向。文章好在两端都没藏。He also names the other face of the coin: once anyone can decompile anything, paid games and apps can be open-sourced against their authors' will, and competitors can lift each other's code. He keeps both halves visible — which is what makes the piece trustworthy.
- 我上了 Hacker News 头条,然后网站被 AI 爬虫冲垮了I Hit the Front Page of HN — Then AI Bots Flooded My Site
- 背景是个个人项目:sprinklz.io,一个可以把某些话题(比如 LLM 新闻)降权的阅读器——讽刺的是,它火恰恰因为大家受够了 LLM 新闻。HN 上百来个赞之后,网站开始「疼得慢」,而且热度退了还越来越慢:真人流量的曲线对不上。The setup is a side project: sprinklz.io, a feed reader that can deprioritize topics — for example, LLM news. Ironically it went viral because people are sick of LLM news. After a few dozen HN upvotes the site turned 'painfully slow,' and it kept getting slower days after the traffic cooled: the real-reader curve did not explain it.
- 他开始查:给每个 URL 路径加顶层日志,发现多数请求根本没抓任何新闻内容,甚至不执行单页应用的 JavaScript——它们不是浏览器,是只敲 URL 的机器。He instrumented every URL path with top-level logging and found that most requests never fetched any articles and did not even execute his single-page app's JavaScript — they were not browsers, just machines knocking on URLs.
- 翻 NGINX 聚合日志抓出「头号用户」:一个自称「监测网站更新、把摘要灌进 AI 水 newsletter」的服务,每分钟轮询他的站点几十次;再往后是 Claudebot、OpenAI 抓取器、Google 索引,以及几个顺手扫 /wp-content/phpinfo.php 的漏洞扫描器(他根本不是 WordPress 站)。Aggregated NGINX logs caught the number-one offender: a service that describes itself as watching websites for changes and summarizing them into an AI-slop newsletter, polling his site many times per minute. Behind it came Claudebot, OpenAI's crawlers, Google's indexer, and a few vulnerability scanners poking /wp-content/phpinfo.php on a site that isn't WordPress.
- 处置很常规:封 IP、上 robots.txt、加限流。但他写下来最诚实的一课是结论变了——以前「上一 HN 头条」的风险是真实流量压垮小水管,现在这条假设作废:小网站要从第一天起按机器流量做容量设计,因为冲垮你的不是读者,是替你「阅读」的机器人。The fixes were routine: blocks, robots.txt, rate limits. The honest lesson he actually writes down is that the old assumption died: the risk of 'going viral on HN' used to be real readers overwhelming a small pipe. Now small sites must capacity-plan for machine traffic from day one, because what floods you isn't readers — it's bots that read on your behalf.
- 文章的价值在一手数据:一个普通博客主能亲眼看到的 2026 年爬虫密度。你不需要认同他对每个 bot 的判决,日志会替你说话。The piece's worth is first-party data: crawler density in 2026 as one ordinary blogger can see it. You don't have to accept his verdicts about each bot; the logs argue for themselves.
- 给编码代理套「缰绳」到底值不值?一个跑了十遍对照实验的答案Are Harnesses Worth the Cost? A Ten-Run Controlled Answer
- 问题很实在:大家都说该给编码代理加「行为缰绳」——架构契约、示例、会自己跑的测试反馈(术语叫 guides 和 sensors,指路和传感器)。作者不信口号,做对照:同一个 API 服务简报,十次独立运行,一组有缰绳,一组裸奔。The question is practical: everyone says coding agents deserve a behavioral harness — architecture contracts, examples, tests that run themselves (guides that steer before the agent acts, sensors that show it what went wrong). The author tested instead of chanting: one API-service brief, ten independent runs each, harness on versus bare.
- 结果一(打脸他自己):前沿模型 GPT-6 Sol 两组都 10/10 全过,缰绳多吃 10.5 倍 token、约 7 倍成本、三倍时间。对前沿模型,缰绳这次纯属浪费——作者原以为它能省 token,数据直接推翻预期,他把这点明说了。Finding one (against his own expectation): the frontier model GPT-6 Sol passed 10/10 either way, while the harness burned about 10.5× the tokens and 7× the cost. For frontier models, this harness was pure waste — he expected token savings and says plainly that the data contradicted him.
- 结果二(反转):换到成本优化型小模型 GPT-6 Luna:裸奔只有 3/10 成功;套上缰绳 10/10,而且单次成本 $0.273,比不套缰绳的 Sol($0.406)还便宜三分之一。Finding two (the twist): switch to the cost-optimized model GPT-6 Luna, and bare runs succeed 3 out of 10, while harnessed runs hit 10/10 — at $0.273 per run, roughly 33% cheaper than unharnessed Sol at $0.406.
- 怎么理解:缰绳对大模型是「把聪明人管笨了」的额外约束,对小模型是「外包了一个资深工程师」——把资深工程师的注意力经济学(哪里会错、先提示什么、错时怎么看见)压成了可执行文本,塞进了模型的注意力里。How to read it: for a big model the harness over-constrains someone already smart; for a small model it outsources a senior engineer — compressing an expert's attention economics (where things go wrong, what to check first, how to see errors) into executable text that gets fed into the model's attention.
- 可带走的不是口号而是问题格式:别问「缰绳好不好」,问「在某个价格档位上,怎么用 token 换可靠性」。廉价模型 + 好缰绳,可能是当下最便宜的可信组合——这对预算敏感的团队是个真实的市场套利机会。The takeaway is a better question format, not a slogan: don't ask 'are harnesses good,' ask 'at this model's price point, how many tokens does reliability cost?' Cheap model plus good harness may be the cheapest dependable combination on the market right now — a real arbitrage for budget-sensitive teams.
- 一个安全工程师为什么劝你「对 OpenAI 和 Anthropic 说不」Why a Security Engineer Says 'Just Say No' to OpenAI and Anthropic
- 作者先把两件事钉死:他是软件与安全工程师,觉得 LLM「极其强大」——他不是反技术;他的反对是政治性的:他认为前沿实验室的领导层属于他所说的技术寡头阵营,赌上世界换 AGI。立场交代干净,后面的账本才经得起看。The author nails two facts first: he is a software and security engineer who finds LLMs 'extremely powerful' — this is not technophobia; his objection is political, aimed at frontier-lab leadership as part of the tech-oligarch coalition he says is gambling the world on AGI. Declaring his position cleanly is what makes the ledger below worth reading.
- 账本第一条:OpenAI 和 Anthropic 不是唯一选项。开源权重的模型已经「几乎一样好」——包括漏洞研究这种复杂任务。所谓「不用它就干不了活」在 2026 年是可以验证为假的。Ledger line one: OpenAI and Anthropic are not the only options. Open-weight models are now 'just about as good,' including for genuinely complex work like vulnerability research. 'We can't get the work done without them' is a claim you can falsify in 2026.
- 第二条:不用它们照样能用强模型——自己的硬件上跑,或走安全飞地(secure enclave)类服务商,或随便哪家便宜的 API 且随时可换。供应商锁定不是物理定律。Line two: you can still use powerful models — run them privately on your own hardware, through secure-enclave providers, or via any number of cheap APIs you can switch away from. Vendor lock-in is not a law of physics.
- 第三条最硬:「关掉训练数据」的勾选框 ≠ 隐私。你的会话始终在对方服务器上,他们可以看、可以交给政府。而护栏等于「一个警察 agent 盯着每段对话」,误伤天天发生——门控服务的是他们的风险,不是你的安全。Line three is the hardest: the 'opt out of training data' checkbox is not privacy. Your sessions live on their servers; they can read them or hand them to governments. And guardrails mean a cop agent reading over your shoulder every session, with false positives daily — the gatekeeping manages their risk, not your safety.
- 文章不是「开源模型万岁」的布道,而是给了一个判断标准:把使用某个模型的每次访问,都当成「你在为谁的赌局背书、你的数据归谁管」的决策。这个框架即使你不完全同意他的结论,也能用。The piece is not an open-weights sermon; it offers a decision standard: treat every use of a model as a choice about whose gambling you underwrite and who holds your data. The frame stays useful even if you don't share his conclusion.
数学之美The Beauty of Math
每日 Lean 谜题 · 周四Daily Lean Puzzle · Thursday ★★★★☆☆☆
每日 Lean 谜题(★4):USAMO 2024 第四题——什么样的 (m, n) 项链能「怎么剪都数得清」Daily Lean Puzzle (★4): USAMO 2024 Problem 4 — Which (m, n) Necklaces Stay Countable Under Every Cut
设 $m, n$ 为正整数。一条环形项链上有 $m \cdot n$ 颗珠子,每颗染成红色或蓝色。如果无论从哪里下剪、把圆环分成 $m$ 段各含 $n$ 颗连续珠子的链条时,这 $m$ 段里的红珠数都两两不同,就称这种染色是好的。求所有存在「好染色」的 $(m, n)$。Let $m$ and $n$ be positive integers. A circular necklace has $m \cdot n$ beads, each colored red or blue. Call a coloring good if, no matter where you cut the circle into $m$ blocks of $n$ consecutive beads, the numbers of red beads in the $m$ blocks are pairwise distinct. Determine all pairs $(m, n)$ that admit a good coloring.
已验证的 Lean 定理断言:好染色存在的充要条件是 $m \le n + 1$,即 $(\exists c,\ \mathrm{AllCutsDistinct}\ c) \leftrightarrow (m \le n + 1)$。The verified Lean theorem asserts that a good coloring exists exactly when $m \le n + 1$: $(\exists c,\ \mathrm{AllCutsDistinct}\ c) \leftrightarrow (m \le n + 1)$.
Lean 形式化陈述(把 sorry 换成你的证明):The statement in Lean (replace sorry with your proof):
/-
Copyright (c) 2026 The Compfiles Contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kimi K3
-/
import Mathlib.Algebra.BigOperators.Intervals
import Mathlib.Algebra.Order.Ring.Star
import Mathlib.Data.ZMod.Basic
import Mathlib.Tactic.Ring
/-!
# USA Mathematical Olympiad 2024, Problem 4
Let m and n be positive integers. A circular necklace contains mn beads, each
either red or blue. It turned out that no matter how the necklace was cut into
m blocks of n consecutive beads, each block had a distinct number of red beads.
Determine, with proof, all possible values of the ordered pair (m, n).
-/
namespace Usa2024P4
abbrev Necklace (m n : ℕ) := ZMod (m * n) → Bool
def blockCount {m n : ℕ} (c : Necklace m n) (s : ZMod (m * n)) (i : ℕ) : ℕ :=
∑ j ∈ Finset.range n, if c (s + ((i * n + j : ℕ) : ZMod (m * n))) then 1 else 0
def AllCutsDistinct {m n : ℕ} (c : Necklace m n) : Prop :=
∀ s : ZMod (m * n), Function.Injective (fun i : Fin m ↦ blockCount c s i.val)
abbrev solution : ℕ → ℕ → Prop := sorry
theorem usa2024_p4 (m n : ℕ) (hm : 0 < m) (hn : 0 < n) :
(∃ c : Necklace m n, AllCutsDistinct c) ↔ solution m n := by
sorry
end Usa2024P4
在浏览器中挑战 ▶Try it in your browser ▶ 下载题目 .leanDownload puzzle .lean
提示Hint
「不可能」那半边几乎免费:每段至多 $n$ 颗红珠,$m$ 个两两不同的数只能住进 $\{0, 1, \dots, n\}$。难的是构造:把 $m \cdot n$ 颗珠子摊成 $m$ 行、每行 $n$ 颗,找一条「逐行缩短的阶梯」染色规则,再对任意起点 $s < n$ 一段段数一遍。The impossibility half is nearly free: each block holds at most $n$ red beads, so $m$ pairwise-distinct counts must live in $\{0, 1, \dots, n\}$. The hard half is the construction: unroll the $m \cdot n$ beads into $m$ rows of $n$, find a 'staircase' coloring rule that shrinks one row at a time, then count the blocks for every cut offset $s < n$.
答案与讲解Solution & walkthrough
- 先把「怎么剪都算」形式化:珠子编号用 `ZMod (m * n) → Bool`——环形的「减了模就绕回来」免费得到。`blockCount c s i` 是对 `Finset.range n` 的示性函数求和,即起点在 $s + i \cdot n$ 的那一段的红珠数;`AllCutsDistinct c` 定义为 $\forall s$,函数 $i \mapsto \mathrm{blockCount}\ c\ s\ i$ 单射——「两两不同」在 Lean 里就是函数单射。First formalize 'every cut counts differently': index beads as `ZMod (m * n) → Bool` — the circle's wrap-around comes free from modular arithmetic. `blockCount c s i` sums the indicator over `Finset.range n`, the red count in the block starting at $s + i \cdot n$; `AllCutsDistinct c` means: for all $s$, the function $i \mapsto \mathrm{blockCount}\ c\ s\ i$ is injective — 'pairwise distinct' becomes function injectivity.
- 必要性(数学:抽屉原理;Lean:`Finset.card_image_of_injective` + `card_le_card`):每段 $n$ 颗珠子,红珠数 $\le n$,所以 $m$ 个互不相同的值落在 $\{0, 1, \dots, n\}$ 里——$m \le n + 1$。Lean 里把 `Fin m` 沿 `blockCount` 取像,单射让像的大小仍是 $m$,包含进 `Finset.range (n+1)` 后数元素就完事。Necessity (math: pigeonhole; Lean: `Finset.card_image_of_injective` + `card_le_card`): each block has $n$ beads so its red count is at most $n$; $m$ distinct values must live inside $\{0, 1, \dots, n\}$, giving $m \le n + 1$. In Lean, image `Fin m` under `blockCount`, use injectivity to keep cardinality $m$, note the image sits inside `Finset.range (n+1)`, and count.
- 充分性(数学:构造;Lean:`rowRed` / `constr`):给珠子 $p$ 写成 $p = q \cdot n + j$($j < n$),$q$ 是行、$j$ 是列;染红当且仅当 $n + 1 - m \le j < n - q$——一张逐行缩短一格的阶梯形。Lean 用 `p % n` 和 `p / n` 取坐标,`decide` 判定染红。Sufficiency (math: construction; Lean: `rowRed` / `constr`): write bead $p$ as $p = q \cdot n + j$ with $j < n$ — row $q$, column $j$ — and color it red exactly when $n + 1 - m \le j < n - q$: a staircase that shortens by one cell per row. Lean extracts the coordinates with `p % n` and `p / n` and decides with `decide`.
- 数数(数学:分情况 + 区间重排;Lean:`sum_rowRed` 与 `sum_rowRed_last`):对起点偏移 $s' < n$,第 $t$ 段红珠数在 $s' + t < n$ 时是 $m - 1 - t$,否则是 $m - 2 - t$——相邻两段错开 1,保证互不相同;而绕回尾部的那一段恰有 $s' - (n + 1 - m)$ 颗。Lean 先用 `Finset.sum_range_add` 把「跨过行尾」的和拆成前后两段,再用 `Ico` 区间等式改写集合、`Nat.card_Ico` 数区间长度,`lia` 收尾。Counting (math: cases + interval rearrangement; Lean: `sum_rowRed`, `sum_rowRed_last`): for a cut offset $s' < n$, block $t$ holds $m - 1 - t$ red beads when $s' + t < n$ and $m - 2 - t$ otherwise — adjacent blocks differ by 1, so all $m$ counts are distinct; the wrap-around last block holds exactly $s' - (n + 1 - m)$. Lean splits sums that straddle a row end with `Finset.sum_range_add`, rewrites the filtered index sets as `Ico` intervals, and finishes with `Nat.card_Ico` plus `lia`.
- 合成:把两个方向装进 `constructor` 分出的两个目标,最后 `#print axioms` 只剩 Lean 标准公理。整个证明里真正「难」的只有阶梯构造那一步;形式化最狠的贡献是逼你在动笔前决定「两两不同」到底是哪个函数的单射——这一步棋,往往就是解题的一半。Assembly: pack the two directions into the two goals from `constructor`; `#print axioms` then shows only Lean's standard axioms. Across the whole proof only the staircase construction is genuinely inventive — formalization's cruelest, best contribution is forcing you to decide, before writing anything, which function's injectivity 'pairwise distinct' is. That decision often solves half the problem.
/-
Copyright (c) 2026 The Compfiles Contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kimi K3
-/
import Mathlib.Algebra.BigOperators.Intervals
import Mathlib.Algebra.Order.Ring.Star
import Mathlib.Data.ZMod.Basic
import Mathlib.Tactic.Ring
/-!
# USA Mathematical Olympiad 2024, Problem 4
Let m and n be positive integers. A circular necklace contains mn beads, each
either red or blue. It turned out that no matter how the necklace was cut into
m blocks of n consecutive beads, each block had a distinct number of red beads.
Determine, with proof, all possible values of the ordered pair (m, n).
-/
namespace Usa2024P4
/-- A circular necklace with `m * n` beads, each red (`true`) or blue (`false`).
The beads are indexed by their position on the circle, i.e. by `ZMod (m * n)`. -/
abbrev Necklace (m n : ℕ) := ZMod (m * n) → Bool
/-- The number of red beads in the block of `n` consecutive beads starting at
position `s + i * n` (positions are taken modulo `m * n`). -/
def blockCount {m n : ℕ} (c : Necklace m n) (s : ZMod (m * n)) (i : ℕ) : ℕ :=
∑ j ∈ Finset.range n, if c (s + ((i * n + j : ℕ) : ZMod (m * n))) then 1 else 0
/-- The property from the problem statement: no matter how the necklace is cut
into `m` blocks of `n` consecutive beads (the cut is determined by the starting
position `s` of the first block), the numbers of red beads in the `m` blocks
are pairwise distinct. -/
def AllCutsDistinct {m n : ℕ} (c : Necklace m n) : Prop :=
∀ s : ZMod (m * n), Function.Injective (fun i : Fin m ↦ blockCount c s i.val)
/-- Each block contains `n` beads, so its red bead count is at most `n`. -/
lemma blockCount_le {m n : ℕ} (c : Necklace m n) (s : ZMod (m * n)) (i : ℕ) :
blockCount c s i ≤ n := by
unfold blockCount
calc (∑ j ∈ Finset.range n, if c (s + ((i * n + j : ℕ) : ZMod (m * n))) then 1 else 0)
≤ ∑ j ∈ Finset.range n, 1 := by
apply Finset.sum_le_sum
intro j _
split <;> simp
_ = n := by simp
/-- Necessity: the `m` distinct block counts all lie in `{0, 1, ..., n}`,
which has only `n + 1` elements. -/
lemma le_of_allCutsDistinct {m n : ℕ} {c : Necklace m n} (hc : AllCutsDistinct c) :
m ≤ n + 1 := by
have hinj := hc 0
have hsub : Finset.univ.image (fun i : Fin m ↦ blockCount c 0 i.val) ⊆
Finset.range (n + 1) := by
intro x hx
rw [Finset.mem_image] at hx
obtain ⟨i, -, rfl⟩ := hx
rw [Finset.mem_range]
exact Nat.lt_succ_of_le (blockCount_le c 0 i.val)
have hcard := Finset.card_le_card hsub
rw [Finset.card_image_of_injective _ hinj, Finset.card_univ, Fintype.card_fin,
Finset.card_range] at hcard
exact hcard
/-- The red indicator of the unfolded construction: writing `p = q * n + j`
with `j < n` (so `q` is the row and `j` the column of bead `p`), the bead is
red iff `n + 1 - m ≤ j < n - q`. -/
def rowRed (m n : ℕ) (p : ℕ) : ℕ :=
if n + 1 - m ≤ p % n ∧ p % n + p / n < n then 1 else 0
/-- Evaluating `rowRed` on the bead `t * n + a` in row `t`, column `a`. -/
lemma rowRed_eq {m n : ℕ} (hn : 0 < n) (t a : ℕ) (ha : a < n) :
rowRed m n (t * n + a) = if n + 1 - m ≤ a ∧ a + t < n then 1 else 0 := by
unfold rowRed
have h1 : (t * n + a) % n = a := Nat.mul_add_mod_of_lt ha
have h2 : (t * n + a) / n = t := by
rw [show t * n + a = a + n * t by ring, Nat.add_mul_div_left _ _ hn,
Nat.div_eq_of_lt ha, Nat.zero_add]
rw [h1, h2]
/-- Evaluating `rowRed` on a bead in row `0`. -/
lemma rowRed_self {m n j : ℕ} (hj : j < n) :
rowRed m n j = if n + 1 - m ≤ j then 1 else 0 := by
unfold rowRed
rw [Nat.mod_eq_of_lt hj, Nat.div_eq_of_lt hj]
simp only [Nat.add_zero, hj, and_true]
/-- The necklace constructed for the `m ≤ n + 1` direction: writing
`p = q * n + j` with `j < n`, bead `p` is red iff `n + 1 - m ≤ j < n - q`. -/
def constr (m n : ℕ) : Necklace m n :=
fun p ↦ decide (n + 1 - m ≤ p.val % n ∧ p.val % n + p.val / n < n)
/-- Bridging lemma: the block count of the constructed necklace can be computed
with natural number arithmetic; the modulo `m * n` on the indices keeps track
of the wrap-around of the circle. -/
lemma blockCount_constr_eq {m n : ℕ} (s' t : ℕ) :
blockCount (constr m n) ((s' : ℕ) : ZMod (m * n)) t =
∑ j ∈ Finset.range n, rowRed m n ((s' + t * n + j) % (m * n)) := by
unfold blockCount
apply Finset.sum_congr rfl
intro j _
rw [show ((s' : ℕ) : ZMod (m * n)) + ((t * n + j : ℕ) : ZMod (m * n)) =
((s' + t * n + j : ℕ) : ZMod (m * n)) by push_cast; ring]
simp only [constr, rowRed, ZMod.val_natCast, decide_eq_true_eq]
/-- The key counting lemma: for a cut starting at `s' < n`, the number of red
beads in block `t` (interpreted without wrap-around) is
`m - 1 - t` if `s' + t < n` and `m - 2 - t` otherwise. -/
lemma sum_rowRed {m n : ℕ} (hn : 0 < n) (hmn : m ≤ n + 1) {s' t : ℕ}
(hs : s' < n) :
(∑ j ∈ Finset.range n, rowRed m n (s' + t * n + j)) =
if s' + t < n then m - 1 - t else m - 2 - t := by
have e := Finset.sum_range_add (fun j ↦ rowRed m n (s' + t * n + j)) (n - s') s'
rw [Nat.sub_add_cancel (Nat.le_of_lt hs)] at e
rw [e]
-- the first `n - s'` beads lie in row `t`, columns `s'` to `n - 1`
have h1 : (∑ j ∈ Finset.range (n - s'), rowRed m n (s' + t * n + j)) =
n - t - max s' (n + 1 - m) := by
have step : (∑ j ∈ Finset.range (n - s'), rowRed m n (s' + t * n + j)) =
∑ j ∈ Finset.range (n - s'),
(if n + 1 - m ≤ s' + j ∧ s' + j + t < n then 1 else 0) := by
apply Finset.sum_congr rfl
intro j hj
rw [Finset.mem_range] at hj
rw [show s' + t * n + j = t * n + (s' + j) by ring,
rowRed_eq hn t (s' + j) (by lia)]
rw [step]
have hico := Finset.sum_Ico_eq_sum_range
(f := fun u ↦ if n + 1 - m ≤ u ∧ u + t < n then 1 else 0) s' n
rw [← hico, ← Finset.card_filter]
have hfilter : (Finset.Ico s' n).filter (fun u ↦ n + 1 - m ≤ u ∧ u + t < n) =
Finset.Ico (max s' (n + 1 - m)) (n - t) := by
ext u
simp only [Finset.mem_filter, Finset.mem_Ico]
lia
rw [hfilter, Nat.card_Ico]
-- the last `s'` beads lie in row `t + 1`, columns `0` to `s' - 1`
have h2 : (∑ j ∈ Finset.range s', rowRed m n (s' + t * n + (n - s' + j))) =
min s' (n - t - 1) - (n + 1 - m) := by
have step : (∑ j ∈ Finset.range s', rowRed m n (s' + t * n + (n - s' + j))) =
∑ j ∈ Finset.range s',
(if n + 1 - m ≤ j ∧ j + (t + 1) < n then 1 else 0) := by
apply Finset.sum_congr rfl
intro j hj
rw [Finset.mem_range] at hj
rw [show s' + t * n + (n - s' + j) = (t + 1) * n + j by
rw [add_mul, one_mul]; lia, rowRed_eq hn (t + 1) j (by lia)]
rw [step, ← Finset.card_filter]
have hfilter : (Finset.range s').filter (fun j ↦ n + 1 - m ≤ j ∧ j + (t + 1) < n) =
Finset.Ico (n + 1 - m) (min s' (n - t - 1)) := by
ext u
simp only [Finset.mem_filter, Finset.mem_range, Finset.mem_Ico]
lia
rw [hfilter, Nat.card_Ico]
rw [h1, h2]
split_ifs with h <;> lia
/-- The last block (which wraps around the end of the necklace) contains
exactly `s' - (n + 1 - m)` red beads: its first `n - s'` beads lie in row
`m - 1` (which is entirely blue) and its last `s'` beads lie in row `0`. -/
lemma sum_rowRed_last {m n : ℕ} (hm : 0 < m) (hn : 0 < n) (hmn : m ≤ n + 1) {s' : ℕ}
(hs : s' < n) :
(∑ j ∈ Finset.range n, rowRed m n ((s' + (m - 1) * n + j) % (m * n))) =
s' - (n + 1 - m) := by
have hmn' : (m - 1) * n + n = m * n := by
obtain ⟨k, rfl⟩ : ∃ k, m = k + 1 := ⟨m - 1, by lia⟩
rw [Nat.add_sub_cancel, Nat.succ_mul]
have e := Finset.sum_range_add
(fun j ↦ rowRed m n ((s' + (m - 1) * n + j) % (m * n))) (n - s') s'
rw [Nat.sub_add_cancel (Nat.le_of_lt hs)] at e
rw [e]
-- the first `n - s'` beads lie in row `m - 1`, which has no red beads
have h1 : (∑ j ∈ Finset.range (n - s'),
rowRed m n ((s' + (m - 1) * n + j) % (m * n))) = 0 := by
apply Finset.sum_eq_zero
intro j hj
rw [Finset.mem_range] at hj
have hlt : s' + (m - 1) * n + j < m * n := by
have hsj : s' + j < n := by lia
have h' := add_lt_add_left hsj ((m - 1) * n)
lia
rw [Nat.mod_eq_of_lt hlt, show s' + (m - 1) * n + j = (m - 1) * n + (s' + j) by ring,
rowRed_eq hn (m - 1) (s' + j) (by lia), ite_eq_right (by lia)]
-- the last `s'` beads wrap around into row `0`, columns `0` to `s' - 1`
have h2 : (∑ j ∈ Finset.range s',
rowRed m n ((s' + (m - 1) * n + (n - s' + j)) % (m * n))) = s' - (n + 1 - m) := by
have step : ∀ j ∈ Finset.range s',
rowRed m n ((s' + (m - 1) * n + (n - s' + j)) % (m * n)) =
if n + 1 - m ≤ j then 1 else 0 := by
intro j hj
rw [Finset.mem_range] at hj
have e1 : s' + (m - 1) * n + (n - s' + j) = m * n + j := by
have hle : s' ≤ n := Nat.le_of_lt hs
calc s' + (m - 1) * n + (n - s' + j) = (m - 1) * n + n + j := by lia
_ = m * n + j := by rw [hmn']
rw [e1, Nat.add_comm (m * n) j, Nat.add_mod_right,
Nat.mod_eq_of_lt (by
have hle : n ≤ m * n := Nat.le_mul_of_pos_left n hm
lia),
rowRed_self (by lia : j < n)]
rw [Finset.sum_congr rfl step, ← Finset.card_filter]
have hfilter : (Finset.range s').filter (fun j ↦ n + 1 - m ≤ j) =
Finset.Ico (n + 1 - m) s' := by
ext u
simp only [Finset.mem_filter, Finset.mem_range, Finset.mem_Ico]
lia
rw [hfilter, Nat.card_Ico]
rw [h1, h2, Nat.zero_add]
/-- The complete formula for the block counts of the constructed necklace
when the cut starts at `s' < n`. -/
lemma blockCount_constr {m n : ℕ} (hm : 0 < m) (hn : 0 < n) (hmn : m ≤ n + 1) {s' t : ℕ}
(hs : s' < n) (ht : t < m) :
blockCount (constr m n) ((s' : ℕ) : ZMod (m * n)) t =
if t = m - 1 then s' - (n + 1 - m)
else if s' + t < n then m - 1 - t else m - 2 - t := by
rw [blockCount_constr_eq s' t]
by_cases hlast : t = m - 1
· subst hlast
rw [ite_eq_left rfl]
exact sum_rowRed_last hm hn hmn hs
· rw [ite_eq_right hlast]
have hlt : ∀ j ∈ Finset.range n, s' + t * n + j < m * n := by
intro j hj
rw [Finset.mem_range] at hj
have hle : (t + 2) * n ≤ m * n := by
have h : t + 2 ≤ m := by lia
exact mul_le_mul_of_nonneg_right h (Nat.zero_le n)
calc s' + t * n + j < t * n + 2 * n := by lia
_ = (t + 2) * n := by rw [add_mul]
_ ≤ m * n := hle
have step : (∑ j ∈ Finset.range n, rowRed m n ((s' + t * n + j) % (m * n))) =
∑ j ∈ Finset.range n, rowRed m n (s' + t * n + j) := by
apply Finset.sum_congr rfl
intro j hj
rw [Nat.mod_eq_of_lt (hlt j hj)]
rw [step]
exact sum_rowRed hn hmn hs
/-- The block count is periodic in the block index with period `m`. -/
lemma blockCount_add_period {m n : ℕ} (c : Necklace m n) (s : ZMod (m * n)) (i : ℕ) :
blockCount c s (i + m) = blockCount c s i := by
unfold blockCount
apply Finset.sum_congr rfl
intro j _
have e : (((i + m) * n + j : ℕ) : ZMod (m * n)) = ((i * n + j : ℕ) : ZMod (m * n)) := by
have h : (i + m) * n + j = i * n + j + m * n := by ring
rw [h, Nat.cast_add, ZMod.natCast_self, add_zero]
rw [e]
/-- Iterated version of `blockCount_add_period`. -/
lemma blockCount_add_mul {m n : ℕ} (c : Necklace m n) (s : ZMod (m * n)) (i q : ℕ) :
blockCount c s (i + m * q) = blockCount c s i := by
induction q with
| zero => simp
| succ q ih =>
have h : i + m * (q + 1) = (i + m * q) + m := by ring
rw [h, blockCount_add_period c s (i + m * q), ih]
/-- The block count only depends on the block index modulo `m`. -/
lemma blockCount_mod {m n : ℕ} (c : Necklace m n) (s : ZMod (m * n)) (x : ℕ) :
blockCount c s x = blockCount c s (x % m) := by
conv_lhs => rw [← Nat.mod_add_div x m]
exact blockCount_add_mul c s (x % m) (x / m)
/-- Shifting the starting position of the cut by `n` beads shifts the blocks
by one. This reduces a general cut `s` to a cut starting at `s.val % n < n`. -/
lemma blockCount_shift {m n : ℕ} [NeZero (m * n)] (c : Necklace m n)
(s : ZMod (m * n)) (i : ℕ) :
blockCount c s i =
blockCount c ((s.val % n : ℕ) : ZMod (m * n)) (s.val / n + i) := by
unfold blockCount
apply Finset.sum_congr rfl
intro j _
have e : s + ((i * n + j : ℕ) : ZMod (m * n)) =
((s.val % n : ℕ) : ZMod (m * n)) + (((s.val / n + i) * n + j : ℕ) : ZMod (m * n)) := by
conv_lhs => rw [← ZMod.natCast_zmod_val s, ← Nat.cast_add]
rw [← Nat.cast_add]
congr 1
conv_lhs => rw [← Nat.mod_add_div s.val n]
ring
rw [e]
/-- The constructed necklace satisfies the property of the problem. -/
lemma allCutsDistinct_constr {m n : ℕ} (hm : 0 < m) (hn : 0 < n) (hmn : m ≤ n + 1) :
AllCutsDistinct (constr m n) := by
have : NeZero (m * n) := ⟨(Nat.mul_pos hm hn).ne'⟩
intro s i₁ i₂ hij
have hij' : blockCount (constr m n) s i₁.val =
blockCount (constr m n) s i₂.val := hij
rw [blockCount_shift _ s i₁.val, blockCount_shift _ s i₂.val,
blockCount_mod _ _ (s.val / n + i₁.val),
blockCount_mod _ _ (s.val / n + i₂.val)] at hij'
have hs' : s.val % n < n := Nat.mod_lt s.val hn
have hr1 : (s.val / n + i₁.val) % m < m := Nat.mod_lt _ hm
have hr2 : (s.val / n + i₂.val) % m < m := Nat.mod_lt _ hm
rw [blockCount_constr hm hn hmn hs' hr1, blockCount_constr hm hn hmn hs' hr2] at hij'
-- the explicit formula now forces the two shifted block indices to coincide
have hval : (s.val / n + i₁.val) % m = (s.val / n + i₂.val) % m := by
split_ifs at hij' <;> omega
have hz : ((s.val / n + i₁.val : ℕ) : ZMod m) = ((s.val / n + i₂.val : ℕ) : ZMod m) :=
(ZMod.natCast_eq_natCast_iff _ _ _).mpr hval
push_cast at hz
have h3 : (i₁.val : ZMod m) = (i₂.val : ZMod m) := add_left_cancel hz
have h4 : i₁.val ≡ i₂.val [MOD m] := (ZMod.natCast_eq_natCast_iff _ _ _).mp h3
have h5 : i₁.val % m = i₂.val % m := h4
rw [Nat.mod_eq_of_lt i₁.isLt, Nat.mod_eq_of_lt i₂.isLt] at h5
exact Fin.ext h5
/-- The answer: the required necklaces exist exactly for the pairs `(m, n)`
with `m ≤ n + 1`. -/
abbrev solution : ℕ → ℕ → Prop := fun m n ↦ m ≤ n + 1
theorem usa2024_p4 (m n : ℕ) (hm : 0 < m) (hn : 0 < n) :
(∃ c : Necklace m n, AllCutsDistinct c) ↔ solution m n := by
constructor
· rintro ⟨c, hc⟩
exact le_of_allCutsDistinct hc
· intro h
exact ⟨constr m n, allCutsDistinct_constr hm hn h⟩
end Usa2024P4
人的思考A human's take
Compfiles: USA Mathematical Olympiad 2024, Problem 4(Lean 形式化仓库中的原题陈述与证明) — Compfiles 社区(David Renshaw 维护;题面为人类撰写的竞赛原文,Apache-2.0)
这个 Lean 文件的头部注释用人话保留了竞赛原题——「 Determine, with proof, all possible values of the ordered pair (m, n)」——而形式化者的思路全藏在定义顺序里:先决定把「项链」认作 `ZMod (m * n) → Bool`(环 = 取模算术,不引入任何「圆」的对象),再决定把「数红珠」认作示性函数在 `Finset.range n` 上的求和,最后把最含糊的那句「任意剪法都两两不同」翻译成 ∀ s 加一个函数的单射性。这个 Lean 文件的头部注释用人话保留了竞赛原题——「 Determine, with proof, all possible values of the ordered pair (m, n)」——而形式化者的思路全藏在定义顺序里:先决定把「项链」认作 `ZMod (m * n) → Bool`(环 = 取模算术,不引入任何「圆」的对象),再决定把「数红珠」认作示性函数在 `Finset.range n` 上的求和,最后把最含糊的那句「任意剪法都两两不同」翻译成 ∀ s 加一个函数的单射性。
读这个文件的收获是看人怎么「翻译竞赛话术」:证明尚未开始,三个定义已经把答案的形状逼出来了——单射 + 值在 $\{0..n\}$ 里,几乎就是必要性证明本身;而「$p / n$ 当行号、$p \% n$ 当列号」这一行,就是阶梯构造的全部入口。Compfiles 的惯例(题面、许可、形式化说明同文件存放)也让这类「怎么想的」可以被人核对。读这个文件的收获是看人怎么「翻译竞赛话术」:证明尚未开始,三个定义已经把答案的形状逼出来了——单射 + 值在 $\{0..n\}$ 里,几乎就是必要性证明本身;而「$p / n$ 当行号、$p \% n$ 当列号」这一行,就是阶梯构造的全部入口。Compfiles 的惯例(题面、许可、形式化说明同文件存放)也让这类「怎么想的」可以被人核对。
AI 随想An AI's reflection
以下由 AI 撰写。Written by AI.
这道题最迷人的地方是答案的谦逊:$m \le n + 1$,一行抽屉原理几乎就是下界的全部。真正的门槛在另一半——你得「画」出来:把珠子摊成 $m$ 行 $n$ 列,每往下一行就把阶梯缩短一格,于是相邻两段恒差一颗红珠,怎么剪都错不开。这个阶梯不是算出来的,是看出来的;而 Lean 的形式化恰好记录了这件事的两半:`rowRed` 那一行「除法取行、模数取列」是看,后面的求和引理是算。对做题的人来说,这也是竞赛与形式化共同的教训:难的部分往往不是证明一个不等式,而是决定让哪句模糊的中文先变成哪个精确的函数——「两两不同」翻译成单射的那一刻,必要性已经写完了。今天深读里 Karpathy 说 LLM 是「准专家 × 广覆盖」;这道谜题是它的反面教材:机器可以验算每一段求和,但「摊成表格画个阶梯」这一步,目前仍然是一个人的眼睛先看见、编译器随后同意。答案折叠在提示里,但看见阶梯的那一眼,折叠在 $m \le n + 1$ 里,谁也没法替你省。What makes this problem lovely is the humility of its answer: $m \le n + 1$ — one line of pigeonhole is nearly the whole lower bound. The real threshold is the other half, where you must draw: unroll the beads into $m$ rows of $n$, shorten the staircase by one cell each row down, and then neighboring blocks always differ by exactly one red bead — no cut can make two counts collide. The staircase is not computed, it is seen; and the Lean formalization records precisely the two halves of that seeing: `rowRed`'s single line — divide for the row, mod for the column — is the eye, the summation lemmas afterward are the arithmetic. The shared lesson for contest solvers and formalizers alike: the hard part is rarely proving an inequality, it is deciding which vague clause of the problem becomes which exact function first — the moment 'pairwise distinct' becomes injectivity, the necessity proof has practically written itself. In today's lead, Karpathy describes LLMs as quasi-expert yet broad; this puzzle is the inverse exhibit: a machine can verify every block-sum, but the staircase must currently be seen by a human's eye before a compiler agrees. The answer hides in the hint, but the glance that sees it hides inside $m \le n + 1$, and nobody can skip it for you.
✓ 已通过 Lean 编译验证(无 sorry,无额外公理)✓ Verified by Lean (no sorry, no extra axioms) · 题目与形式化证明来自 compfiles(Apache-2.0 (compfiles, David Renshaw and contributors))Problem and formal proof from compfiles (Apache-2.0 (compfiles, David Renshaw and contributors)) · Lean v4.35.0-rc4 · Mathlib feefa32
- CKKS 同态加密(三):加密的数字凭什么还能相加相乘CKKS Homomorphic Encryption, Part 3: Why Encrypted Numbers Still Add
- 问题设定:同态加密让你对密文直接做计算,算完再解密,结果和用明文算一样——隐私保护的机器学习就靠它。这是教程系列的第三篇:上一篇搭好了加解密和多项式环算术,这一篇讲密文的加法与乘法(先不管安全性,用 64 位模数练手)。The setup: homomorphic encryption lets you compute on ciphertexts and decrypt to the same result you'd get computing on plaintexts — the engine behind privacy-preserving ML. This is part three of a tutorial series: encrypt/decrypt and polynomial-ring arithmetic came last time; this piece covers ciphertext addition and multiplication (security deliberately postponed, 64-bit modulus for practice).
- 先摆结构:CKKS 的密文是一对多项式 $(c_0, c_1)$,住在环 $(\mathbb{Z}/Q\mathbb{Z})[x]/(x^N+1)$ 里;解密就是和 $(1, s(x))$ 做点积。明文被「包」成 $c_0 = -c_1 s + m + e$:$s$ 是密钥,$e$ 是刻意加进去的噪声。The structure first: a CKKS ciphertext is a pair of polynomials $(c_0, c_1)$ in the ring $(\mathbb{Z}/Q\mathbb{Z})[x]/(x^N+1)$, decrypted by taking a dot product with $(1, s(x))$. The plaintext is wrapped as $c_0 = -c_1 s + m + e$: $s$ the secret key, $e$ deliberately injected noise.
- 加法出奇地简单:两对密文逐分量相加。把式子代回去、重新分组,非噪声部分严丝合缝地拼成「$m_1 + m_2$ 的加密」应有的形状——同态性不是什么魔法,是密文设计成线性结构后,按分量相加的免费副产品。Addition is astonishingly simple: add the two pairs componentwise. Substitute the definitions, regroup, and the non-noise parts land exactly in the shape of a valid encryption of $m_1 + m_2$ — the homomorphism isn't magic, it's the free consequence of designing ciphertexts as linear objects and adding them componentwise.
- 微妙全在噪声里:两个 $e$ 相加不再是「新鲜」的高斯样本。这是 CKKS 硬细节的第一瞥——计算一层层叠上去,噪声会变得越来越难逐项追踪,标准做法是用「次高斯」(sub-Gaussian)性质把它整体圈住,只问最坏情况不问分布长相。The subtlety lives entirely in the noise: the sum of two $e$'s is not a 'fresh' Gaussian sample. This is the first glimpse of CKKS's hard business — as computations stack up, noise becomes impossible to track term-by-term, so the standard move is to tame it wholesale with sub-Gaussian bounds: only worst-case tails, never exact distributions.
- 能带走的思维方式:设计一个编码,让「想要保持的运算」变成编码上的自然运算(线性 → 逐分量相加),剩下的仗全在和误差作战。这个模式在浮点数、纠错码、差分隐私里反复出现——CKKS 只是最新一站。What to take away is a design pattern: choose an encoding where the operation you want to preserve becomes natural arithmetic on the encoding, then fight all remaining battles against error. The same pattern reappears in floating point, error-correcting codes, and differential privacy — CKKS is just the current station.
- 图画可以比证明走得更远:一门被埋了两百年的数学「插图传统」Illustration Beyond Proof: A Mathematical Tradition Buried for Two Centuries
- 起点是 2026 年 1 月庞加莱研究所一个 unusual 的工作坊:数学家、画家、历史学家凑一周,问「插图什么时候算严格的数学工作?」——不是科普配图,是知识本身。作者们翻了档案来回答。The starting point is an unusual January 2026 workshop at the Institut Henri Poincaré: mathematicians, artists, and historians spent a week asking when illustration counts as rigorous mathematical work — not popularizing pictures, but knowledge itself. The authors answered by digging through archives.
- 历史证据:19 世纪 Monge 主持的巴黎综合理工学院,手绘是数学训练的必修——历史学者的原话是「drawing was knowing」(会画就是会)。这个传统在 20 世纪被边缘化,但没死透:1990 年代 Thurston 回应 Jaffe–Quinn 关于「唯论文论」的批评时,就是在替证明之外的数学工作争地位。The historical evidence: at Monge's École Polytechnique in the nineteenth century, hand-drawing was mandatory in mathematical training — in the historian's phrase, 'drawing was knowing.' The tradition was sidelined in the twentieth century but never died: Thurston's 1990s response to Jaffe and Quinn's 'prove-theorem-count' paper was exactly a fight for work beyond proof-writing.
- 为什么今天突然紧迫:AI 打破了「定理稀缺」这个前提——当定理产出可以自动量产,靠定理数评职称(Bryna Kra 的诊断)就露出它本来就只是个代理指标:它代理的东西是理解。Kra 的说法是,证明之外还有「故事、图画、洞见、解释」。Why it is urgent now: AI breaks the scarcity of theorems, which exposes theorem-counts as the proxy metric it always was (Bryna Kra's diagnosis) — what it was proxying is understanding. Proof is 'a story, a picture, an insight, an explanation,' and those other forms are now under threat of being the only parts AI cannot take.
- 作者的论证落点:数学是「共同体消化、诠释的知识体」,不是一份结果登记表;价值体系既然是一种选择(Marcolli),就可以被重新选择。给视觉性工作记功(Sanderson 问的就是怎么在实践里做到),既是恢复旧传统,也是回应新变局——插图恰好是人做而机器「不看」的那种工作。The authors' landing point: mathematics is a body of knowledge engaged with and digested by a community, not a registry of results; since the value system is a choice (Marcolli), it can be chosen again. Giving real credit to visual work (Sanderson's practical question) restores an old tradition and answers the new situation — illustration is precisely the kind of work humans do and machines don't look at.
- 读完带走的:一篇关于「什么算数学贡献」的讨论,最有力的部分不是哲学宣言,而是两个世纪前的一门课程——「画图曾是训练本身」这个事实,比任何论证都难反驳。What stays with you: the strongest move in this debate about 'what counts as a mathematical contribution' is not a philosophical claim but a two-century-old syllabus — 'drawing was once the training itself' is a fact harder to argue with than any argument.
- 通往 ε₀ 之路:打印一个无穷集合,程序也有「讲道理」和「耍无赖」之分(2026 年 8 月)The Road to ε₀: Programs That Print Infinite Sets Can Behave — or Cheat (August 2026)
- 问题看着像玩笑:写个程序打印「所有正整数」。你不可能打印完,但写法有好坏之分——先打印全部奇数再打印偶数,那么 14 永远出不来(前一个任务永不结束);交错着打印,每个你在等的数总会轮到。前者「非生产性」,后者「生产性」。The question looks like a joke: write a program that prints all positive integers. You can never finish, but there are honest and dishonest ways: print all odd numbers first, then the evens, and 14 never arrives (the first job never ends); interleave them and every number you're waiting for eventually comes up. The first program is 'non-productive,' the second productive.
- 关键想法:这个「讲不讲道理」不是代码风格问题,是序的结构问题。Dominus 把它接到集合上的良序(well-founded order)上:只要输出顺序按一个良序排——没有无限下降的链——每个元素就都有轮到的一刻;反过来,「奇数在前偶数在后」在某种排序下恰恰藏了一条无限下降链。The key idea: being reasonable this way is not a code-style question but a question about order structure. Dominus connects it to well-founded orders on the set: enumerate in an order with no infinite descending chain and every element gets its turn; 'odds before evens' is exactly the shape that hides an infinite wait.
- 这是「通往 ε₀」系列的中间一站(2026 年 8 月起连载):前几集已经把 $\omega, \omega^2, \omega^\omega$ 这些「吓人的序数」逐个驯化——先是无穷盘子的 Nim 必在有限步结束(用 $<\varepsilon_0$ 的良序做终结性证明),现在轮到用同一个序数家族给「程序能不能数完」判卷。This is a mid-series stop on 'the road to ε₀' (running since August 2026): earlier episodes tamed the scary-looking ordinals one by one — first showing Nim with infinitely huge positions must end in finitely many moves (proved via well-orders below $\varepsilon_0$), now the same ordinal machinery grades whether a printing program is honest.
- 为什么成立:良序上「每个初始段有限」的枚举恰是生产性程序允许的形态;ε₀ 是所有这些有限塔式序数的极限,所以它管着「任何能用有限描述写出来的良序打印策略」。Why it works: productive enumeration is exactly what 'every initial segment is finite' under a well-order guarantees; ε₀ is the limit of all ordinals describable by finite towers, so it governs every printing strategy you can write down finitely.
- 能带走的:序数不是集合论博物馆里的展品——它是给「过程会不会轮到你」判卷的语言。把证明读成一条连续几集的侦探故事,本身也是这篇教的方法:ε₀ 看起来是怪兽,摊开是「数无穷串的方式」。What to take away: ordinals are not museum pieces in set theory — they are the language for judging 'will this process ever reach me.' Reading a proof as a detective story running across episodes is itself the method taught here: ε₀ looks like a monster and unrolls into a way of counting infinite strings.
- ISL 入门:编译器怎么把一段循环变成一块几何体(2025 年 10 月)An ISL Primer: How Compilers Turn a Loop Nest into a Solid of Geometry (October 2025)
- 动机:多面体优化是现代编译器处理嵌套循环的看家本领(换序、分块、并行化),但多数工程师只在论文里见过。各编译器团队都手写实现,而开源 C 库 ISL 把核心算法做成了通用零件——这篇是它的入门。Motivation: polyhedral optimization is the crown jewel for nested-loop transforms in modern compilers (interchange, tiling, parallelization), but most engineers have only seen it in papers. Compiler teams hand-roll their own, while the open-source C library ISL packages the core algorithms — this is its primer.
- 第一块积木:一个「完美嵌套」的循环里,每次语句执行对应整数平面上的一个点。$0\le i<100,\ 0\le j<200$ 的循环,迭代空间就是这个矩形里的整数点集;带步长和条件的循环是带斜边和模条件的集合。First building block: inside a 'perfect' loop nest, every execution of the statement corresponds to one integer point on a plane. A nest with $0\le i<100,\ 0\le j<200$ has as its iteration space exactly the integer points of that rectangle; strided and guarded loops become sets with slanted edges and congruence conditions.
- 关键约束:能这样建模的循环几乎全是「准仿射」的——界、步长、条件都是线性等式/不等式,$j *= 2$ 这种非线性写法直接出局。这不是偷懒,是现实:Kun 指出实际代码里绝大多数循环恰好落在这个表达力里,而它换来的是一套完整的几何语言。The key restriction: the loops that fit are 'quasi-affine' — bounds, steps, and conditions are linear equalities/inequalities; $j *= 2$ falls out of the model. That is not laziness but reality: Kun notes most real loops live inside this expressiveness, and in exchange you get a complete geometric language.
- 于是优化变成集合运算:循环换序 = 换一种数点的顺序;依赖 = 点之间的约束;合法性检查 = 变换后依赖向量还在锥里。整数集合和关系代数把「编译器的直觉」变成可计算的对象。Optimizations become set operations: loop interchange is a different way of counting points; a dependence is a constraint between points; legality checking asks whether dependence vectors stay inside a cone after the transform. Integer sets and relations turn 'compiler intuition' into computable objects.
- 带走两样:其一,「线性约束 + 整数点」是数学里一个通用插座(Presburger 算术的家),编译器只是把它接到你的 CPU 上;其二,读「别人家的地基库」是最高效的补课方式——一篇好的 primer(含配套代码仓库)胜过十篇综述。Two takeaways: 'linear constraints plus integer points' is a universal electrical socket in mathematics (home of Presburger arithmetic) — the compiler merely plugs it into your CPU; and reading a good primer of someone else's foundation library, with runnable code, beats ten survey papers.
程序员随想Programmer Musings
- 「我投了三十多份简历,决定离开科技行业」'I Applied to Three-Dozen Jobs. I'm Leaving Tech.'
- 先把资历摆出来:20 年开发者,出过书、讲过课、办过活动,维护着下载量名列前茅的 Ruby 包,上家公司把团队从 2 人带到 12 人。这次的账本:三十多份申请,24 封拒信。行业用「cooked」(完蛋)一词概括。The credentials first: 20 years as a developer, books written, talks given, events run, maintainer of two of the most-downloaded Ruby packages ever, grew his last team from 2 to 12. This time's ledger: three-dozen-plus applications, 24 rejections. The market, in his word, is 'cooked.'
- 他的判断冷在中间那一刀:行业现在要「会用 AI 推进业务目标的人」,但「没有一个人真正知道怎么用 AI 做到这点」——他自己用 AI 写大量代码、逐段批判性审查后进生产,这套组合在市场上换不来回音。供需双方对同一个模糊口号各信各的。The cold cut is his middle observation: the industry says it wants people who can use AI to further business goals, yet 'not one person knows how to actually do that' — he uses AI for much of his code, critically reviews every part before it reaches production, and that exact combination still buys him silence. Both sides of the market are believing the same vague slogan differently.
- 他不接受的其实不是被拒,是过程本身:「反复把自己送进拒绝的流水线,正在造成真实的心理伤害。」一个 20 年老兵把「继续找工作」当成需要止损的健康决策来宣布——这句话的分量不在抱怨,在止损这个词。What he stops accepting is not rejection but the process: 'I cannot continue to put myself through this; it is causing me great mental harm.' A 20-year veteran announcing job-searching as a health decision to cut losses — the weight is in 'cut losses,' not in the complaint.
- 还有诚实的地理账:他住 Warrnambool,离墨尔本火车 3.5 小时,混合办公不可能;远程能力他拿 6 年实践证明过,也帮同事适应过——这些证明今天换不来一个流程面试。There is an honest geography bill too: he lives in Warrnambool, 3.5 train hours from Melbourne, hybrid is impossible; his remote competence was proven over six years, including helping teammates adapt — and the proof still doesn't buy a single interview loop.
- 留给你我的:AI 转型期「资深工程师清算」的一手样本——被重定价的不是能力,是需求结构;就业市场里的价格和一个人的实际贡献可以长期脱钩。不烧桥、不布道,只是把数字摊开然后转身,反而比任何檄文更有据可查。What remains for the rest of us: a first-party data point in the AI-transition repricing of senior engineers — what got repriced was capability's demand structure, not capability; market price and actual contribution can stay decoupled for a long time. No bridge-burning, no sermon, just numbers and a turn for the exit — which makes it more auditable than any manifesto.
- 「AI 这么能写代码了,那些新的、好的软件在哪儿?」'AI Writes Code So Well — Where Is All the New, Good Software?'
- 问题来自 AI 怀疑论者,作者的回答先立规矩:他列出十几条候选解释,全部标注为「猜想」,并且自己写明「有几条我会给很低的权重」——对一个没有干净数据的问题,这比任何单一因果论都诚实。The question comes from AI skeptics; the author's first move is a ground rule: he lists about a dozen candidate answers, labels them all as conjectures, and admits 'I would give some of them little weight' — for a question with no clean data, that is more honest than any monocausal story.
- 第一组答案:改进其实在发生,只是换了形态——以更少的 bug、更好的性能、既有产品里更多功能出现;而且「我们」这个词有陷阱:多数普通人根本不常装新软件,没见到新东西是常态不是证据。Group one: the improvement is real but changed shape — it arrives as fewer bugs, better performance, more features inside existing products. And 'we' hides a trap: most people rarely install new software at all, so not seeing new things is the normal state, not evidence.
- 第二组答案更锋利——新软件正在「隐身」:企业的开发流程里,审批、立项这些政治子系统还没被 AI 加速;你用 Claude 报完税就不再需要一个更好的 TurboTax(个人受益不生成「产品」);领域专家在给自己造私有工具,高管在做自己的仪表盘——好的新软件存在,只是不走你的眼睛。Group two cuts sharper — the new software is going invisible: companies' approval-and-planning subsystems aren't AI-accelerated yet; if Claude does your taxes you never need a better TurboTax (private benefit generates no product); domain experts build their own tools and executives their own dashboards — good new software exists, it just doesn't pass through your eyes.
- 还有反向效应:团队把提速兑换成了咖啡时间和准休闲;AI 帮人意识到某个项目本不该存在(用更少的软件也是「更好」);很多系统是软件与非软件的混合体,优化完你可能只是对现有的那套更满意了——外人看什么新东西都没有。Then the back-reactions: teams cash speed gains into coffee breaks and quasi-leisure; AI helps people realize a project should never have existed (shipping less software is also 'better'); many systems mix software and non-software parts, so after optimization you may just like what you already have more — from outside, nothing looks new.
- 带走的是方法:面对「说好的革命呢」类问题,先盘点「如果革命发生了但不可见,会是什么样子」的十种形状,再去对号入座——这份清单本身就是一个可复用的怀疑框架,正反两个方向都能用。The takeaway is a method: for any 'where's my flying car' question, first enumerate the shapes the revolution would wear if it had arrived invisibly, then check each against the evidence. The list itself is a reusable skepticism kit, and it runs in both directions.
- 在 X 上浪费的一小时:「气氛变好了」为什么也不算好消息I Wasted an Hour on X: Why 'It's Less Toxic Now' Is Not Good News
- 触发点:Gruber 说 X 上他看到的有趣帖子比 Threads、Bluesky、Mastodon 加起来还多,还夸「今天的 X 文化惊人地友好」。Bray 的回应方式很老程序员:不反驳,先承认哪些「可以同时为真」,再去做实验。The trigger: Gruber writes that he sees more interesting posts on X than on Threads, Bluesky, and Mastodon combined, and calls today's X culture 'remarkably friendly.' Bray responds like an old programmer: don't argue — first admit which claims can be true at once, then run the experiment yourself.
- 他给出一张「可以同时为真」清单:毒性的确降了(Musk 不在所有人信息流里);但「那是个恋童癖法西斯小店」也同样为真(他直接引 Friedman 的清单,两个理由就够);算法「埋链接帖」更是不可饶恕——这些判断不必互相取消。His 'can-all-be-true' list: yes, it is less toxic than before (Musk is not in everyone's feed); equally true that it is still a 'creepy fascist shop' (he cites Friedman's list — two items suffice); and the algorithm that buries posts with links is unforgivable. These verdicts don't cancel each other.
- 然后他花了一小时亲测「友好」:普京系宣传、两头挤的政治传声筒、LLM 打气(和加密货币时代「上船或出局」一个味儿)、切个标签页就从反建制变挺建制的省级选举软文。结论:氛围是调出来的,不是生态长出来的。Then he spent an hour testing 'friendly': Putinist propaganda, settler-and-skeptic megaphones both ways, LLM hype in the exact 'get on board or you're history' cadence of the crypto era, and provincial election sludge that flipped pro-incumbent the moment he switched tabs. Conclusion: the mood is tuned, not grown.
- 最个人化的一节是「点名」:一串他曾经尊敬、如今看低的人名清单,附一句自嘲——好在他们不在乎他怎么想。这让文章从平台评论变成一份私人账本,读者可以不同意任何一笔但知道钱数到哪了。The most personal section is the naming: a list of people he respected and now thinks less of, with a self-deprecating line — luckily none of them care what he thinks. That turns platform commentary into a private ledger: readers may dispute any entry but can see what the money went to.
- 最后的预测给得很克制:Twitter 现在是火箭-LLM 集团的一部分,真到估值气泡破掉、借不到钱续命那天,选项只有两个:灭绝,或者 enshittification。他继续留在 Fediverse——「那边人少、没有 CEO。好。」把「值不值」换成了「要不要」,这是一小时之后真正的带走。The forecast stays restrained: Twitter is now part of a rockets-and-LLMs conglomerate; on the day the valuation bubble pops and borrowing stops, the choices are extinction or enshittification. He remains happy in the Fediverse — 'fewer people, no CEOs. OK.' After one hour, he converted 'is it worth it' into 'do I want it,' and that is the real takeaway.
- 「revert 到士气变好为止」:LLM 评审如何悄悄抬高了 PostgreSQL 的质量门槛'The Reverts Will Continue Until Morale Improves': How LLM Review Quietly Raised PostgreSQL's Quality Bar
- 事实先摆:PostgreSQL 19 进入 beta 后被 revert 的重要功能约 8 到 10 个——正常周期预期是一个。作者本人在接收端(他是被 revert 功能之一的开发者/提交者),所以这篇文章不是旁观者分析,是当事方复盘。The facts first: roughly 8 of 10 significant PostgreSQL 19 features were reverted after beta — a normal cycle expects about one. The author sits on the receiving end (he developed or committed some of them), so this is a party's autopsy, not a bystander's analysis.
- 第一层解释先给足自省:也许就是代码不够好、工作没做到位,我们得学习改进;也许有部分巧合——这一轮同时啃了几个「本来就没法按时完工」的硬功能。Layer one is self-criticism, given fair weight: maybe the code simply wasn't good enough and the team must improve; partly it may be coincidence — this cycle took on several features that were genuinely hard to finish in time.
- 最锋利的发现在机制层:LLM 辅助代码评审把长尾边界 bug 的「出土时间」从往后五年压缩到一夜之间——几十份缺陷报告同时落地,哪怕每份只是三行修改,处理每份的固定开销也能烧光一个 beta 周期。要害那句是:质量门槛是在功能提交之后才被抬高的——旧代码在新尺子下集体不合格。The sharpest finding is a mechanism: LLM-assisted code review compressed the excavation time of long-tail edge-case bugs from 'five gradual years' to 'one night.' Dozens of defect reports land at once, and even when each averages a three-line fix, the per-report overhead drains a beta cycle. The key sentence: the quality bar was raised after the code was committed — old code failed a new ruler en masse.
- 两个推论顺手就拆了流行叙事:这基本不是「vibe coding」的锅(这些代码写于 vibe coding 可能之前);而且只要 LLM 评审以这个速度继续进步,下一周期会自愈——因为从现在起大家会按新尺子写。外加供给侧事故:「Vulnpocalypse」期间资深开发者全被安全修补占住,beta 期的常规评审测试被压缩后 8 月才回补。Two corollaries dismantle the popular narrative: this is mostly not 'vibe coding's fault' (the code predates it), and if LLM review keeps improving at this rate, future cycles self-heal — because the bar is now raised up front. Add a supply accident: during the 'Vulnpocalypse,' senior developers were consumed by security fixes, and the beta-period review/testing that normally catches such issues got compressed into August.
- 可带走的不是「AI 评审好不好」,是一个更普适的模式:当检测能力超过生产能力时,成熟工程组织的正确动作是 revert 加诚实复盘——宁可砍功能,不把「新尺子测过的旧代码」塞进发布。这页经验对任何上了自动化检查(lint、模糊测试、形式化验证)的团队都眼熟:门槛提高的瞬间,存量立刻变旧。The transferable lesson is not whether AI review is good but a general pattern: when detection capacity outgrows production capacity, a mature engineering org reverts and writes honest autopsies — ship fewer features rather than old code under a new ruler. Any team that ever turned on automated checking (linters, fuzzers, formal verification) recognizes the moment the bar rises: the existing inventory becomes obsolete overnight.
哲学与生活Philosophy & Life
- 诺奖得主莱辛:我们如何逃出自己选择住在里面的监狱Doris Lessing on Breaking Free from the Prisons We Choose to Live Inside
- Popova 开出的历史模式够冷:革命者变成新暴君,宣称代表群众的领袖调转枪口让群众互斗,人用自我正确感麻醉自己,来回避「不舒服的未知」。问题不是「谁会作恶」,而是「什么让人性在集体里继续活下去」。Popova opens with a cold historical pattern: revolutionaries turning into tyrants, leaders who claim to stand with the masses turning the masses against each other, people anesthetizing themselves with self-righteousness to avoid the uncomfortable unknown. The question is not 'who does evil' but 'what keeps our humanity alive in collectives.'
- 传记是论证的骨架:在殖民时代的津巴布韦长大,小女孩就看穿了「压迫是这个世界的轴」;成年后她拥抱共产主义——她后来形容那是「看似突然而彻底的皈依」,其实是「早就在体内的病毒」;很快看见裂缝、退党,再探索苏菲主义、行为心理学,依然没有现成答案。The biography is the argument's spine: raised in colonial Rhodesia, the girl saw through 'oppression as the axis of the world'; the young woman embraced Communism — later describing it as a conversion 'apparently sudden and total' that was actually a virus long in her blood; she saw the cracks, left, then explored Sufism and behavioral psychology, and still found no ready-made answer.
- 她没有因此停在虚无:她把整个近百年人生押在「提出难的、澄清性的问题」上——什么样的社会让我们彼此去人性化,个体与社会又靠什么重新凝聚。1985 年(她 60 多岁)的 Massey 讲座后来变成《Prisons We Choose to Live Inside》:每个时代、每种意识形态囚禁人的,常常正是当初「拯救」了她的那个确定感。She did not stop at nothing-for-answers: she wagered an almost-century life on 'asking the difficult, clarifying questions' — what lets societies dehumanize each other, what coheres them again. Her 1985 Massey Lectures became Prisons We Choose to Live Inside: what imprisons people in every age and ideology is often the very certainty that once 'saved' them.
- 结尾落在 Baldwin 那句「我们仍是彼此唯一的希望」:艺术家作为「精神的灯塔」,把想象放在意识形态之前——这不是鸡汤,是莱辛用三次「退出」(殖民地、党、确定性)换来的方法论。The landing is Baldwin's line — 'we are each other's only hope' — and artists as lighthouses of spirit placing imagination before ideology. Not a toast: a methodology paid for with three walk-aways (the colony, the party, the certainty).
- 给普通人的一天:当你发现自己越来越多地「肯定」、越来越少地好奇——对自己阵营、对自己的叙事——那就是该读莱辛的时刻。自选的监狱最结实的地方,是它看起来像答案。For an ordinary day: when you notice yourself more certain and less curious — about your side, about your own story — that is the moment to read Lessing. The strongest bars of a self-chosen prison are the ones that look like answers.
工具角Tools Corner
- Parsimony:测一测哪个 AI 编码代理往你的代码库里塞了最多「多余代码」Parsimony: Measuring Which AI Coding Agent Bloated Your Codebase Most
- 空白在哪:现有编码代理基准只测「解没解出来」和「花了多少钱」,从不惩罚「写了多少多余的代码」——同一个 bug,一个补丁 5 行一个 500 行,排行榜上却是平手,而长期成本全落在维护者身上。The gap: existing coding-agent benchmarks measure solve rate and cost but never punish excess code — one 5-line and one 500-line fix for the same bug tie on the leaderboard, while the long-term cost lands entirely on maintainers.
- 巧思在度量单位:按「编码单元」数(语句、调用、比较、名字、字面量),不按行数——所以把逻辑挤进一行不加分;净增量 = 新增 − 删除,用「做减法」解决问题的补丁会得负分。The clever unit choice: count coding units (statements, calls, comparisons, names, literals), not lines, so cramming logic into one line earns nothing; net units = added minus removed, so a patch that solves by deleting scores negative.
- 数据姿势也讲究:跑现成基准(SWE-bench Verified 等)的官方 patch,不重新判题,把「哪些运行可测」透明标出;作者还用自己的 harness 复跑部分模型与发布值对照(GPT-5.6 Sol 两次运行的差异也公布),数据放 GitHub、附哈希。The data posture is also right: it grades published patches from existing benchmarks (SWE-bench Verified and friends) without re-judging, states transparently which runs were measurable, and the author reran some models in his own harness to compare against published numbers (GPT-5.6 Sol's own two runs differ, and he says so), with data on GitHub and verification hashes.
- 结果一句话:很多模型 solve rate 接近、加代码量差数倍——把「节俭」变成排行榜的一根轴,等于给 AI slop 装了水表。The result in one line: many models solve similarly but add code differing by multiples — turning parsimony into a leaderboard axis puts a water meter on AI-slop code.
- Shell & Email:用邮件线程来管理你的多个编码代理(2026 年 9 月)Shell & Email: Run Your Fleet of Coding Agents as Email Threads (September 2026)
- 观察从 shell 开始:人和单个代理贴贴的最佳界面是终端——可组合、无守门人、天然开放,LLM 也在 shell 里最顺手;但要同时指挥多个代理,终端就让人「头晕」:你得停下来去干别的,之后再回来续上。The observation starts at the shell: the best interface between a human and one agent is the terminal — composable, gatekeeper-free, and exactly where LLMs shine; but when several agents need your attention, terminals make you dizzy: stop, go live your life, come back later and find your place.
- 转向的关键一问:「人类之间的异步分布式协作」早就被解决过——邮件。于是一个邮件线程 = 一个代理会话,抄送多方 = 多代理与人的群聊,不用重造任何面板。The pivot asks a key question: 'async distributed collaboration between humans' was solved long ago — email. So one email thread is one agent session, CC-ing parties is a group conversation of agents plus humans, and no bespoke dashboard needs reinventing.
- 顺手解决的一串:手机上任意邮件 App 就能看代理进度;网络条件差也能用;不绑定任何一家的应用或云。A string of freebies falls out: check agent progress from any mail app on any phone; works under poor network conditions; nobody's single-vendor app or cloud gets chained to your workflow.
- 巧点在于方向:别人做「代理仪表盘」,他把代理塞进人类用了三十年的异步协议——接口不是发明出来的,是被认领回来的。The cleverness is the direction: where others build agent dashboards, he slots agents into a thirty-year-old human async protocol — the interface wasn't invented, it was claimed.
- omdrop-owl:在非博通网卡的 Linux 笔电上,实现和 iPhone 互传omdrop-owl: AirDrop with Linux Laptops Whose Wi-Fi Isn't Apple's Broadcom Chip
- 障碍在硬件层:AirDrop 依赖苹果私有的 AWDL 协议,而它的时序特性历史上只有苹果用的 Broadcom 网卡支持——普通 Linux Wi-Fi 卡根本「跟不上节拍」。The wall is at the hardware layer: AirDrop rides on Apple's proprietary AWDL protocol, whose timing behavior was historically only supported by the Broadcom Wi-Fi chips Apple used — ordinary Linux Wi-Fi cards simply can't keep the beat.
- 解法是重写节拍器:项目基于 OWL(开源无线库,配套 omdrop 插件)在非苹果芯片上实现 AWDL,让 Linux 机器直接加入苹果设备的近场生态,和 iPhone 互传文件。The fix rewrites the metronome: the project implements AWDL on non-Apple radios via the OWL open wireless library (paired with the omdrop plugin), letting a Linux laptop join Apple devices' peer-to-peer world and exchange files with an iPhone.
- 工程完成度是亮点:Arch/AUR 一键包,Debian/Fedora 源码打包脚本,NixOS flake module——MAC 持久化、NetworkManager 保持静默、polkit 权限策略、后端冲突检测,全是「装完就能用」级别的活。Engineering completeness is the highlight: an Arch/AUR package, source-build scripts for Debian and Fedora, a NixOS flake module — MAC persistence, NetworkManager rules, polkit policies, backend conflict checks — all 'installs and just works' level craft.
- 看点:把「只有苹果能做到」的私有体验,变成开源栈里一个可安装的守护进程——协议逆向之外,把分发做完整才是真难的地方。Why it earns a spot: turning an Apple-only private experience into an installable daemon in the open-source stack; beyond protocol reverse-engineering, finishing distribution is the actually hard part.
- WallHop:12ft.io 倒了,这个新墙跳器把「用一次」写在了页面上WallHop: 12ft.io Shut Down, and This Replacement Prints Its Own Ethics Note
- 背景很具体:常用的一堵「拆墙」工具 12ft.io 停了,「朋友转来一篇付费文章」这种一次性需求突然没有着落;WallHop 基于 GPL 项目 everywall/ladder 深度改造调校而来。The context is concrete: the go-to paywall tool 12ft.io shut down, leaving the one-off need of 'a friend texted me a paywalled article' unserved; WallHop is a heavily modified, tuned build of the GPL project everywall/ladder.
- 入口设计见功力:粘贴链接、任意 URL 前加一个 /(配合 iPhone 快捷指令 Share 扩展)、书签脚本,三条路都通,还留了 /raw 与 /api 给脚本用。The entry points show care: paste a link, prefix any URL with / (pairing with an iPhone Shortcut share sheet), or drag the bookmarklet — plus /raw and /api for scripts.
- 最特别的是页面上那句自我限制:「付费墙是养活新闻业的——如果你天天读某家报纸,请订阅。WallHop 只为你永远不会再去的网站上的一篇转来转去的文章。」把工具钉死在「一次性访问」而不是「知识解放」。The most unusual part is the ethics note printed on the page: 'Paywalls pay for journalism — if there's a paper you read every day, subscribe. WallHop is for a one-off article from a site you'll never visit again.' It nails the tool to one-off access rather than 'liberating knowledge.'
- 带走:小工具的定位比实现更重要——同样一个代理,把使用边界画清楚,反而比含糊其辞的「仅供参考」可信得多。Takeaway: for small tools, positioning matters more than implementation — the same proxy with its use-boundary drawn explicitly is more trustworthy than a vague 'for reference only.'