Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noexcept execution #738

Merged
merged 1 commit into from
Mar 11, 2021
Merged

noexcept execution #738

merged 1 commit into from
Mar 11, 2021

Conversation

gumb0
Copy link
Collaborator

@gumb0 gumb0 commented Feb 17, 2021

Requires #716

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #738 (cc6dced) into master (3b73c24) will not change coverage.
The diff coverage is 88.63%.

@@           Coverage Diff           @@
##           master     #738   +/-   ##
=======================================
  Coverage   99.25%   99.25%           
=======================================
  Files          76       76           
  Lines       11571    11571           
=======================================
  Hits        11485    11485           
  Misses         86       86           
Flag Coverage Δ
rust 99.86% <ø> (ø)
spectests 90.53% <100.00%> (ø)
unittests 99.21% <88.63%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/fizzy/execute.hpp 100.00% <ø> (ø)
lib/fizzy/instantiate.hpp 100.00% <ø> (ø)
test/utils/fizzy_engine.cpp 100.00% <ø> (ø)
tools/wasi/wasi.cpp 59.57% <16.66%> (ø)
lib/fizzy/capi.cpp 99.27% <100.00%> (ø)
lib/fizzy/execute.cpp 98.70% <100.00%> (ø)
lib/fizzy/instantiate.cpp 100.00% <100.00%> (ø)
test/unittests/api_test.cpp 100.00% <100.00%> (ø)
test/unittests/execute_call_test.cpp 100.00% <100.00%> (ø)
test/unittests/execute_test.cpp 100.00% <100.00%> (ø)

@gumb0
Copy link
Collaborator Author

gumb0 commented Feb 17, 2021

GCC 10.2 with LTO, #716 vs noexcept

fizzy/instantiate/blake2b_mean                                     -0.0243         -0.0244            68            66            68            66
fizzy/execute/blake2b/512_bytes_rounds_1_mean                      -0.0943         -0.0944           169           154           169           153
fizzy/execute/blake2b/512_bytes_rounds_16_mean                     -0.0883         -0.0884          2514          2292          2514          2292
fizzy/instantiate/ecpairing_mean                                   +0.0341         +0.0340          3386          3501          3386          3501
fizzy/execute/ecpairing/onepoint_mean                              -0.0816         -0.0817        833729        765676        833741        765604
fizzy/instantiate/keccak256_mean                                   +0.0267         +0.0266           112           115           112           115
fizzy/execute/keccak256/512_bytes_rounds_1_mean                    -0.2242         -0.2243           206           160           206           160
fizzy/execute/keccak256/512_bytes_rounds_16_mean                   -0.2146         -0.2147          2944          2313          2944          2312
fizzy/instantiate/memset_mean                                      +0.0144         +0.0143            20            20            20            20
fizzy/execute/memset/256_bytes_mean                                -0.0189         -0.0190            15            14            15            14
fizzy/execute/memset/60000_bytes_mean                              -0.0017         -0.0018          3211          3206          3211          3206
fizzy/instantiate/mul256_opt0_mean                                 -0.0031         -0.0031            25            25            25            25
fizzy/execute/mul256_opt0/input1_mean                              -0.0394         -0.0394            55            53            55            53
fizzy/instantiate/ramanujan_pi_mean                                +0.0240         +0.0239            65            66            65            66
fizzy/execute/ramanujan_pi/33_runs_mean                            -0.0772         -0.0773           239           221           239           221
fizzy/instantiate/sha1_mean                                        +0.0173         +0.0172           102           104           102           104
fizzy/execute/sha1/512_bytes_rounds_1_mean                         -0.1264         -0.1265           185           161           185           161
fizzy/execute/sha1/512_bytes_rounds_16_mean                        -0.1254         -0.1255          2567          2246          2568          2245
fizzy/instantiate/sha256_mean                                      +0.0111         +0.0110           164           166           164           166
fizzy/execute/sha256/512_bytes_rounds_1_mean                       -0.0917         -0.0918           171           155           171           155
fizzy/execute/sha256/512_bytes_rounds_16_mean                      -0.0924         -0.0925          2334          2118          2334          2118
fizzy/instantiate/taylor_pi_mean                                   +0.0080         +0.0079            12            12            12            12
fizzy/execute/taylor_pi/pi_1000000_runs_mean                       -0.0005         -0.0006         89900         89851         89898         89844
fizzy/instantiate/micro/eli_interpreter_mean                       -0.0013         -0.0014            15            15            15            15
fizzy/execute/micro/eli_interpreter/exec105_mean                   -0.1307         -0.1308            10             9            10             9
fizzy/instantiate/micro/factorial_mean                             +0.0204         +0.0206             2             2             2             2
fizzy/execute/micro/factorial/20_mean                              -0.0701         -0.0698             1             1             1             1
fizzy/instantiate/micro/fibonacci_mean                             +0.0021         +0.0024             3             3             3             3
fizzy/execute/micro/fibonacci/24_mean                              -0.0728         -0.0725         10785         10000         10781          9999
fizzy/instantiate/micro/host_adler32_mean                          +0.0451         +0.0454             7             7             7             7
fizzy/execute/micro/host_adler32/1_mean                            -0.0433         -0.0431             0             0             0             0
fizzy/execute/micro/host_adler32/1000_mean                         -0.0479         -0.0476            67            64            67            64
fizzy/instantiate/micro/icall_hash_mean                            +0.0242         +0.0245            13            13            13            13
fizzy/execute/micro/icall_hash/1000_steps_mean                     -0.1498         -0.1496           155           132           155           132
fizzy/instantiate/micro/spinner_mean                               +0.0063         +0.0065             2             2             2             2
fizzy/execute/micro/spinner/1_mean                                 -0.0840         -0.0839             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                              -0.0602         -0.0600            20            18            20            18
fizzy/instantiate/stress/guido-fuzzer-find-1_mean                  +0.0089         +0.0089           354           357           353           357

