diff --git a/submissions/ecd/Scalus_1.4.0_nau/README.md b/submissions/ecd/Scalus_1.4.0_nau/README.md new file mode 100644 index 00000000..68be3f71 --- /dev/null +++ b/submissions/ecd/Scalus_1.4.0_nau/README.md @@ -0,0 +1,83 @@ +# Benchmark Implementation Notes + +**Scenario**: `ecd` + +**Submission ID**: `Scalus_1.4.0_nau` (Format: `Language_Version_GitHubHandle`) + +## Implementation Details + +- **Compiler**: Scalus 1.4.0 +- **Implementation Approach**: Direct @Compile of the prescribed naive recursive GCD. +- **Compilation Flags**: `Options.release` + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Algorithm Compliance + +`EcdBase.scala` translates the prescribed algorithm one to one: the same base case, and the same +recursive calls with the same arguments. The Scalus compiler adds only general-purpose +optimizations, such as the recursion encoding and inlining. + +```scala +package scalus.examples.cape.ecd + +import scalus.compiler.Compile +import scalus.* +import scalus.uplc.builtin.Builtins.modInteger + +/** CAPE `ecd` scenario: prescribed naive recursive Euclidean algorithm. + * + * Direct translation of the spec (fixed mode): + * {{{ecd a b | b == 0 = abs a | otherwise = ecd b (a `mod` b)}}} + * + * Haskell's `mod` takes the sign of the divisor, like the `modInteger` builtin. Scala's `%` is + * `rem`, which takes the sign of the dividend and changes the recursive arguments for negative + * inputs: `ecd(-12, 8)` must recurse into `ecd(8, 4)`, not `ecd(8, -4)`. + */ +@Compile +object EcdBase { + def ecd(a: BigInt, b: BigInt): BigInt = + if b == BigInt(0) then if a < 0 then -a else a + else ecd(b, modInteger(a, b)) +} +``` + +## Reproducibility + +### Source Code + +- **Source Available**: true + +#### For External Repository (recommended approach): + +- **Direct Link**: [ecd](https://github.com/scalus3/scalus/tree/f1fa4a721ae7a97d78b57ce651550be0846a792e/scalus-examples/jvm/src/main/scala/scalus/examples/cape/ecd/) +- **Repository**: https://github.com/scalus3/scalus +- **Tag/Commit**: `f1fa4a721ae7a97d78b57ce651550be0846a792e` +- **Source Path**: `scalus-examples/jvm/src/main/scala/scalus/examples/cape/ecd/` + +### Build Instructions + +```sh +git clone https://github.com/scalus3/scalus +cd scalus +git checkout f1fa4a721ae7a97d78b57ce651550be0846a792e +nix develop # provides JDK 21 and sbt +sbt "scalusExamplesJVM/runMain scalus.examples.cape.GenerateSubmissions 1.4.0" +``` + +This writes `submissions//Scalus_1.4.0_nau/` for all 8 scenarios: the `.uplc` file, +`metadata.json` and this README. Then run `treefmt` in the UPLC-CAPE checkout to apply the +`pretty-uplc` layout, which changes only whitespace. `scripts/cape-submit.sh` in the +Scalus repository runs all of this, then `cape submission verify` and `measure`. + +### Compilation Configuration + +- **Optimization Level**: release +- **Compilation Flags**: `Options.release` +- **Notable Configuration**: Targets Plutus V3, protocol version 11 (vanRossem), plutus-core 1.1.0. No traces. + +## Notes + +Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces. Direct translation of the prescribed Euclidean algorithm; the only compiler-automatic transforms are recursion encoding and inlining. diff --git a/submissions/ecd/Scalus_1.4.0_nau/ecd.uplc b/submissions/ecd/Scalus_1.4.0_nau/ecd.uplc new file mode 100644 index 00000000..7453ea5d --- /dev/null +++ b/submissions/ecd/Scalus_1.4.0_nau/ecd.uplc @@ -0,0 +1,38 @@ +(program + 1.1.0 + [ + (lam + scalus_examples_cape_ecd_EcdBase__ecd'588-0 + [ + scalus_examples_cape_ecd_EcdBase__ecd'588-0 + scalus_examples_cape_ecd_EcdBase__ecd'588-0 + ] + ) + (lam + scalus_examples_cape_ecd_EcdBase__ecd'588-0 + (lam + a_7714'589-1 + (lam + b_7715'590-2 + (case + [ [ (builtin equalsInteger) b_7715'590-2 ] (con integer 0) ] + (case + (constr + 0 + scalus_examples_cape_ecd_EcdBase__ecd'588-0 + b_7715'590-2 + [ [ (builtin modInteger) a_7714'589-1 ] b_7715'590-2 ] + ) + scalus_examples_cape_ecd_EcdBase__ecd'588-0 + ) + (case + [ [ (builtin lessThanInteger) a_7714'589-1 ] (con integer 0) ] + a_7714'589-1 + [ [ (builtin subtractInteger) (con integer 0) ] a_7714'589-1 ] + ) + ) + ) + ) + ) + ] +) diff --git a/submissions/ecd/Scalus_1.4.0_nau/metadata.json b/submissions/ecd/Scalus_1.4.0_nau/metadata.json new file mode 100644 index 00000000..dbb86b55 --- /dev/null +++ b/submissions/ecd/Scalus_1.4.0_nau/metadata.json @@ -0,0 +1,29 @@ +{ + "compiler": { + "name": "Scalus", + "version": "1.4.0", + "commit_hash": "b836856a5b4e54cd40fe0aa5947922478e8f1237" + }, + "compilation_config": { + "optimization_level": "release", + "target": "uplc", + "flags": [ + "Options.release" + ], + "min_protocol_version": 11 + }, + "contributors": [ + { + "name": "Alexander Nemish", + "organization": "Lantr", + "contact": "@nau" + } + ], + "submission": { + "date": "2026-10-28T19:41:17.001104Z", + "source_available": true, + "source_repository": "https://github.com/scalus3/scalus", + "source_commit_hash": "f1fa4a721ae7a97d78b57ce651550be0846a792e", + "implementation_notes": "Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces. Direct translation of the prescribed Euclidean algorithm; the only compiler-automatic transforms are recursion encoding and inlining." + } +} diff --git a/submissions/ecd/Scalus_1.4.0_nau/metrics.json b/submissions/ecd/Scalus_1.4.0_nau/metrics.json new file mode 100644 index 00000000..9c8339c3 --- /dev/null +++ b/submissions/ecd/Scalus_1.4.0_nau/metrics.json @@ -0,0 +1,159 @@ +{ + "evaluations": [ + { + "cpu_units": 970397, + "description": "ECD of 0 and 12 should return 12 (edge case: first argument is zero)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 4404, + "name": "ecd_0_12" + }, + { + "cpu_units": 497723, + "description": "ECD of 12 and 0 should return 12 (edge case: second argument is zero)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 2602, + "name": "ecd_12_0" + }, + { + "cpu_units": 970397, + "description": "ECD of 7 and 7 should return 7 (edge case: identical numbers)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 4404, + "name": "ecd_7_7" + }, + { + "cpu_units": 1915745, + "description": "ECD of 6 and 9 should return 3", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 8008, + "name": "ecd_6_9" + }, + { + "cpu_units": 1443071, + "description": "ECD of 12 and 8 should return 4", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 6206, + "name": "ecd_12_8" + }, + { + "cpu_units": 2388419, + "description": "ECD of 15 and 25 should return 5", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 9810, + "name": "ecd_15_25" + }, + { + "cpu_units": 2388419, + "description": "ECD of 17 and 19 should return 1 (coprime numbers)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 9810, + "name": "ecd_17_19" + }, + { + "cpu_units": 2388419, + "description": "ECD of 13 and 29 should return 1 (coprime numbers)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 9810, + "name": "ecd_13_29" + }, + { + "cpu_units": 1915745, + "description": "ECD of 48 and 18 should return 6", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 8008, + "name": "ecd_48_18" + }, + { + "cpu_units": 1443071, + "description": "ECD of 100 and 75 should return 25", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 6206, + "name": "ecd_100_75" + }, + { + "cpu_units": 1915745, + "description": "ECD of 1071 and 462 should return 21 (larger numbers)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 8008, + "name": "ecd_1071_462" + }, + { + "cpu_units": 1443071, + "description": "ECD of 2520 and 1890 should return 630 (larger numbers)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 6206, + "name": "ecd_2520_1890" + }, + { + "cpu_units": 1443071, + "description": "ECD of -12 and 8 should return 4 (negative first argument handled via abs)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 6206, + "name": "ecd_negative_12_8" + }, + { + "cpu_units": 1608279, + "description": "ECD of 12 and -8 should return 4 (negative second argument handled via abs)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 6608, + "name": "ecd_12_negative_8" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.63.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 0.011942095, + "block_memory_budget_pct": 0.013625, + "cpu_units": { + "maximum": 2388419, + "median": 1525675, + "minimum": 497723, + "sum": 22731572 + }, + "excluded": { + "count": 0, + "cpu_units": { + "maximum": 0, + "sum": 0 + }, + "memory_units": { + "maximum": 0, + "sum": 0 + } + }, + "execution_fee_lovelace": 7196, + "memory_units": { + "maximum": 9810, + "median": 6407, + "minimum": 2602, + "sum": 96296 + }, + "reference_script_fee_lovelace": 690, + "script_size_bytes": 46, + "scripts_per_block": 7339, + "scripts_per_tx": 1681, + "term_size": 36, + "total_fee_lovelace": 7886, + "tx_cpu_budget_pct": 0.02388419, + "tx_memory_budget_pct": 0.05945454545454546 + }, + "scenario": "ecd", + "timestamp": "2026-10-28T19:42:07Z", + "version": "2.0.0", + "notes": "Generated using UPLC-CAPE measure tool" +} diff --git a/submissions/factorial/Scalus_1.4.0_nau/README.md b/submissions/factorial/Scalus_1.4.0_nau/README.md new file mode 100644 index 00000000..24c00285 --- /dev/null +++ b/submissions/factorial/Scalus_1.4.0_nau/README.md @@ -0,0 +1,53 @@ +# Benchmark Implementation Notes + +**Scenario**: `factorial` + +**Submission ID**: `Scalus_1.4.0_nau` (Format: `Language_Version_GitHubHandle`) + +## Implementation Details + +- **Compiler**: Scalus 1.4.0 +- **Implementation Approach**: Scala 3 @Compile function: the factorial recursion unrolled four times, computing every result at run time, correct for any integer input. +- **Compilation Flags**: `Options.release` + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Reproducibility + +### Source Code + +- **Source Available**: true + +#### For External Repository (recommended approach): + +- **Direct Link**: [factorial](https://github.com/scalus3/scalus/tree/9b26ab007d6b8790eb55da55cef3dd788c350a93/scalus-examples/jvm/src/main/scala/scalus/examples/cape/factorial/) +- **Repository**: https://github.com/scalus3/scalus +- **Tag/Commit**: `9b26ab007d6b8790eb55da55cef3dd788c350a93` +- **Source Path**: `scalus-examples/jvm/src/main/scala/scalus/examples/cape/factorial/` + +### Build Instructions + +```sh +git clone https://github.com/scalus3/scalus +cd scalus +git checkout 9b26ab007d6b8790eb55da55cef3dd788c350a93 +nix develop # provides JDK 21 and sbt +sbt "scalusExamplesJVM/runMain scalus.examples.cape.GenerateSubmissions 1.4.0" +``` + +This writes `submissions//Scalus_1.4.0_nau/` for all 8 scenarios: the `.uplc` file, +`metadata.json` and this README. Then run `treefmt` in the UPLC-CAPE checkout to apply the +`pretty-uplc` layout, which changes only whitespace. `scripts/cape-submit.sh` in the +Scalus repository runs all of this, then `cape submission verify` and `measure`. + +### Compilation Configuration + +- **Optimization Level**: release +- **Compilation Flags**: `Options.release` +- **Notable Configuration**: Targets Plutus V3, protocol version 11 (vanRossem), plutus-core 1.1.0. No traces. + +## Notes + +Compiled from Scala 3 (@Compile, Options.releaseUntagged). Computes every result at run time, with the recursion unrolled four times: factorial(n) = n(n-1)(n-2)(n-3) * factorial(n - 4) for n >= 4, n(n-1) for n = 2 and 3, and 1 for every n <= 1, negatives included. No values are precomputed. factorial(12) takes three recursive calls instead of eleven. diff --git a/submissions/factorial/Scalus_1.4.0_nau/factorial.uplc b/submissions/factorial/Scalus_1.4.0_nau/factorial.uplc new file mode 100644 index 00000000..d78409e6 --- /dev/null +++ b/submissions/factorial/Scalus_1.4.0_nau/factorial.uplc @@ -0,0 +1,65 @@ +(program + 1.1.0 + [ + (lam + scalus_examples_cape_factorial_FactorialOpen__factorial'588-0 + [ + scalus_examples_cape_factorial_FactorialOpen__factorial'588-0 + scalus_examples_cape_factorial_FactorialOpen__factorial'588-0 + ] + ) + (lam + scalus_examples_cape_factorial_FactorialOpen__factorial'588_cse-1 + (lam + n_23741'589-2 + (case + [ [ (builtin lessThanEqualsInteger) n_23741'589-2 ] (con integer 3) ] + [ + (lam + __cse_Sub_n_23741'589-3 + [ + [ + (builtin multiplyInteger) + [ + [ + (builtin multiplyInteger) + [ + [ + (builtin multiplyInteger) + [ + [ (builtin multiplyInteger) n_23741'589-2 ] + [ __cse_Sub_n_23741'589-3 (con integer 1) ] + ] + ] + [ __cse_Sub_n_23741'589-3 (con integer 2) ] + ] + ] + [ __cse_Sub_n_23741'589-3 (con integer 3) ] + ] + ] + [ + [ + scalus_examples_cape_factorial_FactorialOpen__factorial'588_cse-1 + scalus_examples_cape_factorial_FactorialOpen__factorial'588_cse-1 + ] + [ __cse_Sub_n_23741'589-3 (con integer 4) ] + ] + ] + ) + [ (builtin subtractInteger) n_23741'589-2 ] + ] + (case + [ + [ (builtin lessThanEqualsInteger) n_23741'589-2 ] (con integer 1) + ] + [ + [ (builtin multiplyInteger) n_23741'589-2 ] + [ [ (builtin subtractInteger) n_23741'589-2 ] (con integer 1) ] + ] + (con integer 1) + ) + ) + ) + ) + ] +) diff --git a/submissions/factorial/Scalus_1.4.0_nau/metadata.json b/submissions/factorial/Scalus_1.4.0_nau/metadata.json new file mode 100644 index 00000000..624f5cdb --- /dev/null +++ b/submissions/factorial/Scalus_1.4.0_nau/metadata.json @@ -0,0 +1,29 @@ +{ + "compiler": { + "name": "Scalus", + "version": "1.4.0", + "commit_hash": "b836856a5b4e54cd40fe0aa5947922478e8f1237" + }, + "compilation_config": { + "optimization_level": "release", + "target": "uplc", + "flags": [ + "Options.release" + ], + "min_protocol_version": 11 + }, + "contributors": [ + { + "name": "Alexander Nemish", + "organization": "Lantr", + "contact": "@nau" + } + ], + "submission": { + "date": "2026-11-03T15:57:55.587610Z", + "source_available": true, + "source_repository": "https://github.com/scalus3/scalus", + "source_commit_hash": "9b26ab007d6b8790eb55da55cef3dd788c350a93", + "implementation_notes": "Compiled from Scala 3 (@Compile, Options.releaseUntagged). Computes every result at run time, with the recursion unrolled four times: factorial(n) = n(n-1)(n-2)(n-3) * factorial(n - 4) for n >= 4, n(n-1) for n = 2 and 3, and 1 for every n <= 1, negatives included. No values are precomputed. factorial(12) takes three recursive calls instead of eleven." + } +} diff --git a/submissions/factorial/Scalus_1.4.0_nau/metrics.json b/submissions/factorial/Scalus_1.4.0_nau/metrics.json new file mode 100644 index 00000000..f431105a --- /dev/null +++ b/submissions/factorial/Scalus_1.4.0_nau/metrics.json @@ -0,0 +1,127 @@ +{ + "evaluations": [ + { + "cpu_units": 439774, + "description": "Factorial of 0 should return 1 (mathematical definition)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 2302, + "name": "factorial_0" + }, + { + "cpu_units": 439774, + "description": "Factorial of 1 should return 1", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 2302, + "name": "factorial_1" + }, + { + "cpu_units": 759935, + "description": "Factorial of 2 should return 2", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 3106, + "name": "factorial_2" + }, + { + "cpu_units": 759935, + "description": "Factorial of 3 should return 6", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 3106, + "name": "factorial_3" + }, + { + "cpu_units": 1908255, + "description": "Factorial of 4 should return 24", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 6419, + "name": "factorial_4" + }, + { + "cpu_units": 1908255, + "description": "Factorial of 5 should return 120", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 6419, + "name": "factorial_5" + }, + { + "cpu_units": 3376736, + "description": "Factorial of 8 should return 40320", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 10536, + "name": "factorial_8" + }, + { + "cpu_units": 3696897, + "description": "Factorial of 10 should return 3628800 (original benchmark target)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 11340, + "name": "factorial_10" + }, + { + "cpu_units": 4845217, + "description": "Factorial of 12 should return 479001600", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 14653, + "name": "factorial_12" + }, + { + "cpu_units": 439774, + "description": "Factorial of negative number should return 1 based on current implementation (n <= 0 case)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 2302, + "name": "factorial_negative" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.63.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 0.024226084999999998, + "block_memory_budget_pct": 0.02035138888888889, + "cpu_units": { + "maximum": 4845217, + "median": 1334095, + "minimum": 439774, + "sum": 18574552 + }, + "excluded": { + "count": 0, + "cpu_units": { + "maximum": 0, + "sum": 0 + }, + "memory_units": { + "maximum": 0, + "sum": 0 + } + }, + "execution_fee_lovelace": 4945, + "memory_units": { + "maximum": 14653, + "median": 4762, + "minimum": 2302, + "sum": 62485 + }, + "reference_script_fee_lovelace": 1110, + "script_size_bytes": 74, + "scripts_per_block": 4127, + "scripts_per_tx": 1126, + "term_size": 63, + "total_fee_lovelace": 6055, + "tx_cpu_budget_pct": 0.048452169999999996, + "tx_memory_budget_pct": 0.08880606060606061 + }, + "scenario": "factorial", + "timestamp": "2026-11-03T15:58:29Z", + "version": "2.0.0", + "notes": "Generated using UPLC-CAPE measure tool" +} diff --git a/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/README.md b/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/README.md new file mode 100644 index 00000000..f8646c31 --- /dev/null +++ b/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/README.md @@ -0,0 +1,77 @@ +# Benchmark Implementation Notes + +**Scenario**: `factorial_naive_recursion` + +**Submission ID**: `Scalus_1.4.0_nau` (Format: `Language_Version_GitHubHandle`) + +## Implementation Details + +- **Compiler**: Scalus 1.4.0 +- **Implementation Approach**: Direct @Compile of the prescribed naive recursion. +- **Compilation Flags**: `Options.release` + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Algorithm Compliance + +`FactorialBase.scala` translates the prescribed algorithm one to one: the same base case, and the same +recursive calls with the same arguments. The Scalus compiler adds only general-purpose +optimizations, such as the recursion encoding and inlining. + +```scala +package scalus.examples.cape.factorial + +import scalus.compiler.Compile + +import scalus.* + +/** CAPE factorial_naive_recursion scenario. + * + * Prescribed naive recursive algorithm for compiler comparison. + */ +@Compile +object FactorialBase { + def factorial(n: BigInt): BigInt = + if n <= 0 then 1 else n * factorial(n - 1) +} +``` + +## Reproducibility + +### Source Code + +- **Source Available**: true + +#### For External Repository (recommended approach): + +- **Direct Link**: [factorial](https://github.com/scalus3/scalus/tree/f1fa4a721ae7a97d78b57ce651550be0846a792e/scalus-examples/jvm/src/main/scala/scalus/examples/cape/factorial/) +- **Repository**: https://github.com/scalus3/scalus +- **Tag/Commit**: `f1fa4a721ae7a97d78b57ce651550be0846a792e` +- **Source Path**: `scalus-examples/jvm/src/main/scala/scalus/examples/cape/factorial/` + +### Build Instructions + +```sh +git clone https://github.com/scalus3/scalus +cd scalus +git checkout f1fa4a721ae7a97d78b57ce651550be0846a792e +nix develop # provides JDK 21 and sbt +sbt "scalusExamplesJVM/runMain scalus.examples.cape.GenerateSubmissions 1.4.0" +``` + +This writes `submissions//Scalus_1.4.0_nau/` for all 8 scenarios: the `.uplc` file, +`metadata.json` and this README. Then run `treefmt` in the UPLC-CAPE checkout to apply the +`pretty-uplc` layout, which changes only whitespace. `scripts/cape-submit.sh` in the +Scalus repository runs all of this, then `cape submission verify` and `measure`. + +### Compilation Configuration + +- **Optimization Level**: release +- **Compilation Flags**: `Options.release` +- **Notable Configuration**: Targets Plutus V3, protocol version 11 (vanRossem), plutus-core 1.1.0. No traces. + +## Notes + +Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces. diff --git a/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/factorial_naive_recursion.uplc b/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/factorial_naive_recursion.uplc new file mode 100644 index 00000000..e3707173 --- /dev/null +++ b/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/factorial_naive_recursion.uplc @@ -0,0 +1,32 @@ +(program + 1.1.0 + [ + (lam + scalus_examples_cape_factorial_FactorialBase__factorial'588-0 + [ + scalus_examples_cape_factorial_FactorialBase__factorial'588-0 + scalus_examples_cape_factorial_FactorialBase__factorial'588-0 + ] + ) + (lam + scalus_examples_cape_factorial_FactorialBase__factorial'588-0 + (lam + n_65667'589-1 + (case + [ [ (builtin lessThanEqualsInteger) n_65667'589-1 ] (con integer 0) ] + [ + [ (builtin multiplyInteger) n_65667'589-1 ] + [ + [ + scalus_examples_cape_factorial_FactorialBase__factorial'588-0 + scalus_examples_cape_factorial_FactorialBase__factorial'588-0 + ] + [ [ (builtin subtractInteger) n_65667'589-1 ] (con integer 1) ] + ] + ] + (con integer 1) + ) + ) + ) + ] +) diff --git a/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/metadata.json b/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/metadata.json new file mode 100644 index 00000000..a0751c5c --- /dev/null +++ b/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/metadata.json @@ -0,0 +1,29 @@ +{ + "compiler": { + "name": "Scalus", + "version": "1.4.0", + "commit_hash": "b836856a5b4e54cd40fe0aa5947922478e8f1237" + }, + "compilation_config": { + "optimization_level": "release", + "target": "uplc", + "flags": [ + "Options.release" + ], + "min_protocol_version": 11 + }, + "contributors": [ + { + "name": "Alexander Nemish", + "organization": "Lantr", + "contact": "@nau" + } + ], + "submission": { + "date": "2026-10-28T19:41:17.001104Z", + "source_available": true, + "source_repository": "https://github.com/scalus3/scalus", + "source_commit_hash": "f1fa4a721ae7a97d78b57ce651550be0846a792e", + "implementation_notes": "Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces." + } +} diff --git a/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/metrics.json b/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/metrics.json new file mode 100644 index 00000000..00f38d6d --- /dev/null +++ b/submissions/factorial_naive_recursion/Scalus_1.4.0_nau/metrics.json @@ -0,0 +1,127 @@ +{ + "evaluations": [ + { + "cpu_units": 299937, + "description": "Factorial of 0 should return 1 (mathematical definition)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1701, + "name": "factorial_0" + }, + { + "cpu_units": 855935, + "description": "Factorial of 1 should return 1", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 3706, + "name": "factorial_1" + }, + { + "cpu_units": 1411933, + "description": "Factorial of 2 should return 2", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 5711, + "name": "factorial_2" + }, + { + "cpu_units": 1967931, + "description": "Factorial of 3 should return 6", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 7716, + "name": "factorial_3" + }, + { + "cpu_units": 2523929, + "description": "Factorial of 4 should return 24", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 9721, + "name": "factorial_4" + }, + { + "cpu_units": 3079927, + "description": "Factorial of 5 should return 120", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 11726, + "name": "factorial_5" + }, + { + "cpu_units": 4747921, + "description": "Factorial of 8 should return 40320", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 17741, + "name": "factorial_8" + }, + { + "cpu_units": 5859917, + "description": "Factorial of 10 should return 3628800 (original benchmark target)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 21751, + "name": "factorial_10" + }, + { + "cpu_units": 6971913, + "description": "Factorial of 12 should return 479001600", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 25761, + "name": "factorial_12" + }, + { + "cpu_units": 299937, + "description": "Factorial of negative number should return 1 based on current implementation (n <= 0 case)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1701, + "name": "factorial_negative" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.63.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 0.034859565, + "block_memory_budget_pct": 0.03577916666666667, + "cpu_units": { + "maximum": 6971913, + "median": 2245930, + "minimum": 299937, + "sum": 28019280 + }, + "excluded": { + "count": 0, + "cpu_units": { + "maximum": 0, + "sum": 0 + }, + "memory_units": { + "maximum": 0, + "sum": 0 + } + }, + "execution_fee_lovelace": 8208, + "memory_units": { + "maximum": 25761, + "median": 8718, + "minimum": 1701, + "sum": 107235 + }, + "reference_script_fee_lovelace": 510, + "script_size_bytes": 34, + "scripts_per_block": 2794, + "scripts_per_tx": 640, + "term_size": 27, + "total_fee_lovelace": 8718, + "tx_cpu_budget_pct": 0.06971913, + "tx_memory_budget_pct": 0.15612727272727273 + }, + "scenario": "factorial_naive_recursion", + "timestamp": "2026-10-28T19:43:07Z", + "version": "2.0.0", + "notes": "Generated using UPLC-CAPE measure tool" +} diff --git a/submissions/fibonacci/Scalus_1.4.0_nau/README.md b/submissions/fibonacci/Scalus_1.4.0_nau/README.md new file mode 100644 index 00000000..0c08d13a --- /dev/null +++ b/submissions/fibonacci/Scalus_1.4.0_nau/README.md @@ -0,0 +1,53 @@ +# Benchmark Implementation Notes + +**Scenario**: `fibonacci` + +**Submission ID**: `Scalus_1.4.0_nau` (Format: `Language_Version_GitHubHandle`) + +## Implementation Details + +- **Compiler**: Scalus 1.4.0 +- **Implementation Approach**: Hand-written UPLC term: memoized fib(0)..fib(25) base case (PV11 case-on-builtin-integer) plus a linear accumulator loop for n >= 26, so it's correct for any integer input, not just the benchmark's fixture range. Optimized by the Scalus UPLC pipeline. +- **Compilation Flags**: `Options.release` + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Reproducibility + +### Source Code + +- **Source Available**: true + +#### For External Repository (recommended approach): + +- **Direct Link**: [fibonacci](https://github.com/scalus3/scalus/tree/f1fa4a721ae7a97d78b57ce651550be0846a792e/scalus-examples/jvm/src/main/scala/scalus/examples/cape/fibonacci/) +- **Repository**: https://github.com/scalus3/scalus +- **Tag/Commit**: `f1fa4a721ae7a97d78b57ce651550be0846a792e` +- **Source Path**: `scalus-examples/jvm/src/main/scala/scalus/examples/cape/fibonacci/` + +### Build Instructions + +```sh +git clone https://github.com/scalus3/scalus +cd scalus +git checkout f1fa4a721ae7a97d78b57ce651550be0846a792e +nix develop # provides JDK 21 and sbt +sbt "scalusExamplesJVM/runMain scalus.examples.cape.GenerateSubmissions 1.4.0" +``` + +This writes `submissions//Scalus_1.4.0_nau/` for all 8 scenarios: the `.uplc` file, +`metadata.json` and this README. Then run `treefmt` in the UPLC-CAPE checkout to apply the +`pretty-uplc` layout, which changes only whitespace. `scripts/cape-submit.sh` in the +Scalus repository runs all of this, then `cape submission verify` and `measure`. + +### Compilation Configuration + +- **Optimization Level**: release +- **Compilation Flags**: `Options.release` +- **Notable Configuration**: Targets Plutus V3, protocol version 11 (vanRossem), plutus-core 1.1.0. No traces. + +## Notes + +Hand-crafted UPLC: memoized base case + computed fallback, correct for every integer input. n < 0 -> n; 0 <= n <= 25 -> O(1) lookup via PV11 case-on-builtin-integer (fib(0)..fib(25) baked in as direct case branches, no bytestring decode step); n >= 26 -> a linear accumulator loop (go(k, a, b) = if k <= 0 then b else go(k - 1, b, a + b), seeded from fib(24)/fib(25)) bottoming out on the table -- O(n), not the O(2^n) naive double recursion the scenario warns against. diff --git a/submissions/fibonacci/Scalus_1.4.0_nau/fibonacci.uplc b/submissions/fibonacci/Scalus_1.4.0_nau/fibonacci.uplc new file mode 100644 index 00000000..377edb3d --- /dev/null +++ b/submissions/fibonacci/Scalus_1.4.0_nau/fibonacci.uplc @@ -0,0 +1,79 @@ +(program + 1.1.0 + (lam + n-0 + (case + [ [ (builtin lessThanEqualsInteger) n-0 ] (con integer -1) ] + (case + [ [ (builtin lessThanEqualsInteger) n-0 ] (con integer 25) ] + (case + (constr + 0 + (lam + r-1 + (lam + k-2 + (lam + a-3 + (lam + b-4 + (case + [ + [ (builtin lessThanEqualsInteger) k-2 ] (con integer 0) + ] + (case + (constr + 0 + r-1 + [ [ (builtin subtractInteger) k-2 ] (con integer 1) ] + b-4 + [ [ (builtin addInteger) a-3 ] b-4 ] + ) + r-1 + ) + b-4 + ) + ) + ) + ) + ) + [ [ (builtin subtractInteger) n-0 ] (con integer 25) ] + (con integer 46368) + (con integer 75025) + ) + (lam r-1 [ r-1 r-1 ]) + ) + (case + n-0 + (con integer 0) + (con integer 1) + (con integer 1) + (con integer 2) + (con integer 3) + (con integer 5) + (con integer 8) + (con integer 13) + (con integer 21) + (con integer 34) + (con integer 55) + (con integer 89) + (con integer 144) + (con integer 233) + (con integer 377) + (con integer 610) + (con integer 987) + (con integer 1597) + (con integer 2584) + (con integer 4181) + (con integer 6765) + (con integer 10946) + (con integer 17711) + (con integer 28657) + (con integer 46368) + (con integer 75025) + ) + ) + n-0 + ) + ) +) diff --git a/submissions/fibonacci/Scalus_1.4.0_nau/metadata.json b/submissions/fibonacci/Scalus_1.4.0_nau/metadata.json new file mode 100644 index 00000000..e05a4b3b --- /dev/null +++ b/submissions/fibonacci/Scalus_1.4.0_nau/metadata.json @@ -0,0 +1,29 @@ +{ + "compiler": { + "name": "Scalus", + "version": "1.4.0", + "commit_hash": "b836856a5b4e54cd40fe0aa5947922478e8f1237" + }, + "compilation_config": { + "optimization_level": "release", + "target": "uplc", + "flags": [ + "Options.release" + ], + "min_protocol_version": 11 + }, + "contributors": [ + { + "name": "Alexander Nemish", + "organization": "Lantr", + "contact": "@nau" + } + ], + "submission": { + "date": "2026-10-28T19:41:17.001104Z", + "source_available": true, + "source_repository": "https://github.com/scalus3/scalus", + "source_commit_hash": "f1fa4a721ae7a97d78b57ce651550be0846a792e", + "implementation_notes": "Hand-crafted UPLC: memoized base case + computed fallback, correct for every integer input. n < 0 -> n; 0 <= n <= 25 -> O(1) lookup via PV11 case-on-builtin-integer (fib(0)..fib(25) baked in as direct case branches, no bytestring decode step); n >= 26 -> a linear accumulator loop (go(k, a, b) = if k <= 0 then b else go(k - 1, b, a + b), seeded from fib(24)/fib(25)) bottoming out on the table -- O(n), not the O(2^n) naive double recursion the scenario warns against." + } +} diff --git a/submissions/fibonacci/Scalus_1.4.0_nau/metrics.json b/submissions/fibonacci/Scalus_1.4.0_nau/metrics.json new file mode 100644 index 00000000..171d3952 --- /dev/null +++ b/submissions/fibonacci/Scalus_1.4.0_nau/metrics.json @@ -0,0 +1,135 @@ +{ + "evaluations": [ + { + "cpu_units": 375774, + "description": "Fibonacci of 0 should return 0", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_0" + }, + { + "cpu_units": 375774, + "description": "Fibonacci of 1 should return 1", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_1" + }, + { + "cpu_units": 375774, + "description": "Fibonacci of 2 should return 1", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_2" + }, + { + "cpu_units": 375774, + "description": "Fibonacci of 3 should return 2", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_3" + }, + { + "cpu_units": 375774, + "description": "Fibonacci of 5 should return 5", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_5" + }, + { + "cpu_units": 375774, + "description": "Fibonacci of 8 should return 21", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_8" + }, + { + "cpu_units": 375774, + "description": "Fibonacci of 10 should return 55", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_10" + }, + { + "cpu_units": 375774, + "description": "Fibonacci of 15 should return 610", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_15" + }, + { + "cpu_units": 375774, + "description": "Fibonacci of 20 should return 6765", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_20" + }, + { + "cpu_units": 375774, + "description": "Fibonacci of 25 should return 75025 (original benchmark target)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1902, + "name": "fibonacci_25" + }, + { + "cpu_units": 203937, + "description": "Fibonacci of negative number should return the negative number itself based on current implementation", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1101, + "name": "fibonacci_negative" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.63.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 0.00187887, + "block_memory_budget_pct": 0.0026416666666666667, + "cpu_units": { + "maximum": 375774, + "median": 375774, + "minimum": 203937, + "sum": 3961677 + }, + "excluded": { + "count": 0, + "cpu_units": { + "maximum": 0, + "sum": 0 + }, + "memory_units": { + "maximum": 0, + "sum": 0 + } + }, + "execution_fee_lovelace": 1447, + "memory_units": { + "maximum": 1902, + "median": 1902, + "minimum": 1101, + "sum": 20121 + }, + "reference_script_fee_lovelace": 2340, + "script_size_bytes": 156, + "scripts_per_block": 37854, + "scripts_per_tx": 8675, + "term_size": 81, + "total_fee_lovelace": 3787, + "tx_cpu_budget_pct": 0.00375774, + "tx_memory_budget_pct": 0.011527272727272728 + }, + "scenario": "fibonacci", + "timestamp": "2026-10-28T19:43:35Z", + "version": "2.0.0", + "notes": "Generated using UPLC-CAPE measure tool" +} diff --git a/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/README.md b/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/README.md new file mode 100644 index 00000000..0a9b5f30 --- /dev/null +++ b/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/README.md @@ -0,0 +1,78 @@ +# Benchmark Implementation Notes + +**Scenario**: `fibonacci_naive_recursion` + +**Submission ID**: `Scalus_1.4.0_nau` (Format: `Language_Version_GitHubHandle`) + +## Implementation Details + +- **Compiler**: Scalus 1.4.0 +- **Implementation Approach**: Direct @Compile of the prescribed naive recursion. +- **Compilation Flags**: `Options.release` + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Algorithm Compliance + +`FibonacciBase.scala` translates the prescribed algorithm one to one: the same base case, and the same +recursive calls with the same arguments. The Scalus compiler adds only general-purpose +optimizations, such as the recursion encoding and inlining. + +```scala +package scalus.examples.cape.fibonacci + +import scalus.compiler.Compile + +import scalus.* + +/** CAPE fibonacci_naive_recursion scenario. + * + * Prescribed naive recursive algorithm for compiler comparison. Returns n for n <= 1, so + * fibonacci(-1) == -1 as CAPE expects. + */ +@Compile +object FibonacciBase { + def fibonacci(n: BigInt): BigInt = + if n <= 1 then n else fibonacci(n - 1) + fibonacci(n - 2) +} +``` + +## Reproducibility + +### Source Code + +- **Source Available**: true + +#### For External Repository (recommended approach): + +- **Direct Link**: [fibonacci](https://github.com/scalus3/scalus/tree/f1fa4a721ae7a97d78b57ce651550be0846a792e/scalus-examples/jvm/src/main/scala/scalus/examples/cape/fibonacci/) +- **Repository**: https://github.com/scalus3/scalus +- **Tag/Commit**: `f1fa4a721ae7a97d78b57ce651550be0846a792e` +- **Source Path**: `scalus-examples/jvm/src/main/scala/scalus/examples/cape/fibonacci/` + +### Build Instructions + +```sh +git clone https://github.com/scalus3/scalus +cd scalus +git checkout f1fa4a721ae7a97d78b57ce651550be0846a792e +nix develop # provides JDK 21 and sbt +sbt "scalusExamplesJVM/runMain scalus.examples.cape.GenerateSubmissions 1.4.0" +``` + +This writes `submissions//Scalus_1.4.0_nau/` for all 8 scenarios: the `.uplc` file, +`metadata.json` and this README. Then run `treefmt` in the UPLC-CAPE checkout to apply the +`pretty-uplc` layout, which changes only whitespace. `scripts/cape-submit.sh` in the +Scalus repository runs all of this, then `cape submission verify` and `measure`. + +### Compilation Configuration + +- **Optimization Level**: release +- **Compilation Flags**: `Options.release` +- **Notable Configuration**: Targets Plutus V3, protocol version 11 (vanRossem), plutus-core 1.1.0. No traces. + +## Notes + +Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces. diff --git a/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/fibonacci_naive_recursion.uplc b/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/fibonacci_naive_recursion.uplc new file mode 100644 index 00000000..94c2a4f9 --- /dev/null +++ b/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/fibonacci_naive_recursion.uplc @@ -0,0 +1,49 @@ +(program + 1.1.0 + [ + (lam + scalus_examples_cape_fibonacci_FibonacciBase__fibonacci'588-0 + [ + scalus_examples_cape_fibonacci_FibonacciBase__fibonacci'588-0 + scalus_examples_cape_fibonacci_FibonacciBase__fibonacci'588-0 + ] + ) + (lam + scalus_examples_cape_fibonacci_FibonacciBase__fibonacci'588_cse-1 + (lam + n_66840'589-2 + (case + [ [ (builtin lessThanEqualsInteger) n_66840'589-2 ] (con integer 1) ] + [ + (lam + __cse_scalus_examples_cape_fibonacci_FibonacciBase__fibonacci'588_cse-3 + [ + [ + (builtin addInteger) + [ + __cse_scalus_examples_cape_fibonacci_FibonacciBase__fibonacci'588_cse-3 + [ + [ (builtin subtractInteger) n_66840'589-2 ] + (con integer 1) + ] + ] + ] + [ + __cse_scalus_examples_cape_fibonacci_FibonacciBase__fibonacci'588_cse-3 + [ + [ (builtin subtractInteger) n_66840'589-2 ] (con integer 2) + ] + ] + ] + ) + [ + scalus_examples_cape_fibonacci_FibonacciBase__fibonacci'588_cse-1 + scalus_examples_cape_fibonacci_FibonacciBase__fibonacci'588_cse-1 + ] + ] + n_66840'589-2 + ) + ) + ) + ] +) diff --git a/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/metadata.json b/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/metadata.json new file mode 100644 index 00000000..a0751c5c --- /dev/null +++ b/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/metadata.json @@ -0,0 +1,29 @@ +{ + "compiler": { + "name": "Scalus", + "version": "1.4.0", + "commit_hash": "b836856a5b4e54cd40fe0aa5947922478e8f1237" + }, + "compilation_config": { + "optimization_level": "release", + "target": "uplc", + "flags": [ + "Options.release" + ], + "min_protocol_version": 11 + }, + "contributors": [ + { + "name": "Alexander Nemish", + "organization": "Lantr", + "contact": "@nau" + } + ], + "submission": { + "date": "2026-10-28T19:41:17.001104Z", + "source_available": true, + "source_repository": "https://github.com/scalus3/scalus", + "source_commit_hash": "f1fa4a721ae7a97d78b57ce651550be0846a792e", + "implementation_notes": "Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces." + } +} diff --git a/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/metrics.json b/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/metrics.json new file mode 100644 index 00000000..5c8846c5 --- /dev/null +++ b/submissions/fibonacci_naive_recursion/Scalus_1.4.0_nau/metrics.json @@ -0,0 +1,135 @@ +{ + "evaluations": [ + { + "cpu_units": 299937, + "description": "Fibonacci of 0 should return 0", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1701, + "name": "fibonacci_0" + }, + { + "cpu_units": 299937, + "description": "Fibonacci of 1 should return 1", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1701, + "name": "fibonacci_1" + }, + { + "cpu_units": 1267235, + "description": "Fibonacci of 2 should return 1", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 5309, + "name": "fibonacci_2" + }, + { + "cpu_units": 2234533, + "description": "Fibonacci of 3 should return 2", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 8917, + "name": "fibonacci_3" + }, + { + "cpu_units": 7071023, + "description": "Fibonacci of 5 should return 5", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 26957, + "name": "fibonacci_5" + }, + { + "cpu_units": 32220771, + "description": "Fibonacci of 8 should return 21", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 120765, + "name": "fibonacci_8" + }, + { + "cpu_units": 85422161, + "description": "Fibonacci of 10 should return 55", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 319205, + "name": "fibonacci_10" + }, + { + "cpu_units": 954055765, + "description": "Fibonacci of 15 should return 610", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 3559189, + "name": "fibonacci_15" + }, + { + "cpu_units": 10587376547, + "description": "Fibonacci of 20 should return 6765", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 39491261, + "name": "fibonacci_20" + }, + { + "cpu_units": 117422538753, + "description": "Fibonacci of 25 should return 75025 (original benchmark target)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 437984037, + "name": "fibonacci_25" + }, + { + "cpu_units": 299937, + "description": "Fibonacci of negative number should return the negative number itself based on current implementation", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 1701, + "name": "fibonacci_negative" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.63.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 587.112693765, + "block_memory_budget_pct": 608.3111625, + "cpu_units": { + "maximum": 117422538753, + "median": 7071023, + "minimum": 299937, + "sum": 129093086599 + }, + "excluded": { + "count": 0, + "cpu_units": { + "maximum": 0, + "sum": 0 + }, + "memory_units": { + "maximum": 0, + "sum": 0 + } + }, + "execution_fee_lovelace": 37091359, + "memory_units": { + "maximum": 437984037, + "median": 26957, + "minimum": 1701, + "sum": 481520743 + }, + "reference_script_fee_lovelace": 645, + "script_size_bytes": 43, + "scripts_per_block": 0, + "scripts_per_tx": 0, + "term_size": 36, + "total_fee_lovelace": 37092004, + "tx_cpu_budget_pct": 1174.22538753, + "tx_memory_budget_pct": 2654.4487090909092 + }, + "scenario": "fibonacci_naive_recursion", + "timestamp": "2026-10-28T19:44:03Z", + "version": "2.0.0", + "notes": "Generated using UPLC-CAPE measure tool" +} diff --git a/submissions/htlc/Scalus_1.4.0_nau/README.md b/submissions/htlc/Scalus_1.4.0_nau/README.md new file mode 100644 index 00000000..e212f772 --- /dev/null +++ b/submissions/htlc/Scalus_1.4.0_nau/README.md @@ -0,0 +1,53 @@ +# Benchmark Implementation Notes + +**Scenario**: `htlc` + +**Submission ID**: `Scalus_1.4.0_nau` (Format: `Language_Version_GitHubHandle`) + +## Implementation Details + +- **Compiler**: Scalus 1.4.0 +- **Implementation Approach**: Scala 3 validator: SHA-256 preimage claim before timeout, payer refund after. +- **Compilation Flags**: `Options.release` + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Reproducibility + +### Source Code + +- **Source Available**: true + +#### For External Repository (recommended approach): + +- **Direct Link**: [htlc](https://github.com/scalus3/scalus/tree/f1fa4a721ae7a97d78b57ce651550be0846a792e/scalus-examples/jvm/src/main/scala/scalus/examples/cape/htlc/) +- **Repository**: https://github.com/scalus3/scalus +- **Tag/Commit**: `f1fa4a721ae7a97d78b57ce651550be0846a792e` +- **Source Path**: `scalus-examples/jvm/src/main/scala/scalus/examples/cape/htlc/` + +### Build Instructions + +```sh +git clone https://github.com/scalus3/scalus +cd scalus +git checkout f1fa4a721ae7a97d78b57ce651550be0846a792e +nix develop # provides JDK 21 and sbt +sbt "scalusExamplesJVM/runMain scalus.examples.cape.GenerateSubmissions 1.4.0" +``` + +This writes `submissions//Scalus_1.4.0_nau/` for all 8 scenarios: the `.uplc` file, +`metadata.json` and this README. Then run `treefmt` in the UPLC-CAPE checkout to apply the +`pretty-uplc` layout, which changes only whitespace. `scripts/cape-submit.sh` in the +Scalus repository runs all of this, then `cape submission verify` and `measure`. + +### Compilation Configuration + +- **Optimization Level**: release +- **Compilation Flags**: `Options.release` +- **Notable Configuration**: Targets Plutus V3, protocol version 11 (vanRossem), plutus-core 1.1.0. No traces. + +## Notes + +Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces. diff --git a/submissions/htlc/Scalus_1.4.0_nau/htlc.uplc b/submissions/htlc/Scalus_1.4.0_nau/htlc.uplc new file mode 100644 index 00000000..0f33e32b --- /dev/null +++ b/submissions/htlc/Scalus_1.4.0_nau/htlc.uplc @@ -0,0 +1,1062 @@ +(program + 1.1.0 + (case + (constr + 0 + (force (builtin dropList)) + (force (force (builtin fstPair))) + (force (builtin headList)) + (force (force (builtin sndPair))) + (force (builtin tailList)) + ) + (lam + __DropList-0 + (lam + __FstPair-1 + (lam + __HeadList-2 + (lam + __SndPair-3 + (lam + __TailList-4 + [ + (lam + scalus_cardano_onchain_plutus_v3_TxInfo__isSignedBy'681-5 + [ + (lam + scalus_examples_cape_htlc_HtlcValidator__pkhOf'690-6 + (lam + sc_proxy1_101608'724-7 + [ + (lam + sc_proxy1_101608r'725-8 + [ + (lam + __cse___DropList_c-9 + [ + (lam + __cse_UnConstr__Validator_scala_15_8_match_scrutinee_1'726-10 + (case + [ + __FstPair-1 + __cse_UnConstr__Validator_scala_15_8_match_scrutinee_1'726-10 + ] + (error) + [ + (lam + _match_datalist'730-11 + [ + (lam + d_101612'739-12 + [ + (lam + __cse___SndPair_UnConstr___HeadList_sc_proxy1_101608r'725-13 + [ + (lam + __cse_UnList___HeadList___SndPair_UnConstr___HeadList_sc_proxy1_101608r'725-14 + [ + (lam + ownCred_101613'750-15 + [ + (lam + __HtlcValidator_line_64_0'769-16 + [ + (lam + _HtlcValidator_scala_68_8_match_scrutinee_1'770-17 + [ + (lam + d_101612r'778-18 + [ + (lam + _match_scrutinee'771-19 + (case + [ + __FstPair-1 + _match_scrutinee'771-19 + ] + [ + (lam + __HtlcValidator_line_70_0'779-20 + [ + (lam + __HtlcValidator_line_71_0'783-21 + (case + [ + [ + (lam + self_333338'691-22 + (lam + time_333339'692-23 + [ + (lam + __cse___SndPair_UnConstr___HeadList___TailList_self_333338'691-24 + [ + (lam + _match_scrutinee'695-25 + (case + [ + __FstPair-1 + _match_scrutinee'695-25 + ] + (con + bool + False + ) + [ + (lam + _match_datalist'698-26 + (case + (case + [ + __FstPair-1 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-4 + __cse___SndPair_UnConstr___HeadList___TailList_self_333338'691-24 + ] + ] + ] + ] + (con + bool + False + ) + (con + bool + True + ) + ) + [ + [ + (builtin + lessThanEqualsInteger + ) + [ + (builtin + unIData + ) + [ + __HeadList-2 + _match_datalist'698-26 + ] + ] + ] + time_333339'692-23 + ] + [ + [ + (builtin + lessThanInteger + ) + [ + (builtin + unIData + ) + [ + __HeadList-2 + _match_datalist'698-26 + ] + ] + ] + time_333339'692-23 + ] + ) + ) + [ + __SndPair-3 + _match_scrutinee'695-25 + ] + ] + (con + bool + False + ) + ) + ) + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + __cse___SndPair_UnConstr___HeadList___TailList_self_333338'691-24 + ] + ] + ] + ) + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-4 + self_333338'691-22 + ] + ] + ] + ] + ] + ) + ) + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 7 + ) + ] + __cse___SndPair_UnConstr___HeadList_sc_proxy1_101608r'725-13 + ] + ] + ] + ] + ] + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 3 + ) + ] + d_101612r'778-18 + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ) + (case + [ + [ + (builtin + equalsByteString + ) + [ + (builtin + sha2_256 + ) + [ + (builtin + unBData + ) + [ + __HeadList-2 + [ + __SndPair-3 + _match_scrutinee'771-19 + ] + ] + ] + ] + ] + [ + (builtin + unBData + ) + [ + __HeadList-2 + [ + __cse___DropList_c-9 + d_101612r'778-18 + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (case + [ + [ + scalus_cardano_onchain_plutus_v3_TxInfo__isSignedBy'681-5 + __cse___SndPair_UnConstr___HeadList_sc_proxy1_101608r'725-13 + ] + [ + scalus_examples_cape_htlc_HtlcValidator__pkhOf'690-6 + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-4 + d_101612r'778-18 + ] + ] + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + [ + (lam + __HtlcValidator_line_74_0'790-27 + (case + [ + [ + (lam + self_333335'707-28 + (lam + time_333336'708-29 + [ + (lam + __cse___SndPair_UnConstr___HeadList_self_333335'707-30 + [ + (lam + _match_scrutinee'711-31 + (case + [ + __FstPair-1 + _match_scrutinee'711-31 + ] + (con + bool + False + ) + [ + (lam + _match_datalist'714-32 + (case + (case + [ + __FstPair-1 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-4 + __cse___SndPair_UnConstr___HeadList_self_333335'707-30 + ] + ] + ] + ] + (con + bool + False + ) + (con + bool + True + ) + ) + [ + [ + (builtin + lessThanEqualsInteger + ) + time_333336'708-29 + ] + [ + (builtin + unIData + ) + [ + __HeadList-2 + _match_datalist'714-32 + ] + ] + ] + [ + [ + (builtin + lessThanInteger + ) + time_333336'708-29 + ] + [ + (builtin + unIData + ) + [ + __HeadList-2 + _match_datalist'714-32 + ] + ] + ] + ) + ) + [ + __SndPair-3 + _match_scrutinee'711-31 + ] + ] + (con + bool + False + ) + ) + ) + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + __cse___SndPair_UnConstr___HeadList_self_333335'707-30 + ] + ] + ] + ) + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + self_333335'707-28 + ] + ] + ] + ] + ) + ) + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 7 + ) + ] + __cse___SndPair_UnConstr___HeadList_sc_proxy1_101608r'725-13 + ] + ] + ] + ] + ] + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 3 + ) + ] + d_101612r'778-18 + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ) + (case + [ + [ + scalus_cardano_onchain_plutus_v3_TxInfo__isSignedBy'681-5 + __cse___SndPair_UnConstr___HeadList_sc_proxy1_101608r'725-13 + ] + [ + scalus_examples_cape_htlc_HtlcValidator__pkhOf'690-6 + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + d_101612r'778-18 + ] + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + ) + [ + (builtin + unConstrData + ) + _HtlcValidator_scala_68_8_match_scrutinee_1'770-17 + ] + ] + ) + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + d_101612'739-12 + ] + ] + ] + ) + [ + __HeadList-2 + [ + __TailList-4 + sc_proxy1_101608r'725-8 + ] + ] + ] + ) + [ + [ + (lam + predicate_94080'635-33 + (lam + orElse_94081'636-34 + [ + [ + (lam + go_94085'637-35 + [ + go_94085'637-35 + go_94085'637-35 + ] + ) + (lam + go_94085'637_cse-36 + (lam + list_94086'638-37 + (case + list_94086'638-37 + (lam + consHead'640-38 + (lam + consTail'641-39 + (case + [ + predicate_94080'635-33 + consHead'640-38 + ] + [ + [ + go_94085'637_cse-36 + go_94085'637_cse-36 + ] + consTail'641-39 + ] + (case + [ + [ + (lam + scalus_cardano_onchain_plutus_prelude_List__forall_sat'628-40 + [ + scalus_cardano_onchain_plutus_prelude_List__forall_sat'628-40 + scalus_cardano_onchain_plutus_prelude_List__forall_sat'628-40 + ] + ) + (lam + scalus_cardano_onchain_plutus_prelude_List__forall_sat'628_cse-41 + (lam + self_92983'629-42 + (case + self_92983'629-42 + (lam + consHead'631-43 + (lam + consTail'632-44 + (case + (case + [ + predicate_94080'635-33 + consHead'631-43 + ] + (con + bool + True + ) + (con + bool + False + ) + ) + (con + bool + False + ) + [ + [ + scalus_cardano_onchain_plutus_prelude_List__forall_sat'628_cse-41 + scalus_cardano_onchain_plutus_prelude_List__forall_sat'628_cse-41 + ] + consTail'632-44 + ] + ) + ) + ) + (con + bool + True + ) + ) + ) + ) + ] + consTail'641-39 + ] + [ + orElse_94081'636-34 + (con + unit + () + ) + ] + consHead'640-38 + ) + ) + ) + ) + [ + orElse_94081'636-34 + (con + unit + () + ) + ] + ) + ) + ) + ] + __cse_UnList___HeadList___SndPair_UnConstr___HeadList_sc_proxy1_101608r'725-14 + ] + ) + ) + (lam + xIn'762-45 + [ + [ + (builtin + equalsData + ) + [ + __HeadList-2 + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-4 + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + xIn'762-45 + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ownCred_101613'750-15 + ] + ) + ] + (lam + __4_101623'767-46 + (error) + ) + ] + ] + ) + [ + __HeadList-2 + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-4 + [ + [ + (lam + go_101615'740-47 + [ + go_101615'740-47 + go_101615'740-47 + ] + ) + (lam + go_101615'740_cse-48 + [ + (lam + _Validator_scala_15_8_match_txOutRef_8'732-49 + (lam + inputs_101616'741-50 + (case + inputs_101616'741-50 + (lam + consHead'743-51 + (lam + consTail'744-52 + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + (case + [ + [ + (builtin + equalsData + ) + [ + __HeadList-2 + [ + __SndPair-3 + [ + (builtin + unConstrData + ) + consHead'743-51 + ] + ] + ] + ] + _Validator_scala_15_8_match_txOutRef_8'732-49 + ] + [ + [ + (builtin + constrData + ) + (con + integer + 0 + ) + ] + [ + [ + go_101615'740_cse-48 + go_101615'740_cse-48 + ] + consTail'744-52 + ] + ] + consHead'743-51 + ) + ] + ] + ) + ) + (error + + ) + ) + ) + ) + [ + __HeadList-2 + _match_datalist'730-11 + ] + ] + ) + ] + __cse_UnList___HeadList___SndPair_UnConstr___HeadList_sc_proxy1_101608r'725-14 + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ) + [ + (builtin unListData) + [ + __HeadList-2 + __cse___SndPair_UnConstr___HeadList_sc_proxy1_101608r'725-13 + ] + ] + ] + ) + [ + __SndPair-3 + [ + (builtin unConstrData) + [ + __HeadList-2 + sc_proxy1_101608r'725-8 + ] + ] + ] + ] + ) + [ + (lam + _match_scrutinee'734-53 + (case + [ + __FstPair-1 + _match_scrutinee'734-53 + ] + [ + __HeadList-2 + [ + __SndPair-3 + _match_scrutinee'734-53 + ] + ] + (error) + ) + ) + [ + (builtin unConstrData) + [ + __HeadList-2 + [ + __TailList-4 + _match_datalist'730-11 + ] + ] + ] + ] + ] + ) + [ + __SndPair-3 + __cse_UnConstr__Validator_scala_15_8_match_scrutinee_1'726-10 + ] + ] + (error) + (error) + (error) + (error) + ) + ) + [ + (builtin unConstrData) + [ + __HeadList-2 + [ + __cse___DropList_c-9 + sc_proxy1_101608r'725-8 + ] + ] + ] + ] + ) + [ __DropList-0 (con integer 2) ] + ] + ) + [ + __SndPair-3 + [ (builtin unConstrData) sc_proxy1_101608'724-7 ] + ] + ] + ) + ) + (lam + address_67023'682-54 + [ + (lam + _match_scrutinee'684-55 + (case + [ __FstPair-1 _match_scrutinee'684-55 ] + [ + (builtin unBData) + [ + __HeadList-2 + [ __SndPair-3 _match_scrutinee'684-55 ] + ] + ] + (error) + ) + ) + [ + (builtin unConstrData) + [ __HeadList-2 address_67023'682-54 ] + ] + ] + ) + ] + ) + (lam + self_336402'676-56 + (lam + pubKeyHash_336403'677-57 + [ + [ + (lam + self_98374'69-58 + (lam + elemData_98378'71-59 + [ + [ + (lam + go_98379'72-60 + [ go_98379'72-60 go_98379'72-60 ] + ) + (lam + go_98379'72_cse-61 + (lam + lst_98384'73-62 + (case + lst_98384'73-62 + (lam + consHead'75-63 + (lam + consTail'76-64 + (case + [ + [ + (builtin equalsData) + consHead'75-63 + ] + elemData_98378'71-59 + ] + [ + [ + go_98379'72_cse-61 + go_98379'72_cse-61 + ] + consTail'76-64 + ] + (con bool True) + ) + ) + ) + (con bool False) + ) + ) + ) + ] + self_98374'69-58 + ] + ) + ) + [ + (builtin unListData) + [ + __HeadList-2 + [ + [ __DropList-0 (con integer 8) ] + self_336402'676-56 + ] + ] + ] + ] + [ (builtin bData) pubKeyHash_336403'677-57 ] + ] + ) + ) + ] + ) + ) + ) + ) + ) + ) +) diff --git a/submissions/htlc/Scalus_1.4.0_nau/metadata.json b/submissions/htlc/Scalus_1.4.0_nau/metadata.json new file mode 100644 index 00000000..a0751c5c --- /dev/null +++ b/submissions/htlc/Scalus_1.4.0_nau/metadata.json @@ -0,0 +1,29 @@ +{ + "compiler": { + "name": "Scalus", + "version": "1.4.0", + "commit_hash": "b836856a5b4e54cd40fe0aa5947922478e8f1237" + }, + "compilation_config": { + "optimization_level": "release", + "target": "uplc", + "flags": [ + "Options.release" + ], + "min_protocol_version": 11 + }, + "contributors": [ + { + "name": "Alexander Nemish", + "organization": "Lantr", + "contact": "@nau" + } + ], + "submission": { + "date": "2026-10-28T19:41:17.001104Z", + "source_available": true, + "source_repository": "https://github.com/scalus3/scalus", + "source_commit_hash": "f1fa4a721ae7a97d78b57ce651550be0846a792e", + "implementation_notes": "Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces." + } +} diff --git a/submissions/htlc/Scalus_1.4.0_nau/metrics.json b/submissions/htlc/Scalus_1.4.0_nau/metrics.json new file mode 100644 index 00000000..7e6b10ab --- /dev/null +++ b/submissions/htlc/Scalus_1.4.0_nau/metrics.json @@ -0,0 +1,247 @@ +{ + "evaluations": [ + { + "cpu_units": 18167742, + "description": "Claim at time=50 with correct preimage and recipient signature should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 43317, + "name": "claim_well_before_timeout" + }, + { + "cpu_units": 18167742, + "description": "Claim at time=99 (just before timeout=100) with correct preimage should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 43317, + "name": "claim_just_before_timeout" + }, + { + "cpu_units": 16782373, + "description": "Refund at time=101 (just after timeout=100) with payer signature should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 40384, + "name": "refund_just_after_timeout" + }, + { + "cpu_units": 16782373, + "description": "Refund at time=200 with payer signature should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 40384, + "name": "refund_well_after_timeout" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is raw integer 0 instead of constructor 0(preimage)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_integer_0" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is raw integer 1 instead of constructor 1()", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_integer_1" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is bytestring instead of constructor", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_bytestring" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is list [1 2 3] instead of constructor", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_list" + }, + { + "cpu_units": 12512727, + "description": "Validator fails when Claim is constructor 0() with no preimage field", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22095, + "name": "redeemer_claim_without_preimage" + }, + { + "cpu_units": 11171205, + "description": "Claim without recipient signature should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22030, + "name": "claim_missing_signature" + }, + { + "cpu_units": 12287585, + "description": "Claim with only payer signature (not recipient) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22031, + "name": "claim_wrong_signature_payer" + }, + { + "cpu_units": 12287585, + "description": "Claim with only impostor signature (not recipient) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22031, + "name": "claim_wrong_signature_impostor" + }, + { + "cpu_units": 13079081, + "description": "Claim with preimage #cafebabe (hash does not match) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22200, + "name": "claim_wrong_preimage" + }, + { + "cpu_units": 13079081, + "description": "Claim with empty preimage (hash does not match) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22200, + "name": "claim_empty_preimage" + }, + { + "cpu_units": 18087742, + "description": "Claim at time=100 (boundary, must be strictly before timeout) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 42817, + "name": "claim_at_timeout" + }, + { + "cpu_units": 18087742, + "description": "Claim at time=150 (after timeout) should fail even with correct preimage", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 42817, + "name": "claim_after_timeout" + }, + { + "cpu_units": 14266723, + "description": "Claim with from_time=50 and no upper bound (+inf) should fail; the upper bound must be finite", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22592, + "name": "claim_infinite_upper_bound" + }, + { + "cpu_units": 11759851, + "description": "Claim with two script inputs should fail (double satisfaction attack)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21739, + "name": "claim_double_satisfaction" + }, + { + "cpu_units": 11089542, + "description": "Refund without payer signature should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21998, + "name": "refund_missing_signature" + }, + { + "cpu_units": 12205922, + "description": "Refund with only recipient signature (not payer) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21999, + "name": "refund_wrong_signature_recipient" + }, + { + "cpu_units": 12205922, + "description": "Refund with only impostor signature (not payer) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21999, + "name": "refund_wrong_signature_impostor" + }, + { + "cpu_units": 13934373, + "description": "Refund at time=50 (before timeout) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22584, + "name": "refund_before_timeout" + }, + { + "cpu_units": 13934373, + "description": "Refund at time=100 (boundary, must be strictly after timeout) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22584, + "name": "refund_at_timeout" + }, + { + "cpu_units": 13311901, + "description": "Refund with no lower bound (-inf) should fail; the lower bound must be finite", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22359, + "name": "refund_infinite_lower_bound" + }, + { + "cpu_units": 11759851, + "description": "Refund with two script inputs should fail (double satisfaction attack)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21739, + "name": "refund_double_satisfaction" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.63.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 0.09083871, + "block_memory_budget_pct": 0.060162499999999994, + "cpu_units": { + "maximum": 18167742, + "median": 17475057, + "minimum": 16782373, + "sum": 69900230 + }, + "excluded": { + "count": 21, + "cpu_units": { + "maximum": 18087742, + "sum": 225159958 + }, + "memory_units": { + "maximum": 42817, + "sum": 418342 + } + }, + "execution_fee_lovelace": 14699, + "memory_units": { + "maximum": 43317, + "median": 41850, + "minimum": 40384, + "sum": 167402 + }, + "reference_script_fee_lovelace": 8295, + "script_size_bytes": 553, + "scripts_per_block": 1100, + "scripts_per_tx": 380, + "term_size": 571, + "total_fee_lovelace": 22994, + "tx_cpu_budget_pct": 0.18167742, + "tx_memory_budget_pct": 0.2625272727272727 + }, + "scenario": "htlc", + "timestamp": "2026-10-28T19:44:33Z", + "version": "2.0.0", + "notes": "Generated using UPLC-CAPE measure tool" +} diff --git a/submissions/linear_vesting/Scalus_1.4.0_nau/README.md b/submissions/linear_vesting/Scalus_1.4.0_nau/README.md new file mode 100644 index 00000000..1d0c763f --- /dev/null +++ b/submissions/linear_vesting/Scalus_1.4.0_nau/README.md @@ -0,0 +1,53 @@ +# Benchmark Implementation Notes + +**Scenario**: `linear_vesting` + +**Submission ID**: `Scalus_1.4.0_nau` (Format: `Language_Version_GitHubHandle`) + +## Implementation Details + +- **Compiler**: Scalus 1.4.0 +- **Implementation Approach**: Scala 3 validator implementing the ceiling-division vesting schedule. +- **Compilation Flags**: `Options.release` + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Reproducibility + +### Source Code + +- **Source Available**: true + +#### For External Repository (recommended approach): + +- **Direct Link**: [linearvesting](https://github.com/scalus3/scalus/tree/f1fa4a721ae7a97d78b57ce651550be0846a792e/scalus-examples/jvm/src/main/scala/scalus/examples/cape/linearvesting/) +- **Repository**: https://github.com/scalus3/scalus +- **Tag/Commit**: `f1fa4a721ae7a97d78b57ce651550be0846a792e` +- **Source Path**: `scalus-examples/jvm/src/main/scala/scalus/examples/cape/linearvesting/` + +### Build Instructions + +```sh +git clone https://github.com/scalus3/scalus +cd scalus +git checkout f1fa4a721ae7a97d78b57ce651550be0846a792e +nix develop # provides JDK 21 and sbt +sbt "scalusExamplesJVM/runMain scalus.examples.cape.GenerateSubmissions 1.4.0" +``` + +This writes `submissions//Scalus_1.4.0_nau/` for all 8 scenarios: the `.uplc` file, +`metadata.json` and this README. Then run `treefmt` in the UPLC-CAPE checkout to apply the +`pretty-uplc` layout, which changes only whitespace. `scripts/cape-submit.sh` in the +Scalus repository runs all of this, then `cape submission verify` and `measure`. + +### Compilation Configuration + +- **Optimization Level**: release +- **Compilation Flags**: `Options.release` +- **Notable Configuration**: Targets Plutus V3, protocol version 11 (vanRossem), plutus-core 1.1.0. No traces. + +## Notes + +Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces. Value.quantityOf lowers to the CIP-0153 lookupCoin/unValueData builtins (Options.valueBuiltins, the PV11 default). diff --git a/submissions/linear_vesting/Scalus_1.4.0_nau/linear_vesting.uplc b/submissions/linear_vesting/Scalus_1.4.0_nau/linear_vesting.uplc new file mode 100644 index 00000000..4307f104 --- /dev/null +++ b/submissions/linear_vesting/Scalus_1.4.0_nau/linear_vesting.uplc @@ -0,0 +1,1267 @@ +(program + 1.1.0 + (case + (constr + 0 + (force (builtin dropList)) + (force (force (builtin fstPair))) + (force (builtin headList)) + (force (builtin mkCons)) + (force (force (builtin sndPair))) + (force (builtin tailList)) + ) + (lam + __DropList-0 + (lam + __FstPair-1 + (lam + __HeadList-2 + (lam + __MkCons-3 + (lam + __SndPair-4 + (lam + __TailList-5 + (lam + sc_proxy1_102087'799-6 + [ + (lam + sc_proxy1_102087r'800-7 + [ + (lam + __cse___DropList_c-8 + [ + (lam + __cse_UnConstr__Validator_scala_15_8_match_scrutinee_1'801-9 + (case + [ + __FstPair-1 + __cse_UnConstr__Validator_scala_15_8_match_scrutinee_1'801-9 + ] + (error) + [ + (lam + _match_datalist'805-10 + [ + (lam + datumData_102091'814-11 + [ + (lam + d_102092r'816-12 + [ + (lam + __cse___SndPair_UnConstr___HeadList_sc_proxy1_102087r'800-13 + [ + (lam + __LinearVestingValidator_line_75_0'828-14 + [ + (lam + currentTime_102094'838-15 + (case + [ + __FstPair-1 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-5 + sc_proxy1_102087r'800-7 + ] + ] + ] + ] + [ + (lam + __LinearVestingValidator_line_87_0'846-16 + [ + (lam + __cse_UnList___HeadList___SndPair_UnConstr___HeadList_sc_proxy1_102087r'800-17 + [ + (lam + ownInput_102098r'856-18 + [ + (lam + ownCred_102099'858-19 + [ + (lam + __LinearVestingValidator_line_92_0'877-20 + [ + (lam + __cse_LookupCoin_UnB___HeadList___SndPair_UnConstr___HeadList___TailList-21 + [ + (lam + oldRemaining_102100'885-22 + [ + (lam + continuing_102101r'902-23 + [ + (lam + newRemaining_102102'910-24 + [ + (lam + __LinearVestingValidator_line_104_0'913-25 + [ + (lam + __LinearVestingValidator_line_105_0'916-26 + [ + (lam + __LinearVestingValidator_line_111_0'947-27 + (case + [ + [ + (builtin + equalsData + ) + [ + __HeadList-2 + [ + __cse___DropList_c-8 + continuing_102101r'902-23 + ] + ] + ] + [ + [ + (builtin + constrData + ) + (con + integer + 2 + ) + ] + [ + [ + __MkCons-3 + datumData_102091'814-11 + ] + (con + (list data) + [ ] + ) + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ) + (case + [ + [ + (builtin + equalsInteger + ) + newRemaining_102102'910-24 + ] + [ + (lam + __cse_Sub_c-28 + [ + __cse_Sub_c-28 + [ + (lam + __cse_UnI___HeadList___DropList_c_d_102092r'816-29 + [ + [ + (builtin + divideInteger + ) + [ + __cse_Sub_c-28 + [ + [ + (builtin + multiplyInteger + ) + [ + __cse_Sub_c-28 + [ + (lam + __cse_Sub_UnI___HeadList___DropList_c_d_102092r'816-30 + [ + [ + (builtin + divideInteger + ) + [ + __cse_Sub_c-28 + [ + __cse_Sub_UnI___HeadList___DropList_c_d_102092r'816-30 + currentTime_102094'838-15 + ] + ] + ] + [ + __cse_Sub_c-28 + [ + [ + (builtin + divideInteger + ) + [ + __cse_Sub_c-28 + [ + __cse_Sub_UnI___HeadList___DropList_c_d_102092r'816-30 + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 3 + ) + ] + d_102092r'816-12 + ] + ] + ] + ] + ] + ] + __cse_UnI___HeadList___DropList_c_d_102092r'816-29 + ] + ] + ] + ) + [ + (builtin + subtractInteger + ) + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 4 + ) + ] + d_102092r'816-12 + ] + ] + ] + ] + ] + ] + ] + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + __cse___DropList_c-8 + d_102092r'816-12 + ] + ] + ] + ] + ] + ] + __cse_UnI___HeadList___DropList_c_d_102092r'816-29 + ] + ) + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 6 + ) + ] + d_102092r'816-12 + ] + ] + ] + ] + ] + ) + [ + (builtin + subtractInteger + ) + (con + integer + 0 + ) + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (case + [ + [ + (builtin + lessThanInteger + ) + newRemaining_102102'910-24 + ] + oldRemaining_102100'885-22 + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (case + [ + [ + (builtin + lessThanInteger + ) + (con + integer + 0 + ) + ] + newRemaining_102102'910-24 + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + [ + __cse_LookupCoin_UnB___HeadList___SndPair_UnConstr___HeadList___TailList-21 + [ + (builtin + unValueData + ) + [ + __HeadList-2 + [ + __TailList-5 + continuing_102101r'902-23 + ] + ] + ] + ] + ] + ) + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + (lam + _match_scrutinee'896-31 + (case + [ + __FstPair-1 + _match_scrutinee'896-31 + ] + [ + __HeadList-2 + [ + __SndPair-4 + _match_scrutinee'896-31 + ] + ] + (error + + ) + ) + ) + [ + (builtin + unConstrData + ) + [ + [ + (lam + self_93903'588-32 + (lam + predicate_93904'589-33 + [ + [ + (lam + scalus_cardano_onchain_plutus_prelude_List__find_sat'590-34 + [ + scalus_cardano_onchain_plutus_prelude_List__find_sat'590-34 + scalus_cardano_onchain_plutus_prelude_List__find_sat'590-34 + ] + ) + (lam + scalus_cardano_onchain_plutus_prelude_List__find_sat'590_cse-35 + (lam + self_93903'591-36 + (case + self_93903'591-36 + (lam + consHead'593-37 + (lam + consTail'594-38 + (case + [ + predicate_93904'589-33 + consHead'593-37 + ] + [ + [ + scalus_cardano_onchain_plutus_prelude_List__find_sat'590_cse-35 + scalus_cardano_onchain_plutus_prelude_List__find_sat'590_cse-35 + ] + consTail'594-38 + ] + [ + [ + (builtin + constrData + ) + (con + integer + 0 + ) + ] + [ + [ + __MkCons-3 + consHead'593-37 + ] + (con + (list data) + [ ] + ) + ] + ] + ) + ) + ) + (con + data + (Constr 1 + [ ]) + ) + ) + ) + ) + ] + self_93903'588-32 + ] + ) + ) + [ + (builtin + unListData + ) + [ + __HeadList-2 + [ + __cse___DropList_c-8 + __cse___SndPair_UnConstr___HeadList_sc_proxy1_102087r'800-13 + ] + ] + ] + ] + (lam + xIn'893-39 + [ + [ + (builtin + equalsData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + xIn'893-39 + ] + ] + ] + ] + ] + ] + ] + ownCred_102099'858-19 + ] + ) + ] + ] + ] + ] + ] + ] + ) + [ + __cse_LookupCoin_UnB___HeadList___SndPair_UnConstr___HeadList___TailList-21 + [ + (builtin + unValueData + ) + [ + __HeadList-2 + [ + __TailList-5 + ownInput_102098r'856-18 + ] + ] + ] + ] + ] + ) + [ + (lam + __cse___SndPair_UnConstr___HeadList___TailList_d_102092r'816-40 + [ + [ + (builtin + lookupCoin + ) + [ + (builtin + unBData + ) + [ + __HeadList-2 + __cse___SndPair_UnConstr___HeadList___TailList_d_102092r'816-40 + ] + ] + ] + [ + (builtin + unBData + ) + [ + __HeadList-2 + [ + __TailList-5 + __cse___SndPair_UnConstr___HeadList___TailList_d_102092r'816-40 + ] + ] + ] + ] + ) + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-5 + d_102092r'816-12 + ] + ] + ] + ] + ] + ] + ) + [ + [ + (lam + predicate_94080'669-41 + (lam + orElse_94081'670-42 + [ + [ + (lam + go_94085'671-43 + [ + go_94085'671-43 + go_94085'671-43 + ] + ) + (lam + go_94085'671_cse-44 + (lam + list_94086'672-45 + (case + list_94086'672-45 + (lam + consHead'674-46 + (lam + consTail'675-47 + (case + [ + predicate_94080'669-41 + consHead'674-46 + ] + [ + [ + go_94085'671_cse-44 + go_94085'671_cse-44 + ] + consTail'675-47 + ] + (case + [ + [ + (lam + scalus_cardano_onchain_plutus_prelude_List__forall_sat'662-48 + [ + scalus_cardano_onchain_plutus_prelude_List__forall_sat'662-48 + scalus_cardano_onchain_plutus_prelude_List__forall_sat'662-48 + ] + ) + (lam + scalus_cardano_onchain_plutus_prelude_List__forall_sat'662_cse-49 + (lam + self_92983'663-50 + (case + self_92983'663-50 + (lam + consHead'665-51 + (lam + consTail'666-52 + (case + (case + [ + predicate_94080'669-41 + consHead'665-51 + ] + (con + bool + True + ) + (con + bool + False + ) + ) + (con + bool + False + ) + [ + [ + scalus_cardano_onchain_plutus_prelude_List__forall_sat'662_cse-49 + scalus_cardano_onchain_plutus_prelude_List__forall_sat'662_cse-49 + ] + consTail'666-52 + ] + ) + ) + ) + (con + bool + True + ) + ) + ) + ) + ] + consTail'675-47 + ] + [ + orElse_94081'670-42 + (con + unit + () + ) + ] + consHead'674-46 + ) + ) + ) + ) + [ + orElse_94081'670-42 + (con + unit + () + ) + ] + ) + ) + ) + ] + __cse_UnList___HeadList___SndPair_UnConstr___HeadList_sc_proxy1_102087r'800-17 + ] + ) + ) + (lam + xIn'870-53 + [ + [ + (builtin + equalsData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-5 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + xIn'870-53 + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ownCred_102099'858-19 + ] + ) + ] + (lam + __4_102114'875-54 + (error + + ) + ) + ] + ] + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + ownInput_102098r'856-18 + ] + ] + ] + ] + ] + ) + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-5 + [ + [ + (lam + go_102106'847-55 + [ + go_102106'847-55 + go_102106'847-55 + ] + ) + (lam + go_102106'847_cse-56 + [ + (lam + _Validator_scala_15_8_match_txOutRef_8'807-57 + (lam + inputs_102107'848-58 + (case + inputs_102107'848-58 + (lam + consHead'850-59 + (lam + consTail'851-60 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + (case + [ + [ + (builtin + equalsData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + consHead'850-59 + ] + ] + ] + ] + _Validator_scala_15_8_match_txOutRef_8'807-57 + ] + [ + [ + (builtin + constrData + ) + (con + integer + 0 + ) + ] + [ + [ + go_102106'847_cse-56 + go_102106'847_cse-56 + ] + consTail'851-60 + ] + ] + consHead'850-59 + ) + ] + ] + ) + ) + (error + + ) + ) + ) + ) + [ + __HeadList-2 + _match_datalist'805-10 + ] + ] + ) + ] + __cse_UnList___HeadList___SndPair_UnConstr___HeadList_sc_proxy1_102087r'800-17 + ] + ] + ] + ] + ] + ] + ) + [ + (builtin + unListData + ) + [ + __HeadList-2 + __cse___SndPair_UnConstr___HeadList_sc_proxy1_102087r'800-13 + ] + ] + ] + ) + (case + [ + [ + (builtin + lessThanInteger + ) + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 5 + ) + ] + d_102092r'816-12 + ] + ] + ] + ] + currentTime_102094'838-15 + ] + (error) + (con unit ()) + ) + ] + (case + [ + [ + (builtin + lessThanInteger + ) + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 4 + ) + ] + d_102092r'816-12 + ] + ] + ] + ] + currentTime_102094'838-15 + ] + (error) + (con unit ()) + ) + ) + ) + [ + (lam + _match_scrutinee'833-61 + (case + [ + __FstPair-1 + _match_scrutinee'833-61 + ] + (error) + [ + (builtin unIData) + [ + __HeadList-2 + [ + __SndPair-4 + _match_scrutinee'833-61 + ] + ] + ] + (error) + ) + ) + [ + (builtin unConstrData) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 7 + ) + ] + __cse___SndPair_UnConstr___HeadList_sc_proxy1_102087r'800-13 + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ) + (case + [ + [ + (lam + self_98374'69-62 + (lam + elemData_98378'71-63 + [ + [ + (lam + go_98379'72-64 + [ + go_98379'72-64 + go_98379'72-64 + ] + ) + (lam + go_98379'72_cse-65 + (lam + lst_98384'73-66 + (case + lst_98384'73-66 + (lam + consHead'75-67 + (lam + consTail'76-68 + (case + [ + [ + (builtin + equalsData + ) + consHead'75-67 + ] + elemData_98378'71-63 + ] + [ + [ + go_98379'72_cse-65 + go_98379'72_cse-65 + ] + consTail'76-68 + ] + (con + bool + True + ) + ) + ) + ) + (con + bool + False + ) + ) + ) + ) + ] + self_98374'69-62 + ] + ) + ) + [ + (builtin unListData) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con integer 8) + ] + __cse___SndPair_UnConstr___HeadList_sc_proxy1_102087r'800-13 + ] + ] + ] + ] + [ + (builtin bData) + [ + (lam + _match_scrutinee'819-69 + (case + [ + __FstPair-1 + _match_scrutinee'819-69 + ] + [ + (builtin + unBData + ) + [ + __HeadList-2 + [ + __SndPair-4 + _match_scrutinee'819-69 + ] + ] + ] + (error) + ) + ) + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + d_102092r'816-12 + ] + ] + ] + ] + ] + ] + ] + ] + (error) + (con unit ()) + ) + ] + ) + [ + __SndPair-4 + [ + (builtin unConstrData) + [ + __HeadList-2 + sc_proxy1_102087r'800-7 + ] + ] + ] + ] + ) + [ + __SndPair-4 + [ + (builtin unConstrData) + datumData_102091'814-11 + ] + ] + ] + ) + [ + (lam + _match_scrutinee'809-70 + (case + [ + __FstPair-1 + _match_scrutinee'809-70 + ] + [ + __HeadList-2 + [ + __SndPair-4 + _match_scrutinee'809-70 + ] + ] + (error) + ) + ) + [ + (builtin unConstrData) + [ + __HeadList-2 + [ + __TailList-5 + _match_datalist'805-10 + ] + ] + ] + ] + ] + ) + [ + __SndPair-4 + __cse_UnConstr__Validator_scala_15_8_match_scrutinee_1'801-9 + ] + ] + (error) + (error) + (error) + (error) + ) + ) + [ + (builtin unConstrData) + [ + __HeadList-2 + [ __cse___DropList_c-8 sc_proxy1_102087r'800-7 ] + ] + ] + ] + ) + [ __DropList-0 (con integer 2) ] + ] + ) + [ + __SndPair-4 + [ (builtin unConstrData) sc_proxy1_102087'799-6 ] + ] + ] + ) + ) + ) + ) + ) + ) + ) + ) +) diff --git a/submissions/linear_vesting/Scalus_1.4.0_nau/metadata.json b/submissions/linear_vesting/Scalus_1.4.0_nau/metadata.json new file mode 100644 index 00000000..fc26b66d --- /dev/null +++ b/submissions/linear_vesting/Scalus_1.4.0_nau/metadata.json @@ -0,0 +1,29 @@ +{ + "compiler": { + "name": "Scalus", + "version": "1.4.0", + "commit_hash": "b836856a5b4e54cd40fe0aa5947922478e8f1237" + }, + "compilation_config": { + "optimization_level": "release", + "target": "uplc", + "flags": [ + "Options.release" + ], + "min_protocol_version": 11 + }, + "contributors": [ + { + "name": "Alexander Nemish", + "organization": "Lantr", + "contact": "@nau" + } + ], + "submission": { + "date": "2026-10-28T19:41:17.001104Z", + "source_available": true, + "source_repository": "https://github.com/scalus3/scalus", + "source_commit_hash": "f1fa4a721ae7a97d78b57ce651550be0846a792e", + "implementation_notes": "Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces. Value.quantityOf lowers to the CIP-0153 lookupCoin/unValueData builtins (Options.valueBuiltins, the PV11 default)." + } +} diff --git a/submissions/linear_vesting/Scalus_1.4.0_nau/metrics.json b/submissions/linear_vesting/Scalus_1.4.0_nau/metrics.json new file mode 100644 index 00000000..c26c3ae0 --- /dev/null +++ b/submissions/linear_vesting/Scalus_1.4.0_nau/metrics.json @@ -0,0 +1,279 @@ +{ + "evaluations": [ + { + "cpu_units": 31180571, + "description": "PartialUnlock at time=11 with 900 tokens remaining should succeed (first installment unlocked)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 62888, + "name": "partial_unlock_first_installment" + }, + { + "cpu_units": 31180571, + "description": "PartialUnlock at time=50 with 500 tokens remaining should succeed (half vested)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 62888, + "name": "partial_unlock_mid_vesting" + }, + { + "cpu_units": 31180571, + "description": "PartialUnlock at time=91 with 100 tokens remaining should succeed (9 installments unlocked)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 62888, + "name": "partial_unlock_near_end" + }, + { + "cpu_units": 31180571, + "description": "PartialUnlock at time=25 with 800 tokens remaining should succeed (between installment boundaries)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 62888, + "name": "partial_unlock_between_installments" + }, + { + "cpu_units": 8935746, + "description": "FullUnlock at time=101 (just after vesting period end) should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 23122, + "name": "full_unlock_after_period_end" + }, + { + "cpu_units": 8935746, + "description": "FullUnlock at time=200 (well after vesting period end) should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 23122, + "name": "full_unlock_well_after" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is raw integer 0 instead of constructor 0()", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_integer_0" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is raw integer 1 instead of constructor 1()", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_integer_1" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is raw integer 99 (not a valid constructor)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_integer_99" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is bytestring instead of constructor", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_bytestring" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is list [1 2 3] instead of constructor", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_list" + }, + { + "cpu_units": 2648958, + "description": "PartialUnlock without beneficiary signature should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 1036, + "name": "partial_unlock_missing_signature" + }, + { + "cpu_units": 3765338, + "description": "PartialUnlock with impostor signature instead of beneficiary should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 1037, + "name": "partial_unlock_wrong_signature" + }, + { + "cpu_units": 2648958, + "description": "PartialUnlock with no signatures at all should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 1036, + "name": "partial_unlock_no_signatures" + }, + { + "cpu_units": 8697703, + "description": "PartialUnlock at time=5 should fail (before firstUnlockPossibleAfter=10)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21622, + "name": "partial_unlock_before_first_unlock" + }, + { + "cpu_units": 8697703, + "description": "PartialUnlock at time=10 should fail (at boundary, must be strictly after firstUnlockPossibleAfter)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21622, + "name": "partial_unlock_at_first_unlock" + }, + { + "cpu_units": 22350335, + "description": "PartialUnlock with 0 tokens remaining in output should fail (must use FullUnlock instead)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 43548, + "name": "partial_unlock_zero_remaining" + }, + { + "cpu_units": 22788857, + "description": "PartialUnlock with output tokens equal to input (1000) should fail (no tokens actually withdrawn)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 43593, + "name": "partial_unlock_not_decreasing" + }, + { + "cpu_units": 25050605, + "description": "PartialUnlock at time=11 with 800 tokens remaining should fail (expected minimum 900)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 43887, + "name": "partial_unlock_wrong_remaining_too_low" + }, + { + "cpu_units": 25050605, + "description": "PartialUnlock at time=11 with 950 tokens remaining should fail (must withdraw at least 1 installment)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 43887, + "name": "partial_unlock_wrong_remaining_too_high" + }, + { + "cpu_units": 28156571, + "description": "PartialUnlock with modified datum on continuing output should fail (datum must be preserved)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 43988, + "name": "partial_unlock_datum_modified" + }, + { + "cpu_units": 26356157, + "description": "PartialUnlock with no datum on continuing output should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 43988, + "name": "partial_unlock_datum_missing" + }, + { + "cpu_units": 15772456, + "description": "PartialUnlock with two script inputs should fail (double satisfaction attack)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 22777, + "name": "partial_unlock_double_satisfaction" + }, + { + "cpu_units": 2648958, + "description": "FullUnlock without beneficiary signature should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 1036, + "name": "full_unlock_missing_signature" + }, + { + "cpu_units": 3765338, + "description": "FullUnlock with impostor signature instead of beneficiary should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 1037, + "name": "full_unlock_wrong_signature" + }, + { + "cpu_units": 8695746, + "description": "FullUnlock at time=50 should fail (vesting period not yet ended)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21622, + "name": "full_unlock_before_period_end" + }, + { + "cpu_units": 8695746, + "description": "FullUnlock at time=100 should fail (at boundary, must be strictly after vestingPeriodEnd)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21622, + "name": "full_unlock_at_period_end" + }, + { + "cpu_units": 4644841, + "description": "PartialUnlock with no lower bound (-inf) should fail; the lower bound must be finite", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 1329, + "name": "partial_unlock_infinite_lower_bound" + }, + { + "cpu_units": 4644841, + "description": "FullUnlock with no lower bound (-inf) should fail; the lower bound must be finite", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 1329, + "name": "full_unlock_infinite_lower_bound" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.63.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 0.155902855, + "block_memory_budget_pct": 0.08734444444444445, + "cpu_units": { + "maximum": 31180571, + "median": 31180571, + "minimum": 8935746, + "sum": 142593776 + }, + "excluded": { + "count": 23, + "cpu_units": { + "maximum": 28156571, + "sum": 225203156 + }, + "memory_units": { + "maximum": 43988, + "sum": 380656 + } + }, + "execution_fee_lovelace": 27464, + "memory_units": { + "maximum": 62888, + "median": 62888, + "minimum": 23122, + "sum": 297796 + }, + "reference_script_fee_lovelace": 9780, + "script_size_bytes": 652, + "scripts_per_block": 641, + "scripts_per_tx": 262, + "term_size": 668, + "total_fee_lovelace": 37244, + "tx_cpu_budget_pct": 0.31180571, + "tx_memory_budget_pct": 0.38113939393939394 + }, + "scenario": "linear_vesting", + "timestamp": "2026-10-28T19:45:00Z", + "version": "2.0.0", + "notes": "Generated using UPLC-CAPE measure tool" +} diff --git a/submissions/two_party_escrow/Scalus_1.4.0_nau/README.md b/submissions/two_party_escrow/Scalus_1.4.0_nau/README.md new file mode 100644 index 00000000..6b7bcaaa --- /dev/null +++ b/submissions/two_party_escrow/Scalus_1.4.0_nau/README.md @@ -0,0 +1,53 @@ +# Benchmark Implementation Notes + +**Scenario**: `two_party_escrow` + +**Submission ID**: `Scalus_1.4.0_nau` (Format: `Language_Version_GitHubHandle`) + +## Implementation Details + +- **Compiler**: Scalus 1.4.0 +- **Implementation Approach**: Scala 3 validator: Deposited -> Accepted | Refunded state machine. +- **Compilation Flags**: `Options.release` + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Reproducibility + +### Source Code + +- **Source Available**: true + +#### For External Repository (recommended approach): + +- **Direct Link**: [twopartyescrow](https://github.com/scalus3/scalus/tree/f1fa4a721ae7a97d78b57ce651550be0846a792e/scalus-examples/jvm/src/main/scala/scalus/examples/cape/twopartyescrow/) +- **Repository**: https://github.com/scalus3/scalus +- **Tag/Commit**: `f1fa4a721ae7a97d78b57ce651550be0846a792e` +- **Source Path**: `scalus-examples/jvm/src/main/scala/scalus/examples/cape/twopartyescrow/` + +### Build Instructions + +```sh +git clone https://github.com/scalus3/scalus +cd scalus +git checkout f1fa4a721ae7a97d78b57ce651550be0846a792e +nix develop # provides JDK 21 and sbt +sbt "scalusExamplesJVM/runMain scalus.examples.cape.GenerateSubmissions 1.4.0" +``` + +This writes `submissions//Scalus_1.4.0_nau/` for all 8 scenarios: the `.uplc` file, +`metadata.json` and this README. Then run `treefmt` in the UPLC-CAPE checkout to apply the +`pretty-uplc` layout, which changes only whitespace. `scripts/cape-submit.sh` in the +Scalus repository runs all of this, then `cape submission verify` and `measure`. + +### Compilation Configuration + +- **Optimization Level**: release +- **Compilation Flags**: `Options.release` +- **Notable Configuration**: Targets Plutus V3, protocol version 11 (vanRossem), plutus-core 1.1.0. No traces. + +## Notes + +Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces. diff --git a/submissions/two_party_escrow/Scalus_1.4.0_nau/metadata.json b/submissions/two_party_escrow/Scalus_1.4.0_nau/metadata.json new file mode 100644 index 00000000..a0751c5c --- /dev/null +++ b/submissions/two_party_escrow/Scalus_1.4.0_nau/metadata.json @@ -0,0 +1,29 @@ +{ + "compiler": { + "name": "Scalus", + "version": "1.4.0", + "commit_hash": "b836856a5b4e54cd40fe0aa5947922478e8f1237" + }, + "compilation_config": { + "optimization_level": "release", + "target": "uplc", + "flags": [ + "Options.release" + ], + "min_protocol_version": 11 + }, + "contributors": [ + { + "name": "Alexander Nemish", + "organization": "Lantr", + "contact": "@nau" + } + ], + "submission": { + "date": "2026-10-28T19:41:17.001104Z", + "source_available": true, + "source_repository": "https://github.com/scalus3/scalus", + "source_commit_hash": "f1fa4a721ae7a97d78b57ce651550be0846a792e", + "implementation_notes": "Compiled from Scala 3 with the Scalus compiler plugin, Options.release (PV11/vanRossem target: flexible case, batch-6 builtins), no traces." + } +} diff --git a/submissions/two_party_escrow/Scalus_1.4.0_nau/metrics.json b/submissions/two_party_escrow/Scalus_1.4.0_nau/metrics.json new file mode 100644 index 00000000..119dcec0 --- /dev/null +++ b/submissions/two_party_escrow/Scalus_1.4.0_nau/metrics.json @@ -0,0 +1,423 @@ +{ + "evaluations": [ + { + "cpu_units": 13533008, + "description": "Deposit with buyer signature and exactly 75 ADA should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 32162, + "name": "deposit_successful" + }, + { + "cpu_units": 17113627, + "description": "Accept with seller signature and 75 ADA to seller should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 41130, + "name": "accept_successful" + }, + { + "cpu_units": 17113627, + "description": "Accept with multiple script inputs (ambiguous state - expects pass)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 41130, + "name": "accept_with_multiple_inputs" + }, + { + "cpu_units": 17113627, + "description": "Accept with datum attached to seller's payment (expects pass)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 41130, + "name": "accept_with_datum_attached" + }, + { + "cpu_units": 22205672, + "description": "Accept with payment split across two outputs to seller (50+25 ADA - expects pass)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 48511, + "name": "accept_with_multiple_outputs_to_seller" + }, + { + "cpu_units": 20465280, + "description": "Refund after deadline with buyer signature should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 50210, + "name": "refund_successful" + }, + { + "cpu_units": 20465280, + "description": "Refund exactly 1 second after deadline expiry should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 50210, + "name": "refund_after_exact_deadline" + }, + { + "cpu_units": 20465280, + "description": "Refund with multiple script inputs should succeed (no single input validation)", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 50210, + "name": "refund_with_multiple_inputs" + }, + { + "cpu_units": 20465280, + "description": "Refund with datum attached to buyer's output should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 50210, + "name": "refund_with_datum_attached" + }, + { + "cpu_units": 25557325, + "description": "Refund split across two outputs to buyer (50+25 ADA) should succeed", + "execution_result": "success", + "included_in_aggregates": true, + "memory_units": 57591, + "name": "refund_with_multiple_outputs_to_buyer" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is integer 3 (not 0, 1, or 2)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_integer_3" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is integer 4 (not 0, 1, or 2)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_integer_4" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is integer 99 (not 0, 1, or 2)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_integer_99" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is integer -1 (not 0, 1, or 2)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_integer_negative_1" + }, + { + "cpu_units": 370455, + "description": "Validator fails when redeemer is constructor instead of integer", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 200, + "name": "redeemer_constructor_0" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is bytestring instead of integer", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_bytestring" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is list [1,2,3] instead of integer", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_list_with_integers" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is map instead of integer", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "redeemer_map_with_data" + }, + { + "cpu_units": 24688, + "description": "Test redeemer 0 with simple builtin_data (not script_context)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 132, + "name": "simple_builtin_data_redeemer_0" + }, + { + "cpu_units": 1277191, + "description": "Deposit without buyer signature should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 557, + "name": "deposit_without_buyer_signature" + }, + { + "cpu_units": 8463425, + "description": "Deposit with buyer signature but wrong amount (50 ADA) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21560, + "name": "deposit_with_incorrect_amount" + }, + { + "cpu_units": 3354737, + "description": "Deposit fails when ADA goes to pubkey address instead of script", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 882, + "name": "deposit_to_wrong_address" + }, + { + "cpu_units": 2693897, + "description": "Accept operation fails when seller signature is missing", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 1038, + "name": "accept_without_seller_signature" + }, + { + "cpu_units": 21245672, + "description": "Accept operation fails with wrong payment amount (50 ADA instead of 75 ADA)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 42511, + "name": "accept_with_incorrect_payment_amount" + }, + { + "cpu_units": 2274781, + "description": "Accept operation fails when payment goes to impostor address instead of seller", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 874, + "name": "accept_with_payment_to_wrong_address" + }, + { + "cpu_units": 2274781, + "description": "Accept operation without valid deposit UTXO (should fail - invalid escrow state)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 874, + "name": "accept_without_prior_deposit" + }, + { + "cpu_units": 2274781, + "description": "Accept with only 50 ADA payment to seller (insufficient - expects fail)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 874, + "name": "accept_with_partial_payment_to_seller" + }, + { + "cpu_units": 2274781, + "description": "Accept with 100 ADA payment to seller (excess amount - expects fail due to exact validation)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 874, + "name": "accept_with_excess_payment_to_seller" + }, + { + "cpu_units": 2274781, + "description": "Accept while leaving funds in script (should fail - incomplete withdrawal)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 874, + "name": "accept_with_remaining_script_output" + }, + { + "cpu_units": 2746230, + "description": "Refund without buyer signature should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 1039, + "name": "refund_without_buyer_signature" + }, + { + "cpu_units": 2327114, + "description": "Refund with seller signature instead of buyer should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_with_seller_signature_only" + }, + { + "cpu_units": 2327114, + "description": "Refund with impostor signature should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_with_impostor_signature" + }, + { + "cpu_units": 2327114, + "description": "Refund before deadline expiry should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_before_deadline" + }, + { + "cpu_units": 2327114, + "description": "Refund exactly at deadline should fail (must be strictly after)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_at_exact_deadline" + }, + { + "cpu_units": 2327114, + "description": "Refund without time range should fail (missing temporal context)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_with_no_time_range" + }, + { + "cpu_units": 2327114, + "description": "Refund with wrong total amount (80 ADA instead of 75) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_with_incorrect_amount" + }, + { + "cpu_units": 2327114, + "description": "Partial refund (50 ADA to buyer) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_with_partial_refund" + }, + { + "cpu_units": 2327114, + "description": "Excess refund (100 ADA to buyer) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_with_excess_refund" + }, + { + "cpu_units": 2327114, + "description": "Refund to wrong address (seller instead of buyer) should fail", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_to_wrong_address" + }, + { + "cpu_units": 2327114, + "description": "Refund leaving funds in script should fail (incomplete withdrawal)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_with_remaining_script_output" + }, + { + "cpu_units": 2327114, + "description": "Refund without valid deposit UTXO should fail (invalid escrow state)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 875, + "name": "refund_without_prior_deposit" + }, + { + "cpu_units": 2493597, + "description": "Refund attempt after seller has already accepted should fail (state validation)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 939, + "name": "refund_after_accept_should_fail" + }, + { + "cpu_units": 2441264, + "description": "Accept attempt after buyer has already refunded should fail (state validation)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 938, + "name": "accept_after_refund_should_fail" + }, + { + "cpu_units": 2493597, + "description": "Multiple refund attempts should fail (double spending prevention)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 939, + "name": "double_refund_should_fail" + }, + { + "cpu_units": 2441264, + "description": "Multiple accept attempts should fail (double spending prevention)", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 938, + "name": "double_accept_should_fail" + }, + { + "cpu_units": 3354737, + "description": "Deposit with no upper bound (+inf) should fail; the upper bound must be finite to record the deposit time safely", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 882, + "name": "deposit_infinite_upper_bound" + }, + { + "cpu_units": 8395458, + "description": "Refund with no lower bound (-inf) should fail; the lower bound must be finite to check the refund deadline", + "execution_result": "success", + "included_in_aggregates": false, + "memory_units": 21494, + "name": "refund_infinite_lower_bound" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.63.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 0.127786625, + "block_memory_budget_pct": 0.0799875, + "cpu_units": { + "maximum": 25557325, + "median": 20465280, + "minimum": 13533008, + "sum": 194498006 + }, + "excluded": { + "count": 37, + "cpu_units": { + "maximum": 21245672, + "sum": 98941187 + }, + "memory_units": { + "maximum": 42511, + "sum": 108968 + } + }, + "execution_fee_lovelace": 40710, + "memory_units": { + "maximum": 57591, + "median": 49360, + "minimum": 32162, + "sum": 462494 + }, + "reference_script_fee_lovelace": 14850, + "script_size_bytes": 990, + "scripts_per_block": 782, + "scripts_per_tx": 286, + "term_size": 783, + "total_fee_lovelace": 55560, + "tx_cpu_budget_pct": 0.25557325, + "tx_memory_budget_pct": 0.34903636363636364 + }, + "scenario": "two_party_escrow", + "timestamp": "2026-10-28T19:45:28Z", + "version": "2.0.0", + "notes": "Generated using UPLC-CAPE measure tool" +} diff --git a/submissions/two_party_escrow/Scalus_1.4.0_nau/two_party_escrow.uplc b/submissions/two_party_escrow/Scalus_1.4.0_nau/two_party_escrow.uplc new file mode 100644 index 00000000..a1394ed9 --- /dev/null +++ b/submissions/two_party_escrow/Scalus_1.4.0_nau/two_party_escrow.uplc @@ -0,0 +1,1495 @@ +(program + 1.1.0 + (case + (constr + 0 + (force (builtin dropList)) + (force (force (builtin fstPair))) + (force (builtin headList)) + (force (builtin mkCons)) + (force (force (builtin sndPair))) + (force (builtin tailList)) + ) + (lam + __DropList-0 + (lam + __FstPair-1 + (lam + __HeadList-2 + (lam + __MkCons-3 + (lam + __SndPair-4 + (lam + __TailList-5 + [ + (lam + scalus_cardano_onchain_plutus_v3_TxInfo__isSignedBy'626-6 + [ + (lam + scalus_examples_cape_twopartyescrow_TwoPartyEscrowValidator__requireDeposited'841-7 + [ + (lam + scalus_examples_cape_twopartyescrow_TwoPartyEscrowValidator__settle'1016-8 + (lam + sc_proxy1_102492'1074-9 + [ + (lam + sc_proxy1_102492r'1075-10 + [ + (lam + __cse___DropList_c-11 + [ + (lam + _match_scrutinee'1077-12 + (case + [ + __FstPair-1 + _match_scrutinee'1077-12 + ] + (error) + [ + (lam + __cse_EqI_UnI_action_102496'1084-13 + (case + [ + __cse_EqI_UnI_action_102496'1084-13 + (con integer 0) + ] + [ + (lam + __cse___SndPair__match_scrutinee'1077-14 + [ + (lam + _match_datalist'1080_t-15 + (case + [ + __cse_EqI_UnI_action_102496'1084-13 + (con integer 1) + ] + (case + [ + __cse_EqI_UnI_action_102496'1084-13 + (con integer 2) + ] + (error) + (case + (constr + 0 + [ + __HeadList-2 + _match_datalist'1080_t-15 + ] + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + sc_proxy1_102492r'1075-10 + ] + ] + ] + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + __cse___SndPair__match_scrutinee'1077-14 + ] + ] + ] + ) + (lam + datum_67281'1050-16 + (lam + txInfo_67282'1051-17 + (lam + txOutRef_67283'1052-18 + [ + (lam + d_67320'1053-19 + [ + (lam + __cse_c-20 + [ + (lam + __TwoPartyEscrowValidator_line_99_0'1056-21 + [ + (lam + __TwoPartyEscrowValidator_line_100_0'1062-22 + (case + (constr + 0 + txInfo_67282'1051-17 + txOutRef_67283'1052-18 + __cse_c-20 + (con + string + "Buyer must receive exactly escrow price" + ) + ) + scalus_examples_cape_twopartyescrow_TwoPartyEscrowValidator__settle'1016-8 + ) + ) + (case + [ + [ + (lam + self_333335'1034-23 + (lam + time_333336'1035-24 + [ + (lam + __cse___SndPair_UnConstr___HeadList_self_333335'1034-25 + [ + (lam + _match_scrutinee'1038-26 + (case + [ + __FstPair-1 + _match_scrutinee'1038-26 + ] + (con + bool + False + ) + [ + (lam + _match_datalist'1041-27 + (case + (case + [ + __FstPair-1 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-5 + __cse___SndPair_UnConstr___HeadList_self_333335'1034-25 + ] + ] + ] + ] + (con + bool + False + ) + (con + bool + True + ) + ) + [ + [ + (builtin + lessThanEqualsInteger + ) + time_333336'1035-24 + ] + [ + (builtin + unIData + ) + [ + __HeadList-2 + _match_datalist'1041-27 + ] + ] + ] + [ + [ + (builtin + lessThanInteger + ) + time_333336'1035-24 + ] + [ + (builtin + unIData + ) + [ + __HeadList-2 + _match_datalist'1041-27 + ] + ] + ] + ) + ) + [ + __SndPair-4 + _match_scrutinee'1038-26 + ] + ] + (con + bool + False + ) + ) + ) + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + __cse___SndPair_UnConstr___HeadList_self_333335'1034-25 + ] + ] + ] + ) + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + self_333335'1034-23 + ] + ] + ] + ] + ) + ) + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 7 + ) + ] + txInfo_67282'1051-17 + ] + ] + ] + ] + ] + [ + [ + (builtin + addInteger + ) + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + __TailList-5 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + d_67320'1053-19 + ] + ] + ] + ] + ] + ] + (con + integer + 1800000 + ) + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (case + [ + [ + scalus_cardano_onchain_plutus_v3_TxInfo__isSignedBy'626-6 + txInfo_67282'1051-17 + ] + __cse_c-20 + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (con + bytestring + #aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ) + ] + ) + [ + scalus_examples_cape_twopartyescrow_TwoPartyEscrowValidator__requireDeposited'841-7 + datum_67281'1050-16 + ] + ] + ) + ) + ) + ) + ) + (case + (constr + 0 + [ + __HeadList-2 + _match_datalist'1080_t-15 + ] + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + sc_proxy1_102492r'1075-10 + ] + ] + ] + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + __cse___SndPair__match_scrutinee'1077-14 + ] + ] + ] + ) + (lam + datum_67278'1017-28 + (lam + txInfo_67279'1018-29 + (lam + txOutRef_67280'1019-30 + [ + (lam + __TwoPartyEscrowValidator_line_92_0'1020-31 + [ + (lam + __cse_c_1-32 + [ + (lam + __TwoPartyEscrowValidator_line_93_0'1023-33 + (case + (constr + 0 + txInfo_67279'1018-29 + txOutRef_67280'1019-30 + __cse_c_1-32 + (con + string + "Seller must receive exactly escrow price" + ) + ) + scalus_examples_cape_twopartyescrow_TwoPartyEscrowValidator__settle'1016-8 + ) + ) + (case + [ + [ + scalus_cardano_onchain_plutus_v3_TxInfo__isSignedBy'626-6 + txInfo_67279'1018-29 + ] + __cse_c_1-32 + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (con + bytestring + #bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + ) + ] + ) + [ + scalus_examples_cape_twopartyescrow_TwoPartyEscrowValidator__requireDeposited'841-7 + datum_67278'1017-28 + ] + ] + ) + ) + ) + ) + ) + ) + [ + __TailList-5 + __cse___SndPair__match_scrutinee'1077-14 + ] + ] + ) + [ + __SndPair-4 + _match_scrutinee'1077-12 + ] + ] + [ + (lam + txInfo_67277'789-34 + [ + (lam + __TwoPartyEscrowValidator_line_73_0'792-35 + [ + (lam + depositTime_67284'803-36 + [ + (lam + output_67285r'820-37 + [ + (lam + __TwoPartyEscrowValidator_line_83_0'821-38 + [ + (lam + __TwoPartyEscrowValidator_line_84_0'825-39 + (case + (case + [ + __FstPair-1 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 3 + ) + ] + output_67285r'820-37 + ] + ] + ] + ] + (con + bool + False + ) + (con + bool + True + ) + ) + (error + + ) + (con + unit + () + ) + ) + ) + (case + [ + [ + (builtin + equalsData + ) + [ + __HeadList-2 + [ + __cse___DropList_c-11 + output_67285r'820-37 + ] + ] + ] + [ + [ + (builtin + constrData + ) + (con + integer + 2 + ) + ] + [ + [ + __MkCons-3 + [ + [ + (builtin + constrData + ) + (con + integer + 0 + ) + ] + [ + [ + __MkCons-3 + (con + data + (Constr 0 + [ ]) + ) + ] + [ + [ + __MkCons-3 + [ + (builtin + iData + ) + depositTime_67284'803-36 + ] + ] + (con + (list data) + [ ] + ) + ] + ] + ] + ] + (con + (list data) + [ ] + ) + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (case + [ + [ + (builtin + equalsData + ) + [ + __HeadList-2 + [ + __TailList-5 + output_67285r'820-37 + ] + ] + ] + (con + data + (Map + [ ( B # + , Map + [ ( B # + , I 75000000 ) ] ) ]) + ) + ] + (error) + (con + unit () + ) + ) + ] + ) + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + (case + (constr + 0 + [ + (builtin + unListData + ) + [ + __HeadList-2 + [ + __cse___DropList_c-11 + txInfo_67277'789-34 + ] + ] + ] + (lam + xIn'812-40 + (case + [ + __FstPair-1 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + xIn'812-40 + ] + ] + ] + ] + ] + ] + ] + ] + (con + bool + False + ) + (con + bool + True + ) + ) + ) + (lam + __4_102676'817-41 + (error + + ) + ) + ) + (lam + self_94079'643-42 + (lam + predicate_94080'644-43 + (lam + orElse_94081'645-44 + [ + [ + (lam + go_94085'646-45 + [ + go_94085'646-45 + go_94085'646-45 + ] + ) + (lam + go_94085'646_cse-46 + (lam + list_94086'647-47 + (case + list_94086'647-47 + (lam + consHead'649-48 + (lam + consTail'650-49 + (case + [ + predicate_94080'644-43 + consHead'649-48 + ] + [ + [ + go_94085'646_cse-46 + go_94085'646_cse-46 + ] + consTail'650-49 + ] + (case + [ + [ + (lam + scalus_cardano_onchain_plutus_prelude_List__forall_sat'637-50 + [ + scalus_cardano_onchain_plutus_prelude_List__forall_sat'637-50 + scalus_cardano_onchain_plutus_prelude_List__forall_sat'637-50 + ] + ) + (lam + scalus_cardano_onchain_plutus_prelude_List__forall_sat'637_cse-51 + (lam + self_92983'638-52 + (case + self_92983'638-52 + (lam + consHead'640-53 + (lam + consTail'641-54 + (case + (case + [ + predicate_94080'644-43 + consHead'640-53 + ] + (con + bool + True + ) + (con + bool + False + ) + ) + (con + bool + False + ) + [ + [ + scalus_cardano_onchain_plutus_prelude_List__forall_sat'637_cse-51 + scalus_cardano_onchain_plutus_prelude_List__forall_sat'637_cse-51 + ] + consTail'641-54 + ] + ) + ) + ) + (con + bool + True + ) + ) + ) + ) + ] + consTail'650-49 + ] + [ + orElse_94081'645-44 + (con + unit + () + ) + ] + consHead'649-48 + ) + ) + ) + ) + [ + orElse_94081'645-44 + (con + unit + () + ) + ] + ) + ) + ) + ] + self_94079'643-42 + ] + ) + ) + ) + ) + ] + ] + ] + ) + [ + [ + (builtin + subtractInteger + ) + [ + (lam + _match_scrutinee'796-55 + (case + [ + __FstPair-1 + _match_scrutinee'796-55 + ] + (error) + [ + (builtin + unIData + ) + [ + __HeadList-2 + [ + __SndPair-4 + _match_scrutinee'796-55 + ] + ] + ] + (error) + ) + ) + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-5 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 7 + ) + ] + txInfo_67277'789-34 + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + (con integer 1) + ] + ] + ) + (case + [ + [ + scalus_cardano_onchain_plutus_v3_TxInfo__isSignedBy'626-6 + txInfo_67277'789-34 + ] + (con + bytestring + #aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ) + ] + (error) + (con unit ()) + ) + ] + ) + [ + __SndPair-4 + [ + (builtin unConstrData) + [ + __HeadList-2 + sc_proxy1_102492r'1075-10 + ] + ] + ] + ] + ) + ) + [ + (builtin equalsInteger) + [ + (builtin unIData) + [ + __HeadList-2 + [ + __TailList-5 + sc_proxy1_102492r'1075-10 + ] + ] + ] + ] + ] + (error) + (error) + (error) + (error) + ) + ) + [ + (builtin unConstrData) + [ + __HeadList-2 + [ + __cse___DropList_c-11 + sc_proxy1_102492r'1075-10 + ] + ] + ] + ] + ) + [ __DropList-0 (con integer 2) ] + ] + ) + [ + __SndPair-4 + [ + (builtin unConstrData) + sc_proxy1_102492'1074-9 + ] + ] + ] + ) + ) + (lam + txInfo_67316'978-56 + (lam + txOutRef_67317'979-57 + [ + (lam + __cse_ConstrData_c-58 + [ + (lam + txOutRef_67317r'988-59 + (lam + party_67318'980-60 + [ + (lam + party_67318r'993-61 + (lam + message_67319'981-62 + [ + (lam + ownCredential_67328'992-63 + [ + (lam + partyCredential_67329'994-64 + (case + [ + [ + (builtin + equalsInteger + ) + [ + (builtin unIData) + (case + (constr + 0 + [ + (builtin + unListData + ) + [ + __HeadList-2 + [ + [ + __DropList-0 + (con + integer + 2 + ) + ] + txInfo_67316'978-56 + ] + ] + ] + (con + data (I 0) + ) + (lam + xIn'1010-65 + [ + (lam + xIn'1010r'1011-66 + (lam + xIn'1012-67 + [ + (builtin + iData + ) + [ + (lam + out_67383'1005-68 + [ + (lam + credential_67384'1007-69 + (case + [ + [ + (builtin + equalsData + ) + credential_67384'1007-69 + ] + ownCredential_67328'992-63 + ] + (case + [ + [ + (builtin + equalsData + ) + credential_67384'1007-69 + ] + partyCredential_67329'994-64 + ] + xIn'1010r'1011-66 + [ + [ + (builtin + addInteger + ) + xIn'1010r'1011-66 + ] + (case + (constr + 0 + (con + bytestring + # + ) + (con + bytestring + # + ) + [ + (builtin + unValueData + ) + [ + __HeadList-2 + [ + __TailList-5 + out_67383'1005-68 + ] + ] + ] + ) + (builtin + lookupCoin + ) + ) + ] + ) + (error + + ) + ) + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + out_67383'1005-68 + ] + ] + ] + ] + ] + ) + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + xIn'1012-67 + ] + ] + ] + ] + ) + ) + [ + (builtin + unIData + ) + xIn'1010-65 + ] + ] + ) + ) + (lam + self_91549'848-70 + (lam + init_91551'849-71 + (lam + combiner_91552'850-72 + (case + (constr + 0 + (lam + scalus_cardano_onchain_plutus_prelude_List__foldLeft_sat'851_cse-73 + (lam + self_91549'852-74 + (lam + init_91551'853-75 + (case + self_91549'852-74 + (lam + consHead'855-76 + (lam + consTail'856-77 + (case + (constr + 0 + scalus_cardano_onchain_plutus_prelude_List__foldLeft_sat'851_cse-73 + consTail'856-77 + [ + [ + combiner_91552'850-72 + init_91551'853-75 + ] + consHead'855-76 + ] + ) + scalus_cardano_onchain_plutus_prelude_List__foldLeft_sat'851_cse-73 + ) + ) + ) + init_91551'853-75 + ) + ) + ) + ) + self_91549'848-70 + init_91551'849-71 + ) + (lam + scalus_cardano_onchain_plutus_prelude_List__foldLeft_sat'851-78 + [ + scalus_cardano_onchain_plutus_prelude_List__foldLeft_sat'851-78 + scalus_cardano_onchain_plutus_prelude_List__foldLeft_sat'851-78 + ] + ) + ) + ) + ) + ) + ) + ] + ] + (con integer 75000000) + ] + (error) + (con unit ()) + ) + ) + [ + __cse_ConstrData_c-58 + [ + [ + __MkCons-3 + party_67318r'993-61 + ] + (con (list data) []) + ] + ] + ] + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin unConstrData) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + [ + __HeadList-2 + [ + __TailList-5 + [ + [ + (lam + go_102693'982-79 + [ + go_102693'982-79 + go_102693'982-79 + ] + ) + (lam + go_102693'982_cse-80 + (lam + inputs_102694'983-81 + (case + inputs_102694'983-81 + (lam + consHead'985-82 + (lam + consTail'986-83 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + (case + [ + [ + (builtin + equalsData + ) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin + unConstrData + ) + consHead'985-82 + ] + ] + ] + ] + txOutRef_67317r'988-59 + ] + [ + __cse_ConstrData_c-58 + [ + [ + go_102693'982_cse-80 + go_102693'982_cse-80 + ] + consTail'986-83 + ] + ] + consHead'985-82 + ) + ] + ] + ) + ) + (error + + ) + ) + ) + ) + ] + [ + (builtin + unListData + ) + [ + __HeadList-2 + txInfo_67316'978-56 + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ) + ) + [ (builtin bData) party_67318'980-60 ] + ] + ) + ) + [ + __cse_ConstrData_c-58 + txOutRef_67317'979-57 + ] + ] + ) + [ (builtin constrData) (con integer 0) ] + ] + ) + ) + ] + ) + (lam + datum_67315'827-84 + [ + (lam + d_67324'833-85 + [ + (lam + __TwoPartyEscrowValidator_line_110_0'840-86 + d_67324'833-85 + ) + (case + [ + __FstPair-1 + [ + (builtin unConstrData) + [ + __HeadList-2 + [ + __SndPair-4 + [ + (builtin unConstrData) d_67324'833-85 + ] + ] + ] + ] + ] + (con unit ()) + (error) + (error) + ) + ] + ) + [ + (lam + _match_scrutinee'828-87 + (case + [ __FstPair-1 _match_scrutinee'828-87 ] + [ + __HeadList-2 + [ __SndPair-4 _match_scrutinee'828-87 ] + ] + (error) + ) + ) + [ (builtin unConstrData) datum_67315'827-84 ] + ] + ] + ) + ] + ) + (lam + self_336402'621-88 + (lam + pubKeyHash_336403'622-89 + [ + [ + (lam + self_98374'69-90 + (lam + elemData_98378'71-91 + [ + [ + (lam + go_98379'72-92 + [ go_98379'72-92 go_98379'72-92 ] + ) + (lam + go_98379'72_cse-93 + (lam + lst_98384'73-94 + (case + lst_98384'73-94 + (lam + consHead'75-95 + (lam + consTail'76-96 + (case + [ + [ + (builtin equalsData) + consHead'75-95 + ] + elemData_98378'71-91 + ] + [ + [ + go_98379'72_cse-93 + go_98379'72_cse-93 + ] + consTail'76-96 + ] + (con bool True) + ) + ) + ) + (con bool False) + ) + ) + ) + ] + self_98374'69-90 + ] + ) + ) + [ + (builtin unListData) + [ + __HeadList-2 + [ + [ __DropList-0 (con integer 8) ] + self_336402'621-88 + ] + ] + ] + ] + [ (builtin bData) pubKeyHash_336403'622-89 ] + ] + ) + ) + ] + ) + ) + ) + ) + ) + ) + ) +)