Windows AOT spike3(探索,1.7.0-dev / v4.38)
English summary. Exploratory Windows AOT spike3: 5/5 selected non-trivial AOT fixtures embedded in a PE run under wine with byte-identical stdout/rc; estimate 4–6/6–9 weeks MEDIUM-HIGH. There is no Windows AOT implementation and no Windows platform-usability claim; PE emitter/bootstrap/general runtime/SEH remain missing; 1.5 defers the full workstream; older estimates are historical.
Windows AOT 仍未实现、不声称 Windows 平台可用。本页记录 spike3 的探索结果与当前估算。
spike3 结果(探索性)
在第 2 个 spike(PE 内嵌 Q+ AOT 机器码 + VEH syscall trap runtime)基础上,把同一工具链用于 5 个非平凡 AOT-supported fixtures:VM 期望输出 → AOT ELF → 嵌入 PE(R+X @0x400000; 0F 05 syscall → CC 90;BSS 为 no-file .bss;rodata 可选 VirtualAlloc)→ mingw 链接 PE + VEH runtime → wine 运行 → stdout/rc 逐字节比较。
| fixture | 类别 | patched syscall 点 | PE 大小 | 结果 |
|---|---|---|---|---|
abstractions/p11_gstruct_ok.q | structs/generic | 204 | 109,147 B | PASS |
bounds/p08_array_elem_ok.q | arrays/loops | 230 | 112,989 B | PASS |
u64/p08_strings.q | strings | 697 | 329,819 B | PASS |
aot_float/p01_float_print.q | float formatting | 232 | 125,525 B | PASS |
aot_u64/p08_aot_i64_boxed.q | int64 boxed | 236 | 126,549 B | PASS |
5 PASS / 0 FAIL(全部 rc=0、stdout 一致、无 “unsupported syscall” trap)。这是选中子集 的证据,不是通用 Windows AOT 声明:fixtures 来自 tools/test.sh 的 aot_pair(已 AOT 支持)且 syscall 较轻(主要 write/exit);allocator/file/thread/args、SEH、真实 Windows 均未覆盖。
估算演进(当前 = 4–6 / 6–9 周,MEDIUM-HIGH)
| 阶段 | 估算 | 状态 |
|---|---|---|
| 1.4.4 可行性 | 9–15 周 HIGH | historical(被后续取代) |
| spike1/2 | 7–10 / 10–14 周 MEDIUM-HIGH → 5–8 / 8–11 周 | historical |
| spike3(当前) | 4–6 周乐观 / 6–9 周悲观,MEDIUM-HIGH | 当前估计 |
关键路径已从“基础 trap runtime”转为 Q+ 内 PE emitter + 三阶段自举固定点,随后是通用 runtime(allocator/args/file)。1.5 建议暂缓完整 Windows AOT workstream;若 Maintainer 排优先级, 仅做 bounded 4–6 周 static-console 子集 POC;不得作为 1.5 主线交付、不得称平台可用。
仍未完成(gap)
- Q+ 内 PE emitter(
aot_pe.q,替换 mingw 链接)、确定性时间戳/checksum、.pdata/SEH 策略; - 三阶段自举 + 可复现 PE;allocator/args/open/read/stat/mmap/brk/clock 等 runtime 泛化;
- 真实 Windows smoke(当前仅 wine);负向 loud 用例矩阵;打包/CI。
相关文档:docs/WIN32_AOT_SPIKE3.md(当前)、WIN32_AOT_SPIKE2.md、WIN32_AOT_SPIKE.md、 WIN32_AOT_FEASIBILITY.md(均历史/探索记录);spec §11.8。发布候选 NOT PUBLISHED。