Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f1295e5
mostly implement ack transmission but with a few missing todos; the t…
pavel-kirienko Dec 23, 2025
0a26318
tests green
pavel-kirienko Dec 23, 2025
678782a
wip the tx pipeline is entirely broken
pavel-kirienko Dec 24, 2025
1e7a967
progress
pavel-kirienko Dec 24, 2025
4bd91fb
wip
pavel-kirienko Dec 25, 2025
09d8ae8
wip
pavel-kirienko Dec 25, 2025
f379a5e
advance
pavel-kirienko Dec 26, 2025
7f8a3b0
tx_receive_ack
pavel-kirienko Dec 26, 2025
98b94bd
remove old intrusive tx tests
pavel-kirienko Dec 26, 2025
ecb5704
refcounting
pavel-kirienko Dec 26, 2025
223d6f0
shared tx queue wip
pavel-kirienko Dec 26, 2025
d6a6465
resolve the retry logic design challenge, a major one
pavel-kirienko Dec 27, 2025
c5890d6
count the number of allocated frames; the next task is to implement t…
pavel-kirienko Dec 27, 2025
c79db00
push with deduplication
pavel-kirienko Dec 27, 2025
72230bd
nits
pavel-kirienko Dec 27, 2025
99f8ec9
ack sending
pavel-kirienko Dec 27, 2025
c63aadc
bugfixes
pavel-kirienko Dec 27, 2025
ab57867
counters
pavel-kirienko Dec 27, 2025
9e21daa
fix tests
pavel-kirienko Dec 27, 2025
4c13edb
udpard_tx_push_p2p
pavel-kirienko Dec 27, 2025
ce43a18
add tests
pavel-kirienko Dec 27, 2025
d032a71
nits
pavel-kirienko Dec 27, 2025
7dcbe37
update the docs
pavel-kirienko Dec 27, 2025
af65a66
full line coverage
pavel-kirienko Dec 28, 2025
f73110c
ALWAYS invoke the feedback
pavel-kirienko Dec 28, 2025
eafaaec
tests
pavel-kirienko Dec 28, 2025
152bec3
fix tests
pavel-kirienko Dec 28, 2025
377ba4f
more tests
pavel-kirienko Dec 28, 2025
6d5aa3f
fix tests and add coverage to CI
pavel-kirienko Dec 28, 2025
fab1e38
ci
pavel-kirienko Dec 28, 2025
6d12306
scattered tx buffers
pavel-kirienko Dec 28, 2025
f311da6
compose proper P2P headers on tx
pavel-kirienko Dec 28, 2025
9c1dad5
ci
pavel-kirienko Dec 28, 2025
ecddf51
ci
pavel-kirienko Dec 28, 2025
df6aa64
ci
pavel-kirienko Dec 28, 2025
36db309
ci
pavel-kirienko Dec 28, 2025
d6d6da1
ci
pavel-kirienko Dec 28, 2025
dfbeb93
ci
pavel-kirienko Dec 28, 2025
e8320bf
ci
pavel-kirienko Dec 28, 2025
72eda9c
tests
pavel-kirienko Dec 28, 2025
06ddbe1
linter
pavel-kirienko Dec 28, 2025
2d33739
full test coverage
pavel-kirienko Dec 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ Checks: >-
-boost-use-ranges,
-hicpp-static-assert,
-misc-static-assert,
-modernize-macro-to-enum,
-cppcoreguidelines-macro-to-enum,
-*-macro-to-enum,
-*-macro-usage,
-*-enum-size,
-*-use-using,
-bugprone-casting-through-void,
-*-casting-through-void,
-misc-include-cleaner,
-cppcoreguidelines-avoid-do-while,
-*-magic-numbers,
-*-use-enum-class,
-*-use-trailing-return-type,
-*-deprecated-headers,
-*-avoid-c-arrays,
CheckOptions:
- key: readability-function-cognitive-complexity.Threshold
value: '99'
Expand Down
101 changes: 69 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
container: ghcr.io/opencyphal/toolshed:ts24.4.3
strategy:
matrix:
toolchain: [ 'clang', 'gcc' ]
toolchain: [ "clang", "gcc" ]
include:
- toolchain: gcc
c-compiler: gcc
Expand All @@ -24,23 +24,28 @@ jobs:
# language=bash
- run: >
cmake
-B ${{ github.workspace }}/build
-B $GITHUB_WORKSPACE/build
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER=${{ matrix.c-compiler }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }}
.
# language=bash
- run: |
cd ${{ github.workspace }}/build
cd $GITHUB_WORKSPACE/build
make VERBOSE=1 -j$(nproc)
make test ARGS="--verbose"
- name: Archive workspace
if: always()
run: |
cd $GITHUB_WORKSPACE
tar --use-compress-program="gzip -9" -cf $RUNNER_TEMP/workspace.tar.gz .
- uses: actions/upload-artifact@v4
if: always()
with:
# The matrix is shown for convenience but this is fragile because the values may not be string-convertible.
# Shall it break one day, feel free to remove the matrix from here.
name: ${{github.job}}-#${{strategy.job-index}}-${{job.status}}-${{join(matrix.*, ',')}}
path: ${{github.workspace}}/**/*
path: ${{runner.temp}}/workspace.tar.gz
retention-days: 2

