Skip to content

Add support for Ports of Type void#363

Merged
tanneberger merged 2 commits into
mainfrom
void-ports
Jun 8, 2026
Merged

Add support for Ports of Type void#363
tanneberger merged 2 commits into
mainfrom
void-ports

Conversation

@tanneberger

@tanneberger tanneberger commented May 20, 2026

Copy link
Copy Markdown
Member

Changes to the user API:

Now valid:

input x: void
input x
reaction(t) -> out {=
    lf_set(out);
=}

If the port is void, lf_set is now allowed to take only the port.

This the last big missing piece for our v0.1. release. 🏁

@tanneberger tanneberger self-assigned this May 20, 2026
@tanneberger tanneberger requested review from edwardalee, erlingrj and sbgaia and removed request for edwardalee and sbgaia May 20, 2026 20:23
@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Memory usage after merging this PR will be:

Memory Report

action_buffer_full_defer_test_c

from to increase (%)
text 79058 78866 -0.24
data 752 752 0.00
bss 12480 12480 0.00
dec 92290 92098 -0.21

action_buffer_full_drop_test_c

from to increase (%)
text 79058 78866 -0.24
data 752 752 0.00
bss 12480 12480 0.00
dec 92290 92098 -0.21

action_buffer_full_replace_test_c

from to increase (%)
text 79058 78866 -0.24
data 752 752 0.00
bss 12480 12480 0.00
dec 92290 92098 -0.21

action_buffer_full_update_test_c

from to increase (%)
text 79058 78866 -0.24
data 752 752 0.00
bss 12480 12480 0.00
dec 92290 92098 -0.21

action_defer_test_c

from to increase (%)
text 79140 78948 -0.24
data 752 752 0.00
bss 12576 12576 0.00
dec 92468 92276 -0.21

action_drop_test_c

from to increase (%)
text 78964 78772 -0.24
data 752 752 0.00
bss 12576 12576 0.00
dec 92292 92100 -0.21

action_empty_test_c

from to increase (%)
text 78645 78453 -0.24
data 752 752 0.00
bss 12480 12480 0.00
dec 91877 91685 -0.21

action_microstep_test_c

from to increase (%)
text 79175 78983 -0.24
data 760 760 0.00
bss 12576 12576 0.00
dec 92511 92319 -0.21

action_overwrite_test_c

from to increase (%)
text 78890 78698 -0.24
data 752 752 0.00
bss 12576 12576 0.00
dec 92218 92026 -0.21

action_replace_test_c

from to increase (%)
text 78996 78804 -0.24
data 752 752 0.00
bss 12576 12576 0.00
dec 92324 92132 -0.21

action_test_c

from to increase (%)
text 78952 78760 -0.24
data 760 760 0.00
bss 12576 12576 0.00
dec 92288 92096 -0.21

action_update_test_c

from to increase (%)
text 79093 78901 -0.24
data 752 752 0.00
bss 12576 12576 0.00
dec 92421 92229 -0.21

deadline_test_c

from to increase (%)
text 73291 73083 -0.28
data 768 768 0.00
bss 11840 11840 0.00
dec 85899 85691 -0.24

delayed_conn_test_c

from to increase (%)
text 77482 77274 -0.27
data 752 752 0.00
bss 13312 13312 0.00
dec 91546 91338 -0.23

event_payload_pool_test_c

from to increase (%)
text 24314 24413 0.41
data 720 720 0.00
bss 480 480 0.00
dec 25514 25613 0.39

event_queue_test_c

from to increase (%)
text 36107 36107 0.00
data 728 728 0.00
bss 640 640 0.00
dec 37475 37475 0.00

nanopb_test_c

from to increase (%)
text 44474 44474 0.00
data 2120 2120 0.00
bss 320 320 0.00
dec 46914 46914 0.00

physical_clock_test_c

from to increase (%)
text 54811 54603 -0.38
data 832 832 0.00
bss 640 640 0.00
dec 56283 56075 -0.37

port_test_c

from to increase (%)
text 77385 77209 -0.23
data 752 752 0.00
bss 13120 13120 0.00
dec 91257 91081 -0.19

reaction_queue_test_c

from to increase (%)
text 30420 30420 0.00
data 728 728 0.00
bss 480 480 0.00
dec 31628 31628 0.00

