Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion report/benchmarks/factorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ <h1>🚀 UPLC-CAPE Performance Report - factorial</h1>
</div>

<div class="timestamp">
Generated on: 2025-08-20 11:17:51 CEST
Generated on: 2025-08-20 11:38:38 CEST
</div>

<div class="benchmark-section">
Expand Down
13 changes: 12 additions & 1 deletion report/benchmarks/fibonacci.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ <h1>🚀 UPLC-CAPE Performance Report - fibonacci</h1>
</div>

<div class="timestamp">
Generated on: 2025-08-20 11:17:53 CEST
Generated on: 2025-08-20 11:38:40 CEST
</div>

<div class="benchmark-section">
Expand Down Expand Up @@ -225,6 +225,17 @@ <h3>📋 Performance Data</h3>
<td class="numeric">81</td>
<td><a href="https://github.com/IntersectMBO/UPLC-CAPE/blob/main/submissions/fibonacci/Aiken_1.1.17_KtorZ/fibonacci.uplc" target="_blank" rel="noopener">🔗</a></td>
</tr>
<tr>
<td>2025-08-20T05:56:42Z</td>
<td>Plutarch</td>
<td>1.10.1</td>
<td>Seungheon Oh</td>
<td class="numeric">159193455218</td>
<td class="numeric">583897822</td>
<td class="numeric">50</td>
<td class="numeric">43</td>
<td><a href="https://github.com/IntersectMBO/UPLC-CAPE/blob/main/submissions/fibonacci/Plutarch_1.10.1_SeungheonOh/fibonacci.uplc" target="_blank" rel="noopener">🔗</a></td>
</tr>
</tbody>
</table>
</div>
Expand Down
Binary file modified report/benchmarks/images/fibonacci_cpu_units.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified report/benchmarks/images/fibonacci_memory_units.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified report/benchmarks/images/fibonacci_script_size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified report/benchmarks/images/fibonacci_term_size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion report/benchmarks/two-party-escrow.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h1>🚀 UPLC-CAPE Performance Report - two-party-escrow</h1>
</div>

<div class="timestamp">
Generated on: 2025-08-20 11:17:53 CEST
Generated on: 2025-08-20 11:38:40 CEST
</div>

<div class="benchmark-section">
Expand Down
25 changes: 23 additions & 2 deletions report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ <h1>🚀 UPLC-CAPE Performance Reports</h1>
</div>

<div class="timestamp">
Generated on: 2025-08-20 11:17:54 CEST
Generated on: 2025-08-20 11:38:41 CEST
</div>

<!-- Benchmark Summary Table -->
Expand Down Expand Up @@ -308,7 +308,7 @@ <h2>📊 Benchmark Submissions</h2>
</div>
<div class="count">

(3 submissions)
(4 submissions)

</div>
</div>
Expand Down Expand Up @@ -392,6 +392,27 @@ <h2>📊 Benchmark Submissions</h2>
<td class="numeric term-value best-value">38</td>
</tr>

<tr data-cpu="159193455218" data-memory="583897822" data-script="50" data-term="43">
<td>Plutarch</td>
<td>1.10.1</td>
<td>Seungheon Oh</td>
<td>2025-08-20</td>
<td class="numeric">
<span class="tooltip">
<span class="cpu-value">159.19B</span>
<span class="tooltiptext">159193455218</span>
</span>
</td>
<td class="numeric">
<span class="tooltip">
<span class="memory-value">583.90M</span>
<span class="tooltiptext">583897822</span>
</span>
</td>
<td class="numeric script-value">50</td>
<td class="numeric term-value">43</td>
</tr>

</tbody>
</table>

Expand Down
2 changes: 1 addition & 1 deletion submissions/factorial/Plinth_1.52.0.0_Unisay/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
},
"notes": "Generated using UPLC-CAPE measure tool",
"scenario": "factorial",
"timestamp": "2025-08-18T16:56:26Z",
"timestamp": "2025-08-20T09:47:52Z",
"version": "1.0.0"
}
2 changes: 1 addition & 1 deletion submissions/fibonacci/Aiken_1.1.17_KtorZ/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
},
"notes": "Generated using UPLC-CAPE measure tool",
"scenario": "fibonacci",
"timestamp": "2025-08-18T16:56:26Z",
"timestamp": "2025-08-20T09:47:53Z",
"version": "1.0.0"
}
2 changes: 1 addition & 1 deletion submissions/fibonacci/Plinth_1.49.0.0_Unisay/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
},
"notes": "Generated using UPLC-CAPE measure tool",
"scenario": "fibonacci",
"timestamp": "2025-08-18T16:56:26Z",
"timestamp": "2025-08-20T09:47:53Z",
"version": "1.0.0"
}
2 changes: 1 addition & 1 deletion submissions/fibonacci/Plinth_1.52.0.0_Unisay/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
},
"notes": "<optional notes>",
"scenario": "fibonacci",
"timestamp": "2025-08-18T16:56:26Z",
"timestamp": "2025-08-20T09:47:53Z",
"version": "1.0.0"
}
25 changes: 25 additions & 0 deletions submissions/fibonacci/Plutarch_1.10.1_SeungheonOh/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Benchmark Implementation Notes

