3042384b
c-accel: arch prereqs — compat contract, C-side strategy, build scaffolding
Three companion specs under docs/specs/ formalize the boundaries
established in docs/c-accel.md, unblocking bd-mq7 (descriptor → C
plan compiler):
* c_accel_compat.md (bd-47e) — pinpoints what must stay byte-equal
between PB_ENABLE_C unset and =1: public surface, generated
module wrappers, 64-bit cdata, WKT shapes, unknown fields,
extensions, errors. Calls out the lazy-view exclusion.
* c_accel_strategy.md (bd-z7x) — pb_plan struct layout, field-name
luaL_ref caching, 4 KB stack-backed pb_buf, cached per-field
stack indices (the 2× win from spike Phase B), sub-buffer over
backpatching, map/oneof/unknown handling.
* c_accel_build_packaging.md (bd-wky) — where the C module lives
(runtime/pb/c/), how it builds, what the rockspec gains, the CI
matrix shape.
Scaffolding that lands now:
* runtime/pb/init.lua — PB_ENABLE_C=1 opt-in pcall hook; the
loaded module (or nil) is exposed as pb.c_runtime for
introspection. Silent fallback when the module is absent.
* Justfile — `build-c` / `clean-c` recipes (stub erroring cleanly
until bd-ra6 lands runtime/pb/c/), new lua_cpath constant,
LUA_CPATH wired through `test` and `test-one`.
* .builds/{pure-lua,c-enabled}.yml — sourcehut CI manifests, one
per activation mode (sourcehut has no matrix; parallel jobs go
in separate files). ubuntu/noble images.
* .sourcehut/conformance.yml — outside .builds/ so it doesn't
auto-submit; trigger manually with `hut builds submit` before
releases.
* .gitignore — runtime/pb/c_runtime.{so,dylib} and runtime/pb/c/*.o.
745/745 tests pass with PB_ENABLE_C unset and PB_ENABLE_C=1
(silent fallback verified).
Closes bd-47e, bd-z7x, bd-wky. Unblocks bd-mq7.
Eugene Blikh <bigbes@gmail.com> — 2026-05-19 04:24:50 UTC
Commit 3042384b3161fb06cda88cccd98d8f94dd805782 —
view raw patch
Parent(s):
6e89cf99
| File | Status | + | − |
|---|---|---|---|
.beads/interactions.jsonl
|
M | +5 | |
.beads/issues.jsonl
|
M | +19 | -7 |
.builds/c-enabled.yml
|
A | +34 | |
.builds/pure-lua.yml
|
A | +28 | |
.gitignore
|
M | +7 | |
.sourcehut/conformance.yml
|
A | +33 | |
Justfile
|
M | +27 | -3 |
docs/specs/c_accel_build_packaging.md
|
A | +229 | |
docs/specs/c_accel_compat.md
|
A | +310 | |
docs/specs/c_accel_strategy.md
|
A | +433 | |
runtime/pb/init.lua
|
M | +17 |