Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
93f13be
v4 迁移(批内·第一笔):本地堆 rebase 到 develop + 前端取计划版 T1/T2 + T3
dslsdzc Sep 24, 2026
87fdcb2
v4 迁移(批内·第二笔):T4 语料改写完成——src 全 92 档,85 迁移 / 6 no-op / 1 死文件
dslsdzc Oct 11, 2026
4ad482d
v4 迁移(批内·第三笔):前端位置语义修复(消 T4 语义漂移)+ T4 空行收拢收口
dslsdzc Oct 11, 2026
11af17c
v4 迁移(批内·第三笔补):位置语义规则的注释措辞收口——口径写死为「位置标志 ∧ 节点种类」,并逐字引用四格实测与反向实证
dslsdzc Oct 11, 2026
1270cdb
docs(TODO): 登记 #2026-10-11-1(战术「策略定义」语法待重设计)+ #2026-10-11-2(块值 if 发射面缺口)
dslsdzc Oct 11, 2026
88d5c32
v4 迁移(批内·第四笔):T5 自源前端 layout 机件移植 + 位置语义镜像 + `never` 语义(两前端同改)
dslsdzc Oct 11, 2026
a567638
docs(TODO): 登记 #2026-10-11-3——`never ⊆ X` 在类型引擎 `ty_sub` 返回 -1(ICE04)…
dslsdzc Oct 11, 2026
5f24e20
v4 迁移(批内·第四笔补):bootstrap 两处欠账收口——`none` 作值 + 基本类型 `T?` 的语法面
dslsdzc Oct 11, 2026
be75996
docs(TODO): 登记 #2026-10-11-4(bootstrap 缺 T? 语义面)+ #2026-10-11-5(带可选载荷…
dslsdzc Oct 11, 2026
25e7019
v4 迁移(批内·第五笔):T5 六项改实现 + 判据面修复(never/空 region 交汇)+ T6 语料迁移
dslsdzc Oct 11, 2026
ce56e42
v4 迁移(批内·第六笔):T7 收尾重锁 + 过渡形翻转(E2×9 / E3×1)
dslsdzc Oct 11, 2026
0c327f3
fix(v4 迁移收尾): 三档判据面修复——harness 锚点去 v3 形 + T6 折叠模板的单点机械错误
dslsdzc Oct 11, 2026
c448dc3
docs(TODO): 登记 #2026-10-12-1..7——v4 迁移收尾的七笔悬空账(缺陷 2 · 约定待裁 1 · 静默面 1 …
dslsdzc Oct 11, 2026
0b2d9c3
docs(v4 语法): §十 规约按维护者更新版落盘——**取消 `spec fn`**(所有函数都是 `fn`,复用靠函数契约 + `…
dslsdzc Oct 12, 2026
739a5d9
docs(TODO): #2026-10-11-1 闭档——维护者 2026-10-12 的 §十 更新版已答复该设计问题(`#tag` …
dslsdzc Oct 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 19 additions & 19 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# 贡献指南

Core 的开发流程参考 Rust/Linux:**main 即 mainline,任何人(含维护者)不得直推**。
全部改动经 PR + 审查 + 合入门槛进入 main。
全部改动经 PR、审查与合入门槛进入 main。

## 流程

1. **fork 仓库**,在 fork 上建 feature 分支(`fix/xxx`、`feat/xxx`、`docs/xxx`)
2. 提交改动(请用 jj,见下),推送分支
1. **fork 仓库**,在 fork 上建立 feature 分支(`fix/xxx`、`feat/xxx`、`docs/xxx`)。
2. 提交改动(使用 jj,见下节),并推送分支。
3. **开 PR——base 指向 `develop` 集成分支**(main 不接受直接合入;main 的合入仅维护者可执行),按 `.github/pull_request_template.md` 填写:
- 变更描述、测试记录、语义保鲜影响(IR/类型语义是否变化)
4. 等待审查(≥1 审批,审批人限维护者)
5. 审批通过且 PR 层 CI 全绿后,维护者手动 **squash 合入 develop**(merge queue 因免费计划不可用,已降级;见 spec §3.3),源分支由 GitHub 自动删除
- 变更描述、测试记录、语义保鲜影响(IR/类型语义是否变化)。
4. 等待审查(≥1 审批,审批人限维护者)。
5. 审批通过且 PR 层 CI 全绿后,维护者手动 **squash 合入 develop**(merge queue 因免费计划不可用,已降级;见 spec §3.3),源分支由 GitHub 自动删除。

## 铁律

- **全面使用 jj,禁止 `git` 命令**(仓库为 jj colocated 形态;维护者本地 Claude Code hook 会拦截 git)
- 长时间编译/测试任务限速运行(`cpulimit -l 10` 或 `nice -n 19`)
- 文件还原必须经维护者明确许可
- **全面使用 jj,禁止 `git` 命令**(仓库为 jj colocated 形态;维护者本地 Claude Code hook 会拦截 git)。
- 长时间编译或测试任务限速运行(`cpulimit -l 10` 或 `nice -n 19`)。
- 文件还原必须经维护者明确许可。

## 构建与测试

Expand All @@ -30,19 +30,19 @@ python3 tests/selfhost/test_compile.py # 自举编译器测试
# tests/suite/*.cr 为集成测试:./build/corec build FILE.cr -o OUT --static && ./OUT
```

CI 与本地跑同一套命令(`src/ci/run.sh`,按 `CI_JOB_NAME` 分发)。
CI 与本地运行同一套命令(`src/ci/run.sh`,按 `CI_JOB_NAME` 分发)。

## 编码约定

- 全部数组为动态字节缓冲(`string` + grow 函数),无 `MAX_*` 上限
- 扁平 AST / 扁平 IR(每节点为 `{kind, a, b, c, ...}` 结构)
- 每个目录的 `_import.cr` 集中管理共享导入
- 关键字以 `src/compiler/lexer.cr` 为准(唯一)
- 文档(`docs/`)更新与实现同步;伪代码文档(`docs/pseudocode/`)由源码生成,改源码后须重跑 `tools/pseudocode_check.py`
- 全部数组为动态字节缓冲(`string` + grow 函数),无 `MAX_*` 上限。
- 扁平 AST / 扁平 IR(每节点为 `{kind, a, b, c, ...}` 结构)。
- 每个目录的 `_import.cr` 集中管理共享导入。
- 关键字以 `src/compiler/lexer.cr` 为准(唯一)。
- 文档(`docs/`)更新与实现同步;伪代码文档(`docs/pseudocode/`)由源码生成,改动源码后须重跑 `tools/pseudocode_check.py`。

## 审查标准

- 不绕过问题(root cause 直修)
- 语义保鲜:IR 全程保留类型/语义信息
- 惰性/数据流优化不改变程序输出
- 测试随变更更新
- 不绕过问题(root cause 直修)。
- 语义保鲜:IR 全程保留类型/语义信息。
- 惰性/数据流优化不改变程序输出。
- 测试随变更更新。
6 changes: 3 additions & 3 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 报告漏洞

请通过 GitHub 的 **私有漏洞报告**(仓库页 → Security → Report a vulnerability)提交,
请通过 GitHub 的**私有漏洞报告**(仓库页 → Security → Report a vulnerability)提交,
不要公开披露。

## 响应
Expand All @@ -11,5 +11,5 @@

## 范围

编译器本身(`src/compiler/`)、运行时(`src/runtime/`)、生成代码的正确性。
生成代码/编译器的安全问题按严重程度处理。
范围为编译器本身(`src/compiler/`)、运行时(`src/runtime/`)与生成代码的正确性。
生成代码与编译器的安全问题按严重程度处理。
8 changes: 4 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
## 变更描述

<!-- 这个 PR 改了什么、为什么。 -->
<!-- 本 PR 的变更内容与变更原因。 -->

## 测试

<!-- 跑了哪些验证(至少一项):tests/bootstrap、tests/selfhost、tests/suite、自举构建。 -->
<!-- 已运行的验证(至少一项):tests/bootstrap、tests/selfhost、tests/suite、自举构建。 -->

- [ ] 本地测试通过

## 语义保鲜影响

<!-- IR/类型语义是否有变化?对形式验证消费端(.cir/.ccr 消费者)的影响。无则填"无"。 -->
<!-- IR/类型语义的变更情况,以及对形式验证消费端(`.cir`/`.ccr` 消费者)的影响;无则填"无"。 -->

## 已知限制 / 后续

<!-- 非必须。 -->
<!-- 非必需项。 -->
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 更新日志

> 说明:本文档记录里程碑级变更。近期每日开发流水、预存 bug 与架构规划以 `TODO.md` 为准。
> 2026-06-21 至 2026-07-23 之间曾存在文档缺失期,以下条目按提交历史与 TODO.md 补齐。
> 2026-06-21 至 2026-07-23 之间曾存在文档缺失期,以下条目按提交历史与 `TODO.md` 补齐。

## 2026-09-17
### [change] `@no_bounds_check` 更名为 `@NoBoundsCheck`
Expand All @@ -22,7 +22,7 @@
- 函数地址支持:IR_FNADDR + `@addr` 内建(checker/ir_gen/ELF 后端全链路)。
- 并发集成:g_set_curg/g_get_curg 桥接 + M worker 线程池接线。
- 主线程注册为 G 0,可经 channel 阻塞/唤醒;sched_yield 不再重排 Gwaiting。
- 多 M 线程完整验证仍待补(见 TODO.md 预存 bug 第 2 条)。
- 多 M 线程完整验证仍待补(见 `TODO.md` 预存 bug 第 2 条)。

## 2026-07-30
### [fix] restore directory builds
Expand All @@ -42,7 +42,7 @@
## 2026-07-28
### [feat] arena memory model, @ builtins, incremental cache, hotpatch, pointer-model passes
- Arena 内存模型完整实现(`src/stdlib/arena.cr`):init/new/reset 生命周期、动态元数据、free list、嵌套;IR 子图绑定(函数/loop/for/unsafe 自动 arena);ELF 双路径 alloc(arena 感知 + 全局 bump 回退);IR_ARENA_NEW(32)/IR_ARENA_RESET(33) 编码;mmap 堆扩展(BSS 打满自动 mmap 1GB)。
- `@` 内建原语 12 个全部完整:`@sizeOf/@alignOf/@fields/@hasField/@field/@typeInfo/@comptime/@inline/@no_bounds_check/@fast/@unroll/@section`(后增 `@addr`、`@hotpatch`,见 07-31/07-30)。
- `@` 内建原语 12 个已全部实现:`@sizeOf/@alignOf/@fields/@hasField/@field/@typeInfo/@comptime/@inline/@no_bounds_check/@fast/@unroll/@section`(后增 `@addr`、`@hotpatch`,见 07-31/07-30)。
- 增量缓存(函数级 .cir,默认开启):`cir_cache.cr` save/load 每函数快照,`clean-cache` 子命令。
- `@hotpatch` 滚动更新:IR_HOTPATCH_ROUTE(39) + parser `@hotpatch(ver=N)` + checker 多版本签名校验 + ELF 编码 + SIGHUP 信号处理。
- 指针模型三 pass 实现(PointerAnalysis/RegionCheck/ProvenanceVerify):DEREF 后端 cmp+jae+ud2 边界检查(s3 编码 alloc_size)、运行时 prov_table 堆边界检查 patch、arena BSS 全局。
Expand Down Expand Up @@ -159,13 +159,13 @@
Known issue: name_idx in .ccr is off by 1 (first string index mismatch)
### [fix] use index comparison for main lookup
- Replace str_get() comparison with direct index comparison in elf.cr
### [fix] pipeline from source to binary now works!
### [fix] pipeline from source to binary now works
Root cause: g_str_count = 0 after tokenize() reset the string table,
### [feat] BSS global variable support in ELF backend
- Add g_x86_is_global/g_x86_global_off arrays to track BSS vars
### [feat] dynamic linking - external call relocation recording
- IR_CALL to unknown functions now records ext_rel entries instead of
### [feat] dynamic linking with PLT/GOT works!
### [feat] dynamic linking with PLT/GOT works
Bug fix: PLT j loop missing 'break' caused infinite loop in emit().
### [feat] standard library .so files
- Build core_io.so and core_math.so from src/stdlib/*.cr
Expand Down Expand Up @@ -237,13 +237,13 @@
### [refactor] measure _start size via emit_start_size() instead of hardcoded 22
- Extract _start emission into emit_start() function
### [refactor] instruction sizes via _size() functions (Hexagon pessimistic)
### [fix] massive landmine cleanup — dynamic arrays, dynamic linking, instr fixes, va/offset bugs
### [fix] large-scale landmine cleanup — dynamic arrays, dynamic linking, instr fixes, va/offset bugs
- Converted all [int; N]/[string; N] arrays to dynamic string buffers
### [docs] add hard rules — ban git, use jj, no bypassing, no reverting

## 2026-06-18
### [fix] 扫清全部隐患 — CLI 子命令 + 6 个未初始化数组 + batch:= 解析 + 边界校验
CLI 重构:
### [fix] 清理全部隐患 — CLI 子命令 + 6 个未初始化数组 + batch:= 解析 + 边界校验
CLI 重构:
### [fix] 3 parser fixes — parse_primary advance_tok, local_stmts 256-limit, parse_for_expr C-style guard
### [fix] string interpolation parser infinite loop on unterminated { — cli.cr crash root cause
### [fix] string interpolation infinite loop when { without }
Expand Down
Loading
Loading