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

issue152.icry test case fails when building with random-1.2.*, but not with random-1.1.* #1102

Closed
RyanGlScott opened this issue Mar 11, 2021 · 4 comments · Fixed by #1156
Closed
Labels
bug Something not working correctly test-framework For issues related to Cryptol's test framework.

Comments

@RyanGlScott
Copy link
Contributor

Going from random-1.1.* to random-1.2.* causes the issue152.icry test case to fail:

$ rm -f cabal.project.freeze && cabal freeze --constraint="random==1.1.*" && ./cry build && ./cry test tests/issues/issue152.icry
<elided>
Running tests
tests:
  issues:

    issue152.icry: [OK]

         Test Cases  Total      
 Passed  1           1          
 Failed  0           0          
 Total   1           1 

$ rm -f cabal.project.freeze && cabal freeze --constraint="random==1.2.*" && ./cry build && ./cry test tests/issues/issue152.icry 
<elided>
Running tests
tests:
  issues:

    issue152.icry: [Failed]
3,54c3,54
< [0xd4d4cc91cd7a9857, 0x4f3d263304e8ca85, 0x6723eafdcc46836f,
<  0x20e6c946662f2183, 0x6a760db62889b212, ...]
< [[0x01, 0x83, 0x5f, 0x2e, 0xd1, 0x1a, 0x00, 0x1f, 0xfe, 0x55, 0xc8,
<   0x96, 0xcd, 0xe5, 0x9e, 0xca, 0xd9, 0xaa, 0x8a, 0x89, 0x06, 0xbd,
<   0x70, 0x40, 0xa7, 0x3b, 0xad, 0x8e, 0x8b, 0xe8, 0x6b, 0x5f],
<  [0xb1, 0xda, 0x11, 0x71, 0x9f, 0x42, 0x2e, 0x83, 0x42, 0xe3, 0x05,
<   0xab, 0xee, 0x00, 0x68, 0xdb, 0x82, 0x5e, 0xa5, 0xd7, 0x3c, 0x76,
<   0x99, 0xb9, 0xc2, 0xd9, 0xef, 0x44, 0x68, 0x95, 0x9b, 0x4d],
<  [0x2b, 0xd2, 0x62, 0xe8, 0x70, 0x78, 0xc4, 0x35, 0x5b, 0xb9, 0x71,
<   0xbb, 0xb9, 0x03, 0x8d, 0x2b, 0x9b, 0xb5, 0xfb, 0x4b, 0x77, 0xf1,
<   0xed, 0xa9, 0x6a, 0x7b, 0xc7, 0xda, 0xdd, 0x03, 0x12, 0x3d],
<  [0x61, 0xf0, 0xcb, 0x95, 0xf8, 0xe5, 0x39, 0x11, 0xd8, 0xf7, 0x14,
<   0xc1, 0x40, 0xf1, 0x13, 0x1b, 0xb4, 0x6a, 0x39, 0x62, 0x17, 0x4b,
<   0x8c, 0x8b, 0x1b, 0x7d, 0x25, 0x58, 0x50, 0xb5, 0x40, 0x72],
<  [0xb3, 0x00, 0x08, 0x2b, 0xfa, 0x02, 0xf6, 0x85, 0xa7, 0x74, 0x37,
<   0x49, 0xa4, 0x2d, 0x73, 0x0e, 0x64, 0x2d, 0xdd, 0x6b, 0xd2, 0x29,
<   0x9b, 0xda, 0xe8, 0xcc, 0x79, 0x43, 0x89, 0xbf, 0x6d, 0xeb],
<  [0xf0, 0x8d, 0x56, 0x19, 0x57, 0xb8, 0x39, 0xdb, 0x29, 0x3d, 0x4e,
<   0xeb, 0x4a, 0xed, 0x3f, 0x76, 0x2b, 0xc7, 0x50, 0x5a, 0x5b, 0xc2,
<   0xa8, 0x26, 0xe3, 0xe2, 0x14, 0x80, 0xd1, 0xd8, 0x74, 0xc2],
<  [0x1a, 0x41, 0x81, 0xa1, 0x4c, 0xe7, 0xef, 0xf7, 0x97, 0xa5, 0x41,
<   0x12, 0xaf, 0x77, 0xf6, 0xe8, 0x94, 0xc4, 0xc7, 0x26, 0x9a, 0x4b,
<   0xfa, 0x69, 0xf0, 0xe5, 0xc3, 0x24, 0xad, 0xf7, 0x40, 0x75],
<  [0xd7, 0x0a, 0xfb, 0x21, 0xb9, 0xe1, 0x24, 0x8b, 0xca, 0x00, 0x63,
<   0xb9, 0x44, 0xe6, 0xf0, 0xc9, 0xf1, 0x97, 0x52, 0xec, 0x2c, 0xdc,
<   0x37, 0x50, 0xe5, 0xa7, 0xe3, 0xed, 0x82, 0x1e, 0xd3, 0xb1],
<  [0x21, 0x74, 0x26, 0x24, 0x9b, 0x2f, 0x1e, 0xec, 0x3b, 0x0e, 0x7e,
<   0x00, 0x2e, 0xc1, 0x1a, 0x6d, 0x80, 0x50, 0xd8, 0xc8, 0x93, 0x18,
<   0xae, 0x1f, 0x31, 0xa8, 0x3d, 0x69, 0xbd, 0x29, 0xee, 0xe5],
<  [0x11, 0x52, 0x88, 0xe8, 0x22, 0xae, 0x28, 0x0c, 0x8c, 0xb3, 0x28,
<   0x9c, 0xc2, 0xdf, 0x90, 0x7f, 0x6a, 0x0c, 0xc4, 0x38, 0xcc, 0x50,
<   0x1b, 0x0a, 0xef, 0x41, 0x7b, 0x28, 0xb4, 0xfe, 0x79, 0x8e],
<  [0x92, 0xfa, 0x34, 0x31, 0xca, 0x26, 0xe6, 0x64, 0x41, 0x86, 0xd0,
<   0x0e, 0x5e, 0x20, 0xc8, 0xd9, 0x57, 0xf1, 0xfc, 0xa4, 0x2b, 0xbb,
<   0x3a, 0x14, 0x79, 0x80, 0x38, 0x87, 0x28, 0xf1, 0xed, 0xa0],
<  [0x2f, 0x03, 0xe9, 0xbe, 0x00, 0xd9, 0x54, 0x8d, 0xa7, 0x94, 0xb7,
<   0x74, 0x70, 0x42, 0xa5, 0x99, 0xc8, 0x91, 0x0b, 0x1e, 0x97, 0xc1,
<   0x63, 0x12, 0x04, 0x0a, 0xa3, 0x9e, 0x45, 0xc3, 0x8d, 0x74],
<  [0x27, 0x82, 0x01, 0x5b, 0x21, 0xb2, 0xfb, 0x92, 0x13, 0x6e, 0xad,
<   0x72, 0xd8, 0xe6, 0x25, 0x55, 0xcb, 0x05, 0x45, 0x27, 0x5e, 0x42,
<   0x50, 0x5f, 0xc2, 0x4f, 0x11, 0xa3, 0x04, 0x5b, 0x58, 0x17],
<  [0xa4, 0x5b, 0xd2, 0x61, 0x23, 0xfa, 0xd6, 0xb4, 0xf7, 0xde, 0x87,
<   0xbe, 0x62, 0x00, 0x63, 0x3d, 0x89, 0x9c, 0x0f, 0xa9, 0x59, 0xc4,
<   0x51, 0x36, 0x04, 0x6f, 0x2d, 0x1c, 0x3d, 0xd2, 0x10, 0x2b],
<  [0x63, 0x01, 0x51, 0x26, 0xef, 0x1e, 0xe7, 0x91, 0x68, 0x75, 0xb3,
<   0xe2, 0xc9, 0xd8, 0xd9, 0xf5, 0xb0, 0xe8, 0xcd, 0xed, 0x98, 0x60,
<   0xac, 0x7e, 0xf6, 0x05, 0x14, 0xdd, 0xd3, 0x20, 0xdb, 0x1e],
<  [0xfc, 0xc1, 0x39, 0x4c, 0xa6, 0xb4, 0x5e, 0x57, 0xe4, 0x6b, 0xd3,
<   0x3d, 0x2f, 0x71, 0x71, 0x75, 0xdc, 0x5e, 0xdd, 0x7a, 0xbb, 0x77,
<   0xe0, 0x2e, 0x85, 0xd7, 0xc8, 0x26, 0x81, 0x93, 0xb4, 0x79]]
< (0xf7e937b5, 0x2b34)
< {x = 0x5a314507, y = 0x83aa}
---
> [0x09c001b65a314507, 0xee1435275a0e309d, 0x89c241abd79f510e,
>  0x91d6c072b4785d84, 0x3faf78af2a0392e8, ...]
> [[0x2e, 0xb5, 0xff, 0xd4, 0x9d, 0xbf, 0xc8, 0xc1, 0x1b, 0x83, 0x2e,
>   0xe6, 0xef, 0x0f, 0x6c, 0x5d, 0x59, 0xb5, 0x4c, 0x52, 0x44, 0xdf,
>   0x36, 0x35, 0x03, 0x92, 0x41, 0xa4, 0x56, 0xfa, 0xd6, 0xd5],
>  [0x15, 0x77, 0xf9, 0xfa, 0x34, 0x8a, 0x6f, 0x0d, 0x1d, 0x91, 0x24,
>   0x3e, 0x6f, 0x4f, 0xdd, 0x28, 0xb5, 0xcd, 0xf1, 0x6b, 0x49, 0x6d,
>   0x6f, 0x21, 0xda, 0x8f, 0x0f, 0xb3, 0xdd, 0x2e, 0x57, 0xea],
>  [0x8b, 0x48, 0x82, 0x96, 0x3e, 0x6e, 0x49, 0xa2, 0xcc, 0x8e, 0xf2,
>   0x1a, 0x12, 0x8e, 0xf4, 0x57, 0x16, 0x1e, 0x56, 0x94, 0x0f, 0x17,
>   0x83, 0xcd, 0x68, 0x46, 0x7c, 0xa7, 0xc7, 0x75, 0x1f, 0x77],
>  [0xbb, 0x8d, 0x3f, 0xb1, 0xa6, 0xa8, 0x86, 0x25, 0xda, 0x4b, 0x61,
>   0x5a, 0xcf, 0x3b, 0x23, 0x11, 0x2b, 0x22, 0xf2, 0x55, 0x6e, 0x89,
>   0x27, 0x21, 0x20, 0x86, 0x19, 0x12, 0xe7, 0xa9, 0x23, 0x45],
>  [0x91, 0x00, 0x01, 0xb9, 0xf9, 0x6f, 0xc4, 0x42, 0xc3, 0xde, 0x29,
>   0x36, 0x66, 0x45, 0x44, 0x9d, 0x3d, 0xbd, 0x14, 0xc3, 0x00, 0xcd,
>   0x73, 0x1f, 0x86, 0x94, 0x75, 0x36, 0xed, 0x13, 0xac, 0x5d],
>  [0xdd, 0xd5, 0xa0, 0x5b, 0x80, 0x8b, 0x83, 0x73, 0x2b, 0xd4, 0xe5,
>   0xb5, 0x5c, 0x8c, 0x7f, 0x0b, 0xcd, 0xc0, 0x53, 0x55, 0xa5, 0x6c,
>   0xba, 0x53, 0xcf, 0x3a, 0xcb, 0xca, 0x24, 0x01, 0x52, 0xe8],
>  [0x9f, 0xab, 0x82, 0x5c, 0xa0, 0x29, 0x35, 0x86, 0xf7, 0xed, 0xe8,
>   0x19, 0xa0, 0x93, 0x13, 0x5a, 0x10, 0x96, 0x8b, 0xe2, 0x9b, 0xa0,
>   0xc8, 0x7f, 0x24, 0x74, 0x17, 0x35, 0x06, 0x71, 0xdc, 0xb6],
>  [0xa7, 0x74, 0xee, 0x52, 0x92, 0x40, 0x9e, 0xf4, 0x7f, 0xee, 0x07,
>   0xed, 0xbc, 0x40, 0x7e, 0xff, 0x91, 0x37, 0x56, 0x4e, 0xe8, 0x49,
>   0x5f, 0x02, 0xc5, 0xdb, 0xe4, 0xc4, 0x1d, 0x83, 0x7e, 0x27],
>  [0x7f, 0xb8, 0x77, 0x7b, 0xd0, 0x49, 0x63, 0x68, 0xf7, 0xdd, 0xce,
>   0x59, 0x42, 0x32, 0x10, 0xbd, 0xc8, 0x7d, 0xbe, 0xf0, 0xf7, 0x35,
>   0xa5, 0xf3, 0x26, 0x2f, 0x3c, 0x2d, 0x33, 0xcb, 0x76, 0x92],
>  [0xad, 0x64, 0x37, 0x75, 0xda, 0x94, 0xe6, 0x3a, 0x51, 0xd7, 0xbc,
>   0x42, 0x92, 0xa3, 0x21, 0x6f, 0x8c, 0x13, 0xeb, 0x95, 0xd5, 0xde,
>   0xb2, 0xf7, 0xd1, 0x4a, 0x22, 0x7f, 0xe2, 0x06, 0xf2, 0x89],
>  [0x80, 0x14, 0xf1, 0xea, 0x0e, 0x74, 0x53, 0xa9, 0xdf, 0x49, 0x0b,
>   0x49, 0xca, 0xe6, 0x7d, 0xa4, 0x1c, 0x4b, 0xdf, 0xc0, 0x1c, 0x61,
>   0xcb, 0xe1, 0xdb, 0xcc, 0x6a, 0x0d, 0xac, 0x7d, 0xc6, 0xdb],
>  [0x68, 0xd9, 0x21, 0x12, 0x29, 0x9e, 0xb6, 0xda, 0xfc, 0xbd, 0xd0,
>   0x16, 0x65, 0xaa, 0xb2, 0xcd, 0x61, 0xe9, 0x5e, 0xf4, 0x2a, 0x57,
>   0xc8, 0x7f, 0x0b, 0x17, 0xa9, 0x38, 0xf4, 0x33, 0xcd, 0x57],
>  [0x8f, 0xbd, 0x1f, 0x2e, 0x9e, 0x0c, 0xe5, 0x07, 0x8a, 0x5d, 0xff,
>   0x37, 0x5c, 0x40, 0x7f, 0x98, 0xde, 0x0d, 0x51, 0xff, 0x17, 0x60,
>   0xfb, 0x87, 0xa3, 0xc9, 0xf4, 0x3a, 0x25, 0x2b, 0x21, 0xda],
>  [0xe7, 0x5b, 0xdb, 0x76, 0x1f, 0x37, 0x1b, 0x91, 0xed, 0x7d, 0x6b,
>   0x27, 0x30, 0x04, 0x09, 0xd5, 0xeb, 0x32, 0xdb, 0x25, 0x44, 0xae,
>   0x16, 0x94, 0x91, 0x4a, 0x84, 0x22, 0x20, 0xab, 0x69, 0x95],
>  [0x22, 0xc3, 0xed, 0x1b, 0x78, 0xe8, 0x57, 0x11, 0x87, 0x9b, 0xee,
>   0x30, 0x87, 0x35, 0x04, 0x59, 0x37, 0xec, 0x99, 0xe5, 0xa9, 0x37,
>   0xfb, 0x8e, 0xd8, 0x29, 0x3b, 0x60, 0xae, 0xe2, 0xfe, 0xac],
>  [0x15, 0x96, 0xb7, 0xd6, 0x52, 0x60, 0xae, 0xbe, 0x72, 0x52, 0x92,
>   0x31, 0x9a, 0x74, 0x08, 0x31, 0xb7, 0x29, 0xdb, 0xee, 0x08, 0xb3,
>   0x89, 0x30, 0x67, 0xac, 0x71, 0xa3, 0x14, 0x3d, 0xfc, 0x5c]]
> (0xf7e937b5, 0x81b8)
> {x = 0x5a314507, y = 0x309d}
56c56
< 0xfb6686b9c4f59cf7b40ee8b5e1978175f59b0d83b1b401df99f4d8f0a0a4a011
---
> 0x89b5f3508460ae845d8396d15c95cb279ec3a8c4070b9aa943814be876c72e50

