Add PlutusV3 conformance tests and also control budgets
There were some odd discrepancy for `integerToByteString` on the mem side. Either 1 or about 1000 mem units off; which I couldn't quite figure out. Yet, it proves useful to validate builtin at large and ensure we have a valid cost model for v3.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
The test cases here are all extracted from the tests in
|
||||
`plutus-core/untyped-plutus-core/test/Evaluation/Golden.hs` and check that
|
||||
interleaving of forces and normal arguments for builtin applications behaves
|
||||
correctly. Most of these are for `ifThenElse` (`ite`) because that has the most
|
||||
complicated interleaving behaviour of our current builtins (it expects an
|
||||
argument of the built-in `bool` type, then a `force`, then two term arguments).
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (builtin ifThenElse))
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 16100
|
||||
| mem: 200})
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (builtin ifThenElse))
|
||||
@@ -0,0 +1,15 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
[
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[
|
||||
[ (builtin lessThanEqualsInteger) (con integer 11) ] (con integer 22)
|
||||
]
|
||||
]
|
||||
[ (builtin multiplyInteger) (con integer 11) ]
|
||||
]
|
||||
[ (builtin subtractInteger) (con integer 22) ]
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 375986
|
||||
| mem: 1702})
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 [ (builtin multiplyInteger) (con integer 11) ])
|
||||
@@ -0,0 +1,15 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
[
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[
|
||||
[ (builtin lessThanEqualsInteger) (con integer 11) ] (con integer 22)
|
||||
]
|
||||
]
|
||||
(builtin multiplyInteger)
|
||||
]
|
||||
(builtin subtractInteger)
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 311986
|
||||
| mem: 1302})
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (builtin multiplyInteger))
|
||||
@@ -0,0 +1,19 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
[
|
||||
[
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[
|
||||
[ (builtin lessThanEqualsInteger) (con integer 11) ]
|
||||
(con integer 22)
|
||||
]
|
||||
]
|
||||
[ (builtin multiplyInteger) (con integer 11) ]
|
||||
]
|
||||
[ (builtin subtractInteger) (con integer 22) ]
|
||||
]
|
||||
(con integer 22)
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 498939
|
||||
| mem: 1904})
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (con integer 242))
|
||||
@@ -0,0 +1,7 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[ [ (builtin lessThanEqualsInteger) (con integer 11) ] (con integer 22) ]
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 171937
|
||||
| mem: 901})
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 [ (force (builtin ifThenElse)) (con bool True) ])
|
||||
@@ -0,0 +1,9 @@
|
||||
(program
|
||||
1.0.0
|
||||
(force
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[ [ (builtin lessThanEqualsInteger) (con integer 11) ] (con integer 22) ]
|
||||
]
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (force (builtin ifThenElse)))
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 32100
|
||||
| mem: 300})
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (force (builtin ifThenElse)))
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (force (force (builtin ifThenElse))))
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1,15 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
[
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[
|
||||
[ (builtin lessThanEqualsInteger) (con integer 11) ] (con integer 22)
|
||||
]
|
||||
]
|
||||
(con integer 33)
|
||||
]
|
||||
(con string "abc")
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 311986
|
||||
| mem: 1302})
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (con integer 33))
|
||||
@@ -0,0 +1,17 @@
|
||||
-- This is OK because the branches are terms and there's no requirement that
|
||||
--their types match in UPLC even if they do happen to be builtin constants.
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
[
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[
|
||||
[ (builtin lessThanEqualsInteger) (con integer 11) ] (con integer 22)
|
||||
]
|
||||
]
|
||||
(con string "11 <= 22")
|
||||
]
|
||||
(con integer -1111)
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 311986
|
||||
| mem: 1302})
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (con string "11 <= 22"))
|
||||
@@ -0,0 +1,15 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
[
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[
|
||||
[ (builtin lessThanEqualsInteger) (con integer 11) ] (con integer 22)
|
||||
]
|
||||
]
|
||||
(con string "11 <= 22")
|
||||
]
|
||||
(con string "\172(11 <= 22)")
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 311986
|
||||
| mem: 1302})
|
||||
@@ -0,0 +1 @@
|
||||
(program 1.0.0 (con string "11 <= 22"))
|
||||
@@ -0,0 +1,15 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
[
|
||||
[
|
||||
(builtin ifThenElse)
|
||||
[
|
||||
[ (builtin lessThanEqualsInteger) (con integer 11) ] (con integer 22)
|
||||
]
|
||||
]
|
||||
(con string "11 <= 22")
|
||||
]
|
||||
(con string "\172(11 <= 22)")
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1,7 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
(builtin ifThenElse)
|
||||
[ [ (builtin lessThanEqualsInteger) (con integer 11) ] (con integer 22) ]
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1,10 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
[
|
||||
[ (force (builtin ifThenElse)) (con string "11 <= 22") ]
|
||||
(con string "\172(11 <= 22)")
|
||||
]
|
||||
(con string "\172(11 <= 22)")
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1,7 @@
|
||||
(program
|
||||
1.0.0
|
||||
[
|
||||
[ (force (builtin ifThenElse)) (con string "11 <= 22") ]
|
||||
(con string "\172(11 <= 22)")
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
({cpu: 96100
|
||||
| mem: 700})
|
||||
@@ -0,0 +1,4 @@
|
||||
(program 1.0.0 [
|
||||
[ (force (builtin ifThenElse)) (con string "11 <= 22") ]
|
||||
(con string "\172(11 <= 22)")
|
||||
])
|
||||
@@ -0,0 +1,4 @@
|
||||
(program
|
||||
1.0.0
|
||||
[ [ (force (builtin multiplyInteger)) (con integer 11) ] (con integer 22) ]
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1,4 @@
|
||||
(program
|
||||
1.0.0
|
||||
[ (force [ (builtin multiplyInteger) (con integer 11) ]) (con integer 22) ]
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1,4 @@
|
||||
(program
|
||||
1.0.0
|
||||
(force [ [ (builtin multiplyInteger) (con integer 11) ] (con integer 22) ])
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
@@ -0,0 +1 @@
|
||||
evaluation failure
|
||||
Reference in New Issue
Block a user