master vs noexcept

fizzy/instantiate/blake2b_mean                                     -0.0279         -0.0283            68            66            68            66
fizzy/execute/blake2b/512_bytes_rounds_1_mean                      -0.0373         -0.0377           159           154           159           153
fizzy/execute/blake2b/512_bytes_rounds_16_mean                     -0.0382         -0.0385          2383          2292          2384          2292
fizzy/instantiate/ecpairing_mean                                   +0.0054         +0.0051          3483          3501          3483          3501
fizzy/execute/ecpairing/onepoint_mean                              -0.0551         -0.0554        810348        765676        810489        765604
fizzy/instantiate/keccak256_mean                                   -0.0039         -0.0042           116           115           116           115
fizzy/execute/keccak256/512_bytes_rounds_1_mean                    -0.0573         -0.0575           170           160           170           160
fizzy/execute/keccak256/512_bytes_rounds_16_mean                   -0.0577         -0.0580          2454          2313          2455          2312
fizzy/instantiate/memset_mean                                      -0.0028         -0.0031            20            20            20            20
fizzy/execute/memset/256_bytes_mean                                -0.0195         -0.0197            15            14            15            14
fizzy/execute/memset/60000_bytes_mean                              -0.0126         -0.0129          3247          3206          3248          3206
fizzy/instantiate/mul256_opt0_mean                                 -0.0212         -0.0214            25            25            25            25
fizzy/execute/mul256_opt0/input1_mean                              -0.0330         -0.0332            55            53            55            53
fizzy/instantiate/ramanujan_pi_mean                                -0.0058         -0.0061            67            66            67            66
fizzy/execute/ramanujan_pi/33_runs_mean                            -0.0770         -0.0772           239           221           239           221
fizzy/instantiate/sha1_mean                                        -0.0127         -0.0130           105           104           105           104
fizzy/execute/sha1/512_bytes_rounds_1_mean                         -0.1498         -0.1440           190           161           188           161
fizzy/execute/sha1/512_bytes_rounds_16_mean                        -0.1895         -0.1865          2771          2246          2760          2245
fizzy/instantiate/sha256_mean                                      -0.0232         -0.0215           170           166           170           166
fizzy/execute/sha256/512_bytes_rounds_1_mean                       -0.0738         -0.0729           168           155           167           155
fizzy/execute/sha256/512_bytes_rounds_16_mean                      -0.0750         -0.0746          2290          2118          2289          2118
fizzy/instantiate/taylor_pi_mean                                   -0.0028         -0.0025            12            12            12            12
fizzy/execute/taylor_pi/pi_1000000_runs_mean                       -0.0003         +0.0000         89879         89851         89841         89844
fizzy/instantiate/micro/eli_interpreter_mean                       -0.0055         -0.0052            15            15            15            15
fizzy/execute/micro/eli_interpreter/exec105_mean                   -0.1293         -0.1289            10             9            10             9
fizzy/instantiate/micro/factorial_mean                             +0.0125         +0.0129             2             2             2             2
fizzy/execute/micro/factorial/20_mean                              -0.1054         -0.1050             1             1             1             1
fizzy/instantiate/micro/fibonacci_mean                             +0.0111         +0.0115             3             3             3             3
fizzy/execute/micro/fibonacci/24_mean                              -0.0877         -0.0873         10961         10000         10955          9999
fizzy/instantiate/micro/host_adler32_mean                          +0.0206         +0.0181             7             7             7             7
fizzy/execute/micro/host_adler32/1_mean                            -0.0215         -0.0243             0             0             0             0
fizzy/execute/micro/host_adler32/1000_mean                         -0.0031         -0.0049            64            64            64            64
fizzy/instantiate/micro/icall_hash_mean                            +0.0114         +0.0102            13            13            13            13
fizzy/execute/micro/icall_hash/1000_steps_mean                     -0.0777         -0.0784           143           132           143           132
fizzy/instantiate/micro/spinner_mean                               +0.0023         +0.0019             2             2             2             2
fizzy/execute/micro/spinner/1_mean                                 -0.1176         -0.1178             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                              -0.1253         -0.1255            21            18            21            18
fizzy/instantiate/stress/guido-fuzzer-find-1_mean                  +0.0017         +0.0014           356           357           356           357