request_shutdown_test_c

from to increase (%)
text 79026 78834 -0.24
data 752 752 0.00
bss 12576 12576 0.00
dec 92354 92162 -0.21

startup_test_c

from to increase (%)
text 72883 72675 -0.29
data 760 760 0.00
bss 11840 11840 0.00
dec 85483 85275 -0.24

tcp_channel_test_c

from to increase (%)
text 97601 97393 -0.21
data 2480 2480 0.00
bss 15776 15776 0.00
dec 115857 115649 -0.18

timer_test_c

from to increase (%)
text 72887 72679 -0.29
data 752 752 0.00
bss 11840 11840 0.00
dec 85479 85271 -0.24

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Benchmark results after merging this PR:

Benchmark results

Performance:

PingPongUc:
Best Time: 616.566 msec
Worst Time: 759.569 msec
Median Time: 680.876 msec

PingPongC:
Best Time: 171.907 msec
Worst Time: 175.753 msec
Median Time: 174.819 msec

ReactionLatencyUc:
Best latency: 24637 nsec
Median latency: 66605 nsec
Worst latency: 116083 nsec

ReactionLatencyC:
Best latency: 29138 nsec
Median latency: 66529 nsec
Worst latency: 146273 nsec

Memory usage:

PingPongUc:
text data bss dec hex filename
41218 760 9016 50994 c732 bin/PingPongUc

PingPongC:
text data bss dec hex filename
52194 934 424 53552 d130 bin/PingPongC

ReactionLatencyUc:
text data bss dec hex filename
26191 744 2808 29743 742f bin/ReactionLatencyUc

ReactionLatencyC:
text data bss dec hex filename
47736 902 424 49062 bfa6 bin/ReactionLatencyC

@tanneberger tanneberger added this to the v0.1.0 milestone May 20, 2026
@tanneberger tanneberger added the enhancement New feature or request label May 20, 2026
@tanneberger tanneberger changed the title Add Ports of Type void Add support for Ports of Type void May 20, 2026
@tanneberger tanneberger force-pushed the void-ports branch 16 times, most recently from 65b5ab7 to eae160d Compare May 23, 2026 10:48

@edwardalee edwardalee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I left some minor comments. It's not obvious to me how the macro magic works, so some hints in the comments would be helpful.

Comment thread include/reactor-uc/macros_api.h Outdated
Comment thread include/reactor-uc/macros_api.h
Comment thread lfc/core/src/main/kotlin/org/lflang/generator/uc/UcCmakeGenerator.kt Outdated
Comment thread src/schedulers/dynamic/scheduler.c Outdated
Comment thread lfc/core/src/main/kotlin/org/lflang/generator/uc/attribute/UcLoggingAttribute.kt Outdated
Comment thread src/connection.c
@tanneberger tanneberger force-pushed the void-ports branch 3 times, most recently from 1f88752 to 12ed5f8 Compare June 4, 2026 14:33
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Coverage after merging void-ports into main will be

85.31%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
include/reactor-uc
   event.h48.78%37.50%66.67%52.63%101, 101–102, 115–116, 116, 116, 116, 116–117, 119–121, 140–141, 141, 141, 141, 141
