Skip to content

Commit

Permalink
[Test] Get the seed in 'noStructuralErrors' (#6595)
Browse files Browse the repository at this point in the history
Apparently with `QuickCheck` you can throw exceptions in `IO` and of type `IO smth`, but what you can't do is throw an exception of type `IOException`, i.e. you can't throw an exception while you're throwing an exception, because in that case you won't get a seed. It is of course entirely accidental that we throw an exception while throwing an exception, but I didn't expect that to break `QuickCheck`.
  • Loading branch information
effectfully authored Oct 25, 2024
1 parent e294fcb commit 7f6fefe
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ noStructuralErrors term =
prop_noStructuralErrors :: Property
prop_noStructuralErrors = withMaxSuccess 99 $
forAllDoc "ty,tm" genTypeAndTerm_ shrinkClosedTypedTerm $ \(_, termPir) -> ioProperty $ do
termUPlc <- fmap UPLC._progTerm . modifyError throw . toUPlc $ Program () latestVersion termPir
termUPlc <- fmap UPLC._progTerm . modifyError (userError . displayException) . toUPlc $
Program () latestVersion termPir
noStructuralErrors termUPlc

-- | Test that evaluation of an ill-typed terms fails with a structural error.
Expand Down

1 comment on commit 7f6fefe

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

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.

Benchmark suite Current: 7f6fefe Previous: e294fcb Ratio
validation-auction_2-4 899.2 μs 746 μs 1.21
validation-auction_2-5 328.7 μs 230.8 μs 1.42
validation-crowdfunding-success-1 296.2 μs 209.4 μs 1.41
validation-crowdfunding-success-2 295.6 μs 209.5 μs 1.41
validation-escrow-redeem_1-2 494 μs 451.5 μs 1.09
validation-escrow-redeem_2-3 577.1 μs 510.5 μs 1.13
validation-escrow-refund-1 221.6 μs 156.3 μs 1.42
validation-future-increase-margin-1 353.3 μs 249.5 μs 1.42
validation-future-increase-margin-2 762.5 μs 539.2 μs 1.41
validation-future-increase-margin-3 763.9 μs 538 μs 1.42
validation-future-increase-margin-4 685.4 μs 486.9 μs 1.41
validation-future-increase-margin-5 1148 μs 807.8 μs 1.42
validation-future-pay-out-1 353.4 μs 250.2 μs 1.41
validation-future-pay-out-2 759.5 μs 562.2 μs 1.35
validation-future-pay-out-3 762.8 μs 706.5 μs 1.08
validation-future-pay-out-4 1140 μs 806 μs 1.41
validation-future-settle-early-1 353.9 μs 249.3 μs 1.42
validation-future-settle-early-2 702.3 μs 538 μs 1.31
validation-game-sm-success_1-1 441.6 μs 387.4 μs 1.14
validation-game-sm-success_1-2 284.2 μs 201.2 μs 1.41
validation-game-sm-success_1-3 902.6 μs 639.9 μs 1.41
validation-game-sm-success_1-4 333.3 μs 234.8 μs 1.42
validation-game-sm-success_2-1 547.3 μs 390.9 μs 1.40
validation-game-sm-success_2-2 284.8 μs 200.8 μs 1.42
validation-game-sm-success_2-3 905.2 μs 639.3 μs 1.42
validation-multisig-sm-1 419.8 μs 395.8 μs 1.06
validation-multisig-sm-6 557.1 μs 498.1 μs 1.12
validation-multisig-sm-7 541.5 μs 405.7 μs 1.33
validation-prism-3 523.8 μs 408.5 μs 1.28
validation-pubkey-1 200.9 μs 141.6 μs 1.42
validation-stablecoin_1-1 1273 μs 899.5 μs 1.42
validation-stablecoin_1-2 278.6 μs 196.1 μs 1.42
validation-stablecoin_1-3 1470 μs 1272 μs 1.16
validation-decode-auction_1-1 251.9 μs 198.5 μs 1.27
validation-decode-auction_2-1 223.9 μs 211.1 μs 1.06
validation-decode-auction_2-2 750.7 μs 545.3 μs 1.38
validation-decode-auction_2-3 727.9 μs 544.9 μs 1.34
validation-decode-auction_2-4 739.5 μs 549.2 μs 1.35
validation-decode-auction_2-5 266.9 μs 194.2 μs 1.37
validation-decode-crowdfunding-success-1 324.9 μs 236.4 μs 1.37
validation-decode-crowdfunding-success-2 323.7 μs 237.6 μs 1.36
validation-decode-crowdfunding-success-3 324.6 μs 236.8 μs 1.37
validation-decode-currency-1 317.3 μs 239.3 μs 1.33
validation-decode-escrow-redeem_1-1 358.5 μs 316.4 μs 1.13
validation-decode-escrow-redeem_1-2 433.4 μs 316.5 μs 1.37
validation-decode-escrow-redeem_2-1 432.2 μs 316.4 μs 1.37
validation-decode-future-settle-early-3 430.8 μs 318.4 μs 1.35
validation-decode-future-settle-early-4 948.6 μs 685.4 μs 1.38
validation-decode-game-sm-success_1-1 708.1 μs 528.8 μs 1.34
validation-decode-game-sm-success_1-2 224.3 μs 163.9 μs 1.37
validation-decode-game-sm-success_1-3 710.9 μs 530.6 μs 1.34
validation-decode-game-sm-success_1-4 220.5 μs 163.8 μs 1.35
validation-decode-game-sm-success_2-1 729.8 μs 525.9 μs 1.39
validation-decode-game-sm-success_2-3 727.8 μs 530.4 μs 1.37
validation-decode-game-sm-success_2-4 220.9 μs 180 μs 1.23
validation-decode-multisig-sm-2 811 μs 669.9 μs 1.21
validation-decode-ping-pong-1 681.2 μs 631.8 μs 1.08
validation-decode-ping-pong-2 679.9 μs 492.9 μs 1.38
validation-decode-ping-pong_2-1 661.5 μs 490 μs 1.35
validation-decode-prism-1 216.6 μs 178.4 μs 1.21
validation-decode-stablecoin_2-2 224.5 μs 174.8 μs 1.28
validation-decode-stablecoin_2-3 914.5 μs 865.5 μs 1.06
nofib-clausify/formula1 4457 μs 3501 μs 1.27
nofib-clausify/formula2 5958 μs 4512 μs 1.32
nofib-clausify/formula3 16340 μs 11280 μs 1.45
nofib-clausify/formula4 37450 μs 25890 μs 1.45
nofib-clausify/formula5 79210 μs 63460 μs 1.25
nofib-knights/8x8 119400 μs 102800 μs 1.16
nofib-primetest/05digits 14980 μs 11000 μs 1.36
nofib-queens4x4/bt 7840 μs 5405 μs 1.45
nofib-queens4x4/bm 9873 μs 6849 μs 1.44
nofib-queens4x4/bjbt1 9471 μs 6551 μs 1.45
nofib-queens4x4/bjbt2 8899 μs 6138 μs 1.45
nofib-queens4x4/fc 19860 μs 15990 μs 1.24
nofib-queens5x5/bm 111100 μs 93540 μs 1.19
nofib-queens5x5/bjbt1 124700 μs 86080 μs 1.45
nofib-queens5x5/bjbt2 121100 μs 99700 μs 1.21
nofib-queens5x5/fc 252700 μs 228600 μs 1.11
marlowe-semantics/0101080808040600020306010000000302050807010208060100070207080202 875.8 μs 780.3 μs 1.12
marlowe-semantics/04000f0b04051006000e060f09080d0b090d0104050a0b0f0506070f0a070008 1026 μs 801.1 μs 1.28
marlowe-role-payout/01dcc372ea619cb9f23c45b17b9a0a8a16b7ca0e04093ef8ecce291667a99a4c 233.8 μs 163.7 μs 1.43
marlowe-role-payout/0201020201020000020000010201020001020200000002010200000101010100 266 μs 187.4 μs 1.42
marlowe-role-payout/0202010002010100020102020102020001010101020102010001010101000100 248.2 μs 174.4 μs 1.42
marlowe-role-payout/0303020000020001010201060303040208070100050401080304020801030001 248.7 μs 175.5 μs 1.42
marlowe-role-payout/031d56d71454e2c4216ffaa275c4a8b3eb631109559d0e56f44ea8489f57ba97 294.2 μs 206.8 μs 1.42
marlowe-role-payout/03d730a62332c51c7b70c16c64da72dd1c3ea36c26b41cd1a1e00d39fda3d6cc 277.7 μs 195.9 μs 1.42
marlowe-role-payout/0403020000030204010000030001000202010101000304030001040404030100 257.2 μs 181.7 μs 1.42
marlowe-role-payout/0405010105020401010304080005050800040301010800080207080704020206 282.7 μs 199.2 μs 1.42
marlowe-role-payout/041a2c3b111139201a3a2c173c392b170e16370d300f2d28342d0f2f0e182e01 283.3 μs 200.2 μs 1.42
marlowe-role-payout/04f592afc6e57c633b9c55246e7c82e87258f04e2fb910c37d8e2417e9db46e5 327.9 μs 231.2 μs 1.42
marlowe-role-payout/057ebc80922f16a5f4bf13e985bf586b8cff37a2f6fe0f3ce842178c16981027 240.3 μs 170.8 μs 1.41
marlowe-role-payout/06317060a8e488b1219c9dae427f9ce27918a9e09ee8ac424afa33ca923f7954 255.2 μs 229.3 μs 1.11
marlowe-role-payout/07658a6c898ad6d624c37df1e49e909c2e9349ba7f4c0a6be5f166fe239bfcae 235.2 μs 165.9 μs 1.42
marlowe-role-payout/0bdca1cb8fa7e38e09062557b82490714052e84e2054e913092cd84ac071b961 283.2 μs 199.2 μs 1.42
marlowe-role-payout/0c9d3634aeae7038f839a1262d1a8bc724dc77af9426459417a56ec73240f0e0 252.1 μs 177.8 μs 1.42
marlowe-role-payout/0d0f01050a0a0a0b0b050d0404090e0d0506000d0a041003040e0f100e0a0408 251.3 μs 178.1 μs 1.41
marlowe-role-payout/0dbb692d2bf22d25eeceac461cfebf616f54003077a8473abc0457f18e025960 285.4 μs 201.3 μs 1.42
marlowe-role-payout/0e00171d0f1e1f14070d0a00091f07101808021d081e1b120219081312081e15 243.4 μs 171.5 μs 1.42
marlowe-role-payout/0e72f62b0f922e31a2340baccc768104025400cf7fdd7dae62fbba5fc770936d 270 μs 191.3 μs 1.41
marlowe-role-payout/0e97c9d9417354d9460f2eb35018d3904b7b035af16ab299258adab93be0911a 268.7 μs 188.9 μs 1.42
marlowe-role-payout/0f010d040810040b10020e040f0e030b0a0d100f0c080c0c05000d04100c100f 282.3 μs 198.6 μs 1.42
marlowe-role-payout/1138a04a83edc0579053f9ffa9394b41df38230121fbecebee8c039776a88c0c 246.4 μs 175.3 μs 1.41
marlowe-role-payout/211e1b6c10260c4620074d2e372c260d38643a3d605f63772524034f0a4a7632 225.5 μs 179.4 μs 1.26
marlowe-role-payout/21a1426fb3fb3019d5dc93f210152e90b0a6e740ef509b1cdd423395f010e0ca 269 μs 189.6 μs 1.42
marlowe-role-payout/224ce46046fab9a17be4197622825f45cc0c59a6bd1604405148e43768c487ef 249.7 μs 175.5 μs 1.42
marlowe-role-payout/332c2b1c11383d1b373e1315201f1128010e0e1518332f273f141b23243f2a07 237.4 μs 167.2 μs 1.42
marlowe-role-payout/3565ee025317e065e8555eef288080276716366769aad89e03389f5ec4ce26d7 257.5 μs 182.2 μs 1.41
marlowe-role-payout/3569299fc986f5354d02e627a9eaa48ab46d5af52722307a0af72bae87e256dc 243.5 μs 171.3 μs 1.42
marlowe-role-payout/36866914aa07cf62ef36cf2cd64c7f240e3371e27bb9fff5464301678e809c40 242.5 μs 171 μs 1.42
marlowe-role-payout/371c10d2526fc0f09dbe9ed59e44dcd949270b27dc42035addd7ff9f7e0d05e7 286.8 μs 201.9 μs 1.42
marlowe-role-payout/3897ef714bba3e6821495b706c75f8d64264c3fdaa58a3826c808b5a768c303d 251.1 μs 176.2 μs 1.43
marlowe-role-payout/4121d88f14387d33ac5e1329618068e3848445cdd66b29e5ba382be2e02a174a 283.8 μs 200.5 μs 1.42
marlowe-role-payout/4299c7fcf093a5dbfe114c188e32ca199b571a7c25cb7f766bf49f12dab308be 269.1 μs 189.9 μs 1.42
marlowe-role-payout/452e17d16222a427707fa83f63ffb79f606cc25c755a18b1e3274c964ed5ec99 292.3 μs 205 μs 1.43
marlowe-role-payout/46f8d00030436e4da490a86b331fa6c3251425fb8c19556080e124d75bad7bd6 247.5 μs 173.8 μs 1.42
marlowe-role-payout/47364cfaf2c00f7d633283dce6cf84e4fd4e8228c0a0aa50e7c55f35c3ecaa1c 247.4 μs 174.7 μs 1.42
marlowe-role-payout/49b8275d0cb817be40865694ab05e3cfe5fc35fb43b78e7de68c1f3519b536bd 254 μs 178.2 μs 1.43
marlowe-role-payout/4dd7755b6ca1f0c9747c1fc0ee4da799f6f1c07108e980bd9f820911ad711ff2 319 μs 224.4 μs 1.42
marlowe-role-payout/6621a69217f09d91f42876a9c0cecf79de0e29bdd5b16c82c6c52cf959092ec4 269.2 μs 189.8 μs 1.42
marlowe-role-payout/674b0577409957172ad85223c765d17e94c27714276c49c38dfae0a47a561a1e 237.8 μs 168 μs 1.42
marlowe-role-payout/6b7bc2b9002a71b33cfd535d43f26334a283d0b9ad189b7cd74baac232c3b9fc 236.5 μs 166.3 μs 1.42
marlowe-role-payout/6c364699767a84059ffd99cf718562a8c09d96e343f23dc481e8ffda13af424f 247 μs 175.2 μs 1.41
marlowe-role-payout/6d66bddb4269bdf77392d3894da5341cf019d39787522af4f83f01285991e93c 246.4 μs 188.5 μs 1.31
marlowe-role-payout/87167fc5469adac97c1be749326fa79a6b7862ce68aa4abcb438e3c034bd0899 286.7 μs 241.3 μs 1.19
marlowe-role-payout/b43564af5f13cc5208b92b1ad6d45369446f378d3891e5cb3e353b30d4f3fb10 245.6 μs 193.6 μs 1.27

This comment was automatically generated by workflow using github-action-benchmark.

CC: @IntersectMBO/plutus-core

Please sign in to comment.