Skip to content

docs: document caller-owned instances and fxp arithmetic for 0.4.0 - #9

Merged
aajll merged 1 commit into
5-chore-drop-poolfrom
5-docs-caller-owned
Oct 14, 2026
Merged

aajll merged 1 commit into
5-chore-drop-poolfrom
5-docs-caller-owned

Conversation

@aajll

@aajll aajll commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Refs #5

Layer 4 of 4. Documents the 0.4.0 API and records the change in the changelog.

Changes

  • README.md: caller-owned quick starts for PID, FIR and biquad using fxp constructors; number format; dt semantics; lifecycle; thread-safety contract for caller-owned instances.
  • CONTRIBUTING.md: storage and arithmetic design decisions; cppcheck and Valgrind commands for the fxp build; coverage gate.
  • AGENTS.md: commands without pool options.
  • README platform table, CONTRIBUTING and AGENTS: the C2000 cross-build is a CI gate (layer 1), not a local pre-submit check.
  • CHANGELOG.md [Unreleased]: breaking changes, fixes, removals, and the one-LSB re-baselined filter expectations.

Acceptance criteria evidence

  • Docs — README, CONTRIBUTING and CHANGELOG describe the new API and behaviour. The three README examples compile with -std=c11 -Wall -Wextra -Wpedantic -Werror against the built library and run with exit status 0.
  • Expectations explained — CHANGELOG lists each moved value and why.

Whole change

The library moves from pool-backed, raw int32_t Q16.16 arithmetic to caller-owned instances on the fxp kernel. That fixes three defects: the PID integral dropped sub-LSB contributions, filter sums could overflow a signed integer with extreme operands, and negative sums were narrowed with a right shift. The library is in the 0.x series, so the new API replaces the old one in 0.4.0 without deprecation shims. No release or tag is part of this stack.

TI C2000

fxp needs aajll/fxp#3 to compile where CHAR_BIT == 16, and the wrap pins a commit that includes it. Layer 1 adds the same C2000 CI job that fxp runs, so every layer builds on both CGT LTS versions with warnings as errors.

Check, every layer CGT 22.6.2 CGT 25.11.1
Library and subprojects, -Dwerror=true, --abi=coffabi 0 diagnostics 0 diagnostics
Library and subprojects, -Dwerror=true, --abi=eabi 0 diagnostics 0 diagnostics
Test program (test_pid.c, test_filters.c, harness, library, fxp), compiled and linked with -z, COFF and EABI, top layer 0 diagnostics 0 diagnostics

cl2000 --issue_remarks reports nothing on src/filters.c or src/pid_controller.c. A manual audit found no 16-bit-int hazards in src/: no shifts, and the uint16_t index arithmetic is cast back after each promotion.

Limitations

  • fxp has no release tag yet, so the wrap pins commit 24315b4; move it to a tag once fxp 0.1.0 is published.
  • The FIR sum saturates on overflow of a partial sum. Once saturated, the output can depend on tap order; a filter whose taps and samples fit the accumulator is unaffected.
  • C2000 evidence is compile and link only. No C28x hardware or simulator was available, so the test program was not executed on target.

Stack

  1. filters — FIR and biquad on fxp, caller-owned, saturating; TI C2000 CI gate
  2. pid — PID on fxp: wide integral, dt per term, caller-owned
  3. build — drop pool-allocator, its options and headers; coverage gate 100/100
  4. docs — README, CONTRIBUTING, AGENTS and CHANGELOG for 0.4.0

Review bottom first. Each layer builds and passes the full suite on its own. The whole-change narrative and limitations are in the top pull request (layer 4).

@aajll
aajll added this pull request to stack #10 October 14, 2026 16:16
@aajll
aajll force-pushed the 5-docs-caller-owned branch from c77fea8 to 74a3bb7 Compare October 14, 2026 16:53
The README, contributing guide and agent guide describe the caller-owned API, the fxp number format, the dt semantics and the TI C2000 CI gate, and drop the pool configuration. The changelog records the breaking changes, the fixes and the one-LSB re-baselined filter expectations under [Unreleased].

Refs #5
@aajll
aajll force-pushed the 5-docs-caller-owned branch from 74a3bb7 to 7de6c7f Compare October 14, 2026 16:56
@aajll
aajll merged commit a9bc885 into master Oct 14, 2026
16 checks passed
@aajll
aajll deleted the 5-docs-caller-owned branch October 14, 2026 17:00
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.

1 participant