Skip to content

Conversation

@Unisay
Copy link
Contributor

@Unisay Unisay commented Dec 9, 2025

Summary

Optimizes the CEK machine's handling of VConstr by simplifying type conversions and updating documentation.

Changes

1. Simplified Type Conversion

Before:

| fromIntegral @_ @Integer i > fromIntegral @Int @Integer maxBound ->

After:

| i > fromIntegral @Int @Word64 maxBound ->

Since i is already Word64, we can directly compare it to maxBound :: Int converted to Word64, eliminating the unnecessary intermediate conversion through Integer. This is more efficient and clearer.

2. Updated Documentation

Updated Note [Integral types as Integer] to clarify that all non-64-bit systems (not just 32-bit) are banned for node deployment. Changed wording from "we don't care about" to "64-bit systems are required for" for better tone.

Related

Fixes #7478

Simplify the type conversion in VConstr index validation by
eliminating unnecessary intermediate conversion through Integer.

Changed from:
  fromIntegral @_ @integer i > fromIntegral @int @integer maxBound
To:
  i > fromIntegral @int @Word64 maxBound

Since i is already Word64, we can directly compare it to maxBound
converted to Word64, which is more efficient and clearer.

Also updated Note [Integral types as Integer] to clarify that all
non-64-bit systems (not just 32-bit) are banned for node deployment.

Fixes #7478
@Unisay Unisay requested a review from SeungheonOh December 9, 2025 10:16
@Unisay Unisay self-assigned this Dec 9, 2025
@Unisay Unisay added the No Changelog Required Add this to skip the Changelog Check label Dec 9, 2025
@Unisay Unisay requested a review from a team December 9, 2025 12:27
@SeungheonOh
Copy link
Collaborator

/benchmark validation

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Click here to check the status of your benchmark.

@SeungheonOh
Copy link
Collaborator

/benchmark casing

@SeungheonOh
Copy link
Collaborator

SeungheonOh commented Dec 9, 2025

/benchmark lists

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Comparing benchmark results of 'validation' on 'dd37ea88ba' (base) and 'ab471bee84' (PR)

