Skip to content

Improve Ord IntSet instance #787

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

Closed
treeowl opened this issue Jun 28, 2021 · 13 comments · Fixed by #1086
Closed

Improve Ord IntSet instance #787

treeowl opened this issue Jun 28, 2021 · 13 comments · Fixed by #1086

Comments

@treeowl
Copy link
Contributor

treeowl commented Jun 28, 2021

An attempt was made in #670, but it proved to have some subtle bug in #783 and had to be reverted. It would be nice to fix and reinstate.

@jwaldmann
Copy link
Contributor

I'm on it. First step is to trigger the bug in testing. I made an Arbitrary instance that produces larger numbers jwaldmann@80af818 (this may be generally useful?) and then indeed I am seeing the mis-behaviour with

stack  test :intset-properties --ta '-t instance'  --ta '-a 100000'

I will next look into a proposed fix jwaldmann@259b737 but it's not working as-is.

@jwaldmann
Copy link
Contributor

jwaldmann commented Jul 21, 2021

This Large generator already exists (https://hackage.haskell.org/package/QuickCheck-2.14.2/docs/Test-QuickCheck.html#t:Large) so I am using that 7d89135 . All intset-properties look good - except for the Ord-related ones. An example is

prop_instanceOrdIntSet: [Failed]
*** Failed! Falsified (after 6487 tests):
fromList [8614693178962916916,9139268739591489368]
fromList [2968846309351689790,4115242320062133052,8853465997820928815]
(used seed 4781226516308396838)

this is probably related to some overflow that changes the sign.

Yes - 182b06b looks good now.

@jwaldmann
Copy link
Contributor

How should I proceed here? I think the issue is fixed. Rebase the fix on #788?

@treeowl
Copy link
Contributor Author

treeowl commented Aug 17, 2021

Weren't you trying to fix the clever instance?

@jwaldmann
Copy link
Contributor

I think I did (

instance Ord IntSet where
) I'm just asking how you want the PR.

@treeowl
Copy link
Contributor Author

treeowl commented Aug 17, 2021

I feel like there's some communication issue going on here, but I'm confused as to who doesn't understand whom and why. Yes, I'd expect you to rebase your improvement branch on master and submit a PR, but if you have other intentions just explain again please.

@jwaldmann
Copy link
Contributor

Sorry for being not clear. I was waiting for #788 to land. It is orthogonal in the source - the connection is that it would have caught the bug in this "clever" instance. Anyway I will base on (current) master.

@meooow25
Copy link
Contributor

meooow25 commented Aug 2, 2024

@jwaldmann any chance you would want to try this again, since #788 is resolved?

@jwaldmann
Copy link
Contributor

yes I will look into this.

@meooow25 meooow25 mentioned this issue Aug 5, 2024
8 tasks
@meooow25
Copy link
Contributor

meooow25 commented Oct 5, 2024

@jwaldmann just checking if you made some progress on this. Would be nice to wrap this up. I could give it a try if you've been too busy.

@jwaldmann
Copy link
Contributor

Sorry for the ongoing delay, and thanks for the offer. I am trying this week. After that - you may take over.

@meooow25 meooow25 mentioned this issue Oct 31, 2024
9 tasks
@meooow25
Copy link
Contributor

@jwaldmann, any luck?

@meooow25
Copy link
Contributor

meooow25 commented Jan 3, 2025

I'll try implementing this tomorrow.

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

Successfully merging a pull request may close this issue.

3 participants