src
   action.c94.44%84.62%100%98.33%100–101, 108, 147, 27, 44, 44, 62, 77, 99
   builtin_triggers.c90.91%70%100%96.77%14, 18, 40, 43
   clock_synchronization.c75.45%62.16%92.31%78.54%106–109, 116–118, 143, 149–151, 154, 158, 160–161, 161, 161–163, 163, 163, 166, 166, 166–167, 170–175, 175, 175–176, 180, 182–188, 188, 188–189, 192, 214–215, 224–225, 238–239, 241, 254–256, 26, 264–266, 27, 30, 310–311, 323, 323–326, 33–35, 49–52, 79–80, 95–97
   connection.c91.25%78.72%100%96.15%102, 109, 115–116, 14, 153, 155–156, 158, 27–28, 35, 50, 59
   environment.c94.12%83.33%100%100%16, 29
   event.c100%100%100%100%
   federated.c82.87%61.62%100%91.67%125, 128–129, 155–156, 17–18, 183, 19–20, 209–210, 217, 221, 221, 221, 231–232, 235–237, 240–241, 243–246, 250, 253, 263, 286–288, 296–298, 31, 312–313, 315–318, 321–323, 36–37, 43–44, 48, 61, 61, 61–62, 70
   logging.c88.52%83.33%100%89.36%25, 38–40, 47, 60–61
   network_channel.c80.77%75%100%82.35%40, 40, 45–46, 57
   physical_clock.c97.40%83.33%100%100%26, 41
   port.c91.57%76.67%100%100%10, 15, 22, 26, 32, 48–49
   queues.c91.90%84.21%100%94.15%128, 132, 132, 132–133, 181, 188–191, 217–219, 221, 234, 250, 255, 261, 55, 62–65
   reaction.c95.90%89.13%100%100%21, 30, 32, 56, 72
   reactor.c86%69.70%100%98.73%10, 101–102, 14–19, 22, 28, 32–34, 37–38, 43, 60, 77, 83, 91
   serialization.c75%50%100%80%16–17, 26–27, 34–35, 42–43
   shutdown_coordinator.c85.16%75%100%87.23%100, 115, 130, 15, 21, 23–24, 27, 45–46, 68–69, 71–72, 74–75, 78, 94, 99
   startup_coordinator.c57.42%48.78%71.43%61%104–106, 116, 122, 124–125, 128, 138, 144, 149, 153–154, 174, 177–178, 188, 188, 188–189, 191, 193, 196, 21, 222, 226–227, 227, 227–228, 232, 235, 237, 242–243, 264, 273, 276, 293–294, 303, 303–304, 308, 32, 320, 368–370, 370, 370–371, 371, 371–374, 377–378, 378, 378, 381, 386, 386, 386–396, 399, 401, 404, 406–407, 407, 407–408, 411, 411, 411–413, 413, 413–414, 414, 414–416, 420, 420, 420–422, 426–429, 429, 429, 431–432, 435, 435, 435–436, 436, 436, 436, 436–437, 442–443, 443, 443–444, 444, 444–445, 449–450, 452, 454, 454, 454–463, 463, 463–471, 473, 477, 479, 479, 479, 481–482, 482, 482–483, 483, 483, 486–487, 487, 487–489, 494, 500, 500, 500, 500, 516–519, 521–524, 526–529, 531–533, 550, 550, 550, 550, 64, 67, 67, 67–69, 69, 69–76, 76, 76, 79, 79, 79–80, 82, 91–92, 94
   tag.c45.79%37.04%60%54.17%14, 17, 23–24, 24, 24, 24, 24–25, 27, 27, 27, 27, 27–28, 30, 30, 30–31, 33–34, 34, 34–35, 37, 37, 37, 37, 37–38, 40, 40, 40, 40, 40–41, 43, 63, 67–68, 83–85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85–87, 89
   timer.c97.50%83.33%100%100%14
   trigger.c100%100%100%100%
   util.c56.41%33.33%75%65.22%12–13, 13, 13–14, 14, 14–15, 15, 15–16, 18–19, 21, 24, 5
src/environments
   federated_environment.c85.91%70%100%90.91%113–116, 116, 116–119, 119, 119–121, 157–159, 25, 31, 43, 52, 55
   unfederated_environment.c93.62%71.43%100%97.01%13, 42, 42–43, 59–60
src/platform/posix
   posix.c84.87%63.64%86.67%90.24%114, 121, 126, 133, 17, 19, 21–23, 36–37, 59, 63, 77, 81, 95
   tcp_ip_channel.c70.56%57.31%100%79.38%102–103, 103, 103–104, 107–108, 108, 108–109, 112–113, 113, 113–114, 125–126, 128, 130, 134–135, 143, 146–147, 147, 147–148, 153–154, 154, 154–155, 161–162, 162, 162–163, 179, 182, 186, 186, 186, 186, 186–187, 187, 187–188, 188, 188–189, 191, 193, 193, 193–194, 203, 210–211, 216, 220–222, 222, 222–223, 226, 235, 235, 235–236, 269–270, 270,

@tanneberger

Copy link
Copy Markdown
Member Author

document the CHOOSER macros.

@tanneberger tanneberger merged commit 688f71e into main Jun 8, 2026
15 checks passed
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.

3 participants