Results table
Script dd37ea8 ab471be Change
auction_1-1 165.4 μs 165.7 μs +0.2%
auction_1-2 538.7 μs 541.2 μs +0.5%
auction_1-3 532.0 μs 538.3 μs +1.2%
auction_1-4 213.9 μs 215.2 μs +0.6%
auction_2-1 165.8 μs 165.7 μs -0.1%
auction_2-2 535.6 μs 539.6 μs +0.7%
auction_2-3 696.5 μs 699.7 μs +0.5%
auction_2-4 531.3 μs 535.9 μs +0.9%
auction_2-5 213.9 μs 215.5 μs +0.7%
coop-1 226.1 μs 231.2 μs +2.3%
coop-2 726.0 μs 731.5 μs +0.8%
coop-3 2.003 ms 1.982 ms -1.0%
coop-4 885.5 μs 904.9 μs +2.2%
coop-5 389.5 μs 393.9 μs +1.1%
coop-6 670.9 μs 677.3 μs +1.0%
coop-7 323.6 μs 329.3 μs +1.8%
crowdfunding-success-1 193.8 μs 195.9 μs +1.1%
crowdfunding-success-2 193.8 μs 195.4 μs +0.8%
crowdfunding-success-3 194.0 μs 195.3 μs +0.7%
currency-1 215.9 μs 216.3 μs +0.2%
escrow-redeem_1-1 305.5 μs 307.8 μs +0.8%
escrow-redeem_1-2 307.3 μs 307.6 μs +0.1%
escrow-redeem_2-1 355.4 μs 355.5 μs +0.0%
escrow-redeem_2-2 355.3 μs 356.4 μs +0.3%
escrow-redeem_2-3 354.1 μs 356.2 μs +0.6%
escrow-refund-1 143.2 μs 144.2 μs +0.7%
future-increase-margin-1 215.6 μs 216.9 μs +0.6%
future-increase-margin-2 459.9 μs 459.6 μs -0.1%
future-increase-margin-3 459.2 μs 460.6 μs +0.3%
future-increase-margin-4 416.5 μs 418.1 μs +0.4%
future-increase-margin-5 702.9 μs 701.9 μs -0.1%
future-pay-out-1 215.8 μs 216.5 μs +0.3%
future-pay-out-2 458.4 μs 459.7 μs +0.3%
future-pay-out-3 459.1 μs 459.8 μs +0.2%
future-pay-out-4 701.0 μs 701.5 μs +0.1%
future-settle-early-1 215.4 μs 215.9 μs +0.2%
future-settle-early-2 458.5 μs 459.2 μs +0.2%
future-settle-early-3 460.0 μs 459.1 μs -0.2%
future-settle-early-4 531.6 μs 532.7 μs +0.2%
game-sm-success_1-1 335.6 μs 338.7 μs +0.9%
game-sm-success_1-2 185.7 μs 186.6 μs +0.5%
game-sm-success_1-3 537.0 μs 540.0 μs +0.6%
game-sm-success_1-4 214.1 μs 216.6 μs +1.2%
game-sm-success_2-1 337.1 μs 339.3 μs +0.7%
game-sm-success_2-2 185.0 μs 186.3 μs +0.7%
game-sm-success_2-3 536.9 μs 540.0 μs +0.6%
game-sm-success_2-4 214.2 μs 215.9 μs +0.8%
game-sm-success_2-5 537.8 μs 542.2 μs +0.8%
game-sm-success_2-6 214.3 μs 216.4 μs +1.0%
multisig-sm-01 341.8 μs 344.3 μs +0.7%
multisig-sm-02 334.3 μs 334.6 μs +0.1%
multisig-sm-03 335.4 μs 336.9 μs +0.4%
multisig-sm-04 338.0 μs 338.7 μs +0.2%
multisig-sm-05 473.8 μs 474.7 μs +0.2%
multisig-sm-06 339.3 μs 343.5 μs +1.2%
multisig-sm-07 333.6 μs 334.8 μs +0.4%
multisig-sm-08 333.6 μs 335.9 μs +0.7%
multisig-sm-09 336.2 μs 338.2 μs +0.6%
multisig-sm-10 473.5 μs 474.2 μs +0.1%
ping-pong-1 284.2 μs 286.0 μs +0.6%
ping-pong-2 284.1 μs 285.8 μs +0.6%
ping-pong_2-1 178.7 μs 179.6 μs +0.5%
prism-1 154.9 μs 157.4 μs +1.6%
prism-2 352.4 μs 356.8 μs +1.2%
prism-3 322.4 μs 324.0 μs +0.5%
pubkey-1 133.0 μs 133.7 μs +0.5%
stablecoin_1-1 814.2 μs 810.9 μs -0.4%
stablecoin_1-2 181.6 μs 182.7 μs +0.6%
stablecoin_1-3 930.6 μs 927.7 μs -0.3%
stablecoin_1-4 191.6 μs 193.7 μs +1.1%
stablecoin_1-5 1.185 ms 1.182 ms -0.3%
stablecoin_1-6 235.9 μs 239.4 μs +1.5%
stablecoin_2-1 811.5 μs 810.0 μs -0.2%
stablecoin_2-2 180.7 μs 183.1 μs +1.3%
stablecoin_2-3 932.0 μs 928.0 μs -0.4%
stablecoin_2-4 191.5 μs 193.2 μs +0.9%
token-account-1 165.6 μs 166.2 μs +0.4%
token-account-2 290.0 μs 291.8 μs +0.6%
uniswap-1 343.3 μs 342.2 μs -0.3%
uniswap-2 196.8 μs 197.3 μs +0.3%
uniswap-3 1.474 ms 1.478 ms +0.3%
uniswap-4 302.5 μs 308.4 μs +2.0%
uniswap-5 991.0 μs 995.9 μs +0.5%
uniswap-6 289.0 μs 292.6 μs +1.2%
vesting-1 300.4 μs 300.6 μs +0.1%
dd37ea8 ab471be Change
TOTAL 35.84 ms 35.98 ms +0.4%

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Click here to check the status of your benchmark.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Comparing benchmark results of 'casing' on 'dd37ea88ba' (base) and 'ab471bee84' (PR)

