M2 · charge storage on the dieM2 · 晶粒上的電荷儲存
Where the die overrules the engine晶粒推翻引擎之處
This is the real 2C02 silicon layout — the same segment polygons the switch-level engine simulates — rendered live in your browser. On top of it, every floating pass-gate election is painted as a graded heatmap: red where real silicon capacitance reverses the winner the engine's connection-count proxy would have picked, amber where the engine can't call it at all — a tie it settles by graph-walk order — and cool blue where physics and the engine agree. Drag to pan, wheel to zoom, hover any cell. Of 6,820 floating elections on this die, 517 (7.6%) come out backwards under physics and another 601 (8.8%) are coin-flips the engine breaks by accident. Because M2 is a physical quantity, the colour is a temperature, not a label — and the hot cells cluster exactly where you would hope: the pattern shift-registers and the sprite datapath. 這是真實的 2C02 矽佈局 —— 開關級引擎模擬的同一批 segment 多邊形 —— 在你瀏覽器裡即時渲染。上面把每一場浮動 pass-gate 選舉畫成一張分級熱度圖:紅色 = 真實矽電容把贏家翻盤,推翻引擎用連接數代理選出的贏家;琥珀 = 引擎根本喊不出來 —— 一場它靠圖走訪順序硬分的平手;冷藍 = 物理與引擎一致。拖曳平移、滾輪縮放、停在任一 cell 上。這顆晶粒上共 6,820 場浮動選舉,其中 517 場(7.6%)在物理下翻盤,另有 601 場(8.8%)是引擎意外分出的擲硬幣。因為 M2 是物理量,顏色是溫度、不是標籤 —— 而發燙的 cell 正好聚在你會期望的地方:pattern 移位暫存器與精靈資料路徑。
Faint background = the die's layers (diffusion / poly / metal). Graded fills = the M2 election heatmap. A flagged node with no polygon (pure-logic, no silicon area) simply isn't drawn — here every one of the 7,378 flagged cells has silicon, so the map is complete. Click a swatch below to toggle a temperature band; turn off agree to see only the divergence.暗色背景 = 晶粒各層(擴散 / 多晶矽 / 金屬)。分級填色 = M2 選舉熱度圖。被標記但沒有多邊形的節點(純邏輯、無矽面積)就不畫 —— 這裡 7,378 個被標記的 cell 每一個都有矽面積,所以這張圖是完整的。點下方色塊可開關溫度帶;把一致關掉,就只剩分歧。
How the detection works偵測演算法怎麼運作
M4 is a structural pattern — a latch either is or isn't. M2 is the opposite: a physical one, decided by a continuous quantity the netlist never states — capacitance. So there is no clean yes/no; there is a margin, and the right picture is a heatmap. Here is the quantity, and the election it settles. M4 是結構性 pattern —— 一個閂鎖要嘛是、要嘛不是。M2 恰好相反:它是物理性的,由網表從未寫下的一個連續量決定 —— 電容。所以沒有乾淨的是/否;有的是一個差距,而正確的畫面就是熱度圖。以下是那個量,以及它裁決的那場選舉。
1 · What a switch-level engine does when nothing drives1 · 沒有東西在驅動時,開關級引擎怎麼做
When a transistor group has no path to ground, no pull-up, and no external driver, it is floating — it must hold its remembered charge. Real silicon resolves this by physics: the node with the largest capacitance wins, because it holds the most charge. But Visual6502 → MetalNES → AprVisual.S1 never carried real capacitance, so they use a cheap proxy — a connection count — with ties broken by whatever order the graph walk happens to visit: 當一個電晶體群沒有接地路徑、沒有上拉、也沒有外部驅動時,它就浮動 —— 只能保住記憶中的電荷。真實矽靠物理裁決:電容最大的節點勝出,因為它存的電荷最多。但 Visual6502 → MetalNES → AprVisual.S1 從來沒有真的電容,所以它們用一個廉價代理 —— 連接數 —— 平手時就看圖走訪剛好先碰到誰:
conn(node) = (#times node is a transistor channel terminal c1/c2)
+ (#times node is a transistor gate)
# winner = larger conn; equal conn → decided by graph-walk order (an accident, not physics)
2 · The capacitance the die actually carries2 · 晶粒實際承載的電容
The layout does know. segdefs carries every silicon polygon (its layer + vertex list); transdefs carries every gate's W×L. Node capacitance is dominated by gate oxide, plus the wiring area on each layer — so we sum the shoelace area of each polygon, weighted by an NMOS-era per-layer prior (metal ≈ 0.03, poly ≈ 0.04, diffusion ≈ 0.10 fF/µm², gate oxide ≈ 1.0), and add the area of every gate the node drives. Only the ratios decide a winner, so no unit calibration is needed:
佈局確實知道。segdefs 記錄了每一塊矽多邊形(層別+頂點串);transdefs 記錄了每個閘的 W×L。節點電容由閘氧化層主導,加上各層佈線面積 —— 所以我們把每塊多邊形的鞋帶面積加總,依 NMOS 時代的各層先驗加權(金屬 ≈ 0.03、多晶矽 ≈ 0.04、擴散 ≈ 0.10 fF/µm²、閘氧化層 ≈ 1.0),再加上該節點所驅動每個閘的面積。決定贏家的只是比值,所以不需要單位校準:
+ Σ{ t : gate(t)=node } gate_area(t) × W_gate
3 · The election — and charge-sharing, which decides it3 · 那場選舉 —— 以及裁決它的電荷分享
The 2-node floating groups that dominate the engine's sub-1% floating branch are exactly the pass-gate pairs: a transistor whose two channel terminals are both signal nodes. When that gate opens, the two nodes share charge and settle to a single weighted-average voltage: 主宰引擎那不到 1% 浮動分支的兩節點浮動群,正是那些 pass-gate 對:一顆電晶體、兩個通道端點都是訊號節點。當那個閘打開,兩個節點分享電荷,穩定到單一的加權平均電壓:
So for every pass-gate pair we hold the vote twice — once with the engine's conn proxy, once with C_phys — and compare the winners. That is the whole detector: ~6.8k elections, re-counted under physics.
於是每一對 pass-gate,我們投兩次票 —— 一次用引擎的 conn 代理,一次用 C_phys —— 再比對贏家。這就是整個偵測器:約 6.8k 場選舉,用物理重新計票。
| Heat band溫度帶 | What the election did選舉發生了什麼 | 2C02 count2C02 數量 |
|---|---|---|
| flip翻盤 | physics reverses the engine's winner — the bigger real capacitor is the node the connection count called the loser. The engine, run to quiescence, would latch the wrong value.物理推翻引擎的贏家 —— 真實電容較大的,是連接數判為輸家的那個節點。引擎跑到穩定,會閂進錯的值。 | 517 (7.6%) 853 nodes個節點 |
| lottery抽籤 | the engine's counts tie — it has no opinion and settles the group by graph-walk order, a structural accident. Physics is decisive here, so the "right" answer exists; the engine just isn't computing it.引擎的計數平手 —— 它沒意見,靠圖走訪順序把群裁定掉,一個結構性偶然。物理在這裡是有定論的,「正確」答案存在,只是引擎沒在算它。 | 601 (8.8%) 982 nodes個節點 |
| agree一致 | the connection count happens to name the same winner physics does — the cheap proxy is right. The cool baseline the hot spots stand out against.連接數剛好指到與物理相同的贏家 —— 廉價代理是對的。這是讓熱點凸顯出來的冷色基線。 | 5,693 (83.5%) 5,543 nodes個節點 |
| top flips最烈翻盤 | the peak of the heatmap — the flips where the capacitance ratio is most lopsided (decisiveness d = |Ca−Cb|/(Ca+Cb) nearest 1). Not a separate cause; just the reddest of the red.熱度圖的頂點 —— 電容比最懸殊的那些翻盤(果斷度 d = |Ca−Cb|/(Ca+Cb) 最接近 1)。不是另一種成因,只是紅中之紅。 | 40 nodes個節點 |
/bkg_pat_out, the background pattern output, with C_phys ≈ 1176 against its rival's ≈ 64 (d = 0.90); /spr_pat_out, the sprite pattern output, is close behind. These are wide bus nodes — physically large, high-capacitance — that the engine sees only as conn = 2 versus a rival's 3, so it picks the rival. Where the die lays down more silicon, the die wins the charge-share; and by colouring that margin, the heatmap redraws the datapath the engine's counter is blind to. That is the whole point of a physical mechanism: the number is the geometry.
掃描器根本不知道什麼是「移位暫存器」。它只拿到多邊形與閘幾何、別無其他 —— 這顆晶粒上最果斷的翻盤卻是 /bkg_pat_out(背景 pattern 輸出),C_phys ≈ 1176 對上對手的 ≈ 64(d = 0.90);/spr_pat_out(精靈 pattern 輸出)緊追在後。這些是寬匯流排節點 —— 物理上很大、高電容 —— 引擎卻只看到 conn = 2 對上對手的 3,於是選了對手。晶粒鋪下越多矽的地方,晶粒就贏得電荷分享;而只要把那個差距上色,熱度圖就重畫出引擎的計數器看不見的資料路徑。這正是物理性機制的全部命題:那個數字就是幾何。
Full write-up — the scatter of proxy vs capacitance, the verdict bars, and the decisiveness histogram: M2 · Who wins when nothing is driving? →完整論述 —— 代理 vs 電容的散點、判決長條、與果斷度直方圖:M2 · 沒有東西在驅動時,誰勝出? →
Live layout rendering adapted from Visual6502's wires.js (Brian & Barry Silverman, MIT). Layout data derived from the Visual 2C02 netlist (CC-BY-NC-SA) — the corrected data/system-def/. Detection: WebSite/s1a/py/m2_charge_wins.py --dump-nodes.
即時佈局渲染改編自 Visual6502 的 wires.js(Brian & Barry Silverman,MIT)。佈局資料衍生自 Visual 2C02 網表(CC-BY-NC-SA)—— 修正版 data/system-def/。偵測:WebSite/s1a/py/m2_charge_wins.py --dump-nodes。