-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial bitwise primitives * Wire up new builtins * Tests * Changelogs * Fix failing goldens * Fix cost model for tests * Bitwise primitives are not in Conway * Finish shift tests * Fix goldens * Rest of tests * Rename operations * Note about split composition for shift property * Explain bitwise tests in comments, remove AND and OR tests for finding and counting bits * Goldens for bitwise primops * Chop down property test running times a bit * Add test for finding first in zero byte string, rename some tests for clarity * Clarify implementation choices in the comments * Tidy up helpers for property tests * Consolidate all bitwise ops, retarget links to CIPs
- Loading branch information
Showing
25 changed files
with
2,135 additions
and
1,238 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
plutus-core/changelog.d/20240523_124004_koz.ross_bitwise_2.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!-- | ||
A new scriv changelog fragment. | ||
Uncomment the section that is right (remove the HTML comment wrapper). | ||
--> | ||
|
||
<!-- | ||
### Removed | ||
- A bullet item for the Removed category. | ||
--> | ||
### Added | ||
|
||
- Implementation and tests for primitive operations in [this | ||
CIP](https://github.com/mlabs-haskell/CIPs/blob/koz/bitwise/CIP-XXXX/CIP-XXXX.md) | ||
|
||
### Changed | ||
|
||
- Rename `ReplicateByteString` to `ReplicateByte` (and similarly for denotation) | ||
|
||
<!-- | ||
### Deprecated | ||
- A bullet item for the Deprecated category. | ||
--> | ||
<!-- | ||
### Fixed | ||
- A bullet item for the Fixed category. | ||
--> | ||
<!-- | ||
### Security | ||
- A bullet item for the Security category. | ||
--> |
This file contains 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
1,168 changes: 1,168 additions & 0 deletions
1,168
plutus-core/plutus-core/src/PlutusCore/Bitwise.hs
Large diffs are not rendered by default.
Oops, something went wrong.
544 changes: 0 additions & 544 deletions
544
plutus-core/plutus-core/src/PlutusCore/Bitwise/Convert.hs
This file was deleted.
Oops, something went wrong.
464 changes: 0 additions & 464 deletions
464
plutus-core/plutus-core/src/PlutusCore/Bitwise/Logical.hs
This file was deleted.
Oops, something went wrong.
This file contains 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
1 change: 1 addition & 0 deletions
1
plutus-core/plutus-core/test/TypeSynthesis/Golden/DefaultFun/CountSetBits.plc.golden
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bytestring -> integer |
1 change: 1 addition & 0 deletions
1
plutus-core/plutus-core/test/TypeSynthesis/Golden/DefaultFun/FindFirstSetBit.plc.golden
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bytestring -> integer |
1 change: 1 addition & 0 deletions
1
plutus-core/plutus-core/test/TypeSynthesis/Golden/DefaultFun/ReplicateByte.plc.golden
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
integer -> integer -> bytestring |
1 change: 1 addition & 0 deletions
1
plutus-core/plutus-core/test/TypeSynthesis/Golden/DefaultFun/RotateByteString.plc.golden
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bytestring -> integer -> bytestring |
1 change: 1 addition & 0 deletions
1
plutus-core/plutus-core/test/TypeSynthesis/Golden/DefaultFun/ShiftByteString.plc.golden
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bytestring -> integer -> bytestring |
This file contains 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
Oops, something went wrong.
2ec9bf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'Plutus Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.05
.validation-decode-auction_1-1
197.3
μs186.3
μs1.06
validation-decode-auction_1-2
559.8
μs522
μs1.07
validation-decode-auction_1-4
197.3
μs186.8
μs1.06
validation-decode-auction_2-1
197.4
μs186.3
μs1.06
validation-decode-auction_2-2
557.2
μs528.7
μs1.05
validation-decode-auction_2-3
559.8
μs532.7
μs1.05
validation-decode-auction_2-5
197.8
μs186.8
μs1.06
validation-decode-crowdfunding-success-1
241.4
μs228.4
μs1.06
validation-decode-crowdfunding-success-2
241.3
μs228.8
μs1.05
validation-decode-crowdfunding-success-3
241.4
μs228.4
μs1.06
validation-decode-escrow-redeem_1-1
324.2
μs307.2
μs1.06
validation-decode-escrow-redeem_1-2
324.2
μs307.3
μs1.05
validation-decode-escrow-redeem_2-2
324.5
μs309
μs1.05
validation-decode-future-pay-out-1
241.6
μs227.9
μs1.06
validation-decode-uniswap-5
756.3
μs709.5
μs1.07
This comment was automatically generated by workflow using github-action-benchmark.
CC: @IntersectMBO/plutus-core