log: X86 motherboard hit OOM swap death-spiral on its CPU board PCB write

Killed at the 14-min mark — VmRSS 1.96 GB + VmSwap 1.41 GB on a 3.3 GB
RAM box with 4 GB swap (3.6 GB used), read_bytes 24 GB (pure swap thrash),
process state D (uninterruptible disk sleep). The CPU board PCB doc
(8K+ objects, 35+ child schematic pages) overflowed our current
all-in-memory build pattern: pcb_writer builds the full output list
before to_sexpr serializes once at the end, plus the 35 write_sch_page
calls each build their own Relations + lib_symbols dedup state.

Saved what finished: 4/5 X86 boards complete (Sch-CAM-IMX415,
Schematic1, SCHEMATIC1, Sch-VTX-SSC338Q), the CPU board SCHEMATIC1_1
has all its 35 child .kicad_sch but no .kicad_pcb. Final downstream
delivery: 17 board projects across the 3 supported Pro projects, 32/32
files pass kicad-cli (sch erc + pcb export svg).

Streaming-write fix is the next logical follow-up but out of scope
for this turn.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-29 00:56:17 +08:00
parent 183f82a3be
commit c474f8ad83

23
log.md
View File

@@ -16,7 +16,7 @@
|---|---|---|---|
| ESP-VoCat | Pro 3.x AES | ✅ 6 boards | 之前已验证 |
| 220V 电源 | Pro 3.x AES | ✅ **7 boards** | 修了两个 bug 之后 |
| X86 主板 | Pro 3.x AES | ⏳ 跑中 | 7374 docs / 1.9GB RAM目前 5 boards 出来CPU 板 PCB 还在写 |
| X86 主板 | Pro 3.x AES | ⚠️ 4/5 boards | 7374 docsCPU 板 PCB 写到 OOM swap death-spiral14 min 还没完,**杀掉**保剩 4 板 |
| 泰山派 (RK3566) | **Pro 2.x JSON** | ❌ no BOARDs | 我们的 EPRO2 pipeline 不识别 Pro 2.x docType |
| 梁山派 | **Pro 2.x JSON** | ❌ no BOARDs | 同上 |
@@ -49,9 +49,28 @@
71 → 73`test_odd_inner_signal_count_padded_to_even_total` + `test_duplicate_board_titles_get_distinct_basenames`
### X86 OOM 真因
跑到 14 分钟还没出 CPU 板 .kicad_pcb看进程状态
- VmRSS 1.96 GB + VmSwap 1.41 GB = 实占 3.4 GB
- 系统 3.3 GB RAM + 4 GB swapfree 120 Mi、swap free 434 Mi——**死循环 swap 抖**
- read_bytes 24 GB远超数据本身—— 全是 swap-in/swap-out
- State: Duninterruptible disk sleep
CPU 板 PCB doc 是 X86 项目里最大的(>8K objects + 35+ 子 SCH 页),我们的 `pcb_writer` 把整个输出 list 在内存里建好再 to_sexpr 一次性序列化,加上 35+ 次 `write_sch_page`(每次 `Relations.build` 加 lib_symbols 嵌入)累积爆 RAM。
**杀掉,保已经写完的 4 块**。要修得做 streaming 输出(边算边写文件,不在内存里建大 list。下一轮独立改动。
### 下游交付
ESP-VoCat 6 + 220V 7 = **13 个 board** 项目目录就绪,可以直接拷给下游同学的 corpus。X86 跑完后再加 5 个左右(已知是 ADL_S 平台 motherboard含 CPU/PCH/USB/PCIe 多板)。
| 来源 | 板数 | 状态 |
|---|---:|---|
| ESP-VoCat | 6 | ✅ 全 |
| 220V 电源 | 7 | ✅ 全 |
| X86 主板 | **4/5** | ✅ 部分CPU 板 SCHEMATIC1_1 缺 .kicad_pcb子页 SCH 都在)|
| 泰山派 | 0 | ❌ Pro 2.x本轮不支持 |
| 梁山派 | 0 | ❌ Pro 2.x本轮不支持 |
| **合计** | **17** | 32/32 文件 kicad-cli 解析通过 |
---