04:16:41 Can anyone confirm what @xmrack wrote? 04:16:43 I don't see an update on the official webpage (https://github.com/j-berman/fcmp-plus-plus-optimization-competition). 04:16:45 I submitted my Helioselene entry 5 days early. Berman answered a question that I put into the PR. No feedback or requests for changes were given in the PR or here in Matrix chat. I'm happy make any changes needed or required even if they are outside the scope of the contest, but I'd need to know what was invalid if that's truely the case. I'd like to make the repo public, but sinc 04:16:47 e there is a chance that the competition is ongoing, here's a Gist with the benchmarks that I was getting: 04:16:49 https://gist.github.com/dimalinux/fef1a6f70df3f6924e22c45f50b1cc3b 04:38:49 <3​21bob321:monero.social> Are you in monero research lab ? 04:39:02 <3​21bob321:monero.social> Was posted there 04:41:03 I'll join it (thanks!). If you read the README for the competition, this is the official channel. 05:43:50 woopsidaisy 06:00:55 Wow. After spending many, many man hours on the Helioselene contest, the last thing I expected as the result was to be accused off plagiarism and writing code that breaks US Copyright law (see the research channel). I know kayabanerve can be passionate and I'm very grateful for all the work he does, so I'm not going to hold it against him. That said, to counter these accusations, 06:00:55 I'm opening the repository permissions for my submission: 06:00:57 https://github.com/dimalinux/fcmp-plus-plus-optimization-competition/pull/1 06:00:59 All my code is in the branch called `contest`. I submitted my entry 5 days early and explicitly asked in the PR on how to do attribution for the `crypto-bigint` code. If I had received a request, I would have already made it. The contest is using the MIT license, just as the `crypto-bigint` library, and the `cypto-bigint` library was already doing the vast majority of the liftin 06:01:01 g in the competition's reference code. 06:01:03 The rules for the contest stated: 06:01:05 > helioselene uses crypto-bigint for its arithmetic. Replacing its field arithmetic with a tailored implementation will likely provide significant savings. 06:01:07 I stripped the library down to the nuts and bolts and created a tailored U256 implementation with const modular arithmetic. 06:01:09 Here is what the reference code was using (and the code base that I started with): 06:01:11 https://github.com/RustCrypto/crypto-bigint/tree/v0.5.5https://github.com/RustCrypto/crypto-bigint/tree/v0.5.5 06:05:48 The code in question that started from the `cypto-bigint` (but doesn't have a ton in common with it now) is all under this folder (no where else): 06:05:49 https://github.com/dimalinux/fcmp-plus-plus-optimization-competition/tree/contest/helioselene-contest/helioselene-contest-src/src/u256 06:15:36 From what I read in the research-lab channel, the main problem with this is that it's a dependency inlined in the source tree of this solution, which adds a burden of maintaining it (who will pull and integrate all the fixes and changes from the parent lib?). Also, there is not comments in files with attributions and/or reference of where the files 06:15:36 were taken from. No matter if it's a MIT license (free for any use), authors of that code should be mentioned in the top comment in each file ("copyright" comment). And their original LICENSE file should also be there. Another problem with this solution was that it wasn't fast enough if the original crypto-bigint lib was used. 06:22:23 @sech1 The `crypto-bigint` is a ginormous monster. Look at how much code is in that `u256` module: 06:22:23 ``` 06:22:25 helioselene-contest-src$ wc -l $(find src/u256 -name '*.rs') | tail -1 06:22:27 1659 total 06:22:29 ``` 06:22:38 @sech1 The `crypto-bigint` library is a ginormous monster. Look at how much code is in that `u256` module: 06:22:39 ``` 06:22:41 helioselene-contest-src$ wc -l $(find src/u256 -name '*.rs') | tail -1 06:22:43 1659 total 06:22:45 ``` 06:25:37 1659 line is a monster? That's a small library, if you ask me. You haven't seen BIG libraries yet. 06:26:47 Also note that I didn't strip any copyrights from the code (that project only does its license at the top of the repo), and I nicely asked how to best add attribution here on June 25th: 06:26:49 https://github.com/dimalinux/fcmp-plus-plus-optimization-competition/pull/1#discussion_r2167611866 06:29:43 Ah, 1659 files, not lines. Still not very big. grpc C++ library with all its dependencies is 13223 files, for example 06:29:56 1659 is *my* code for U256. The `crypto-bigint` library is much larger. And it's a monster in terms of readability, as it is trying to solve a much bigger problem than U256. My version eliminates a lot of templating. 06:30:57 Still, the best practice is to use the original library as it is much easier for maintainability. And another point about your code not being fast enough with the original library, still stands. But I'm not the judge in that competition. 06:31:16 1659 is _my_ code for U256 (that's lines, there are 20 files). The `crypto-bigint` library is much larger. And it's a monster in terms of readability, as it is trying to solve a much bigger problem than U256. My version eliminates a lot of templating. 06:36:11 Optimizing the U256 code was where I spent the majority of the time and how I got the performance improvements. The contest rules explicitly suggested removing its use with a tailored solution, so that is what I ran with. 06:36:29 I took a quick look at https://github.com/RustCrypto/crypto-bigint/tree/master/src/modular/monty_form (this library, right?), and I don't see any mess in the code. Yes, the code is complex and has this feel of long-time developed library that handles all the possible uses, but it's not a mess and not a monster code 06:36:31 Optimizing the U256 code was where I spent the majority of the time and how I got the performance improvements. The contest rules explicitly suggested removing crypto-bigint's use with a tailored solution, so that is what I ran with. 06:38:18 Like I said, I'm not the judge in that competition. They had their reasons, probably. 06:39:09 For what it is trying to accomplish, it is not a mess. It is just trying to accomplish a hell of a lot more. Note that it is big enough that you did not pick the right directory. You wanted `src/modular/const_monty_form`. 06:40:20 Looks to me as if "being faster" and "using the original library" are mutually exclusive. Bring the original library in again -> there is no more contest entry, because nothing is any faster than before. 06:41:05 Good point. The contest was about helioselene, not bigint optimization 06:43:19 (I am speaking in the context of dimalinux 's contest entry, and I tend to support their viewpoint that what they did should be permitted, given the circumstances.) 06:44:00 The contest rules weren't clear enough then 06:44:17 Yeah, right :) Hindsight, I heard about it 06:45:00 But well, if it turns out that BitInt optimizations *is* on the way to make Helioselene faster ...? 06:45:39 I considered taking part in the contest, but Rust stopped me. I also read that heliosene entries were expected to have some Crandall prime optimization (?) that would really speed them up. And I agree, algorithmic optimizations are always better than hand-tuning the code to get a few % 06:45:48 @rbrunner7:monero.social: I just don't feel like there was any way I could have known these requirements. I'll quote the contest suggestion again as it is getting buried here: 06:45:49 > helioselene uses crypto-bigint for its arithmetic. Replacing its field arithmetic with a tailored implementation will likely provide significant savings. 06:45:51 My u256 module is a tailored implementation of the math for the field arithmetic. On top of that, I'm being accused of plagiarism and breaking copyright law. So I opened up the repo permissions so that everyone can see that this is plainly not the case. 06:45:51 And this submission didn't do it 06:46:13 In fact, both submissions didn't do it 06:46:26 And the contest rules didn't ask for it ... 06:46:40 Only perhaps hinted at it to be a good way 06:48:27 Does anyone have good references for Crandall prime optimization? Especially references tailored for implementing it in code? (They were hinted at on the top page. Putting it in the helioselene specific page could have helped people a little.) 06:49:52 No idea :) In a few hours some people in the know, located in the Americas, will wake up and might help. Could be a good idea to also ask in the MRL room. 06:56:18 I guess the answer is somewhere in this book https://www.amazon.com/Prime-Numbers-Computational-Richard-Crandall/dp/0387947779 07:43:31 Anyways, I'm going to bed. By any reasonable interpretation of the contest rules, I should be awarded the prize and I will gladly modify the code until it makes everyone happy. I'm even happy to forgo the prize until J Berman and Jeffro are happy with it assuming they have time to communicate in the PR or chat about the changes to make. The cuprate group wanted lots of changes whe 07:43:33 n I implemented the legacy cryptonight hash in Rust for them. They'll vouch for me. I made sure that everyone was happy before that code got merged. My contest entry is open now, so no one can seriously accuse me of breaking copyright law (or even not wanting to give attribution for the roots of the `u256` module). 07:44:13 good night 07:44:13 sweet dream 12:51:09 https://annas-archive.org/search?index=&page=1&q=Crandall+%26+Pomerance%2C+Prime+Numbers&display=&sort= 12:55:58 dimalinux: I'm sorry if I personally offended you, and I did not mean to. AFAICT, your repository currently violates crypto-bigint's license. That was my citation. 12:57:07 Asking in a PR how to attribute crypto-bigint does not make it attributed. Your library bring MIT-licensed does not make crypto-bigint properly licensed. crypto-bigint already being a dependency does not mean its source code can be directly copied without attribution. 12:59:15 My comment was on the pedantry of it, and I hope it was clear I acknowledged the contest had a flawed feedback loop IMO and that should have explicitly existed and been better handled. One of the reasons I supported an extension was to effect that feedback loop despite not originally being present. 12:59:51 sech1, rbrunner7: Depends on the definition of "expected". 13:00:58 dimalinux: "I should be awarded the prize", no, you should be eligible for the prize in your opinion. Being awarded it would require you have the best eligible submission. 13:02:45 I'm legitimately unsure if your entry meets the minimum performance bar once the Ed25519 code is reverted. Because of how you replaced the macro'd point for a generic (completely valid), I was unable to quickly revert that aspect and evaluate from there. 13:02:55 "Expected" means some algorithmic improvements, not just code tuning 13:03:17 like with divisors, where it got 30x speedup. Now that's the speedup! 13:03:29 While we could not revert the ed25519 code, it's unusable without such a reversion because not using the same type from dalek_ff_group removed functionality and broke interoperability. 13:03:55 Code tuning can be done slowly over time, once an optimal algorithm is implemented 13:03:59 sech1: I mean, the expectation was performance and the presumed was way Crandall prime. That didn't introduce an explicit expectation. 13:04:27 Also, friendly reminder I'm speaking as someone who proposed the contest, someone who works on the FCMP++ tree, and someone who did some review of the entries, not as a judge. 13:04:37 My opinion is solely an opinion. 13:05:15 a​illia thanks for the link btw, will be an interesting weekend read for me (irrespective of the current contest) 13:05:22 I appreciate the apology. Honest question here: If crypto-bigint is dual licensed under the MIT license and the contest is under the MIT license, why would there be any licensing conflict. I think we should give attribution in wherever the code is going. I feel like maybe no one even looked at the code to see how different it is after optimizing it for the contest use case. 13:05:43 Because MIT requires attribution. 13:05:50 I appreciate the apology. Honest question here: If crypto-bigint is dual licensed under the MIT license and the contest is under the MIT license, why would there be any licensing conflict. I think we should give attribution in wherever the code is going. I feel like maybe no one even looked at the code to see how different it is after optimizing it for the contest use case (as a side note). 13:06:31 MIT doesn't require you use the same license. MIT requires you follow the stated licensing terms. MIT requires attribution. The code I viewed did not attribute itself properly. 13:07:25 "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software" 13:07:49 so as long as the LICENSE and AUTHORS file are copied (and copyright comments in the source files are preserved), it should be enough 13:08:13 Distinctly, regarding the crypto-bigint changes: I did not have access to the commit history and did not run a diff at the time. I only cared for the end performance numbers at this time which did outperform the implementation of helioselene I initially put forth :) 13:10:52 Right, so there's my LICENSE file in dimalinux's tree: https://github.com/dimalinux/fcmp-plus-plus-optimization-competition/blob/contest/helioselene-contest%2Fhelioselene-contest-src%2FLICENSE 13:10:53 The inclusion of the u256 mod: https://github.com/dimalinux/fcmp-plus-plus-optimization-competition/blob/contest/helioselene-contest%2Fhelioselene-contest-src%2Fsrc%2Flib.rs#L194 13:10:55 And then its actual code: https://github.com/dimalinux/fcmp-plus-plus-optimization-competition/blob/contest/helioselene-contest%2Fhelioselene-contest-src%2Fsrc%2Fu256%2Fmod.rs 13:10:57 All without further licensing (and none in that folder). 13:11:39 > Copyright (c) 2021-2025 The RustCrypto Project Developers 13:11:39 > ... 13:11:41 > The above copyright notice and this permission notice 13:11:43 shall be included in all copies or substantial portions 13:11:45 of the Software. 13:11:50 So just to be clear, that attribution problem is out of the way as soon as there is an attribution. It's a problem, but one that will be easy to solve. There are more issues of course, but that is thankfully simple. 13:12:29 I'm not saying dimalinux is malicious and didn't simply misunderstand, which was a flaw in the contest. It didn't have a proper flow to correct (relatively simple) misunderstandings, hence the extension. 13:13:04 I am saying that yes, currently this breaks one of the contest rules. 13:13:07 rbrunner7: Yes. 13:13:21 Ok :) 13:14:13 FWIW crypto-bigint is also APACHEd (user's choice) and that also wasn't chosen, and I did immediately recognize the code. 13:17:04 I was following the suggestion right in the contest: 13:17:05 > helioselene uses crypto-bigint for its arithmetic. Replacing its field arithmetic with a tailored implementation will likely provide significant savings. 13:17:07 Was I supposed to somehow clean room the tailored implementation even though the the 2 code bases are completely license-compatible? 13:19:37 No. You didn't license crypto-bigint though dimalinux 13:20:11 Your current usage of crypto-bigint, AFAIK, I am not a lawyer, is subject to American DMCA claims and lawsuits. 13:20:53 The contest has a rule to not accept code that puts the Monero project in a legally risky position. 13:23:49 Using it as a dependency didn't redistribute its source code. Inlining it does. I want to clarify that in case your confusion was over our existing usage of the library. 13:26:56 Also, again: the suggested fix from the MRL discussions isn't to replace your fork. It's just to license it. 13:28:44 There's also the issue of the first part of rule 2 and rule 7: 13:28:45 > 2. Submissions must be written by the submitter... 13:28:47 and 13:28:49 > 7. Dependencies must be pre-approved. 13:28:51 Is modifying and vendoring a dependency still a dependency? We could argue technicalities, but I argue that it breaks the spirit of the rules either way, and it wasn't pre-approved. The majority of the submission by line count isn't written by you AFAICT. 13:28:54 There's also the issue of the first part of rule 2 and rule 7: 13:28:55 > 2. Submissions must be written by the submitter... 13:28:57 and 13:28:59 > 3. Dependencies must be pre-approved. 13:29:01 > Is modifying and vendoring a dependency still a dependency? We could argue technicalities, but I argue that it breaks the spirit of the rules either way, and it wasn't pre-approved. The majority of the submission by line count isn't written by you AFAICT. 13:29:04 Ok. So if I duplicate the MIT license file in the `u256` folder and add `Copyright (c) 2021-2025 The RustCrypto Project Developers` to give them attribution and we are good? 13:29:13 There's also the issue of the first part of rule 2 and rule 7: 13:29:15 > 2. Submissions must be written by the submitter... 13:29:17 and 13:29:19 > 7. Dependencies must be pre-approved. 13:29:21 Is modifying and vendoring a dependency still a dependency? We could argue technicalities, but I argue that it breaks the spirit of the rules either way, and it wasn't pre-approved. The majority of the submission by line count isn't written by you AFAICT. 13:29:23 Sorry about the edits IRC folks... 13:32:11 jeffro256: That was something I raised yet a discussion which wasn't actually had. I'll refrain from that beyond speculation and if this submission is optimal, given the line count, would likely call for its allowance given it's a fork of a pre-approved dependency but that's my opinion as an individual. 13:41:20 dimalinux: Regarding my licensing concerns? Yes. Inclusion of their license should reconcile that. 13:43:00 Regarding Crandall primes, I think this is what was meant by this: https://eprint.iacr.org/2006/121.pdf 13:43:07 "Also, Crandall [2] proposed a new form of primes, namely n = 2d−C, where C is a relatively small odd number, e.g. no longer than the length of a computer word (16-32 bits). When a modulus n is of this form, modular arithmetic can be accomplished using only shifts and additions, eliminating costly divisions." 13:43:28 Eliminating divisions will indeed bring a huge speedup 13:44:45 Thanks for the clarity. I'll add it. 16:25:55 No fair use exemption for privately shared contest code when the proper attribution and source was acknowledged? 17:40:42 I'm not a lawyer, but I'm pretty sure fair use doesn't apply when in a contest for monetary benefits. Doesn't matter that it isnt publicly shared. Proper attribution *wasnt* given , which is the issue at hand 17:45:42 Doesn't fair use cover research and scholarship? 17:46:18 I think it not being publicly shared goes to 'the purpose and character of the use' 19:24:35 I feel the need to comment here, as "wasn't" was written in bold. It was very clearly noted in the unmerged PR submitted well before the deadline: 19:24:37 https://github.com/dimalinux/fcmp-plus-plus-optimization-competition/pull/1#discussion_r2167611866 19:24:39 As soon as my question as to how best to attribute the code was answered here in the chat today, I added the additional MIT licence to the repo. It's not the solution I would have come up with, so I am glad that I asked for clarification.