-
Notifications
You must be signed in to change notification settings - Fork 71
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
Implement accumL
with newPulse
#260
Conversation
I'm not 100% clear on what's going on but I trust that this makes things better. At the very least I can see how this allocates one fewer latch nodes, so that seems good.
A few questions - mostly permutations of the same question, really - where are we retaining the previous state? Do you mean in memory somewhere, due to laziness or something? (Like, does the |
It's a tricky one to explain, but lemme try again 😄 First, the setup:
Now, let's look at what happens when
The state after network evaluation is now:
Does that help?
It's the first, but single-step is a bit ambiguous. It's a single step leak on
Also just to clarify, this is not a problem with laziness.
This is correct, but only for the latch I should also note that this is part of the problem described by #259. |
Thanks for catching this and sorry for taking so long to take a look at this -- work. 🤪 I agree with you, @ocharles
I approve, feel free to merge. 🙏🏻 |
@HeinrichApfelmus You need a job like mine where |
Whoa, who's hiring banana engineers?! |
CircuitHub 😎 But not hiring at the moment unfortunately 😞 |
If they feel the need to hire again — you know where to find us. 😉 |
Currently
accumL
usesmapL
to read the previous state whenever the state updatePulse
fires. This is problematic, because when the previous state is read inmapL
(and transformed into a(a -> a) -> a
function), this is cached into theLatch
. This means that when the state updatePulse
fires, we'll update one latch to the new state, while also retaining the previous state. This commit redefinesaccumL
as a call tonewLatch
(as before) and creates a newPulse
withnewPulse
whose evaluation function reads thePulse
containing thea -> a
endmorphism, and also reads the current state from its latch. With this implementation, no historic values are leaked byaccumL
.