optimizations:
Expand All @@ -49,13 +54,13 @@ jobs:
container: ghcr.io/opencyphal/toolshed:ts24.4.3
strategy:
matrix:
toolchain: [ 'clang', 'gcc' ]
toolchain: [ "clang", "gcc" ]
build_type: [ Release, MinSizeRel ]
include:
- toolchain: gcc
c-compiler: gcc
cxx-compiler: g++
cxx-flags: -fno-strict-aliasing # GCC in MinSizeRel C++20 mode misoptimizes the Cavl test.
cxx-flags: ""
- toolchain: clang
c-compiler: clang
cxx-compiler: clang++
Expand All @@ -66,7 +71,7 @@ jobs:
# language=bash
- run: >
cmake
-B ${{ github.workspace }}/build
-B $GITHUB_WORKSPACE/build
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_C_COMPILER=${{ matrix.c-compiler }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }}
Expand All @@ -75,36 +80,68 @@ jobs:
.
# language=bash
- run: |
cd ${{ github.workspace }}/build
cd $GITHUB_WORKSPACE/build
make VERBOSE=1 -j$(nproc)
make test ARGS="--verbose"
- name: Archive workspace
if: always()
run: |
cd $GITHUB_WORKSPACE
tar --use-compress-program="gzip -9" -cf $RUNNER_TEMP/workspace.tar.gz .
- uses: actions/upload-artifact@v4
if: always()
with:
# The matrix is shown for convenience but this is fragile because the values may not be string-convertible.
# Shall it break one day, feel free to remove the matrix from here.
name: ${{github.job}}-#${{strategy.job-index}}-${{job.status}}-${{join(matrix.*, ',')}}
path: ${{github.workspace}}/**/*
path: ${{runner.temp}}/workspace.tar.gz
retention-days: 2

# TODO: re-enable this
# avr:
# if: github.event_name == 'push'
# runs-on: ubuntu-latest
# env:
# mcu: at90can64
# flags: -Wall -Wextra -Werror -pedantic -Wconversion -Wtype-limits
# strategy:
# matrix:
# std: [ 'c99', 'c11', 'gnu99', 'gnu11' ]
# steps:
# - uses: actions/checkout@v4
# # language=bash
# - run: |
# sudo apt update -y && sudo apt upgrade -y
# sudo apt install gcc-avr avr-libc
# avr-gcc --version
# - run: avr-gcc -Ilib/cavl/ libudpard/*.c -c -std=${{matrix.std}} -mmcu=${{env.mcu}} ${{env.flags}}
coverage:
if: github.event_name == 'push'
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toolshed:ts24.4.3
steps:
- uses: actions/checkout@v4
with:
submodules: true
# language=bash
- run: >
cmake -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=Debug -DNO_STATIC_ANALYSIS=ON -DENABLE_COVERAGE=ON .
# language=bash
- run: |
cd $GITHUB_WORKSPACE/build
make -j$(nproc) && make test && make coverage
- name: Archive workspace
if: always()
run: |
cd $GITHUB_WORKSPACE
tar --use-compress-program="gzip -9" -cf $RUNNER_TEMP/workspace.tar.gz .
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{github.job}}-#${{strategy.job-index}}-${{job.status}}
path: ${{runner.temp}}/workspace.tar.gz
retention-days: 30

