Who wins when nothing is driving?沒有人在驅動的時候,誰輸誰贏?

Toolbox study #1 (mechanism M2). A switch-level engine settles a floating transistor group by letting "the biggest capacitance win" — but it measures bigness by counting wires. The die's own polygons know the real answer. One Python script, two dies, 9,682 elections re-run under physics: 1,000 verdicts flip.

工具箱研究 #1(機制 M2)。開關級引擎裁決浮接電晶體群的規則是「電容最大者勝」—— 但它量「大」的方式是數線頭。晶粒自己的多邊形知道真正的答案。一隻 Python、兩顆晶粒、9,682 場選舉用物理重投:1,000 場判決翻盤。

M2 · charge storage m2_charge_wins.py 2A03 JSON 2C02 JSON 2026-07-17

The problem問題 The engine's quietest rule引擎裡最安靜的一條規則

A switch-level simulator spends its life resolving groups: sets of nodes joined by conducting transistors. Each group takes one value, picked by a strict priority — a path to GND wins; else VCC or a pull-up wins; else an external driver; else… nothing is driving at all. That last case is a floating group: a puddle of charge cut off from every supply, remembering whatever it held last.

開關級模擬器一輩子都在解:被導通電晶體連在一起的一坨節點。每群取一個值,按嚴格優先序 —— 有到 GND 的路就 GND 勝;不然 VCC / 上拉勝;不然外部驅動;再不然⋯⋯根本沒有人在驅動。最後這種就是浮接群:一灘被所有電源切斷的電荷,記著它最後的值。

Our engine (following Visual6502 → MetalNES) resolves it with one line of intent: “purely floating: largest-cap node wins.” But no engine in this family ever had capacitance. The stand-in, from WireCore.cs:

我們的引擎(承 Visual6502 → MetalNES)用一句話裁決它:「純浮接:電容最大的節點勝。」但這一族引擎從來沒有真的電容。頂替上場的,是 WireCore.cs 裡的:

NodeConnections[nn] = node.C1c2s.Count + node.Gates.Count;   // the "capacitance" proxy
// GetNodeValue(), floating branch: the group takes the state of its max-connection node;
// ties fall through to graph-walk order — a structural accident, not physics.

Counting wire attachments is not a crazy proxy — more terminals usually means more metal. But it is a proxy, and this study asks the obvious question nobody in the lineage ever checked: how often does it get the election wrong?

數線頭不是亂來的代理 —— 接點多通常銅線也多。但它終究是代理,而這份研究問一個這一族從來沒人查過的問題:它把選舉判錯的頻率,到底是多少?

Why it matters here. The M2 shim family — open-bus last transferred byte, OAM dynamic cells destroyed by a rendering-disable edge, the DL data latch — are all charge-storage behaviours patched around this exact abstraction. Before S1a replaces those shims with a real charge mechanism, we need to know how much of the floor is load-bearing.

為什麼重要。M2 shim 家族 —— open bus 的最後傳輸位元組、被關渲染邊沿毀掉的 OAM 動態 cell、DL 資料閂鎖 —— 全是繞著這個抽象打的電荷儲存補丁。S1a 要用真的電荷機制取代它們之前,得先知道這塊地板有多少是承重的。

The physics物理 Charge sharing: the biggest tank sets the level電荷分享:最大的水缸決定水位