@chfast
Copy link
Collaborator

chfast commented Feb 17, 2021

Clang11, master vs noexcept:

fizzy/execute/blake2b/512_bytes_rounds_1_mean                     -0.0013         -0.0013            81            80            81            80
fizzy/execute/blake2b/512_bytes_rounds_16_mean                    +0.0026         +0.0026          1212          1215          1212          1215
fizzy/execute/ecpairing/onepoint_mean                             -0.0091         -0.0091        410335        406591        410338        406593
fizzy/execute/keccak256/512_bytes_rounds_1_mean                   -0.0401         -0.0401           102            98           102            98
fizzy/execute/keccak256/512_bytes_rounds_16_mean                  -0.0398         -0.0398          1495          1435          1495          1435
fizzy/execute/memset/256_bytes_mean                               +0.0231         +0.0231             7             7             7             7
fizzy/execute/memset/60000_bytes_mean                             +0.0265         +0.0265          1495          1535          1495          1535
fizzy/execute/mul256_opt0/input1_mean                             -0.0047         -0.0047            29            28            29            28
fizzy/execute/ramanujan_pi/33_runs_mean                           +0.0361         +0.0361           110           114           110           114
fizzy/execute/sha1/512_bytes_rounds_1_mean                        +0.0155         +0.0155            88            89            88            89
fizzy/execute/sha1/512_bytes_rounds_16_mean                       +0.0101         +0.0101          1224          1237          1224          1237
fizzy/execute/sha256/512_bytes_rounds_1_mean                      +0.0097         +0.0097            81            82            81            82
fizzy/execute/sha256/512_bytes_rounds_16_mean                     +0.0134         +0.0134          1109          1124          1109          1124
fizzy/execute/taylor_pi/pi_1000000_runs_mean                      +0.0014         +0.0014         40681         40737         40682         40737
fizzy/execute/micro/eli_interpreter/exec105_mean                  +0.0239         +0.0239             4             5             4             5
fizzy/execute/micro/factorial/20_mean                             -0.0154         -0.0154             1             1             1             1
fizzy/execute/micro/fibonacci/24_mean                             -0.0210         -0.0210          5211          5102          5211          5102
fizzy/execute/micro/host_adler32/1_mean                           -0.0082         -0.0082             0             0             0             0
fizzy/execute/micro/host_adler32/1000_mean                        +0.0249         +0.0249            33            34            33            34
fizzy/execute/micro/icall_hash/1000_steps_mean                    +0.0064         +0.0064            70            70            70            70
fizzy/execute/micro/spinner/1_mean                                -0.0190         -0.0190             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                             +0.0415         +0.0415             9             9             9             9

