Skip to content

feat: implement Kompact v1 foundation - #23

Draft
trancee wants to merge 9 commits into
mainfrom
feat/kompact-v1
Draft

feat: implement Kompact v1 foundation#23
trancee wants to merge 9 commits into
mainfrom
feat/kompact-v1

Conversation

@trancee

@trancee trancee commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • implement the Kompact v1 common runtime, annotations, KSP2 processor, Gradle plugin, generated Kotlin/C99 interfaces, registry compatibility, and publication model
  • validate reserved/unknown identities, versions, lengths, transport-tail bits, and recursively ordered bodies with validate-before-mutate behavior
  • generate scalar, byte, array, optional, nested, nested-array, active, and decode-only Kotlin/C interfaces from one canonical descriptor pass
  • add stable schema diagnostics, cycle and wrapped-width checks, canonical rational semantics, duplicate-key rejection, lifecycle/history/source validation, descriptor fingerprints, and ABI baselines
  • make standalone KSP work with separately published source-retained annotations; validate aligned runtime/annotation/plugin versions
  • add deterministic relocated-cache tests, exact generated C snapshot checks, disposable JVM/Android/iOS/C publication consumers, and atomic output publication
  • add reviewed conformance cases, fixed-seed Kotlin property coverage, C status/precedence and sanitizer fuzz harnesses
  • add retained small/medium/large workloads, optimized byte-chunk runtime operations, JVM ratio enforcement, AndroidX Microbenchmark, and Apple benchmark compilation
  • add Linux, Android, Apple, QEMU big-endian, fuzz, publication, performance, and generic physical-runner workflows

Specification

Implements the repository-controlled requirements indexed by the closed Kompact v1 implementation-ready specification and ADR-0001 through ADR-0010.

TDD evidence

Observed red then green at generated-consumer seams for transport-tail rejection, validation precedence, C aggregate writers/optionals, optional arrays, schema cycles, array-count diagnostics, semantic names, lifecycle transitions, namespace mismatch, duplicate registry keys, supported-decoder removal, published annotation discovery, and real multi-target publication consumption. Runtime property and benchmark-workload correctness tests cover the non-generated seams.

Verification

  • ./gradlew clean --no-build-cache --no-configuration-cache && ./gradlew check --no-build-cache --no-configuration-cache passed: 163 actionable check tasks, 157 executed
  • disposable repository publication passed: 123 actionable tasks; the external consumer then compiled generated code for JVM, Android, iosArm64, and iosSimulatorArm64
  • strict multi-translation-unit generated C99 consumer passed with -Wall -Wextra -Wconversion -Wsign-conversion -Werror -pedantic-errors
  • generated large C header: 17,111 bytes, below the 64 KiB limit
  • full JVM benchmark profile passed the 1.10 reference ratio gate: large 0.9635, medium 0.9863, small 0.9724
  • AndroidX benchmark APK assembled; iOS benchmark sources compiled for device and simulator
  • GCC C conformance, fixed-seed C fuzz smoke, Clang ASan/UBSan fuzz execution, ABI checks, Spotless, detekt, Kover, Android lint, and benchmark smoke passed
  • actionlint and git diff --check passed

Review

The two-axis /code-review pass produced one valid Standards finding: the 300-line D9 default deviations lacked a repository rationale. README.md now records each cohesive transaction/fixture deviation; every maintained file remains below the 500-line hard ceiling. The current-index Spec recheck found no remaining decode-only or C enum-array issue and reported no findings.

External release blockers

  • the maintainer selected generic android-reference and ios-reference self-hosted labels because concrete runner/device identities are unavailable; replace them with pinned metadata before release
  • the Android physical workflow is executable; the iPhone workflow currently captures metadata and compiles iosArm64, but signed device execution, timing loops, and Instruments allocation evidence still require the physical runner/signing environment
  • no production firmware compiler is selected; GCC and Clang remain the defined gates until a firmware toolchain is adopted
  • obtain independent human review

The PR remains draft until these external gates complete.

Impact

This remains a first pre-release API and wire-format implementation; no published consumer migration exists. Runtime failures remain typed and redacted and never include packet or attempted write values. The runtime bit loop now processes byte chunks rather than individual bits; controlled JVM generated/reference ratios remain within the ADR-0008 ceiling.

@trancee trancee added the enhancement New feature or request label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kompact v1 implementation-ready specification

1 participant