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
15 changes: 13 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 01:29:56 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-20T06:29:51Z</td>
<td>Plinth</td>
<td>1.52.0.0</td>
<td>Unisay</td>
Expand All @@ -203,6 +203,17 @@ <h3>📋 Performance Data</h3>
<td class="numeric">29</td>
<td><a href="https://github.com/IntersectMBO/UPLC-CAPE/blob/main/submissions/factorial/Plinth_1.52.0.0_Unisay/factorial.uplc" target="_blank" rel="noopener">🔗</a></td>
</tr>
<tr>
<td>2025-08-20T06:29:51Z</td>
<td>Plutarch</td>
<td>Plutarch</td>
<td>Seungheon Oh</td>
<td class="numeric">7845912</td>
<td class="numeric">28362</td>
<td class="numeric">42</td>
<td class="numeric">35</td>
<td><a href="https://github.com/IntersectMBO/UPLC-CAPE/blob/main/submissions/factorial/Plutarch_1.10.1_SeungheonOh/factorial.uplc" target="_blank" rel="noopener">🔗</a></td>
</tr>
</tbody>
</table>
</div>
Expand Down
8 changes: 4 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 01:29:57 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-20T06:29:52Z</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-20T06:29:52Z</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-20T06:29:52Z</td>
<td>Aiken</td>
<td>1.1.17</td>
<td>KtorZ</td>
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 01:29:57 CDT
</div>

<div class="benchmark-grid">
Expand Down
25 changes: 25 additions & 0 deletions submissions/factorial/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**: `factorial`

**Submission ID**: `Plutarch_1.10.1_SeungheonOh` (Format: `Language_Version_GitHubHandle`)

## Implementation Details

- **Compiler**: `<compiler name and version>`
- **Implementation Approach**: `<recursive|iterative|memoized>`
- **Compilation Flags**: `<optional flags>`

## Performance Results

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

## Reproducibility

- **Source Available**: `<true|false>`
- **Source Repository**: `<URL or N/A>`
- **Compilation Config**: describe any non-default parameters

## Notes

Describe any notable optimizations, deviations from the spec, or measurement conditions.
6 changes: 6 additions & 0 deletions submissions/factorial/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": {}
}
34 changes: 34 additions & 0 deletions submissions/factorial/Plutarch_1.10.1_SeungheonOh/factorial.uplc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
(program
1.1.0
[
[
(lam i-0 [ i-0 i-0 ])
(lam
i-1
(lam
i-2
(force
(case
(constr
0
[ [ (builtin equalsInteger) i-2 ] (con integer 0) ]
(delay (con integer 1))
(delay
[
[ (builtin multiplyInteger) i-2 ]
[
[ i-1 i-1 ]
[ [ (builtin subtractInteger) i-2 ] (con integer 1) ]
]
]
)
)
(force (builtin ifThenElse))
)
)
)
)
]
(con integer 10)
]
)
27 changes: 27 additions & 0 deletions submissions/factorial/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": "Plutarch",
"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/factorial/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": 7845912,
"memory_units": 28362,
"script_size_bytes": 42,
"term_size": 35
},
"notes": "<optional notes>",
"scenario": "factorial",
"timestamp": "2025-08-20T06:29:51Z",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Optional: Place your source code files here
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module Main where

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

-- conditional with no hoisting
pif'' :: Term s PBool -> Term s a -> Term s a -> Term s a
pif'' cond ifT ifF =
pforce $ (pforce $ punsafeBuiltin PLC.IfThenElse) # cond # pdelay ifT # pdelay ifF

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))

pfactorial :: Term s (PInteger :--> PInteger)
pfactorial =
-- This is concise, but slower
pfix' $ \r -> plam $ \x -> pif'' (x #== 0) 1 (x * (r # (x - 1)))
-- This bloats the script size, but faster
-- punrollBound 11 perror $ \r -> plam $ \x -> pif (x #== 1) x (x * (r # (x - 1)))

main :: IO ()
main =
case compile mempty $ pfactorial # 10 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