When a pass gate closes between two floating nodes, their charge redistributes: the final voltage is the capacitance-weighted average V = (C₁V₁ + C₂V₂) / (C₁ + C₂). In a binary world that has a clean reading: the bigger capacitance drags the pair to its own remembered state. A 10:1 capacitance ratio is a landslide; 1.05:1 is a coin toss (and real silicon would settle mid-rail and let the next stage's threshold decide).

當 pass gate 在兩個浮接節點之間關合,電荷重新分配:最終電壓是電容加權平均 V = (C₁V₁ + C₂V₂) / (C₁ + C₂)。翻成二值世界就是一句話:電容大的一方,把整對拖向自己記住的值。電容比 10:1 是壓倒性勝利;1.05:1 是擲銅板(真矽會停在中間電位,讓下一級的門檻決定)。

And real node capacitance is not "number of wires". In this NMOS process it is dominated by thin gate oxide: every transistor gate hanging on a node contributes ~1.0 fF/µm² of its W×L, an order of magnitude above the wiring itself (metal ≈ 0.03, poly ≈ 0.04, diffusion ≈ 0.10 fF/µm² — Mead & Conway era priors). A short stub driving three gates can out-weigh a long lonely trace; a long bus with no listeners can out-weigh a busy little junction. Connection count sees none of this structure.

而真實的節點電容,不是「線的數量」。這個 NMOS 製程裡它由薄閘氧化層主導:掛在節點上的每一顆電晶體閘極,以它的 W×L 貢獻 ~1.0 fF/µm² —— 比佈線本身高一個數量級(metal ≈ 0.03、poly ≈ 0.04、diffusion ≈ 0.10 fF/µm²,Mead & Conway 時代的先驗)。一根驅動三個閘極的短樁,可以比一條孤單的長線更重;一條沒有聽眾的長匯流排,可以比一個熱鬧的小接點更重。連接數看不見這些結構。

A real election from the 2C02 die 2C02 晶粒上一場真實的選舉 A = /bkg_pat_out long poly/metal run + a row of listener gates 長長的 poly/metal 走線 + 一排聽眾閘極 gates: W×L × Cox — the heavy part of C_phys 閘極:W×L × Cox —— C_phys 的主力 C_phys ≈ 1176 · conn = 2 pass gate closes pass gate 關合 B = sprite-fetch mux node tiny internal junction, 3 attachments 內部小接點,只有 3 個接腳 C_phys ≈ 64 · conn = 3 Engine: conn 3 > 2 → the tiny mux node wins the pair 引擎:數線頭 3 > 2 → 小節點勝出 —— 判給了錯的一邊 Physics: C 1176 vs 64 → the big line wins, 18:1 — decisiveness d = 0.90 物理:電容 1176 對 64 → 大線 18:1 壓倒性勝出(決定性 d = 0.90) V = (C_A·V_A + C_B·V_B) / (C_A + C_B) ≈ 0.95·V_A + 0.05·V_B After charge sharing the pair sits at A's remembered value — B dilutes it by only 5%. 電荷分享之後,整對停在 A 記住的值 —— B 只稀釋了 5%。
The single most decisive flip found on the 2C02: the background pattern shifter output vs the sprite-fetch multiplexer node beside it. The engine hands the election to the wrong side.2C02 上最一面倒的翻盤:背景 pattern 移位器輸出 vs 旁邊的精靈取圖多工節點。引擎把選舉判給了錯的一邊。

The data資料 The die already carries its own answer晶粒身上本來就帶著答案

Everything needed is in the netlist files we already parse — and, until now, partly threw away:

需要的一切都在我們本來就解析的網表檔裡 —— 只是至今有一部分解析完就丟掉:

Layer層別metalpolydiffusion (sw / diode / rail)gate oxide (per gate W×L)閘氧化層(每閘 W×L)
weight, relative fF/unit²權重(相對 fF/unit²)0.030.040.101.00

Units are relative — a verdict needs only ratios, so die coordinates never need converting to microns, and the priors only need to be right in proportion. The netlist data itself is CC-BY-NC-SA (Visual6502 project); the script takes paths to your own copies and nothing is vendored here.單位是相對的 —— 判決只需要比值,所以晶粒座標不必換算成微米,先驗只要比例正確。網表資料本身是 CC-BY-NC-SA(Visual6502 計畫);程式吃你自備檔案的路徑,本站不隨附資料。

The script程式 m2_charge_wins.py — re-running 9,682 electionsm2_charge_wins.py —— 重投 9,682 場選舉

One file, stdlib only (download). The recipe:

一個檔案,只用標準函式庫(下載)。配方:

python m2_charge_wins.py --segdefs visual2a03-segdefs.js --transdefs visual2a03-transdefs.js \
                         --nodenames visual2a03-nodenames.js --label 2A03 --outdir out/
# → console report + m2_2A03_summary.json + 3 SVG figures

Results結果 A thousand flipped verdicts, twelve hundred coin tosses一千場翻盤,一千二百次擲銅板

transistors電晶體 pass-gate pairspass-gate 對 agree一致 FLIP翻盤 engine tie (lottery)引擎平手(抽籤) Spearman ρ
2A03 (CPU+APU)10,9162,862 1,765 · 61.7%483 · 16.9%613 · 21.4%0.68
2C02 (PPU)16,8726,820 5,693 · 83.5%517 · 7.6%601 · 8.8%0.56
both dies兩晶粒合計27,7889,682 7,458 · 77.0%1,000 · 10.3%1,214 · 12.5%

Read that middle column honestly: one in ten elections comes out backwards under physics, and another one in eight is a tie the engine settles by the order a graph walk happened to visit nodes — the same "structural lottery" family (D-class) that made instrument-probing and netlist patches so hazardous in the accuracy campaigns.

誠實地讀中間那欄:每十場選舉就有一場在物理下是反的,另外每八場有一場是平手 —— 由圖走訪剛好先碰到誰來裁決,正是精度戰役裡讓探針與網表補丁如此危險的那個「結構樂透」家族(D 類)。

2A03 scatter
2A03: connection count vs C_phys, one dot per node (log-log). Correlated (ρ=0.68) but wide — a full decade of capacitance hides inside each connection count. Purple: nodes involved in flipped pairs.2A03:連接數 vs C_phys,一點一節點(log-log)。有相關(ρ=0.68)但很散 —— 同一個連接數底下藏著整整一個數量級的電容差。紫點:翻盤對的成員。
2C02 scatter
2C02: same picture, ρ=0.56 — the PPU's proxy is even looser, though its pair verdicts agree more often (its pass-gate fabric is more uniform).2C02:同一張圖,ρ=0.56 —— PPU 的代理更鬆,不過它的節點對判決一致率反而較高(pass-gate 結構較均勻)。
2A03 verdicts
2A03 verdicts. Only 61.7% of floating-pair elections stand on solid ground.2A03 開票。只有 61.7% 的浮接對選舉站在實地上。
2C02 verdicts
2C02 verdicts. Fewer flips, but 601 lotteries remain.2C02 開票。翻盤較少,但仍有 601 場抽籤。
2C02 decisiveness
How decisive is physics where it disagrees? Flipped pairs (red) are not marginal calls — the distribution reaches d≈0.9, i.e. 18:1 capacitance landslides that the engine calls for the other side. (Green: agreeing pairs, for comparison.)物理翻盤的地方,它有多篤定?翻盤對(紅)不是邊緣判例 —— 分佈一路延伸到 d≈0.9,也就是 18:1 的電容壓倒性差距,引擎卻判給另一邊。(綠:一致的對,對照用。)

Named casualties有名有姓的受害者

So what所以呢 The staged road from census to shim retirement從普查到 shim 退役的分段路

This census is evidence and parameters, not yet a mechanism. The road it opens is deliberately staged — each step banked and verified before the next (the project's standing rule: a shim removed without full verification didn't happen):

這份普查是證據與參數,還不是機制。它打開的路刻意分段 —— 每一步入帳並驗證過,才走下一步(專案鐵律:拔了 shim 沒驗證 = 沒發生):

Bonus, for M7: the 1,214 lottery pairs double as the target list for canonical renumbering — every one is a place where determinism currently rests on file order. Physics (this page's C_phys) is exactly the tie-break key M7 wants. 順帶給 M7 的紅利:那 1,214 對抽籤,同時就是正準重編號的目標清單 —— 每一對都是決定論目前壓在檔案順序上的地方。物理(本頁的 C_phys)正是 M7 想要的平手裁決鍵。

Honest limits誠實極限 What this census cannot say這份普查說不了的事