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

[Test] Mark more 'Integer's as interesting #6619

Merged

Conversation

effectfully
Copy link
Contributor

This makes one of the distribution tests display more info about the distribution.

@effectfully effectfully added Test No Changelog Required Add this to skip the Changelog Check labels Oct 31, 2024
@effectfully effectfully self-assigned this Oct 31, 2024
@effectfully
Copy link
Contributor Author

Here's what the test shows now:

      distribution of 'Integer' constants:             OK (0.05s)
        +++ OK, passed 10000 tests:
        12.28% (-1, -127)
        11.93% (1, 127)
        10.82% (-128, -32767)
        10.78% (128, 32767)
         9.16% (9223372036854775808, 147573952589676412912)
         8.92% (-2147483648, -9223372036854775807)
         8.83% (-9223372036854775808, -147573952589676412912)
         8.36% (2147483648, 9223372036854775807)
         7.62% (-32768, -2147483647)
         7.38% (32768, 2147483647)
         3.92% 0

         2.51% 127
         2.45% -127
         2.45% 1
         2.30% -32767
         2.09% -1
         2.01% -147573952589676412912
         1.99% 32767
         1.95% 128
         1.91% -9223372036854775808
         1.90% 147573952589676412912
         1.81% -128
         1.71% 9223372036854775808
         1.67% 2147483648
         1.66% -2147483648
         1.65% -9223372036854775807
         1.61% 9223372036854775807
         1.45% -32768
         1.43% 2147483647
         1.36% -2147483647
         1.34% 32768

@effectfully
Copy link
Contributor Author

I've looked at that distribution and decided to tweak it a little, since it was generating "interesting" integers a bit too often leaving "uninteresting" ones not sufficiently covered. The new distribution:

      distribution of 'Integer' constants:             OK (0.05s)
        +++ OK, passed 10000 tests:
        12.23% (1, 127)
        12.00% (-1, -127)
        11.56% (-128, -32767)
        10.73% (128, 32767)
         9.46% (-9223372036854775808, -147573952589676412912)
         8.91% (9223372036854775808, 147573952589676412912)
         8.84% (-2147483648, -9223372036854775807)
         8.38% (2147483648, 9223372036854775807)
         7.72% (-32768, -2147483647)
         7.40% (32768, 2147483647)
         2.77% 0
        
         1.93% 1
         1.78% 127
         1.75% -127
         1.72% -128
         1.59% -1
         1.59% -32767
         1.55% 32767
         1.40% 128
         1.31% 9223372036854775808
         1.30% 2147483648
         1.27% -147573952589676412912
         1.27% -9223372036854775808
         1.26% -9223372036854775807
         1.25% 147573952589676412912
         1.24% -2147483648
         1.11% 32768
         1.05% -32768
         1.05% 9223372036854775807
         1.02% 2147483647
         0.97% -2147483647

The difference is just about 1%, so not very significant, but I like this distribution more.

@effectfully effectfully force-pushed the effectfully/test/mark-more-Integers-as-interesting branch from ad3d092 to ede713d Compare October 31, 2024 20:54
@effectfully
Copy link
Contributor Author

/benchmark validation

Copy link
Contributor

github-actions bot commented Nov 4, 2024

Click here to check the status of your benchmark.

@effectfully
Copy link
Contributor Author

This one is very insignificant, so I'm gonna merge it without waiting for a review. Feel free to ignore it or if you review it and have some comments, I'll address them in another PR.

@effectfully effectfully merged commit d7d35f0 into master Nov 5, 2024
8 checks passed
@effectfully effectfully deleted the effectfully/test/mark-more-Integers-as-interesting branch November 5, 2024 14:22
v0d1ch pushed a commit to v0d1ch/plutus that referenced this pull request Dec 6, 2024
This is what the test prints now:

```
      distribution of 'Integer' constants:             OK (0.05s)
        +++ OK, passed 10000 tests:
        12.23% (1, 127)
        12.00% (-1, -127)
        11.56% (-128, -32767)
        10.73% (128, 32767)
         9.46% (-9223372036854775808, -147573952589676412912)
         8.91% (9223372036854775808, 147573952589676412912)
         8.84% (-2147483648, -9223372036854775807)
         8.38% (2147483648, 9223372036854775807)
         7.72% (-32768, -2147483647)
         7.40% (32768, 2147483647)
         2.77% 0
        
         1.93% 1
         1.78% 127
         1.75% -127
         1.72% -128
         1.59% -1
         1.59% -32767
         1.55% 32767
         1.40% 128
         1.31% 9223372036854775808
         1.30% 2147483648
         1.27% -147573952589676412912
         1.27% -9223372036854775808
         1.26% -9223372036854775807
         1.25% 147573952589676412912
         1.24% -2147483648
         1.11% 32768
         1.05% -32768
         1.05% 9223372036854775807
         1.02% 2147483647
         0.97% -2147483647
```
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 Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant