# Future Proposal: Featherweight Profile

**URL:** <https://forum.opencyphal.org/t/future-proposal-featherweight-profile/743>\
**Category:** Specification\
**Created:** [February 3, 2020, 5:43am UTC](https://forum.opencyphal.org/t/future-proposal-featherweight-profile/743 "2020-02-03T05:43:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottdixon](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/scottdixon/32/39_2.png) [@scottdixon](https://forum.opencyphal.org/u/scottdixon)\
**Post date:** [February 3, 2020, 5:43am UTC](https://forum.opencyphal.org/t/future-proposal-featherweight-profile/743/1 "2020-02-03T05:43:16Z")

</div>

What if we defined a sub-set of UAVCAN designed to be even simpler and more deterministic, ~~requiring no dynamic memory allocation of any kind~~ _allowing for more primitive memory management,_ and eliminating some of the more vexing parts of the protocol for implementers. Specifically the featherweight profile (It’s a working title) would remove variable-length arrays and RPC/service calls (and unions if my proposal to remove unions wholesale is rejected). All full UAVCAN nodes would be able to receive all messages from featherweight nodes and would be able to send featherweight-compatible messages to those nodes (i.e. featherweight is a proper sub-set of the full protocol). We would also add a directive to DSDL to assert that a given message is compatible with the subset.

This is particularly useful for a safety-critical device that is self-programming over CAN. The primary application can be a featherweight but the secondary “flash over CAN” application would implement the full protocol. This allows for a certified hypervisor to protect the two making it easier to certify the primary to a higher design assurance level then the secondary and for the secondary to implement a large number of higher-level functions to facilitate diagnostics and debugging interactions without introducing failure modes to the primary application.

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [February 3, 2020, 9:54pm UTC](https://forum.opencyphal.org/t/future-proposal-featherweight-profile/743/2 "2020-02-03T21:54:43Z")

</div>

The overall idea makes sense in general and we should track this but I would like to point out that the full protocol does not seem to prescribe any logic that is inherently non-deterministic, nor does it necessarily require dynamic memory.

DSDL is _specifically designed to avoid dynamic storage allocation_. The upper size bound is always known for any variable-length type. The fact that Libuavcan v1 is going to require it is a mere _implementation detail that does not follow from the protocol design_ (the old Libuavcan and Libcanard did not need it).

Whether the dynamic memory is required at the transport layer is dependent on the application design rather than on the protocol itself. In our generic implementations such as Libuavcan/Libcanard, we have to rely on dynamic memory of some kind because these are _generic implementations_ and we do not have the luxury of making assumptions about how the application is going to be using the protocol. If we had access to the right context, it would be trivial to eliminate all forms of dynamic storage allocation.

I think that the Featherweight Profile belongs to the domain of implementation rather than specification. The main issue I see here is that the statement “featherweight is a proper subset of the full protocol” implies that the complement of that set is unimplementable under strong predictability requirements, which does not seem to be the case. I think we should consider instead turning it into a sort of best-practices advisory document describing how to deploy UAVCAN in high-DAL systems.

_(Even if the protocol did require dynamic memory, it wouldn’t make it non-deterministic by itself, either. Contrary to popular misconceptions, dynamic memory can be managed in constant time and with bounded fragmentation. Dynamic memory adds complexity, though, so it is undesirable still.)_

---

<div class="post-metadata">

**Author:** ![scottdixon](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/scottdixon/32/39_2.png) [@scottdixon](https://forum.opencyphal.org/u/scottdixon)\
**Post date:** [February 4, 2020, 12:38am UTC](https://forum.opencyphal.org/t/future-proposal-featherweight-profile/743/3 "2020-02-04T00:38:40Z")

</div>

I edited my proposal to word it better (The determinism I refer to is the time-bounded determinism of RPC interactions where the guarantees deteriorate as the latencies increase).

Is it something that is purely implementation? Perhaps but we would need to, as we already do, have nothing in the core specification that violated this profile. Because of that, and to be pedantic, the specification would need foreknowledge of these constraints which makes them intrinsic.

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [February 4, 2020, 2:37pm UTC](https://forum.opencyphal.org/t/future-proposal-featherweight-profile/743/4 "2020-02-04T14:37:03Z")

</div>

> [@scottdixon](#):
>
> Perhaps but we would need to, as we already do, have nothing in the core specification that violated this profile. Because of that, and to be pedantic, the specification would need foreknowledge of these constraints which makes them intrinsic.

I agree. Do you think the set of design principles we set out in section 1.3 is not sufficient? Should we extend it, or do you have something else in mind?
