P5.5: migrate the 35 BuildOptions accessors off #compiler to VM-native abi(.compiler)

`BuildOptions :: struct #compiler { ...35 methods... }` becomes
`BuildOptions :: struct { }` (an opaque null-sentinel handle) plus 35 free
`ufcs (self: BuildOptions, …) abi(.compiler)` decls in build.sx, each serviced
by a new `comptime_vm.callBuildOptionFn` arm (off `callCompilerFn`). No legacy
`compiler_lib` handler: the names are registered in `bound_fns` with a single
bailing stub only so `weldedCompilerFn` accepts them.

- String lifetime: setters dupe the arg into the persistent `Vm.gpa` (the
  Compilation allocator, threaded into both `tryEval` and `runBuildCallback` —
  not the per-eval VM arena) and write/append to the threaded `BuildConfig`.
  Getters read the field/slice or compute the target predicate from the triple.
- Dispatch routing (Option B): a `#run`/const-init entry that directly calls a
  compiler-domain/welded fn (`emit_llvm.entryNeedsVm`) runs on the VM with no
  legacy fallback regardless of the `-Dcomptime-flat` gate, so gate-OFF stays
  green without a legacy BuildOptions handler (P5.7 retires the legacy interp).
- Mark the 5 `platform/bundle.sx` getter-calling helpers `abi(.compiler)` (they
  are comptime-only bundler code; otherwise their now-welded getter calls trip
  the runtime-call gate).
- 37 `.ir` snapshots regenerated (std transitively imports build.sx → string-
  pool/type-table indices shift); verified `.ir`-only, zero behavior-stream diffs.

BuildOptions `compiler_call` strict bails gone (1609/1614/1615 strict-clean);
1616 now bails on a separate, pre-existing unported bitwise/shift VM gap (`shr`),
to port first in P5.6. 703/0 both gates.

Also sweep the outdated "flat memory" terminology to "comptime/byte-addressable"
across comptime_vm + the plan/checkpoint/CLAUDE docs: the comptime VM is
arena-backed, byte-addressable memory where `Addr` is a real host pointer, not a
flat contiguous address space (flag names `-Dcomptime-flat`/`SX_COMPTIME_FLAT` kept).
This commit is contained in:
agra
2026-06-19 13:21:09 +03:00
parent af32c3823c
commit ba28488d99
48 changed files with 13896 additions and 14974 deletions

View File

@@ -341,7 +341,7 @@ features — diagnostics renderer, heterogeneous variadic packs), and
**ERR** (error handling: separate-channel `!` errors, `try` / `catch` /
`or` / `onfail`, return traces), and **COMPILER-API** (the comptime `compiler`
library that supersedes the metatype `declare`/`define` `#builtin`s and the
`#compiler` attribute — **pivoted 2026-06-17** off the byte-weld to a **flat-memory
`#compiler` attribute — **pivoted 2026-06-17** off the byte-weld to a **byte-addressable
bytecode comptime VM** as its foundation; see `current/PLAN-COMPILER-VM.md`). They
touch mostly disjoint files; any can be advanced independently.
@@ -352,7 +352,7 @@ touch mostly disjoint files; any can be advanced independently.
- `current/CHECKPOINT-LANG.md` — LANG progress tracker.
- `current/CHECKPOINT-ERR.md` — ERR progress tracker.
- `current/CHECKPOINT-COMPILER-API.md` — COMPILER-API progress tracker
(has a `## ⏯ Resume` block; **pivoted to the flat-memory VM** — Phase 0 strip
(has a `## ⏯ Resume` block; **pivoted to the comptime VM** — Phase 0 strip
pending, branch `reify`).
2. Read the plan that corresponds to the stream the user wants to advance:
- `current/PLAN.md` — IR implementation plan.
@@ -360,7 +360,7 @@ touch mostly disjoint files; any can be advanced independently.
- `~/.claude/plans/tidy-doodling-cray.md` — MEM (mem.sx) implementation plan.
- `current/PLAN-LANG.md` — LANG implementation plan.
- `current/PLAN-ERR.md` — ERR implementation plan.
- `current/PLAN-COMPILER-VM.md`**COMPILER-API active plan** (flat-memory bytecode
- `current/PLAN-COMPILER-VM.md`**COMPILER-API active plan** (byte-addressable bytecode
comptime VM, then re-home the compiler-API on it). `design/comptime-compiler-api.md`
is the SUPERSEDED weld design, kept only for history + to scope the Phase 0 strip.
3. Read `specs.md` if you need to understand language behavior.