Skip to content

Commit

Permalink
aarch64-darwin CI (#5113)
Browse files Browse the repository at this point in the history
* aarch64-darwin CI

Unsure if this will actually work.

* Noop commit

* Increase size cutoff

* Rework the pretty-printing of budget stuff
  • Loading branch information
michaelpj committed Feb 10, 2023
1 parent 7719fc2 commit 1bf2d74
Show file tree
Hide file tree
Showing 38 changed files with 241 additions and 585 deletions.
3 changes: 2 additions & 1 deletion nix/cells/automation/ciJobs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

let


inherit (inputs.cells.plutus) library;
inherit (library) pkgs;
inherit (pkgs.stdenv) system;
Expand Down Expand Up @@ -48,7 +49,7 @@ let
};

final-jobset =
if system == "x86_64-linux" || system == "x86_64-darwin" then
if system == "x86_64-linux" || system == "x86_64-darwin" || system == "aarch64-darwin" then
filtered-jobs // { required = required-job; }
else { };

Expand Down
5 changes: 2 additions & 3 deletions plutus-benchmark/nofib/test/formulaBudget.budget.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
({ cpu: 37605791908
| mem: 161972648
})
({cpu: 37605791908
| mem: 161972648})
5 changes: 2 additions & 3 deletions plutus-benchmark/nofib/test/knightsBudget.budget.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
({ cpu: 7563493298
| mem: 28459340
})
({cpu: 7563493298
| mem: 28459340})
5 changes: 2 additions & 3 deletions plutus-benchmark/nofib/test/queens4budget.budget.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
({ cpu: 14229364305
| mem: 54977742
})
({cpu: 14229364305
| mem: 54977742})
5 changes: 2 additions & 3 deletions plutus-benchmark/nofib/test/queens5budget.budget.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
({ cpu: 191619634648
| mem: 725849980
})
({cpu: 191619634648
| mem: 725849980})
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
({ cpu: 492446997
| mem: 1613269
})
({cpu: 492446997
| mem: 1613269})
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
({ cpu: 141826245
| mem: 466293
})
({cpu: 141826245
| mem: 466293})
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
({ cpu: 438942997
| mem: 1400528
})
({cpu: 438942997
| mem: 1400528})
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
({ cpu: 127689877
| mem: 410384
})
({cpu: 127689877
| mem: 410384})
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,9 @@ instance Monoid ExBudget where
mempty = ExBudget mempty mempty

instance Pretty ExBudget where
pretty (ExBudget cpu memory) = parens $ fold
[ "{ cpu: ", pretty cpu, line
, "| mem: ", pretty memory, line
, "}"
pretty (ExBudget cpu memory) = parens $ braces $ vsep
[ "cpu:" <+> pretty cpu
, "| mem:" <+> pretty memory
]

newtype ExRestrictingBudget = ExRestrictingBudget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ import PlutusCore.Evaluation.Machine.ExBudget
import PlutusCore.Evaluation.Machine.Exception
import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (..), ExMemory (..))

