Skip to content
Closed
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
4 changes: 2 additions & 2 deletions 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-18 18:56:34 CEST
Generated on: 2025-08-20 00:56:44 CDT
</div>

<div class="benchmark-section">
Expand Down Expand Up @@ -193,7 +193,7 @@ <h3>📋 Performance Data</h3>
</thead>
<tbody>
<tr>
<td>2025-08-18T16:56:26Z</td>
<td>2025-08-20T05:56:42Z</td>
<td>Plinth</td>
<td>1.52.0.0</td>
<td>Unisay</td>
Expand Down
19 changes: 15 additions & 4 deletions 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-18 18:56:36 CEST
Generated on: 2025-08-20 00:56:45 CDT
</div>

<div class="benchmark-section">
Expand Down Expand Up @@ -193,7 +193,7 @@ <h3>📋 Performance Data</h3>
</thead>
<tbody>
<tr>
<td>2025-08-18T16:56:26Z</td>
<td>2025-08-20T05:56:42Z</td>
<td>Plinth</td>
<td>1.49.0.0</td>
<td>Unisay</td>
Expand All @@ -204,7 +204,7 @@ <h3>📋 Performance Data</h3>
<td><a href="https://github.com/IntersectMBO/UPLC-CAPE/blob/main/submissions/fibonacci/Plinth_1.49.0.0_Unisay/fibonacci.uplc" target="_blank" rel="noopener">🔗</a></td>
</tr>
<tr>
<td>2025-08-18T16:56:26Z</td>
<td>2025-08-20T05:56:42Z</td>
<td>Plinth</td>
<td>1.52.0.0</td>
<td>Unisay</td>
Expand All @@ -215,7 +215,7 @@ <h3>📋 Performance Data</h3>
<td><a href="https://github.com/IntersectMBO/UPLC-CAPE/blob/main/submissions/fibonacci/Plinth_1.52.0.0_Unisay/fibonacci.uplc" target="_blank" rel="noopener">🔗</a></td>
</tr>
<tr>
<td>2025-08-18T16:56:26Z</td>
<td>2025-08-20T05:56:42Z</td>
<td>Aiken</td>
<td>1.1.17</td>
<td>KtorZ</td>
Expand All @@ -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/factorial_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/factorial_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/factorial_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/factorial_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.
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/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h1>🚀 UPLC-CAPE Performance Reports</h1>
</div>

<div class="timestamp">
Generated on: 2025-08-18 18:56:36 CEST
Generated on: 2025-08-20 00:56:45 CDT
</div>

<div class="benchmark-grid">
Expand Down
27 changes: 27 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,27 @@
# 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-unknown"
},
"measurements": {
"cpu_units": 159193455218,
"memory_units": 583897822,
"script_size_bytes": 50,
"term_size": 43
},
"notes": "<optional notes>",
"scenario": "fibonacci",
"timestamp": "2025-08-20T05:56:42Z",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Optional: Place your source code files here
35 changes: 35 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,35 @@
module Main where

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

-- 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'
Loading