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
PLT-5287: Define a runCekM-like function giveCekReqs
for the debugger
#5229
Conversation
plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/Debug/Internal.hs
Outdated
Show resolved
Hide resolved
bd4be1d
to
f559514
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still a bit suspicious that GivenCekReqs
escapes. I would have thought we could e.g. pass the CEK arguments to handleStep
etc. I'm not really sure. It just feels like a mess atm.
plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/Debug/Internal.hs
Outdated
Show resolved
Hide resolved
?cekStepCounter = ctr | ||
in act exBudgetInfo | ||
-- note that we do not call the final budget&emit getters like in `runCekM`, | ||
-- since we do not need it for our usecase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely act
can do this itself if it needs to?
=> MachineParameters CekMachineCosts fun (CekValue uni fun ann) | ||
-> ExBudgetMode cost uni fun | ||
-> EmitterMode uni fun | ||
-> (GivenCekReqs uni fun ann s => ExBudgetInfo cost uni fun s -> m a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The passing of the ExBudgetInfo is kind of mixed up in it also. And nothing uses it? So it doesn't just set up the requirements? I'm confused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. The fewer implicit parameters the better!
plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/Debug/Internal.hs
Outdated
Show resolved
Hide resolved
After discussing with Michael, I will try to improve this PR a bit to make it less leaky |
/benchmark plutus-benchmark:validation |
/benchmark plutus-benchmark:validation |
Click here to check the status of your benchmark. |
Comparing benchmark results of ' plutus-benchmark:validation' on 'f49230f650' (base) and '9e0788f643' (PR) Results table
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MUCH better IMO.
(Breakpointable ann bps, MonadFree (DebugF uni fun ann bps) m) | ||
=> NTerm uni fun ann -> m () | ||
runDriver = void . runReaderT driver . initState | ||
runDriverT = void . runReaderT driver . initState |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a kind of weird name. It sounds like it should be a function that gets you out of the DriverT
monad transformer... but that's definitely not what's happening here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed a weird name. It does not actually run the whole Driving
monad stack (i.e. reader,free); it only runs the Reader CekState
which is the state of the driver.
So it is very similar to runReaderT
. If you have a better name, let me know!
plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/Debug/Internal.hs
Outdated
Show resolved
Hide resolved
@@ -58,6 +58,7 @@ module UntypedPlutusCore.Evaluation.Machine.Cek.Internal | |||
, Slippage | |||
, defaultSlippage | |||
, NTerm | |||
, runCekM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used somewhere? I guess it must be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used by the steppable cek to provide the same runCekDeBruijn
run-to-completion interface as the original cek
ba7c3f0
to
7776795
Compare
Pre-submit checklist: