1eb062c1
c_runtime: wire encode/decode dispatch + conformance-c harness
pb.encode / pb.decode lazy-compile desc.c_plan on first call and route
to pb.c_runtime.encode/decode when PB_ENABLE_C=1 loaded the module.
Eager compile at finalize_message time fails on codegen's
forward-declared descriptors — sub-messages don't have .fields yet —
so compilation is deferred until first encode/decode, by which time
the whole module table is populated and sub-plan chase resolves.
Full-mode codegen wrappers (M.<Type>_{encode,decode}) gain the same
lazy-compile prologue, bypassing the inline body when the C runtime
is loaded. Runtime-mode wrappers already call pb.encode and pick up
dispatch centrally.
Harness side: the conformance Docker image now installs tarantool-dev
+ build-essential so the C runtime can be built in-container; a new
`just conformance-c` recipe builds runtime/pb/c_runtime.so inside the
container, runs the suite with PB_ENABLE_C=1, then cleans the .so to
keep the bind mount free of foreign-platform binaries. The runner
script also pre-populates package.loaded.pb (avoids
.rocks/lib/tarantool/pb.so from starwing lua-protobuf masking ours)
and orders package.cpath by jit.os so mixed .dylib/.so trees from
host/container interleavings don't cross-load.
Verified:
- just test → 748 pass, 291 C-conditional skipped
- PB_ENABLE_C=1 just test → 1026/1039 pass; 13 fails are strict-decode
gaps in the C decoder (bd-rc8)
- just conformance-c → 2729/2806 binary suite pass; 77 unexpected
failures match the same gap categories
(illegal wire-type 6/7, field-num 0/over,
overlong tag varint, UTF-8 rejection,
message merge for oneof/repeated)
Strict-decode parity tracked in bd-rc8; this commit closes the wiring
half of bd-43t (conformance gate for C paths).
Eugene Blikh <bigbes@gmail.com> — 2026-05-23 19:32:30 UTC
Commit 1eb062c1de71ba3ca4d3bc55efdcd1a1c98e063f —
view raw patch
Parent(s):
c91a5ee5
| File | Status | + | − |
|---|---|---|---|
.beads/issues.jsonl
|
M | +1 | |
Justfile
|
M | +26 | -1 |
cmd/conformance-runner.lua
|
M | +24 | |
cmd/protoc-gen-tarantool/internal/gen/inline.go
|
M | +17 | |
docker/conformance.Dockerfile
|
M | +4 | -1 |
examples/expected/full/c_int64/c_int64_pb.lua
|
M | +10 | |
examples/expected/full/c_nested/c_nested_pb.lua
|
M | +50 | |
examples/expected/full/c_repeated/c_repeated_pb.lua
|
M | +20 | |
examples/expected/full/conformance/conformance_pb.lua
|
M | +50 | |
examples/expected/full/hello/hello_pb.lua
|
M | +60 | |
examples/expected/full/proto2_basic/proto2_basic_pb.lua
|
M | +100 | |
examples/expected/full/protobuf_test_messages/proto2/test_messages_proto2_pb.lua
|
M | +210 | |
examples/expected/full/protobuf_test_messages/proto3/test_messages_proto3_pb.lua
|
M | +50 | |
examples/expected/full/quickstart/quickstart_pb.lua
|
M | +10 | |
runtime/pb/init.lua
|
M | +35 | -2 |