Results table
Script dd37ea8 ab471be Change
casing/pairFstSnd/2000 552.8 μs 564.8 μs +2.2%
casing/pairFstSnd/4000 1.218 ms 1.246 ms +2.3%
casing/pairFstSnd/6000 2.049 ms 2.092 ms +2.1%
casing/pairFstSnd/8000 2.956 ms 2.992 ms +1.2%
casing/pairFstSnd/10000 3.902 ms 3.969 ms +1.7%
casing/pairFstSnd/12000 4.730 ms 4.810 ms +1.7%
casing/pairCasing/2000 335.9 μs 332.7 μs -1.0%
casing/pairCasing/4000 788.9 μs 781.6 μs -0.9%
casing/pairCasing/6000 1.433 ms 1.417 ms -1.1%
casing/pairCasing/8000 2.200 ms 2.184 ms -0.7%
casing/pairCasing/10000 3.042 ms 3.010 ms -1.1%
casing/pairCasing/12000 3.935 ms 3.913 ms -0.6%
casing/chooseUnit/2000 225.4 μs 224.8 μs -0.3%
casing/chooseUnit/4000 500.8 μs 501.9 μs +0.2%
casing/chooseUnit/6000 824.7 μs 820.6 μs -0.5%
casing/chooseUnit/8000 1.205 ms 1.203 ms -0.2%
casing/chooseUnit/10000 1.693 ms 1.697 ms +0.2%
casing/chooseUnit/12000 2.271 ms 2.276 ms +0.2%
casing/unitCasing/2000 36.56 μs 38.48 μs +5.3%
casing/unitCasing/4000 72.46 μs 75.62 μs +4.4%
casing/unitCasing/6000 107.9 μs 116.0 μs +7.5%
casing/unitCasing/8000 143.5 μs 148.2 μs +3.3%
casing/unitCasing/10000 178.6 μs 182.9 μs +2.4%
casing/unitCasing/12000 206.5 μs 216.5 μs +4.8%
casing/headList/2000 236.9 μs 246.8 μs +4.2%
casing/headList/4000 494.1 μs 516.8 μs +4.6%
casing/headList/6000 773.9 μs 807.4 μs +4.3%
casing/headList/8000 1.080 ms 1.126 ms +4.3%
casing/headList/10000 1.426 ms 1.484 ms +4.1%
casing/headList/12000 1.814 ms 1.882 ms +3.7%
casing/headListCasing/2000 153.4 μs 151.9 μs -1.0%
casing/headListCasing/4000 328.5 μs 328.1 μs -0.1%
casing/headListCasing/6000 529.0 μs 526.4 μs -0.5%
casing/headListCasing/8000 774.8 μs 769.8 μs -0.6%
casing/headListCasing/10000 1.070 ms 1.062 ms -0.7%
casing/headListCasing/12000 1.421 ms 1.416 ms -0.4%
casing/bool/2000 35.01 μs 38.49 μs +9.9%
casing/bool/4000 70.91 μs 75.74 μs +6.8%
casing/bool/6000 105.9 μs 113.0 μs +6.7%
casing/bool/8000 140.6 μs 149.9 μs +6.6%
casing/bool/10000 181.0 μs 186.7 μs +3.1%
casing/bool/12000 216.8 μs 223.1 μs +2.9%
casing/bool 32.85 μs 35.65 μs +8.5%
casing/bool 64.54 μs 71.21 μs +10.3%
casing/bool 98.12 μs 97.26 μs -0.9%
casing/bool 130.4 μs 138.2 μs +6.0%
casing/bool 163.7 μs 167.1 μs +2.1%
casing/bool 194.8 μs 206.2 μs +5.9%
casing/integer/2000 42.95 μs 47.04 μs +9.5%
casing/integer/4000 83.44 μs 93.58 μs +12.2%
casing/integer/6000 125.2 μs 139.3 μs +11.3%
casing/integer/8000 168.9 μs 187.0 μs +10.7%
casing/integer/10000 195.8 μs 232.4 μs +18.7%
casing/integer/12000 248.8 μs 280.1 μs +12.6%
casing/list/2000 124.0 μs 122.9 μs -0.9%
casing/list/4000 280.1 μs 283.2 μs +1.1%
casing/list/6000 474.3 μs 475.9 μs +0.3%
casing/list/8000 698.7 μs 702.8 μs +0.6%
casing/list/10000 986.4 μs 987.8 μs +0.1%
casing/list/12000 1.348 ms 1.350 ms +0.1%
casing/list 122.3 μs 122.3 μs 0.0%
casing/list 279.4 μs 280.2 μs +0.3%
casing/list 471.6 μs 473.1 μs +0.3%
casing/list 699.0 μs 698.5 μs -0.1%
casing/list 981.8 μs 975.8 μs -0.6%
casing/list 1.338 ms 1.331 ms -0.5%
casing/regularApply/3 589.5 ns 579.5 ns -1.7%
casing/regularApply/10 690.2 ns 687.9 ns -0.3%
casing/regularApply/30 970.3 ns 970.2 ns -0.0%
casing/regularApply/100 2.120 μs 2.098 μs -1.0%
casing/regularApply/500 8.985 μs 8.849 μs -1.5%
casing/regularApply/1000 18.38 μs 18.08 μs -1.6%
casing/caseApply/3 640.8 ns 624.8 ns -2.5%
casing/caseApply/10 784.8 ns 765.3 ns -2.5%
casing/caseApply/30 1.136 μs 1.122 μs -1.2%
casing/caseApply/100 2.756 μs 2.760 μs +0.1%
casing/caseApply/500 11.81 μs 11.90 μs +0.8%
casing/caseApply/1000 23.54 μs 23.88 μs +1.4%
dd37ea8 ab471be Change
TOTAL 54.89 ms 55.49 ms +1.1%

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Click here to check the status of your benchmark.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Comparing benchmark results of 'listst' on 'dd37ea88ba' (base) and 'ab471bee84' (PR)

Results table
Script dd37ea8 ab471be Change
dd37ea8 ab471be Change
TOTAL 0.000 ps 0.000 ps -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Changelog Required Add this to skip the Changelog Check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The CEK machine handles VConstr suboptimally

3 participants