-
Notifications
You must be signed in to change notification settings - Fork 12
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
implement partition via partition-values #41
Conversation
@countvajhula I am now remembering some things about Racket BC that may make implementing this via qi/macro harder. Any thoughts? Or is the BC failure not related to this (do you know)? With permission, I'd also like this PR (or another commit after this PR merges) to bump the version (I'm thinking 2.1, since it shouldn't be breaking). The reason for this request is that I have another package for which I originally implemented this code; with the version bump after the merge, I can have that package depend on "new enough" Qi and remove the code I wrote. |
Actually, what I remembered is about 8.3+ vs. 8.2-, so this failure shouldn't be related to BC specifically. |
@benknoble Thank you for this 💛 . I still need to take a closer look but is there any reason Re: the build failure on BC, it sounds a lot like this error, which is a known issue. A workaround is to use Re: new version, that sounds like a good reason to cut a new version. As it happens I have been planning a new version for the near future and was envisioning it to include:
And this PR would be great to include as well. I'd say we're pretty close on these. One thing to keep on the radar is that #38 would affect the present PR. It's a straightforward mapping:
Since the mapping is straightforward, I think we can work on the present PR without worrying about #38. And depending on which one gets merged first, the other can translate this partition code to the new way. |
It is like If you want a completely backwards-incompatible break, Until we finalize this, I will keep partition as its own form.
Implementing in
Yes, one or the other should be translatable. |
4337e5f
to
fcc01a3
Compare
Would putting the In that case, this needs a fresh form benchmark in |
Now that tests pass, I'll accept the invite and add the profiling. Then when we have results I'll add the fancier implementation and compare. RE: naming, sounds good. |
Pushing metrics still isn't working, but the result for the first two commits (naïve impl.) is currently
Now we'll see if the partition-values commit works on the first try 😅 |
@benknoble oh man, that's annoying, sorry for the hassle 😖. It would be great to figure out the permissions issue but I think that might take some time since even the official recommendation from github-action-benchmark is that pull requests are not supported. So for now, in order for the charts to show the magic, I'm thinking what we could do is, once this PR is reviewed and ready to go, I can manually cherry-pick the initial version of |
@benknoble Actually, another, possibly better option: we merge the partition PR with the initial implementation, and then do a second PR for the improved implementation. That way we can use normal workflows instead of cherry-picking, etc. Thanks for your patience as we iron out the kinks in the performance stuff 😄 |
New results:
which is definitely an improvement. @countvajhula I'm ok with either approach. Let me know what you want to do—I can close this PR if necessary to open 2 new ones, or re-push it to the original naïve partition + profile and then open a 2nd later for |
@benknoble Awesome! Ok yes, let's do the two-PR approach then. Btw in case you haven't tried already, you can also run tests and profiling locally, via |
Yeah, I know, but the intra- and inter- package requires mean I have to uninstall and reinstall Qi to point to a development copy, and I now have a few local packages that depend on Qi, and it wasn't worth the hassle at the time 😅 |
Do you want this to be PR #1 or do you want 2 brand new PRs? |
I don't have a preference - maybe two new PRs would be easier? Whatever's more convenient for you! |
@@ -137,6 +138,31 @@ | |||
(define (filter-values f . args) | |||
(apply values (filter f args))) | |||
|
|||
(define (partition-values c+bs . args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would be good to add some comments to explain how this function works at a high level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erm, yes. It was written in a fugue of "flow state" ;) and never got the attention it deserved.
Summary of Changes
partition
viapartition-values
as in Generalized Sieve #40.I didn't test this locally beyond what I had in my original local implementation, so I don't know if my code yet fits into the expected repo structures correctly. I'm hoping the GH action will tell :)
Public Domain Dedication
I'm leaving the below unless it's noise for anyone that isn't me and can be removed.
(Why: The freely released, copyright-free work in this repository represents an investment in a better way of doing things called attribution-based economics. Attribution-based economics is based on the simple idea that we gain more by giving more, not by holding on to things that, truly, we could only create because we, in our turn, received from others. As it turns out, an economic system based on attribution -- where those who give more are more empowered -- is significantly more efficient than capitalism while also being stable and fair (unlike capitalism, on both counts), giving it transformative power to elevate the human condition and address the problems that face us today along with a host of others that have been intractable since the beginning. You can help make this a reality by releasing your work in the same way -- freely into the public domain in the simple hope of providing value. Learn more about attribution-based economics at drym.org, tell your friends, do your part.)