kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

commit 5da5c8eea63865c3655b4fd54f7893bcc6c56fed
parent d8ba4d9aca807f9af346621a85ea7ebef62a1898
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Thu, 18 Jun 2026 15:43:00 -0700

Rewrite v1 release checklist

Diffstat:
Mdoc/plan/README.md | 2+-
Mdoc/plan/RELEASE.md | 422+++++++++++++++++++++++++++++++++----------------------------------------------
2 files changed, 179 insertions(+), 245 deletions(-)

diff --git a/doc/plan/README.md b/doc/plan/README.md @@ -8,7 +8,7 @@ shrinks to whatever remains open (and is deleted once nothing remains open). | Roadmap | Scope | Design doc | |---------|-------|------------| -| [RELEASE.md](RELEASE.md) | Cross-cutting initial-release punchlist: remaining release blockers and per-subsystem validation gaps (completed items are removed, not checked off). | — | +| [RELEASE.md](RELEASE.md) | V1 release-control checklist: public surface, hidden/out surface, hard validation gates, release blockers, and final signoff. | — | | [OPTIMIZER.md](OPTIMIZER.md) | Completing the O2 SSA mid-end, live-range splitting/coalescing, the residual O1 generated-code-quality gaps that need SSA, -O0 quality, machine register-constraint improvements, and broader inlining. Carries the known non-deficiencies (what *not* to chase). | [../OPT.md](../OPT.md) | | [LINKER.md](LINKER.md) | Incremental linking (JIT append + the unbuilt file-based "m2" redesign) **and** system-linker compatibility (ordered DSO/`--as-needed`, ELF TLS planning + TLSDESC, shared/relocatable links, sysroot interop, toolchain validation). | [../LINK.md](../LINK.md), [../OBJ.md](../OBJ.md) | | [DEBUG.md](DEBUG.md) | The interactive JIT debugger + DWARF: x64/rv64 session parity, displaced-step instruction coverage, unit/smoke tests, REPL polish, Toy/C REPL frontends, and DWARF producer/consumer gaps (loclists, CFI register recovery, composite locations). | [../DBG.md](../DBG.md), [../DWARF.md](../DWARF.md) | diff --git a/doc/plan/RELEASE.md b/doc/plan/RELEASE.md @@ -1,247 +1,181 @@ -# Initial release punchlist - -This is the release-control checklist for kit's first public release. It turns -the current scope decisions into concrete work items. Design details remain in -the subsystem docs and roadmaps linked from `doc/DESIGN.md` and -`doc/plan/README.md`; this file is the cross-cutting release list. - -## Release scope - -### Ship - -- C11 toolchain: preprocessor, parser/checker, codegen, `cc`, `cpp`, `as`, `ld`, - archive/object tools, byte tools, hash/compress, `cas`/`pkg`, and `install`. -- Curated real-world C library/application build gates, including hosted links - against system libraries and platform frameworks. -- Optimization: `-O0` and `-O1` only. `-O2` is not a release feature. -- LTO / whole-program optimization, enabled explicitly and able to run at `-O1`. -- Content-addressed build coordinator (`kit build` / `<kit/build_coord.h>`), layered on - CAS and package/trust infrastructure. -- Runtime: target `libkit_rt.a`, freestanding headers/libc subset, compiler-rt - helpers, atomics, setjmp, and coroutines for the release support set. -- JIT runtime (`kit run`) and IR interpreter (`kit run --no-jit`) for supported - host-compatible targets. -- WebAssembly: single-TU `wasm32` output, Wasm/WAT input, and runtime execution - with partial WASI Preview1 compatibility. -- Interactive debugger on x64, arm64, and rv64 for Linux, macOS, and FreeBSD. -- Cross-compilation support set: - - arm64: macOS, Linux, Windows, FreeBSD, freestanding - - x64: Linux, Windows, FreeBSD, freestanding - - rv64: Linux, FreeBSD, freestanding - - rv32: freestanding - -### Do not ship - -- `-O2` as a distinct optimization level. -- The Toy frontend as a user-facing language. -- The user-mode ELF emulator. -- File-based/AOT incremental linking. -- Creating dynamic/shared libraries. Release builds may still create executables - that link against dynamic libraries. -- Multi-TU Wasm output, Wasm static linking, wasm64, or complete WASI. -- Interactive debugger support on Windows or rv32. - -## Global release cleanup - -- [ ] Freeze the public release surface in README/help/docs so it matches the - scope above. -- [ ] Disable or hide the emulator (`KIT_EMU_ENABLED`, `KIT_TOOL_EMU_ENABLED`, - docs, help, default tests). -- [ ] Hide Toy from user-facing docs and install/help output; keep it as internal - test coverage where useful. -- [ ] Remove `-O2` release claims and make `-O2` behavior explicit: either reject - it for v1 or document it as an alias for `-O1` only if that is intentional. -- [ ] Remove or reject dynamic-library creation entry points for release: - `cc -shared`, `ld -shared`, `build-lib -dynamic`, and any equivalent flag - spellings. Preserve executable links against DSOs. -- [ ] Remove incremental-linking claims from docs and make any public reserved - entry points either unavailable or clearly unsupported. -- [ ] Update `src/core/config_assert.c` so every release gate is asserted, - including RV32 and newer `KIT_TOOL_*` flags. -- [ ] Build and test at least one "release gates" configuration with disabled - emulator, no user-facing Toy, and no dynamic-library creation path. +# V1 release checklist + +This is the release-control checklist for kit v1. It defines the public surface, +the hidden/out surface, the gates that prove each claim, and the correctness +issues that block release. Subsystem details live in the durable docs linked from +[../DESIGN.md](../DESIGN.md); this file is the cross-cutting ship/no-ship list. + +## V1 public surface + +Ship these only when the validation gates below are hard-green: no unexpected +failures and no unexpected skips in the selected lane. + +- **C11 toolchain:** `cc`, `check`, `cpp`, `as`, `ld`, `build-exe`, `build-obj`, + static `build-lib`, public compile/link APIs, runtime archive selection, and + the C/asm object pipelines described in [../DRIVER.md](../DRIVER.md). +- **Binutils/object tools:** `ar`, `ranlib`, `strip`, `objcopy`, `objdump`, `nm`, + `size`, `addr2line`, `disas`, and `mc`. +- **Byte and support tools:** `xxd`, `cmp`, `strings`, `hash` plus + `sha256sum`/`b2sum`/`crc32`, `compress` plus `gzip`/`gunzip`/`lz4`/`lz4c`, + `cpio`, `image`, `gram`, and `symbolize`. +- **Distribution/build tools:** `cas`, `pkg`, `build`, `install`, and `update`, + including release artifact update smoke coverage. +- **Optimization levels:** `-O0` and `-O1`. `-O2` is accepted for v1 only as an + explicit alias for `-O1`; help, docs, and tests must say it is not a distinct + optimization level and may change after v1. +- **ELF shared libraries:** creating ELF DSOs and linking ELF executables against + DSOs. Non-ELF shared-library creation is not a v1 feature. +- **WebAssembly:** `wasm32` output, Wasm/WAT input, `kit run` runtime execution, + and partial WASI Preview1. Multi-source Wasm is in scope only when all sources + are provided together in one `cc`/`build-*` invocation. +- **JIT/debugger:** `kit run`, `kit run --no-jit`, and `kit dbg` only for + host/arch pairs that are proven by hard-green tests. Remove any unproven + debugger platform claim before release. + +## Hidden or out of scope + +- User-facing Toy language docs, help, and install exposure. Toy may remain as + internal test coverage. +- User-facing `emu` docs, help, install exposure, and release claims. +- Non-ELF shared-library creation: Mach-O dylib creation, PE/COFF DLL creation, + and any equivalent `cc -shared`, `ld -shared`, or `build-lib -dynamic` path for + non-ELF targets must reject clearly or be hidden. +- Separate-object/static Wasm linking, wasm64, and complete WASI. +- Android/iOS runtime execution and self-host claims. +- Full-depth corpus/self-host portability as a v1 gate unless it is already + green. Keep these lanes visible as deferred validation, not release blockers. +- File-based/AOT incremental linking claims. Internal JIT/linker mechanisms may + stay documented only where they are real implementation details. + +Unsupported optional features are not blockers unless docs, help, default +install, or tests imply they are part of v1. ## Target support matrix -For each target in the release set: - -- [ ] `kit cc -c` produces a valid object with correct predefined macros and data - model. -- [ ] `kit as` / inline asm support is either validated or explicitly diagnosed - when unsupported. -- [ ] `kit ld` links static executables and relocatable objects where applicable. -- [ ] Runtime archive auto-selection works for `cc` and `ld`. -- [ ] Runtime helpers, atomics, setjmp, and coroutines pass targeted tests. -- [ ] Debug info emission and object inspection round-trip. -- [ ] Hosted targets validate sysroot/libc integration; freestanding targets - validate startup/runtime policy. - -Target-specific work: - -- [ ] Validate Windows arm64/x64 object/link/runtime support, including UCRT - import libraries and large-frame stack probing. -- [ ] Validate Linux arm64/x64/rv64 hosted static and dynamic-executable links. -- [ ] Validate freestanding arm64/x64/rv64/rv32 startup, runtime autolink, and - no-host assumptions. -- [ ] Decide and document target names accepted for the support set - (`aarch64-*`, `arm64-*`, `x86_64-*`, `riscv64-*`, `riscv32-*`, - `*-none-elf`, `*-freestanding`, etc.). - -## Execution environments - -Release validation is orchestrated from a macOS/aarch64 host. Prepare each -execution environment explicitly so test skips mean "unsupported by this lane", -not "runner missing". Native/VM run signoff is in place for macOS arm64, Windows -arm64/x64, FreeBSD arm64/rv64/x64, Linux arm64/rv64/x64 (alpine musl -static+dynamic, debian glibc), and freestanding arm64/rv64/x64/rv32. - -## Runtime - -- [ ] Validate compiler-rt integer/fp helpers for every release data model: - LP64, LLP64, and ILP32. -- [ ] Validate atomic helper coverage, including non-lock-free widths. -- [ ] Validate `<setjmp.h>` and `<kit/coro.h>` on arm64/x64/rv64/rv32 release - variants. Wasm32 has no coroutine support in v1; document that clearly. -- [ ] Wire or reject Win64 large-frame probing cleanly. -- [ ] Validate runtime header search/install layout for release packages and - `kit install`. -- [ ] Add targeted runtime tests for every newly supported FreeBSD/freestanding - variant. - -## RV32 - -- [ ] Finish or clearly reject `__int128` on rv32 with a front-end diagnostic. -- [ ] Provide or reject 64-bit atomic libcalls (`__atomic_*_8`) for rv32. -- [ ] Legalize 64-bit overflow intrinsics on rv32. -- [ ] Fix rv32 i64 varargs. -- [ ] Decide and document TLS behavior for freestanding rv32. -- [ ] Fix the rv32 soft-float compare lowering bug. -- [ ] Triage and fix the `123_spec_demo` hang. -- [ ] Add rv32 assembler byte-golden lanes and CSR pseudo-op/name coverage, or - document the assembler limitation. -- [ ] Move rv32 C corpus lanes from known-red/opt-in to release-green, and keep - any Toy rv32 lane internal-only rather than part of the release claim. -- [ ] Run `test-smoke-rv32`, rv32 object/link/JIT host-gated tests, and the rv32 - parse/codegen corpus under `qemu-system-riscv32`. - -## LTO and optimizer - -LTO is on main (`-flto` wired through `cc`/build verbs; preserved/export-set -computation, non-preserved internalization, cross-TU inlining, and LTO tests -landed). Remaining: - -- [ ] Keep release optimization levels to `-O0` and `-O1`; confirm LTO stays - available at `-O1` only (no `-O2` path). -- [ ] Decide the release spelling (`-flto`, plus any rejected aliases) and make - diagnostics precise. -- [ ] Make `-shared -flto` reject cleanly as part of the general dynamic-library - creation policy (currently a "not supported yet" diagnostic). -- [ ] Refresh O0/O1 benchmark baselines and record LTO impact separately. - -## Build coordinator - -The coordinator implementation is on main; the durable spec is -[../BUILD_COORDINATOR.md](../BUILD_COORDINATOR.md). Remaining: - -- [ ] Add store crash-safety/fault-injection tests. -- [ ] Add broader scheduler/concurrency tests for jobs limits, future dedup, and - cancellation once the hosted `kit build` path grows a scheduler. -- [ ] Add release packaging integration coverage for signed trace bundles and - object/trace remotes. -- [ ] Decide whether v1 needs hermeticity enforcement or ships with the documented - recipe contract only. - -## WebAssembly and WASI - -- [ ] Define the exact v1 Wasm target surface: single-TU `wasm32`, no wasm64, no - static Wasm linker, no multi-TU Wasm output. -- [ ] Validate `wasm32-none` single-TU output for C sources and runtime helpers. -- [ ] Enable and document partial `wasm32-wasi` compatibility if accepted for v1. -- [ ] Define the supported WASI Preview1 import subset, expected failures, and - security policy. At minimum audit argv/env, stdio, `proc_exit`, random, - clock, preopened directories, read/write permissions, and unsupported fd/fs - calls. -- [ ] Validate `kit run` Wasm host-import binding, resource policy flags, cwd, - env, and exit-code propagation. -- [ ] Add Wasm/WASI smoke tests that do not depend on Toy. -- [ ] Make unsupported Wasm proposals and unsupported WASI calls fail with - feature-naming diagnostics. -- [ ] Update `doc/WASM.md`, driver help, and README to match - the v1 Wasm/WASI surface. - -## Interactive debugger - -- [ ] Define debugger v1 scope: x64, arm64, rv64 on Linux, macOS, and FreeBSD. - Windows and rv32 are explicitly out of scope. -- [ ] Validate end-to-end sessions for every supported host/arch pair: - breakpoints, continue, step, next, finish, backtrace, registers, variables, - memory read/write, Ctrl-C/interrupt, and teardown. -- [ ] Bring x64 and rv64 session integration to parity with arm64: - fault classification, trap PC normalization, register marshalling, and - displaced single-step. -- [ ] Handle known declined displaced-step forms or diagnose them cleanly. -- [ ] Add scripted transcript tests and low-level unit tests for breakpoint patch - round-trip, guarded copy, displaced stepping, and source stepping. -- [ ] Remove degraded-mode messaging once the v1 session implementation is - complete. -- [ ] Update `doc/DBG.md`, `doc/plan/DEBUG.md`, help text, and README with the - exact v1 platform scope. - -## Linker and dynamic linking - -- [ ] Preserve executable dynamic-link support: PT_INTERP/PT_DYNAMIC/DT_NEEDED, - import libraries, `.tbd`, and sysroot/library resolution as applicable. -- [ ] Reject or hide creating shared libraries for v1 across `cc`, `ld`, and - build verbs. -- [ ] Keep `ld -r` relocatable combining supported and tested. -- [ ] Remove release claims for file-based incremental linking; keep any JIT - append/publish internals documented only where they are real and needed. -- [ ] Validate executable links against dynamic libraries for Linux, FreeBSD, - macOS, and Windows targets in the support set. - -## C ecosystem gates - -The reproducible harness is landed (`test/ecosystem/` + `scripts/ecosystem.sh`, -`make provision-ecosystem` / `make test-ecosystem`): build each project with -`kit cc`/`kit ar`, run a driver, and diff against a checked-in golden AND against -clang, at both `-O0` and `-O1`. All seven projects — cJSON, Lua, LZ4, miniz, -tinyexpr, yyjson, and SQLite — are green at both levels and byte-identical to -clang. Remaining gates extend hosted system-library coverage: - -- [ ] Add a hosted SDL2 gate: compile a minimal C app and link it through the - platform mechanism (`pkg-config`/`sdl2-config`, framework, or import - library), with an offscreen/headless smoke mode where possible. -- [ ] Add at least one terminal/system-library app gate, such as ncurses/curses or - readline/editline, to exercise hosted include/library discovery. -- [ ] Add a macOS framework gate, preferably a pure-C CoreFoundation smoke, to - prove `-framework` and `.tbd` system-library resolution. -- [ ] Add Linux/FreeBSD system-library link gates for `-lm`, `-ldl`, `-lpthread`, - and one package-discovered library. (Lua already links `-lm`; a dedicated - gate is still pending.) -- [ ] Add Windows hosted link gates for system/import libraries used by the - release support set. -- [ ] Add an LTO ecosystem lane for at least SQLite (both opt levels already run; - LTO lane still TODO). - -## Release validation - -- [ ] Reconcile `doc/TESTING.md` with `mk/test.mk` so default and opt-in test - tiers match reality. -- [ ] Define the release CI/test matrix, separating host-independent tests, - exec-dependent tests, cross-arch tests, and bootstrap. -- [ ] Run targeted frontend tests: `test-asm`, `test-parse`, `test-pp`, - `test-toy` only if still used internally, and Wasm tests. -- [ ] Run codegen/API/opt tests: `test-cg-api`, `test-opt`, `test-isa`, - `test-aa64-inline`, x64/rv64 inline tests, LTO tests. -- [ ] Run link/object tests: `test-link`, `test-elf`, `test-macho`, `test-coff`, - `test-ar`, `test-driver-ar`, `test-driver-build`. -- [ ] Run debug tests: `test-debug`, `test-dwarf`, `test-dbg`, arch-specific dbg - tests on supported hosts. -- [ ] Run runtime/libc/smoke tests for every supported runtime target. -- [ ] Run bootstrap in debug and release modes on the reference host; add other - host bootstraps if feasible. -- [ ] Run sanitizer/LSan lanes on Linux for driver and library leaks. -- [ ] Refresh O0/O1 benchmarks and `doc/CODE_SIZE.md`. -- [ ] Update release packaging: version, licenses, support-dir layout, runtime - archives, headers, docs, and `kit install` default tool set. -- [ ] Produce a final release-note feature list and a separate limitations list. +Official v1 targets: + +| Family | V1 targets | Release claim | +|--------|------------|---------------| +| Linux glibc | aa64, x64, rv64 | Compile, link, and execute where a runner is provisioned. | +| Linux musl | aa64, x64, rv64 | Compile, link, and execute where a runner is provisioned. | +| FreeBSD | aa64, x64, rv64 | Compile, link, and execute where a runner is provisioned. | +| Windows | aa64, x64 | Compile, link, and execute where a runner is provisioned. | +| macOS | aa64, x64 | Compile, link, and execute where a runner is available. | +| Android | aa64 | Cross/link target only. No v1 runtime or self-host claim. | +| iOS device | aa64 | Cross/link target only. No v1 runtime or self-host claim. | +| iOS simulator | aa64, x64 | Cross/link target only. No v1 runtime or self-host claim. | +| Freestanding | aa64, x64, rv64, rv32, arm32 | Cross/link/runtime-library target; execution only through explicit smoke lanes. | + +Target names, selector grammar, provisioning, and deferred full-depth lanes are +owned by [../PORT.md](../PORT.md) and `scripts/hosted.sh`. If the matrix above +changes, update those sources and this checklist together. + +## Hard release gates + +All command output for signoff should be captured under a release-check log +directory, then inspected from the saved logs. + +- [ ] `make test-tier1` passes with no unexpected skip/fail. +- [ ] `make test-cross DEPTH=coarse` passes for the full official target set. +- [ ] `make test-cross DEPTH=smoke RUN=1` passes for every target with an + execution runner. Android and iOS are excluded from runtime assertions. +- [ ] Deferred portability lanes are listed with owner/status: + `make test-cross DEPTH=full`, `make test-selfhost DEPTH=smoke`, and + `make test-selfhost DEPTH=full`. +- [ ] Release-gate configuration has `emu` and user-facing Toy hidden/disabled, + while internal Toy tests remain available if still useful. +- [ ] No public v1 doc or help text claims a feature outside this checklist. + +## Blocking correctness issues + +These block v1 until fixed, removed from the public claim, or explicitly +converted into a non-public unsupported feature. + +- [ ] Fix the latent `kit run` uninitialized-stack read. +- [ ] Fix the c_target Wasm `memory.grow` backing-store bug. +- [ ] Fix aa64 optimized inline-asm staging panics or remove the affected + optimized inline-asm claim. +- [ ] Fix x64 optimized inline-asm staging panics or remove the affected + optimized inline-asm claim. +- [ ] Make `-O2` behavior explicit everywhere: alias to `-O1`, not a separate + optimizer level. +- [ ] Hide or remove user-facing `emu` exposure from README, driver help, + install defaults, and release docs. +- [ ] Hide Toy from user-facing docs, help, examples, and install defaults. +- [ ] Reject or hide non-ELF shared-library creation paths for `cc`, `ld`, and + `build-lib`; keep ELF DSO creation enabled and tested. +- [ ] Update docs/help/tests for the Wasm boundary: same-invocation multi-source + `wasm32` is supported; separate-object/static Wasm linking, wasm64, and + complete WASI are not. +- [ ] Keep debugger support claims hard-green only. Any host/arch pair without + proven breakpoints, stepping, backtrace, registers, variables, memory + access, interrupt, and teardown is removed from the v1 claim. + +## Claim validation checklist + +### Documentation and help + +- [ ] README, `kit --help`, per-tool help, and install output match the V1 public + surface exactly. +- [ ] [../DRIVER.md](../DRIVER.md) documents `-O2` as a temporary `-O1` alias, + ELF-only shared-library creation, and hidden `emu`/Toy policy. +- [ ] [../LINK.md](../LINK.md) and [../OBJ.md](../OBJ.md) distinguish ELF DSO + creation from executable links against DSOs on all object formats. +- [ ] [../WASM.md](../WASM.md) states the `wasm32`, WAT/Wasm input, runtime, + partial-WASI, and same-invocation multi-source boundary. +- [ ] [../BUILD_COORDINATOR.md](../BUILD_COORDINATOR.md), + [../DISTRIBUTE.md](../DISTRIBUTE.md), and release packaging docs cover + `build`, `cas`, `pkg`, `install`, and `update`. +- [ ] [../KERNEL.md](../KERNEL.md) matches the shipped `image` and `cpio` tool + surface. +- [ ] [../DBG.md](../DBG.md) contains only debugger platforms that are + hard-green. + +### Toolchain and linker + +- [ ] C frontend, preprocessing, asm, object, archive, linker, runtime selection, + and JIT lanes are covered by `make test-tier1`. +- [ ] ELF DSO creation passes targeted tests for supported ELF targets. +- [ ] ELF executable links against DSOs pass targeted tests for supported ELF + targets. +- [ ] Non-ELF shared-library creation rejects clearly in `cc`, `ld`, and + `build-lib`. +- [ ] `-O2` alias behavior is covered by driver/help tests and optimizer tests. +- [ ] aa64, x64, rv64, rv32, and arm32 compile/link claims are covered by the + hard release gates or explicitly scoped as freestanding smoke lanes. + +### WebAssembly and WASI + +- [ ] Targeted `wasm32` single-source C output tests pass. +- [ ] Targeted same-invocation multi-source `wasm32` tests pass. +- [ ] Wasm/WAT input and `kit run` execution tests pass. +- [ ] WASI Preview1 supported imports are listed and tested; unsupported calls + fail with feature-naming diagnostics. +- [ ] Separate-object/static Wasm linking and wasm64 attempts reject clearly. + +### Utility and distribution tools + +- [ ] `make test-driver-tools` covers `xxd`, `cmp`, byte-tool aliases, `disas`, + and `mc` as applicable. +- [ ] `make test-driver-cpio` validates `cpio`. +- [ ] `make test-driver-gram` and `make test-gram` validate `gram`. +- [ ] `make test-driver-cas`, `make test-driver-pkg`, and `make test-dist` + validate CAS/package distribution. +- [ ] `make test-selfdist` validates `pkg` plus `update` install/flip/rollback + behavior. +- [ ] Release artifact/update smoke passes after packaging, including `install` + layout and default tool set. +- [ ] `hash`, `compress`, `strings`, `objcopy`, `objdump`, `strip`, `ar`, + `ranlib`, `nm`, `size`, `addr2line`, `symbolize`, and `image` each have a + hard-green driver or tier1 lane before being listed in release notes. + +## Final signoff + +- [ ] Version, license files, third-party notices, support directory layout, + runtime archives, headers, docs, and default install links are complete. +- [ ] Release notes contain a feature list and a separate limitations list that + exactly matches this file. +- [ ] Every checked gate has a saved log path, command line, host triple, target + selector, and pass/fail/skip summary. +- [ ] Every unchecked item is either fixed before tagging or removed from the v1 + public claim.