Skip to content

Commit

Permalink
Comments and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
effectfully committed Apr 18, 2024
1 parent 28f46c7 commit 9d8942d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions plutus-benchmark/plutus-benchmark.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ benchmark validation-full
, base >=4.9 && <5
, bytestring
, criterion >=1.5.9.0
, deepseq
, directory
, filepath
, flat ^>=0.6
Expand Down
1 change: 1 addition & 0 deletions plutus-benchmark/validation/bench/BenchFull.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import PlutusLedgerApi.V1
import UntypedPlutusCore qualified as UPLC

import Common
import Control.DeepSeq (force)
import Control.Exception
import Criterion
import Data.ByteString as BS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ mkMachineParametersFor semVars newCMP = do
-- See Note [Inlining meanings of builtins].
(,) semVar . inline mkMachineParameters semVar <$>
applyCostModelParams (toCekCostModel semVar) newCMP
-- Force all thunks to pay the costs of creating machine parameters upfront. Doing it here saves
-- Force all thunks to pay the cost of creating machine parameters upfront. Doing it here saves
-- us from doing that in every single benchmark runner.
pure $! force res
-- Not marking this function with @INLINE@, since at this point everything we wanted to be inlined
Expand Down
9 changes: 9 additions & 0 deletions plutus-ledger-api/src/PlutusLedgerApi/Common/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ cache using a semantics variant as a key. We compute the semantics variant from
version using the stored function. Note that the semantics variant depends on the language version
too, but the latter is known statically (because each language version has its own evaluation
context), hence there's no reason to require it to be provided at runtime.
The reason why we associate a 'DefaultMachineParameters' with a semantics variant rather than a
protocol version are
1. generally there are far more protocol versions than semantics variants supported by a specific
language version, so we save on pointless duplication of bundles of machine parameters
2. builtins don't know anything about protocol versions, only semantics variants. It is therefore
more semantically precise to associate bundles of machine parameters with semantics variants than
with protocol versions
-}
data EvaluationContext = EvaluationContext
{ _evalCtxLedgerLang :: PlutusLedgerLanguage
Expand Down

0 comments on commit 9d8942d

Please sign in to comment.