Conversation
改法(checker.cr):
- 抽可复用三件(照 (乙) dex_align_call_args 先例):`s1p_gate`(懒初始化+CORE_S1P 门)·
`s1p_arg_one`(跳过规则②③ + unify + **只打数值**台账行)· `s1p_arg_ring`(fi 形参链环);
另加 `s1p_enum_ring`(枚举变体**不注册 FuncInfo** ⇒ 形参型取枚举声明的 `ei_variant_type_node`)。
- 三处接线(此前本分支均早退 ⇒ 台账盲区):**方法**(`param_skip=1`:实参链不含接收者、形参链含 self)·
**模块限定**(`param_skip=0`)· **枚举构造**(走 enum 环)。
- 修正块内 ④ 注(旧注写反):**实参链不含接收者**,偏移在**形参**侧(parser 实证)。
- `EXPR_AT`(内建)**本刀不做**:其盲区是「已打点但被 build 面豁免放行」⇒ 由刀 4 撤豁免兑现。
覆盖面矩阵(实测,CORE_S1P=1;前=刀 2 前):
直调 `f("hi")` 前 `9917 2 29 0 0 3 f` 后**逐字同**(助手抽取行为等价)
方法 `s.m("hi")` 前 0 条 后 `9917 3 57 1 0 3 S.m`(形参序=1,self 已跳)
模块 `fmt.int_str` 前 0 条 后 `9917 2 47 0 0 3 int_str`
枚举 `V("hi")` 前 0 条 后 `9917 2 27 0 0 3 V`
内建 `@raw_int("s")` 无(设计;TF07 硬错,归刀 4)
判据网(本刀的重锁,按该断言**自己的指令**执行):
- `tests/selfhost/test_s1p_liveness.py` 的 `method_call_not_covered`(把「方法未覆盖」钉成预期,
其断言文案即写着「若此处非 0 ⇒ 请同步更新档头注」)⇒ 重锁为 `method_call_covered`(恰 1 条 + 形参序/被调名逐字段),
并**新增两条覆盖腿** `module_call_covered` / `enum_ctor_covered`(均非嵌套形态 + 逐字段,**两向钉子**);
档头注同步改写(历史留痕保留)。套件现 **PASS**。
**零足迹判据(不是声称)**:默认位(无 CORE_S1P)——pre(develop@origin 独立工作区所构)vs post 双编译器逐档冷态对拍:
`tests/suite/*.cr` **32 档 ELF+`.ccr` 逐字节相同 · 0 档不同 · 4 档两侧同非零**;canary **5/5** 且五值同改前;
S1P 套件的默认位腿(语料 36 档零打点 + 自源台账 0 点)全绿。
**顺带登记(先于本刀存在的缺陷)**:嵌套实参里的调用被台账**打点两次**(`g(f("hi"))` ⇒ [f,f],平铺 ⇒ [g]),
**pre/post 二进制同形** ⇒ 非本刀引入;影响 = 扫面计数对嵌套点翻倍(刀 3 分类时须去重)。
批次判据:check src/compiler rc=0 · ^error[ = 0 · selftest-types 415/415 · 五套件全绿
(s1p_liveness / generic_param_erasure / optional / generic_constr / arg_inference_gap)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
把 S1P 报账台账从直调形扩到四形态(直调 / 方法调用 / 模块限定 / 枚举构造),为
(甲)刀 4 的实参面硬错提供完整覆盖面。改动面(2 档)
src/compiler/checker.cr—— 抽可复用助手(s1p_gate/s1p_arg_one/s1p_arg_ring/s1p_enum_ring),四形态共用一份台账;方法形(含接收者位偏移param_skip=1)、模块限定形、枚举构造形(载荷型取自枚举声明,变体不注册 FuncInfo)三处新接线。tests/selfhost/test_s1p_liveness.py—— 钉「方法调用不覆盖」的旧判据按其实例自带的说明重锁为「已覆盖」,并补模块形/枚举形两条腿。判据(本机实测)
1. 活性自证(防「0 点 = 没装」):方法形探针
x.take(n)(string形参 ←int变量)⇒ 刀 2 前 0 行 · 刀 2 后 1 行(
9917 10 12 1 3 0 S3.take);同档直调形对照freefn(n)仍报。2. 零足迹(逐字节):同一输入
tests/suite/chan_test.cr、同一 cwd、pre/post 两二进制⇒
out(ELF,57582 B)与out.ccr(244794 B)IDENTICAL。3.
.ccrSTR 段面(本仓有前科:必经路径新增str_intern⇒ 破逐字节判据):刀 2 新增行里str_intern= 0,仅 3 处只读istr_get⇒ 结构性零新增 intern。4. canary 5/5 PASS(对未改动的值表
tools/baseline/canary_values.tsv):canary_elf28854 B ·pa_ccr·pa_static_ccr·gt_ccr·gt_static_ccr⇒ 无需 bump、无需重锁。
5. 覆盖面读数(四形态下):
check src/compiler(40 档全闭包,project)check src/targets/x86_64-linux(24 档闭包)⇒ 三形态已被覆盖但在本语料上不产生新点(新点只出现在人工探针上)。
⇒
src/compiler在四形态下均为 0 点——这是「刀 4 硬错不会自伤自举」的前提。6. 套件:
test_s1p_livenessPASS ·test_compilePASS ·test_purityPASS。边界(如实登记)
bi_add注册的内建 callee 走内建回退、无 FuncInfo ⇒ 其实参面零覆盖(单独立项)。