@gumb0
Copy link
Collaborator Author

gumb0 commented Feb 18, 2021

Clang11 #716 vs noexcept

fizzy/execute/blake2b/512_bytes_rounds_1_mean                     -0.1054         -0.1053           183           163           183           163
fizzy/execute/blake2b/512_bytes_rounds_16_mean                    -0.1186         -0.1186          2755          2428          2755          2428
fizzy/execute/ecpairing/onepoint_mean                             -0.1180         -0.1179        953241        840790        953207        840782
fizzy/execute/keccak256/512_bytes_rounds_1_mean                   -0.0031         -0.0030           223           222           223           222
fizzy/execute/keccak256/512_bytes_rounds_16_mean                  -0.0204         -0.0203          3266          3200          3266          3200
fizzy/execute/memset/256_bytes_mean                               -0.1468         -0.1468            15            13            15            13
fizzy/execute/memset/60000_bytes_mean                             -0.1571         -0.1570          3368          2839          3368          2839
fizzy/execute/mul256_opt0/input1_mean                             -0.0849         -0.0849            63            57            63            57
fizzy/execute/ramanujan_pi/33_runs_mean                           -0.1072         -0.1072           246           219           246           219
fizzy/execute/sha1/512_bytes_rounds_1_mean                        -0.1082         -0.1082           192           171           192           171
fizzy/execute/sha1/512_bytes_rounds_16_mean                       -0.1091         -0.1091          2671          2380          2671          2380
fizzy/execute/sha256/512_bytes_rounds_1_mean                      -0.0825         -0.0824           177           163           177           163
fizzy/execute/sha256/512_bytes_rounds_16_mean                     -0.0828         -0.0828          2413          2214          2414          2214
fizzy/execute/taylor_pi/pi_1000000_runs_mean                      +0.0027         +0.0027         87670         87909         87670         87909
fizzy/execute/micro/eli_interpreter/exec105_mean                  -0.0969         -0.0969            10             9            10             9
fizzy/execute/micro/factorial/20_mean                             -0.0006         -0.0005             1             1             1             1
fizzy/execute/micro/fibonacci/24_mean                             -0.0407         -0.0407         11611         11138         11611         11138
fizzy/execute/micro/host_adler32/1_mean                           -0.0604         -0.0604             0             0             0             0
fizzy/execute/micro/host_adler32/1000_mean                        -0.0393         -0.0393            68            66            68            66
fizzy/execute/micro/icall_hash/1000_steps_mean                    -0.0223         -0.0223           147           144           147           144
fizzy/execute/micro/spinner/1_mean                                -0.0748         -0.0748             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                             -0.1665         -0.1665            19            16            19            16

master vs noexcept:

fizzy/execute/blake2b/512_bytes_rounds_1_mean                     -0.0937         -0.0935           180           163           180           163
fizzy/execute/blake2b/512_bytes_rounds_16_mean                    -0.1070         -0.1076          2719          2428          2721          2428
fizzy/execute/ecpairing/onepoint_mean                             -0.0483         -0.0488        883452        840790        883945        840782
fizzy/execute/keccak256/512_bytes_rounds_1_mean                   -0.0290         -0.0293           229           222           229           222
fizzy/execute/keccak256/512_bytes_rounds_16_mean                  -0.0620         -0.0622          3411          3200          3412          3200
fizzy/execute/memset/256_bytes_mean                               -0.1447         -0.1448            15            13            15            13
fizzy/execute/memset/60000_bytes_mean                             -0.1580         -0.1581          3372          2839          3373          2839
fizzy/execute/mul256_opt0/input1_mean                             -0.1280         -0.1281            66            57            66            57
fizzy/execute/ramanujan_pi/33_runs_mean                           -0.1239         -0.1240           250           219           250           219
fizzy/execute/sha1/512_bytes_rounds_1_mean                        -0.1101         -0.1101           193           171           193           171
fizzy/execute/sha1/512_bytes_rounds_16_mean                       -0.1118         -0.1118          2679          2380          2679          2380
fizzy/execute/sha256/512_bytes_rounds_1_mean                      -0.0739         -0.0738           175           163           175           163
fizzy/execute/sha256/512_bytes_rounds_16_mean                     -0.0788         -0.0788          2403          2214          2403          2214
fizzy/execute/taylor_pi/pi_1000000_runs_mean                      +0.0022         +0.0023         87713         87909         87710         87909
fizzy/execute/micro/eli_interpreter/exec105_mean                  -0.0963         -0.0963            10             9            10             9
fizzy/execute/micro/factorial/20_mean                             +0.0052         +0.0053             1             1             1             1
fizzy/execute/micro/fibonacci/24_mean                             -0.0348         -0.0348         11540         11138         11540         11138
fizzy/execute/micro/host_adler32/1_mean                           -0.0453         -0.0457             0             0             0             0
fizzy/execute/micro/host_adler32/1000_mean                        -0.0066         -0.0072            66            66            66            66
fizzy/execute/micro/icall_hash/1000_steps_mean                    +0.0016         +0.0011           144           144           144           144
fizzy/execute/micro/spinner/1_mean                                -0.0271         -0.0275             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                             -0.1679         -0.1682            19            16            19            16

@gumb0 gumb0 force-pushed the execute-function-noexcept branch 2 times, most recently from b8942e9 to 7e78d7b Compare February 19, 2021 12:32
@gumb0 gumb0 force-pushed the execute-function-noexcept2 branch 2 times, most recently from 8b8c66c to d306b86 Compare February 23, 2021 17:37
@gumb0 gumb0 force-pushed the execute-function-noexcept branch from ce0536c to 1996489 Compare March 1, 2021 13:36
@gumb0 gumb0 force-pushed the execute-function-noexcept2 branch from ffda4ba to 61d30e2 Compare March 1, 2021 13:52
int) -> ExecutionResult {
return std::any_cast<Value>(host_context);
int) noexcept -> ExecutionResult {
return *std::any_cast<Value>(&host_context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed for noexcept and why wasn't this done in #716?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any_cast taking a reference returns error by throwing bad_cast exception.
Here it's changed to any_cast taking a pointer, which returns nullptr in case of error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay. Though this could have been done as reference in the first place in #716.

Copy link
Member

@axic axic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@gumb0 gumb0 force-pushed the execute-function-noexcept branch 3 times, most recently from 16e12bc to 0ad804f Compare March 11, 2021 11:21
@gumb0 gumb0 force-pushed the execute-function-noexcept2 branch from 61d30e2 to f381ae7 Compare March 11, 2021 11:56
@gumb0 gumb0 requested a review from chfast March 11, 2021 12:05
@gumb0 gumb0 force-pushed the execute-function-noexcept2 branch from f381ae7 to 4aaccab Compare March 11, 2021 12:08
Base automatically changed from execute-function-noexcept to master March 11, 2021 12:13
@gumb0 gumb0 force-pushed the execute-function-noexcept2 branch from 4aaccab to 3088493 Compare March 11, 2021 12:52
@gumb0 gumb0 force-pushed the execute-function-noexcept2 branch from 3088493 to cc6dced Compare March 11, 2021 13:24
@axic axic merged commit 08f86e8 into master Mar 11, 2021
@axic axic deleted the execute-function-noexcept2 branch March 11, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants