Merged
Conversation
Implement factorial benchmark analogous to fibonacci: - Add factorial.md scenario specification - Implement Factorial.hs module with factorial(10) = 3628800 - Add factorial executable in cabal project - Test shows correct output and performance metrics Related to plutus-private issue #1758
- Merge FactorialMain.hs into Main.hs to generate both fibonacci and factorial UPLC files - Remove separate factorial executable from cabal file - Single fibonacci executable now generates both benchmark files - Verified both programs work correctly: fibonacci(25)=75025, factorial(10)=3628800
- Create complete factorial submission for Plinth 1.52.0.0 - factorial.uplc program computing factorial(10) = 3628800 - Performance metrics: 5.86M CPU units, 21.7K memory units - All validation checks pass - Source code included in submission
- Replace redundant Factorial.hs copy with README link to plinth/src/Factorial.hs - Add README.md files to existing Plinth fibonacci submissions - Use relative paths (../../../../plinth/src/) for GitHub navigation - Eliminates duplicate source code maintenance - Provides clear navigation to original implementation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a factorial benchmark scenario to the UPLC-CAPE benchmarking framework, complementing the existing fibonacci benchmark. The implementation provides a recursive factorial function that computes factorial(10) = 3628800, following the same patterns and structure as the existing fibonacci benchmark.
Key Changes:
- Added factorial benchmark scenario specification and implementation
- Created Factorial.hs module with recursive factorial algorithm
- Generated complete submission with performance metrics and documentation
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scenarios/factorial.md | Comprehensive specification document defining the factorial benchmark requirements, acceptance criteria, and submission guidelines |
| plinth/src/Factorial.hs | Core factorial implementation using PlutusTx with recursive algorithm targeting factorial(10) |
| plinth/uplc-cape-benchmarks.cabal | Updated library to expose the new Factorial module alongside existing Fibonacci module |
| plinth/app/Main.hs | Modified main application to generate factorial.uplc output file in addition to fibonacci.uplc |
| submissions/factorial/Plinth_1.52.0.0_Unisay/* | Complete benchmark submission including UPLC program, metadata, metrics, and documentation |
| submissions/fibonacci/*/source/README.md | Added source code documentation for existing fibonacci submissions |
Remove explanations about what source code contains or does. Keep only the reference link to the source file.
- Update timestamps to current measurement run - Add standardized notes field for metrics generation - Automated updates from measure tool execution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scenarios/factorial.mdspecification for factorial(10) = 3628800 targetKey Results
Files Added/Modified
Test Plan
cabal run fibonaccigenerates both UPLC filesRelated to https://github.com/IntersectMBO/plutus-private/issues/1758