# TODO: re-enable this
# avr:
# if: github.event_name == 'push'
# runs-on: ubuntu-latest
# env:
# mcu: at90can64
# flags: -Wall -Wextra -Werror -pedantic -Wconversion -Wtype-limits
# strategy:
# matrix:
# std: [ 'c99', 'c11', 'gnu99', 'gnu11' ]
# steps:
# - uses: actions/checkout@v4
# # language=bash
# - run: |
# sudo apt update -y && sudo apt upgrade -y
# sudo apt install gcc-avr avr-libc
# avr-gcc --version
# - run: avr-gcc -Ilib/cavl/ libudpard/*.c -c -std=${{matrix.std}} -mmcu=${{env.mcu}} ${{env.flags}}

arm:
if: github.event_name == 'push'
Expand All @@ -113,7 +150,7 @@ jobs:
flags: -Wall -Wextra -Werror -pedantic -Wconversion -Wtype-limits -Wcast-align -Wfatal-errors
strategy:
matrix:
std: [ 'c99', 'c11', 'gnu99', 'gnu11' ]
std: [ "c99", "c11", "gnu99", "gnu11" ]
steps:
- uses: actions/checkout@v4
# language=bash
Expand All @@ -139,12 +176,12 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
submodules: true
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
distribution: "zulu"
# language=bash
- run: |
clang --version
Expand Down Expand Up @@ -179,6 +216,6 @@ jobs:
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.20
with:
source: './libudpard ./tests'
extensions: 'c,h,cpp,hpp'
source: "./libudpard ./tests"
extensions: "c,h,cpp,hpp"
clangFormatVersion: ${{ env.LLVM_VERSION }}
1 change: 1 addition & 0 deletions .idea/dictionaries/project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# LibUDPard instructions for agents
# LibUDPard instructions for AI agents

Please read README.md for general information about LibUDPard.
The library source files are just two: `libudpard/udpard.c` and `libudpard/udpard.h`.
Please read `README.md` for general information about LibUDPard, and `CONTRIBUTING.md` for development-related notes.

Keep the code and comments very brief. Be sure every significant code block is preceded with a brief comment.

When building the code, don't hesitate to use multiple jobs to use all CPU cores.

Run all tests in debug build to ensure that all assertion checks are enabled.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ next-generation intelligent vehicles: manned and unmanned aircraft, spacecraft,
## Features

- Zero-copy RX pipeline -- payload is moved from the NIC driver all the way to the application without copying.
- ≤1-copy TX pipeline with deduplication across multiple interfaces and scattered input buffer support.
- Support for redundant network interfaces with seamless interface aggregation and zero fail-over delay.
- Robust message reassembler tolerant to highly distorted datagram streams (out-of-order, duplication, distinct MTU).
- Message ordering recovery for ordering-sensitive applications (e.g., state estimators, control loops).
- Robust message reassembler supporting highly distorted datagram streams:
out-of-order fragments, message ordering recovery, fragment/message deduplication, interleaving, variable MTU, ...
- Robust message ordering recovery for ordering-sensitive applications (e.g., state estimators, control loops)
with well-defined deterministic recovery in the event of lost messages.
- Packet loss mitigation via:
- repetition-coding FEC (transparent to the application);
- redundant interfaces (packet lost on one interface may be received on another, transparent to the application);
- positive acknowledgment with retransmission (retransmission not handled by the library).
- reliable topics (retransmit until acknowledged; callback notifications for successful/failed deliveries).
- Heap not required; the library can be used with fixed-size block pool allocators.
- Detailed time complexity and memory requirement models for the benefit of real-time high-integrity applications.
- Runs on any 8/16/32/64-bit platform and extremely resource-constrained baremetal environments with ~100K ROM/RAM.
- MISRA C compliance (reach out to <https://forum.opencyphal.org>).
- Full implementation in a single C file with less than 2k lines of straightforward code!
- Runs anywhere out of the box, including extremely resource-constrained baremetal environments with ~100K ROM/RAM.
No porting required.
- Partial MISRA C compliance (reach out to <https://forum.opencyphal.org>).
- Full implementation in a single C file with only 2k lines of straightforward C99!
- Extensive test coverage.

## Usage

Expand Down Expand Up @@ -72,7 +76,9 @@ standards-compliant C99 compiler is available.

### v3.0

WIP --- adding support for Cyphal v1.1.
The library has been redesigned from scratch to support Cyphal v1.1, named topics, and reliable transfers.
No porting guide is provided since the changes are too significant;
please refer to the new API docs in `libudpard/udpard.h`.

### v2.0

Expand Down
Loading