# If output is OK:
cp /home/rscott/Documents/Hacking/Haskell/cryptol/output/tests/issues/issue152.icry.stdout \
     /home/rscott/Documents/Hacking/Haskell/cryptol/tests/issues/issue152.icry.stdout



         Test Cases  Total      
 Passed  0           0          
 Failed  1           1          
 Total   1           1

(ht to @yav for originally noticing this.)

@RyanGlScott RyanGlScott added bug Something not working correctly test-framework For issues related to Cryptol's test framework. labels Mar 11, 2021
@RyanGlScott
Copy link
Contributor Author

It looks like this test case's output is tightly coupled to how the random package is implemented. See f4e7975 for another example where the .stdout file had to be changed to accommodate changes in random.

@robdockins
Copy link
Contributor

We should either 1) remove our dependency on random and just use the tf-random API 2) add a random <= 1.1 upper bound or 3) add a random >= 1.2 bound and change the expected output file.

@robdockins
Copy link
Contributor

I'm inclined to switch over to use the tf-random API directly. Anyone have objections?

@yav
Copy link
Member

yav commented Apr 6, 2021

No objection

robdockins added a commit that referenced this issue Apr 7, 2021
Instead, directly use the generators defined in `tf-random`.
This changes the generation algorithm for some types, so we
need to update the tests that depend on those concrete values.

Fixes #1102
robdockins added a commit that referenced this issue Apr 7, 2021
Instead, directly use the generators defined in `tf-random`.
This changes the generation algorithm for some types, so we
need to update the tests that depend on those concrete values.

Fixes #1102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something not working correctly test-framework For issues related to Cryptol's test framework.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants