Skip to content

Commit a77ad8c

Browse files
committed
WIP
1 parent 21d8358 commit a77ad8c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

plutus-core/cost-model/data/builtinCostModelC.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@
633633
"intercept": 352998,
634634
"slope": 19410
635635
},
636-
"type": "linear_in_w"
636+
"type": "linear_in_x"
637637
},
638638
"memory": {
639639
"arguments": 1,
@@ -1197,10 +1197,10 @@
11971197
"unionValue": {
11981198
"cpu": {
11991199
"arguments": {
1200-
"square_of_sum_coefficient00": 3128363791,
1201-
"square_of_sum_coefficient11": 5
1200+
"intercept": 1163050,
1201+
"slope": 1470
12021202
},
1203-
"type": "square_of_sum"
1203+
"type": "multiplied_sizes"
12041204
},
12051205
"memory": {
12061206
"arguments": 1,
@@ -1299,4 +1299,4 @@
12991299
"type": "linear_in_max_yz"
13001300
}
13011301
}
1302-
}
1302+
}

plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/CostingFun/Core.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ runTwoArgumentModel
635635
let !size1 = sumCostStream costs1
636636
!size2 = sumCostStream costs2
637637
in CostLast $ evaluateTwoVariableQuadraticFunction f size1 size2
638-
runTwoArgumentModel (ModelTwoArgumentsSquareOfSum f) = undefined
638+
runTwoArgumentModel (ModelTwoArgumentsSquareOfSum _) = \_ _ -> CostLast 10000
639639
{-# OPAQUE runTwoArgumentModel #-}
640640

641641

@@ -750,6 +750,7 @@ runCostingFunThreeArguments (CostingFun cpu mem) =
750750
data ModelFourArguments
751751
= ModelFourArgumentsConstantCost CostingInteger
752752
| ModelFourArgumentsLinearInW OneVariableLinearFunction
753+
| ModelFourArgumentsLinearInX OneVariableLinearFunction
753754
deriving stock (Show, Eq, Generic, Lift)
754755
deriving anyclass (NFData)
755756

@@ -771,6 +772,10 @@ runFourArgumentModel
771772
(ModelFourArgumentsLinearInW (OneVariableLinearFunction intercept slope)) =
772773
lazy $ \_ _ _ costs4 ->
773774
scaleLinearly intercept slope costs4
775+
runFourArgumentModel
776+
(ModelFourArgumentsLinearInX (OneVariableLinearFunction intercept slope)) =
777+
lazy $ \costs1 _ _ _ ->
778+
scaleLinearly intercept slope costs1
774779
{-# OPAQUE runFourArgumentModel #-}
775780

776781
-- See Note [runCostingFun* API].

0 commit comments

Comments
 (0)