Commit Graph
19 Commits
Author SHA1 Message Date
TermiNexus 16d0302b08 fix(compiler): stub 注入泛型类跳过方法 declare,修复 ndarray[T] 错误特化
Phase2 翻译 App 文件注入 numpy stub 时,_inject_method_declare 解析
class ndarray[T] 的模板签名(ndarray[T] | t.CPtr),T 无上下文可替换
→ _specialize_generic_class("ndarray", ["T"]) 递归崩溃。泛型类
(type_params 非空)跳过方法 declare 注入,具体特化方法 define 已由
Phase1 生成,返回类型仍走 vpi 返回注解缓存泛型归一化。
(含 4 处 TC-DBG 定位插桩,验证后移除)
2026-08-08 16:33:04 +08:00
TermiNexus ea8bb0b3a4 fix(compiler): 方法返回类型三级来源重构(移除 _infer_method_ret_ty 按名推断)
方法返回类型改为:当前模块函数 → text.ll define → vpi stub 返回注解缓存,全部未命中 fail-fast 终止(无白名单、无 hook 编译器)。

1. VpiReader 文本提取缓存 + 按需加载 + 动态扩容 + 无注解默认 i32
2. 类名解析修复(继承括号不入类名、模块级函数清空类名)
3. SetTempDir 提前到 Phase1(json 在 Phase1 翻译,Phase2 太晚)
4. 内置方法 __before_init__/__init__/__new__ 固定返回类型
5. 泛型归一化匹配 + _subst_template_arg 模板参数替换
6. 调试插桩 VPI_DEBUG_ENABLE 开关(默认关闭)
2026-08-08 09:43:15 +08:00
TermiNexus a9ebb20790 "fix(compiler): vpi 返回注解缓存按需加载 + 动态扩容
1. _lookup_method_ret_ty_via_vpi 查缓存前按需读取
   {temp_dir}/{sha1[0:2]}/{sha1}.vpi 填充缓存,覆盖模块自身翻译时
   (同模块方法调用、定义在后)stub 尚未注入的场景
2. 缓存容量由固定 4096 改为 stdlib.realloc 翻倍动态扩容(上限 1M),
   根治写满后条目静默丢弃导致 JsonValue._pool_alloc 等查不到"
2026-08-08 02:24:12 +08:00
TermiNexus 3197152d4e fix: vpi stub 注解解析改用被读模块自己的 imports 上下文,根治跨模块误报 2026-08-08 00:51:19 +08:00
TermiNexus 6dbcbe247e fix: vpi stub 注入期间修正错误归因,多级堆栈显示编译上下文与被读 stub 真实位置 2026-08-08 00:33:29 +08:00
TermiNexus e2bdfc1c4e chore: 移除 DDEBUG/MATCHDBG 调试日志残留 2026-08-07 23:29:39 +08:00
TermiNexus 987088fdff 'fix(core): support keyword args in method calls
_translate_method_call ignored cl.keywords, so keyword-style calls
like add_argument("--count", short="-c", arg_type=INT) lost all
keyword values (short_name/arg_type stayed default), breaking
Test 4. Match keywords against function params by name, fill
missing params with zero values to keep call arity consistent.'
2026-08-07 17:30:41 +08:00
TermiNexus f7cc0f84d1 解决了_parse_type_string 节点损坏,改用字符串直接解析 2026-08-07 01:44:34 +08:00
TermiNexus c876df7907 依据 T97 决定性结果,修复了 CVoid 严格验证,other_ty 有效性验证,fallback 不依赖 kind() 实现 2026-08-06 23:00:01 +08:00
TermiNexus f8436c74d2 提交新的建议忽略 2026-08-06 18:08:09 +08:00
TermiNexus 8ad500c4da 基本稳定可以编译 Test 2026-08-05 20:12:08 +08:00
TermiNexus a3b9bdc409 修正了逻辑,使 TPV 可以编译 Test,但自举还有一段距离 2026-08-03 02:01:20 +08:00
TermiNexus bfb55d68f4 取消了 i8* == i8* 实际使用 strcmp 的规则,修复了诸多 Bug 2026-07-30 21:56:19 +08:00
TermiNexus d227bee139 将 .py 和 .pyi 后缀名改为了 .vp 和 .vpi 后缀名 2026-07-30 16:34:50 +08:00
TermiNexus 32af3f93fa 自举实验失败,C1 编译 Test 成功,暂未达到自举收敛点 2026-07-30 15:44:32 +08:00
TermiNexus 03d0bba534 修正了一些错误 2026-07-26 20:33:17 +08:00
TermiNexus 909792bc8f 实现了切片存储 2026-07-22 21:56:33 +08:00
TermiNexus 751dc72d61 实现了 TPV 的 pyi 生成逻辑(部分),删除了直接拷贝自 CPython(TPC) 版本的死代码 2026-07-22 19:47:23 +08:00
TermiNexus 92a381f003 修复了 TPV 的一些错误,包括闭包等 2026-07-22 14:05:38 +08:00