Skip to content

docs: split the README into integration, API and design docs - #11

Merged
aajll merged 1 commit into
masterfrom
10-docs-landing-page
Oct 14, 2026
Merged

aajll merged 1 commit into
masterfrom
10-docs-landing-page

Conversation

@aajll

@aajll aajll commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Refs #10

Summary

  • README.md: a landing page (82 lines) with a compiled quick start, description, validated toolchains and links.
  • docs/integration.md: requirements, copy-in, Meson subproject, installed package, buffer sizing and PPACK_PAYLOAD_BITS, build and test, cross builds in generic wording.
  • docs/api.md: field descriptors, pack and unpack, error codes with their check order, scaled-field semantics, and recipes (CAN-FD frame, narrow scaled field, round to nearest, stored record).
  • docs/design.md: goals and non-goals, wire format, addressing models, range argument, scaled arithmetic, failure behaviour, cost, MISRA position, verification. It absorbs docs/large-payload-verification.md, which is deleted.
  • CONTRIBUTING.md and AGENTS.md in the shared primitives structure, keeping the MISRA deviation process, the wire-format stability rules and the legacy-comparison commands.
  • ppack docs examples test via tests/docs/check_snippets.py.
  • src/ppack.c: the GLOBAL PROTOTYPES banner above the function definitions now reads GLOBAL FUNCTIONS, the banner the shared structure names. Comment only.

Verification of documented values

Each value was checked with a scratch probe built under ASan, UBSan and float-cast-overflow, natively and with PPACK_SIMULATE_16BIT_MAU; both models agree:

  • Quick start bytes B8 0B F6 FF E2 04 00 00 and the round trip.
  • Truncation: 12.349 at 0.01 gives 12.34, -1.5 at 1 gives -1; with the half-step helper, 12.35 and -2.
  • Clamps: UINT32 1e10 gives 4294967040, INT32 -1e10 gives -2147483648, INT16 +inf gives 32767, NaN gives -PPACK_ERR_INVALARG.
  • Narrow fields: 12-bit UINT16 carries 5000 as 904; 12-bit INT16 carries 2048 as -2048; the 10-bit thermal field carries 260 °C as raw 176, 4 °C, and the recipe's clamp keeps 215.75.
  • Wider fields: 24-bit UINT16 0x1234 gives 34 12 00, 24-bit INT16 -2 gives FE FF FF.
  • Check order: NULL payload with an empty table gives -PPACK_ERR_NULLPTR; unknown type with zero width gives -PPACK_ERR_INVALARG.
  • Partial output: a pack failing on field 2 leaves field 1 written in a cleared buffer; an unpack failing on field 2 leaves field 1 written.
  • Zero scale: pack -PPACK_ERR_OVERFLOW, unpack returns offset.
  • CAN-FD: a field at 480+32 in 512 bits succeeds, at 481 gives -PPACK_ERR_OVERFLOW.
  • Legacy comparison rerun locally: 5,512,760 cases per storage model.

Checks

  • meson test: 3 of 3 pass under ASan and UBSan (native, simulated, docs examples).
  • Docs test falsified: dropping an argument from the CAN-FD recipe's ppack_pack call fails it at docs/api.md:137; reverted.
  • check_links.py: 29 relative links, 0 broken. The 2.5.0 CHANGELOG entry now links to the verification record at the v2.5.0 tag.
  • scripts/format.sh: 28 files match.

Routing ledger

Old location New location
README features, use cases README description; api.md other uses
Requirements, supported architectures integration.md requirements
Copy-in, Meson subproject integration.md
Quick start README
Buffer default, PPACK_PAYLOAD_BITS override integration.md buffer sizing
CAN-FD example, larger stored records api.md recipes
Building, coverage integration.md, CONTRIBUTING.md
API reference, types, error codes, input validation api.md
Wire format, 16-bit-MAU specifics design.md, api.md field descriptors
Scaled fields, saturation, non-finite, quantisation api.md scaled fields; clamp rationale in design.md
Forcing the simulation flag integration.md build and test
Limitations design.md non-goals
Notes table (memory, MISRA, WCET, threading, F32, UINT8, version header) design.md, api.md, integration.md
Large-payload scope, range argument design.md range argument
Persistent tests, legacy comparison design.md verification; commands in CONTRIBUTING.md
Consumer obligations api.md conventions and stored record; design.md non-goals

Dropped with reason:

  • Clang rows in the validated-configurations table: CI runs GCC only.
  • The unvalidated architecture list: the requirements define support, not a list of untested targets.
  • Issue and consumer-repository links in the verification record: the design record describes the library, not its history or consumers.
  • The dated local verification record and its target cross file: the CI-backed checks are listed in design.md, and the consumer owns its cross file. The one local-only item, a target compile with the maximum buffer override, is not in CI and is no longer claimed.
  • "Audit callers that relied on the old rejection": a 2.5.0 migration note, kept in the CHANGELOG entry.

Not changed

The header Doxygen and code semantics. Scaled fields saturate to the type's range, not the field width, so a narrow scaled field wraps; this is documented as current behaviour with a call-site clamp recipe, not changed.

The README becomes a landing page, with installation and buffer sizing in docs/integration.md, the API and scaled-field semantics in docs/api.md, and the wire format, range argument and verification in docs/design.md, which absorbs the large-payload verification record. A docs example test compiles every C block, and CONTRIBUTING.md and AGENTS.md follow the shared primitives structure.

Refs #10
@aajll aajll linked an issue Oct 14, 2026 that may be closed by this pull request
5 tasks
@aajll
aajll merged commit 8220f3c into master Oct 14, 2026
9 checks passed
@aajll
aajll deleted the 10-docs-landing-page branch October 14, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split the README into integration, API and design docs

1 participant