import Control.Lens (ifoldMap)
import Control.Lens (imap)
import Control.Monad.Except
import Data.Hashable (Hashable)
import Data.HashMap.Monoidal as HashMap
import Data.List (intersperse)
import Data.Map.Strict qualified as Map
import Data.Primitive.PrimArray
import Data.SatInt
Expand Down Expand Up @@ -81,8 +80,8 @@ newtype CekExTally fun = CekExTally (MonoidalHashMap (ExBudgetCategory fun) ExBu
instance (Show fun, Ord fun) => Pretty (CekExTally fun) where
pretty (CekExTally m) =
let om = Map.fromList $ HashMap.toList m
in parens $ fold (["{ "] <> (intersperse (line <> "| ") $ fmap group $
ifoldMap (\k v -> [(pretty k <+> "causes" <+> pretty v)]) om) <> ["}"])
in parens $ encloseSep "{" "}" "| " $ fmap group $
Map.elems $ imap (\k v -> (pretty k <+> "causes" <+> group (pretty v))) om

data TallyingSt fun = TallyingSt (CekExTally fun) ExBudget
deriving stock (Eq, Show, Generic)
Expand Down
15 changes: 9 additions & 6 deletions plutus-core/untyped-plutus-core/test/Evaluation/Machines.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ import PlutusCore.StdLib.Meta.Data.Function (etaExpand)
import GHC.Exts (fromString)
import GHC.Ix
import Hedgehog hiding (Size, Var, eval)
import Prettyprinter
import Prettyprinter.Render.Text
import Test.Tasty
import Test.Tasty.Extras
import Test.Tasty.Golden
import Test.Tasty.Hedgehog

testMachine
Expand Down Expand Up @@ -69,7 +68,7 @@ testBudget
testBudget runtime name term =
nestedGoldenVsText
name
(renderStrict $ layoutPretty defaultLayoutOptions {layoutPageWidth = AvailablePerLine maxBound 1.0} $
(render $
prettyPlcReadableDef $ runCekNoEmit (MachineParameters Plc.defaultCekMachineCosts runtime) Cek.tallying term)

bunchOfFibs :: PlcFolderContents DefaultUni DefaultFun
Expand Down Expand Up @@ -114,7 +113,9 @@ bunchOfIfThenElseNats =

test_budget :: TestTree
test_budget
= runTestNestedIn ["untyped-plutus-core", "test", "Evaluation", "Machines"]
-- Error diffs are very big
= localOption (SizeCutoff 1000000)
. runTestNestedIn ["untyped-plutus-core", "test", "Evaluation", "Machines"]
. testNested "Budget"
$ concat
[ folder Plc.defaultBuiltinsRuntime bunchOfFibs
Expand All @@ -132,12 +133,14 @@ testTallying :: TestName -> Term Name DefaultUni DefaultFun () -> TestNested
testTallying name term =
nestedGoldenVsText
name
(renderStrict $ layoutPretty defaultLayoutOptions {layoutPageWidth = AvailablePerLine maxBound 1.0} $
(render $
prettyPlcReadableDef $ runCekNoEmit Plc.defaultCekParameters Cek.tallying term)

test_tallying :: TestTree
test_tallying =
runTestNestedIn ["untyped-plutus-core", "test", "Evaluation", "Machines"]
-- Error diffs are very big
localOption (SizeCutoff 1000000)
. runTestNestedIn ["untyped-plutus-core", "test", "Evaluation", "Machines"]
. testNested "Tallying"
. foldPlcFolderContents testNested
(\name _ -> pure $ testGroup name [])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
( (Right (1))
, ({ tally: ({ BStep BConst causes ({ cpu: 69000
| mem: 300
})
| BStep BVar causes ({ cpu: 299000
| mem: 1300
})
| BStep BLamAbs causes ({ cpu: 322000
| mem: 1400
})
| BStep BApply causes ({ cpu: 414000
| mem: 1800
})
| BStep BDelay causes ({ cpu: 115000
| mem: 500
})
| BStep BForce causes ({ cpu: 138000
| mem: 600
})
| BStep BBuiltin causes ({ cpu: 46000
| mem: 200
})
| BBuiltinApp LessThanEqualsInteger causes ({ cpu: 205397
| mem: 1
})
| BBuiltinApp IfThenElse causes ({ cpu: 80556
| mem: 1
})
| BStartup causes ({ cpu: 100
| mem: 100
})})
| budget: ({ cpu: 1689053
| mem: 6202
})
, ({ tally: ({BStep BConst causes ({cpu: 69000 | mem: 300})
| BStep BVar causes ({cpu: 299000 | mem: 1300})
| BStep BLamAbs causes ({cpu: 322000 | mem: 1400})
| BStep BApply causes ({cpu: 414000 | mem: 1800})
| BStep BDelay causes ({cpu: 115000 | mem: 500})
| BStep BForce causes ({cpu: 138000 | mem: 600})
| BStep BBuiltin causes ({cpu: 46000 | mem: 200})
| BBuiltinApp LessThanEqualsInteger causes ({cpu: 205397 | mem: 1})
| BBuiltinApp IfThenElse causes ({cpu: 80556 | mem: 1})
| BStartup causes ({cpu: 100 | mem: 100})})
| budget: ({cpu: 1689053
| mem: 6202})
}) )
Original file line number Diff line number Diff line change
@@ -1,41 +1,16 @@
( (Right (1))
, ({ tally: ({ BStep BConst causes ({ cpu: 207000
| mem: 900
})
| BStep BVar causes ({ cpu: 828000
| mem: 3600
})
| BStep BLamAbs causes ({ cpu: 690000
| mem: 3000
})
| BStep BApply causes ({ cpu: 1196000
| mem: 5200
})
| BStep BDelay causes ({ cpu: 207000
| mem: 900
})
| BStep BForce causes ({ cpu: 276000
| mem: 1200
})
| BStep BBuiltin causes ({ cpu: 207000
| mem: 900
})
| BBuiltinApp AddInteger causes ({ cpu: 206477
| mem: 2
})
| BBuiltinApp SubtractInteger causes ({ cpu: 412954
| mem: 4
})
| BBuiltinApp LessThanEqualsInteger causes ({ cpu: 616191
| mem: 3
})
| BBuiltinApp IfThenElse causes ({ cpu: 241668
| mem: 3
})
| BStartup causes ({ cpu: 100
| mem: 100
})})
| budget: ({ cpu: 5088390
| mem: 15812
})
, ({ tally: ({BStep BConst causes ({cpu: 207000 | mem: 900})
| BStep BVar causes ({cpu: 828000 | mem: 3600})
| BStep BLamAbs causes ({cpu: 690000 | mem: 3000})
| BStep BApply causes ({cpu: 1196000 | mem: 5200})
| BStep BDelay causes ({cpu: 207000 | mem: 900})
| BStep BForce causes ({cpu: 276000 | mem: 1200})
| BStep BBuiltin causes ({cpu: 207000 | mem: 900})
| BBuiltinApp AddInteger causes ({cpu: 206477 | mem: 2})
| BBuiltinApp SubtractInteger causes ({cpu: 412954 | mem: 4})
| BBuiltinApp LessThanEqualsInteger causes ({cpu: 616191 | mem: 3})
| BBuiltinApp IfThenElse causes ({cpu: 241668 | mem: 3})
| BStartup causes ({cpu: 100 | mem: 100})})
| budget: ({cpu: 5088390
| mem: 15812})
}) )
Original file line number Diff line number Diff line change
@@ -1,41 +1,16 @@
( (Right (2))
, ({ tally: ({ BStep BConst causes ({ cpu: 345000
| mem: 1500
})
| BStep BVar causes ({ cpu: 1357000
| mem: 5900
})
| BStep BLamAbs causes ({ cpu: 1058000
| mem: 4600
})
| BStep BApply causes ({ cpu: 1978000
| mem: 8600
})
| BStep BDelay causes ({ cpu: 299000
| mem: 1300
})
| BStep BForce causes ({ cpu: 414000
| mem: 1800
})
| BStep BBuiltin causes ({ cpu: 368000
| mem: 1600
})
| BBuiltinApp AddInteger causes ({ cpu: 412954
| mem: 4
})
| BBuiltinApp SubtractInteger causes ({ cpu: 825908
| mem: 8
})
| BBuiltinApp LessThanEqualsInteger causes ({ cpu: 1026985
| mem: 5
})
| BBuiltinApp IfThenElse causes ({ cpu: 402780
| mem: 5
})
| BStartup causes ({ cpu: 100
| mem: 100
})})
| budget: ({ cpu: 8487727
| mem: 25422
})
, ({ tally: ({BStep BConst causes ({cpu: 345000 | mem: 1500})
| BStep BVar causes ({cpu: 1357000 | mem: 5900})
| BStep BLamAbs causes ({cpu: 1058000 | mem: 4600})
| BStep BApply causes ({cpu: 1978000 | mem: 8600})
| BStep BDelay causes ({cpu: 299000 | mem: 1300})
| BStep BForce causes ({cpu: 414000 | mem: 1800})
| BStep BBuiltin causes ({cpu: 368000 | mem: 1600})
| BBuiltinApp AddInteger causes ({cpu: 412954 | mem: 4})
| BBuiltinApp SubtractInteger causes ({cpu: 825908 | mem: 8})
| BBuiltinApp LessThanEqualsInteger causes ({cpu: 1026985 | mem: 5})
| BBuiltinApp IfThenElse causes ({cpu: 402780 | mem: 5})
| BStartup causes ({cpu: 100 | mem: 100})})
| budget: ({cpu: 8487727
| mem: 25422})
}) )
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
( (Right (delay (\z -> \f -> f (delay (\z -> \f -> f (delay (\z -> \f -> f (delay (\z -> \f -> f (delay (\z -> \f -> f (delay (\z -> \f -> f (delay (\z -> \f -> f (delay (\z -> \f -> f (delay (\z -> \f -> f (delay (\z -> \f -> f (delay (\z -> \f -> z)))))))))))))))))))))))
, ({ tally: ({ BStep BConst causes ({ cpu: 0
| mem: 0
})
| BStep BVar causes ({ cpu: 3220000
| mem: 14000
})
| BStep BLamAbs causes ({ cpu: 2162000
| mem: 9400
})
| BStep BApply causes ({ cpu: 2806000
| mem: 12200
})
| BStep BDelay causes ({ cpu: 851000
| mem: 3700
})
| BStep BForce causes ({ cpu: 598000
| mem: 2600
})
| BStep BBuiltin causes ({ cpu: 0
| mem: 0
})
| BStartup causes ({ cpu: 100
| mem: 100
})})
| budget: ({ cpu: 9637100
| mem: 42000
})
, ({ tally: ({BStep BConst causes ({cpu: 0 | mem: 0})
| BStep BVar causes ({cpu: 3220000 | mem: 14000})
| BStep BLamAbs causes ({cpu: 2162000 | mem: 9400})
| BStep BApply causes ({cpu: 2806000 | mem: 12200})
| BStep BDelay causes ({cpu: 851000 | mem: 3700})
| BStep BForce causes ({cpu: 598000 | mem: 2600})
| BStep BBuiltin causes ({cpu: 0 | mem: 0})
| BStartup causes ({cpu: 100 | mem: 100})})
| budget: ({cpu: 9637100
| mem: 42000})
}) )

0 comments on commit 1bf2d74

Please sign in to comment.