Skip to content
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

Release candidate v5.0.1 (please ignore) #809

Merged
merged 49 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7602213
v5.0-jit-costing: Enhance all tests with expected jit costing
jozanek Mar 17, 2022
5532635
v5.0-add-jit-costing-for-tests: Long methods
aslesarenko Mar 19, 2022
47c1138
v5.0-add-jit-costing-for-tests: fixed property("NEQ of tuples of nume…
aslesarenko Mar 21, 2022
516e80e
v5.0-add-jit-costing-for-tests: fixed property("NEQ of collections of…
aslesarenko Mar 21, 2022
9e96cf4
v5.0-jit-costing: Another bunch of tests uses jit costing
jozanek Mar 29, 2022
2e0ec20
v5.0-jit-costing: binary and method cost details abstraction.
jozanek Mar 30, 2022
51a6977
v5.0-jit-costing: fix test for SAvlTree.valueLengthOptMethod
jozanek Mar 30, 2022
6f834ac
v5.0-jit-costing: Correst expectedExpr for 'Coll fold with nested If'…
jozanek Mar 30, 2022
a7d2321
v5.0-add-jit-costing-for-tests: renamings
aslesarenko Apr 1, 2022
c84aa35
v5.0-fix-flatmap: remove checkValidFlatmap from flatMap_eval (which i…
aslesarenko Apr 4, 2022
bee7396
v5.0-fix-flatmap: comment test code
aslesarenko Apr 4, 2022
d37ba99
Merge remote-tracking branch 'origin/v5.0-fix-flatmap' into v5.0-add-…
aslesarenko Apr 4, 2022
d25924a
v5.0-jit-costing: Coll.flatMap equivalence failing test due to costDe…
jozanek Mar 30, 2022
e50a12c
v5.0-jitc-failing-Coll-flatmap-equivalence: fix tests
aslesarenko Apr 4, 2022
b5ee207
v5.0-jit-costing: AvlTree.contains failing test due to expectedCost.
jozanek Mar 30, 2022
894903c
v5.0-jitc-for-changed-feature-testing: Enable jitc for ChangedFeature
jozanek Apr 6, 2022
b109f81
v5.0-jitc-for-changed-feature-testing: Add jitc to 'Random headers ac…
jozanek Apr 6, 2022
24917d3
v5.0-jitc-for-changed-feature-testing: Add jitc to 'Context propertie…
jozanek Apr 6, 2022
cb3d771
v5.0-jitc-for-changed-feature-testing: Add jitc to 'xorOf equivalence…
jozanek Apr 6, 2022
8a8e9c0
v5.0-jitc-for-changed-feature-testing: Add jitc to 'Global.xor equiva…
jozanek Apr 6, 2022
f616d68
v5.0-jitc-for-changed-feature-testing: Add jitc to 'Option fold worka…
jozanek Apr 6, 2022
fc95085
v5.0-jitc-for-changed-feature-testing: Add jitc to 'substConstants eq…
jozanek Apr 6, 2022
325dfda
v5.0-jitc-for-changed-feature-testing: Comments for tests which ignor…
jozanek Apr 6, 2022
261bc3c
v5.0-jitc-for-changed-feature-testing: Add jitc to 'Global.xor equiva…
jozanek Apr 6, 2022
3654798
v5.0-jitc-for-changed-feature-testing: Comment
jozanek Apr 6, 2022
2bbc256
v5.0-jitc-failing-Coll-flatmap-equivalence: Remove unused method and …
jozanek Apr 7, 2022
700917c
Merge pull request #786 from ScorexFoundation/v5.0-jitc-failing-Coll-…
jozanek Apr 7, 2022
599a0e0
v5.0-jitc-failing-avltree-contains: Hardcoded scenario for some avltr…
jozanek Apr 13, 2022
48a0a4d
Merge pull request #787 from ScorexFoundation/v5.0-jitc-failing-avltr…
aslesarenko Apr 15, 2022
28da029
v5.0-jitc-for-changed-feature-testing: checking CostDetails
aslesarenko Apr 15, 2022
4bcc605
v5.0-jitc-for-changed-feature-testing: checking CostDetails (part 2)
aslesarenko Apr 15, 2022
fc7de98
v5.0-jitc-for-changed-feature-testing: checking CostDetails (part 3)
aslesarenko Apr 15, 2022
f6d9991
v5.0-jitc-for-changed-feature-testing: checking CostDetails (part 4)
aslesarenko Apr 15, 2022
a8633b6
Merge branch 'v5.0-add-jit-costing-for-tests' into v5.0-jitc-for-chan…
jozanek Apr 19, 2022
3f94014
v5.0-jitc-for-changed-feature-testing: Add jitc to 'Coll flatMap meth…
jozanek Apr 19, 2022
be20e3a
v5.0-jitc-for-changed-feature-testing: Add jitc to 'Option fold worka…
jozanek Apr 19, 2022
91cd31b
v5.0-jitc-for-changed-feature-testing: Add jitc to 'Coll flatMap meth…
jozanek Apr 19, 2022
d91406d
v5.0-jitc-for-changed-feature-testing: Add jitc to 'AlvTree.{get,getM…
jozanek Apr 19, 2022
f9e05a8
v5.0-jitc-for-changed-feature-testing: Add jitc to 'AvlTree.update eq…
jozanek Apr 20, 2022
19607a7
v5.0-jitc-for-changed-feature-testing: Add jitc to 'AvlTree.remove eq…
jozanek Apr 20, 2022
5bef13c
v5.0-jitc-for-changed-feature-testing: Add jitc to 'AvlTree.{contains…
jozanek Apr 21, 2022
46b0f44
v5.0-jitc-for-changed-feature-testing: Add jitc to 'AvlTree.insert eq…
jozanek Apr 21, 2022
c106776
v5.0-jitc-for-changed-feature-testing: Add jitc to 'AvlTree.update eq…
jozanek Apr 21, 2022
99d260d
v5.0-jitc-for-changed-feature-testing: Add jitc to 'AvlTree.remove eq…
jozanek Apr 21, 2022
d4dadd1
v5.0-add-jit-costing-for-tests: 'Coll slice method equivalence' test
jozanek Apr 22, 2022
4e269e9
v5.0-jitc-for-changed-feature-testing: resolve remaining TODO mainnet
aslesarenko Apr 22, 2022
41e1f2a
v5.0-jitc-for-changed-feature-testing: code cleanup + ScalaDocs
aslesarenko Apr 23, 2022
0d8e873
v5.0-jitc-for-changed-feature-testing: renamings
aslesarenko Apr 23, 2022
743123c
Merge pull request #791 from ScorexFoundation/v5.0-jitc-for-changed-f…
aslesarenko Apr 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sigmastate/src/main/scala/org/ergoplatform/ErgoLikeContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ case object MinerPubkey extends NotReadyValueByteArray with ValueCompanion {
}

/** When interpreted evaluates to a IntConstant built from Context.currentHeight */
case object Height extends NotReadyValueInt with ValueCompanion {
case object Height extends NotReadyValueInt with FixedCostValueCompanion {
override def companion = this
override def opCode: OpCode = OpCodes.HeightCode
/** Cost of: 1) Calling Context.HEIGHT Scala method. */
Expand All @@ -272,7 +272,7 @@ case object Height extends NotReadyValueInt with ValueCompanion {
}

/** When interpreted evaluates to a collection of BoxConstant built from Context.boxesToSpend */
case object Inputs extends LazyCollection[SBox.type] with ValueCompanion {
case object Inputs extends LazyCollection[SBox.type] with FixedCostValueCompanion {
override def companion = this
override def opCode: OpCode = OpCodes.InputsCode
/** Cost of: 1) Calling Context.INPUTS Scala method. */
Expand All @@ -286,7 +286,7 @@ case object Inputs extends LazyCollection[SBox.type] with ValueCompanion {
}

/** When interpreted evaluates to a collection of BoxConstant built from Context.spendingTransaction.outputs */
case object Outputs extends LazyCollection[SBox.type] with ValueCompanion {
case object Outputs extends LazyCollection[SBox.type] with FixedCostValueCompanion {
override def companion = this
override def opCode: OpCode = OpCodes.OutputsCode
/** Cost of: 1) Calling Context.OUTPUTS Scala method. */
Expand Down Expand Up @@ -316,7 +316,7 @@ case object LastBlockUtxoRootHash extends NotReadyValueAvlTree with ValueCompani


/** When interpreted evaluates to a BoxConstant built from context.boxesToSpend(context.selfIndex) */
case object Self extends NotReadyValueBox with ValueCompanion {
case object Self extends NotReadyValueBox with FixedCostValueCompanion {
override def companion = this
override def opCode: OpCode = OpCodes.SelfCode
/** Cost of: 1) Calling Context.SELF Scala method. */
Expand Down Expand Up @@ -349,7 +349,7 @@ case object Context extends NotReadyValue[SContext.type] with ValueCompanion {
/** When interpreted evaluates to the singleton instance of [[special.sigma.SigmaDslBuilder]].
* Corresponds to `Global` variable in ErgoScript which can be used like `Global.groupGenerator`.
*/
case object Global extends NotReadyValue[SGlobal.type] with ValueCompanion {
case object Global extends NotReadyValue[SGlobal.type] with FixedCostValueCompanion {
override def companion = this
override def opCode: OpCode = OpCodes.GlobalCode
/** Cost of: 1) accessing Global instance. */
Expand Down
2 changes: 1 addition & 1 deletion sigmastate/src/main/scala/sigmastate/Values.scala
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ object Values {
Colls.fromArray(is)
}
}
object ConcreteCollection extends ValueCompanion {
object ConcreteCollection extends FixedCostValueCompanion {
override def opCode: OpCode = ConcreteCollectionCode
/** Cost of: allocating new collection
* @see ConcreteCollection_PerItem */
Expand Down
2 changes: 1 addition & 1 deletion sigmastate/src/main/scala/sigmastate/lang/Terms.scala
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ object Terms {
}
}

object MethodCall extends ValueCompanion {
object MethodCall extends FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.MethodCallCode
/** Cost of: 1) packing args into Array 2) java.lang.reflect.Method.invoke */
override val costKind = FixedCost(JitCost(4))
Expand Down
10 changes: 5 additions & 5 deletions sigmastate/src/main/scala/sigmastate/trees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ case class BoolToSigmaProp(value: BoolValue) extends SigmaPropValue {
SigmaDsl.sigmaProp(v)
}
}
object BoolToSigmaProp extends ValueCompanion {
object BoolToSigmaProp extends FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.BoolToSigmaPropCode
override val costKind = FixedCost(JitCost(15))
val OpType = SFunc(SBoolean, SSigmaProp)
Expand All @@ -186,7 +186,7 @@ case class CreateProveDlog(value: Value[SGroupElement.type]) extends SigmaPropVa
SigmaDsl.proveDlog(v)
}
}
object CreateProveDlog extends ValueCompanion {
object CreateProveDlog extends FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.ProveDlogCode
override val costKind = FixedCost(JitCost(10))
val OpType = SFunc(SGroupElement, SSigmaProp)
Expand Down Expand Up @@ -227,7 +227,7 @@ case class CreateProveDHTuple(gv: Value[SGroupElement.type],
SigmaDsl.proveDHTuple(g, h, u, v)
}
}
object CreateProveDHTuple extends ValueCompanion {
object CreateProveDHTuple extends FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.ProveDiffieHellmanTupleCode
override val costKind = FixedCost(JitCost(20))
}
Expand Down Expand Up @@ -1019,7 +1019,7 @@ case class Negation[T <: SType](input: Value[T]) extends OneArgumentOperation[T,
i.negate(inputV)
}
}
object Negation extends OneArgumentOperationCompanion {
object Negation extends OneArgumentOperationCompanion with FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.NegationCode
override val costKind = FixedCost(JitCost(30))
override def argInfos: Seq[ArgInfo] = NegationInfo.argInfos
Expand Down Expand Up @@ -1498,7 +1498,7 @@ case class If[T <: SType](condition: Value[SBoolean.type], trueBranch: Value[T],
}
}
}
object If extends QuadrupleCompanion {
object If extends QuadrupleCompanion with FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.IfCode
/** Cost of: conditional switching to the right branch (excluding the cost both
* condition itself and the branches) */
Expand Down
3 changes: 0 additions & 3 deletions sigmastate/src/main/scala/sigmastate/types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1688,9 +1688,6 @@ object SCollection extends STypeCompanion with MethodByNameUnapply {
*/
def flatMap_eval[A, B](mc: MethodCall, xs: Coll[A], f: A => Coll[B])
(implicit E: ErgoTreeEvaluator): Coll[B] = {
if (!VersionContext.current.isJitActivated) {
checkValidFlatmap(mc)
}
val m = mc.method
var res: Coll[B] = null
E.addSeqCost(m.costKind.asInstanceOf[PerItemCost], m.opDesc) { () =>
Expand Down
14 changes: 7 additions & 7 deletions sigmastate/src/main/scala/sigmastate/utxo/transformers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ case class ByIndex[V <: SType](input: Value[SCollection[V]],
}
}
}
object ByIndex extends ValueCompanion {
object ByIndex extends FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.ByIndexCode
override val costKind = FixedCost(JitCost(30))
}
Expand Down Expand Up @@ -364,7 +364,7 @@ case class SizeOf[V <: SType](input: Value[SCollection[V]])
inputV.length
}
}
object SizeOf extends SimpleTransformerCompanion {
object SizeOf extends SimpleTransformerCompanion with FixedCostValueCompanion {
val OpType = SFunc(SCollection(SType.tIV), SInt)
override def opCode: OpCode = OpCodes.SizeOfCode
/** Cost of: 1) calling Coll.length method (guaranteed to be O(1))
Expand All @@ -387,7 +387,7 @@ case class ExtractAmount(input: Value[SBox.type]) extends Extract[SLong.type] wi
inputV.value
}
}
object ExtractAmount extends SimpleTransformerCompanion {
object ExtractAmount extends SimpleTransformerCompanion with FixedCostValueCompanion {
val OpType = SFunc(SBox, SLong)
override def opCode: OpCode = OpCodes.ExtractAmountCode
/** Cost of: 1) access `value` property of a [[special.sigma.Box]] */
Expand All @@ -408,7 +408,7 @@ case class ExtractScriptBytes(input: Value[SBox.type]) extends Extract[SByteArra
inputV.propositionBytes
}
}
object ExtractScriptBytes extends SimpleTransformerCompanion {
object ExtractScriptBytes extends SimpleTransformerCompanion with FixedCostValueCompanion {
val OpType = SFunc(SBox, SByteArray)
override def opCode: OpCode = OpCodes.ExtractScriptBytesCode

Expand Down Expand Up @@ -495,7 +495,7 @@ case class ExtractRegisterAs[V <: SType]( input: Value[SBox.type],
inputV.getReg(registerId.number)(tV)
}
}
object ExtractRegisterAs extends ValueCompanion {
object ExtractRegisterAs extends FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.ExtractRegisterAs
/** CostOf: 1) accessing `registers` collection 2) comparing types 3) allocating Some()*/
override val costKind = FixedCost(JitCost(50))
Expand Down Expand Up @@ -625,7 +625,7 @@ case class OptionGetOrElse[V <: SType](input: Value[SOption[V]], default: Value[
inputV.getOrElse(dV)
}
}
object OptionGetOrElse extends ValueCompanion {
object OptionGetOrElse extends ValueCompanion with FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.OptionGetOrElseCode
/** Cost of: 1) Calling Option.getOrElse Scala method. */
override val costKind = FixedCost(JitCost(20))
Expand All @@ -643,7 +643,7 @@ case class OptionIsDefined[V <: SType](input: Value[SOption[V]])
inputV.isDefined
}
}
object OptionIsDefined extends SimpleTransformerCompanion {
object OptionIsDefined extends SimpleTransformerCompanion with FixedCostValueCompanion {
override def opCode: OpCode = OpCodes.OptionIsDefinedCode
/** Cost of: 1) Calling Option.isDefined Scala method. */
override val costKind = FixedCost(JitCost(10))
Expand Down
Loading