ci: optional selfhost-loop workflow + determinism script

Add tools/selfhost_loop.sh with path-normalized C and stripped ELF
checks (bootstrap ×2). Wire GitHub Actions (manual/weekly/main paths)
outside default make test. Raise selfhost lexer maxTokens for large files.
This commit is contained in:
2026-07-19 23:43:51 +03:00
parent c82757d51c
commit fe1da8b42e
7 changed files with 256 additions and 40 deletions
+11
View File
@@ -189,6 +189,17 @@ summary table and exits:
Use `Std::Test` module for assertions inside test code.
### Selfhost loop (optional CI)
```bash
make selfhost-loop # bootstrap builds src/ twice; C+ELF match
BUX_SELFHOST_FIXED_POINT=1 make selfhost-loop # also buxc2→buxc3 (experimental)
```
Not part of default `make test`. GitHub Actions workflow
`.github/workflows/selfhost-loop.yml` runs it on:
- manual `workflow_dispatch`
- weekly schedule
- pushes to `main` that touch `src/`, `lib/`, bootstrap, or the loop script
### Format (`bux fmt`)
```bash
./buxc fmt examples/hello.bux # reformat one file
+22 -5
View File
@@ -1,7 +1,7 @@
# Bux — План към „добър“ език (v0.5 → v1.0)
> **Дата:** 2026-07-19
> **Текущо:** v0.5.x — HirNode sourceFile #line, selfhost CI, **LSP 0.12 path rename**, Nexus KA
> **Текущо:** v0.5.x — HirNode sourceFile, **optional selfhost-loop CI**, LSP 0.12, Nexus KA
> **Цел:** Език, с който се пишат реални проекти комфортно, безопасно (по избор) и с надежден toolchain.
---
@@ -754,9 +754,26 @@ A (stdlib ergonomics) → B (compiler holes) → C (ownership depth)
---
## Сесия 48 (optional CI: selfhost-loop)
1. **`tools/selfhost_loop.sh`**: bootstrap determinism (buxc × 2)
- path-normalized `#line` C compare (abs path / build-dir noise stripped)
- stripped ELF compare; **fails** on real C or ELF mismatch
2. **Lexer:** `maxTokens` 32k → 131k (hir_lower was at the ceiling for buxc2 parse)
3. **Optional fixed-point** `BUX_SELFHOST_FIXED_POINT=1`: buxc2 → buxc3
- experimental; selfhost still diverges on full compiler C emit
4. **GitHub Actions** `.github/workflows/selfhost-loop.yml`
- `workflow_dispatch` (+ optional fixed_point input)
- weekly cron (Sunday 06:00 UTC)
- push to `main` when `src/` / `lib/` / loop script change
- **not** on every PR / not in default `make test`
5. Verified: `make selfhost-loop` PASS (determinism)
---
## Следващи стъпки
1. Optional: selfhost-loop as optional CI job (slow)
2. LSP find-implementations request (dedicated, beyond call hierarchy)
3. Workspace-wide import path index without open documents (optional polish)
4. Expr/Stmt-level sourceFile if macros / cross-file inlining land
1. LSP find-implementations request (dedicated, beyond call hierarchy)
2. Workspace-wide import path index without open documents (optional polish)
3. Expr/Stmt-level sourceFile if macros / cross-file inlining land
4. Fix selfhost C backend so buxc2→buxc3 fixed-point is green