**Scenario**: `fibonacci`

**Submission ID**: `Plutarch_1.10.1_SeungheonOh`

## Implementation Details

- **Compiler**: `Plutarch v1.10.1`
- **Implementation Approach**: `recursive`
- **Compilation Flags**: N/A

## Performance Results

- See [metrics.json](metrics.json) for detailed performance measurements

## Reproducibility

- **Source Available**: true
- **Source Repository**: N/A
- **Compilation Config**: describe any non-default parameters

## Notes

I provided two different fix point combinator: `pfix'` and `pfix''`. They have different performance trade offs. `pfix'` will generate smaller script with bigger CPU and Memory cost while `pfix''` will generate bigger script(in terms of size) with smaller CPU and Memory cost.
6 changes: 6 additions & 0 deletions submissions/fibonacci/Plutarch_1.10.1_SeungheonOh/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"comment": "Optional: Include compilation parameters that affect UPLC output",
"optimization_flags": [],
"compiler_settings": {},
"build_environment": {}
}
40 changes: 40 additions & 0 deletions submissions/fibonacci/Plutarch_1.10.1_SeungheonOh/fibonacci.uplc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
(program
1.1.0
[
[
(lam i-0 [ i-0 i-0 ])
(lam
i-1
(lam
i-2
(force
(case
(constr
0
[ [ (builtin lessThanEqualsInteger) i-2 ] (con integer 1) ]
(delay i-2)
(delay
[
[
(builtin addInteger)
[
[ i-1 i-1 ]
[ [ (builtin subtractInteger) i-2 ] (con integer 1) ]
]
]
[
[ i-1 i-1 ]
[ [ (builtin subtractInteger) i-2 ] (con integer 2) ]
]
]
)
)
(force (builtin ifThenElse))
)
)
)
)
]
(con integer 25)
]
)
27 changes: 27 additions & 0 deletions submissions/fibonacci/Plutarch_1.10.1_SeungheonOh/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compiler": {
"name": "Plutarch",
"version": "1.10.1",
"commit_hash": "75c06ef1e77742916574414975f76ddac59cce4a"
},
"compilation_config": {
"optimization_level": "Plutarch",
"target": "uplc",
"flags": ["Plutarch"],
"environment": {
"dependencies": {
"plutarch": "1.10.1"
}
}
},
"contributor": {
"name": "Seungheon Oh",
"organization": "IOG",
"contact": "seungheon.oh@iohk.io"
},
"submission": {
"date": "2025-08-19T00:00:00Z",
"source_available": true,
"implementation_notes": "Plutarch"
}
}
15 changes: 15 additions & 0 deletions submissions/fibonacci/Plutarch_1.10.1_SeungheonOh/metrics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"execution_environment": {
"evaluator": "PlutusTx.Eval-1.52.0.0"
},
"measurements": {
"cpu_units": 159193455218,
"memory_units": 583897822,
"script_size_bytes": 50,
"term_size": 43
},
"notes": "<optional notes>",
"scenario": "fibonacci",
"timestamp": "2025-08-20T09:47:54Z",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Optional: Place your source code files here
42 changes: 42 additions & 0 deletions submissions/fibonacci/Plutarch_1.10.1_SeungheonOh/source/fibo.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module Main where

import Control.Lens (traverseOf)
import Plutarch.Internal.Term (compile, punsafeCoerce)
import Plutarch.Prelude
import Plutarch.Script
import PlutusCore (FreeVariableError, runQuoteT)
import PlutusCore.Pretty
import UntypedPlutusCore (
fakeNameDeBruijn,
progTerm,
programMapNames,
unDeBruijnTerm,
)

-- this is faster than `Plutarch.Internal.Fix.pfix`.
pfix' :: (Term s (a :--> b) -> Term s (a :--> b)) -> Term s (a :--> b)
pfix' f =
(plam $ \r -> (punsafeCoerce r) # r)
# (plam $ \r -> f ((punsafeCoerce r) # r))

-- this is faster than `pfix'` but generates more bloat uplc.
pfix'' :: (Term s (a :--> b) -> Term s (a :--> b)) -> Term s (a :--> b)
pfix'' f =
(plam $ \r -> f ((punsafeCoerce r) # r))
# (plam $ \r -> f ((punsafeCoerce r) # r))

pfibo :: Term s (PInteger :--> PInteger)
pfibo =
pfix' $ \r -> plam $ \x ->
pif (x #<= 1) x (r # (x - 1) + r # (x - 2))

main :: IO ()
main =
case compile mempty $ pfibo # 25 of
Left _ -> error "compiliation failed"
Right (Script s) ->
case runQuoteT $
traverseOf progTerm unDeBruijnTerm $
programMapNames fakeNameDeBruijn s of
Left (_ :: FreeVariableError) -> error "debruijn conversion failed"
Right s' -> print $ prettyPlcClassic s'