Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #88 #116

Merged
merged 11 commits into from
Jul 25, 2024
Merged

Resolve #88 #116

merged 11 commits into from
Jul 25, 2024

Conversation

rneswold
Copy link
Contributor

This pull request will close issue #88.

This took a couple hours to figure out. The compiler kept telling me
things that weren't allowed. The problem was I was trying to pass one
of the channels in the `outputs` array, but the compiler couldn't tell
if more than one future was mutably accessing the same element.

The trick was to pair the output channel with the program so that
iterating through the entries guaranteed each future contained a
unique element.
@rneswold
Copy link
Contributor Author

I think this code change is correct, but I'd like to be sure, so I'm going to try to write some units tests before merging it.

@rneswold rneswold linked an issue Jul 22, 2024 that may be closed by this pull request
rneswold added 5 commits July 23, 2024 01:07
This commit introduces an "Emulator" type that provides a test harness
for logic blocks. Three units tests have been added using this
harness:

- One that tests a logic block that forwards an input to an output.
- One that forwards a calculation to an output and
- One that forwards an input to two outputs. This test gives some
  proof that this development branch actually allows concurrency when
  updating more than one expression.
The output device map isn't lining up with the expressions. In other
words, it's possible for a computed value to go to the wrong output.
We actually sort the expression list to be in index-ascending order so
the target of the expressions matches the index of the setting
channel.
@rneswold
Copy link
Contributor Author

Finally added a harness to test the logic blocks and they discovered a bug! 🎉 However, there are a few more tests I need to add:

  • All input devices must be unique (i.e. no two input variables can refer to the same device.)
  • All output devices must be unique (i.e. no two output variables can refer to the same device.)

rneswold added 5 commits July 24, 2024 23:42
Before the logic block starts initializing itself, it validates the
parameters. Tests were added to confirm they work.
It was a diagnostic message. But now we have unit tests to confirm
things are working.
The emulator now waits for the exit signal AND looks to see if the
logic block exits. If it exits, the error value is returned. This
allows us to write more specific tests.
@rneswold rneswold merged commit e361a5d into DrMemCS:main Jul 25, 2024
4 checks passed
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.

⚡ Add concurrency to logic block body
1 participant