tdulcet / Distributed-Computing-Scripts

🖧 Distributed Computing Scripts for GIMPS, BOINC and Folding@home
MIT License
19 stars 12 forks source link

--mfaktc and --mfakto prototype #24

Closed brubsby closed 3 months ago

brubsby commented 4 months ago

Very much a work in progress, but creating this PR mostly as a jumping off point for discussion and feedback. Probably won't be ready for v2.2, and definitely shouldn't hold up the release of CERT support.

Current TODO:

Nice to have:

Testing areas:

Bugs:

Server-side changes wishlist:

Probably won't do:

brubsby commented 4 months ago

Ended up forking mfaktc to add json results that include the AID, will probably add default logging soon too, so we can parse the logs and use those for work estimation.

brubsby commented 4 months ago

--max-exp (and presumably --min-exp) aren't working with work preference 12.

connectionpool.py: [MainThread 2024-07-25 11:45:42,315]  DEBUG: http://v5.mersenne.org:80 "GET /v5server/?px=GIMPS&v=0.95&t=ga&g=[guid]=0&a=&max=138000000&ss=19191919&sh=ABCDABCDABCDABCDABCDABCDABCDABCD HTTP/11" 200 179
primenet.py: [MainThread 2024-07-25 11:45:42,316]  INFO: PrimeNet success code with additional info:
primenet.py: [MainThread 2024-07-25 11:45:42,316]  INFO: Server assigned trial factoring work.
primenet.py: [MainThread, Worker #1 2024-07-25 11:45:42,316]  INFO: Got assignment D5BBDEFA9AA42BBBC44F3AD5CFA8DA31: Trial factor M146204119
primenet.py: [MainThread, Worker #1 2024-07-25 11:45:42,316]  DEBUG: Fetching using v5 API
primenet.py: [MainThread, Worker #1 2024-07-25 11:45:42,316]  INFO: Getting assignment from server

We can maybe ask George or James to add support for these, as it looks correct from our side, but either way not extremely pressing. Just wanted to test them out since you mentioned them.

brubsby commented 4 months ago

Starting another spot for discussion here, as it's not really mfaktx related per se, but primenet related, and I feel I've saturated my outgoing communications to folks for the time being :)

For my TODO post above:

fix percentage calculation for Stages=1 and multiple bitlevel assignments This raises some question about what exactly we should report as STAGE and percentage in various cases. Let's go through an example of an assignment that is TF from 2^75 to 2^77.

If mfaktc.ini has Stages=0, then my understanding is that it's running every single bitrange in the assignment at once, so for example, if we find a 76.5 "bit" factor, we aren't sure that there isn't also 75.5 "bit" factor to be found in the range as well. So from this, reporting a simple TF75 stage seems a bit misleading, as the percentage associated with this stage is actually the joint percentage of TF75-77.

Similarly if mfaktc.ini has Stages=1, and we're reporting progress on TF from 2^75 to 2^77, we will report progress stage TF75 (and a percentage) during 75-76, and then TF76 (and a percentage) during 76-77. What exactly these percentages should be is unclear to me. If we are reporting 0-100% for each stage, then TF75 (and a percentage) is indistinguishable from the Stages=0 case of TF75 (and a percentage).

Estimated completion date, I would think, should just be when we expect to release the exponent, and not necessarily when the current stage is done. But I'm not sure if percentage should be that as well.

TL;DR: Should percentage be our progress on the current stage, or the progress of the whole assignment?

brubsby commented 3 months ago

As the number of changes in this PR keeps growing, merging upstream changes starts to get a bit more painful (I think it might've been better if I started with a rebase, but my tooling kept telling me a merge was a better idea), would you be open to merging this into the 2.2 branch at some point soon, and doing more changes as another PR? Or would you rather keep a version of the code with CERT stuff separate from the TF stuff, in case we want to release them independently?

brubsby commented 3 months ago

Here's the code I used to regenerate the merged table, on the chance it saves you any amount of manual effort:

import tables
tables.array(
    (
        (4,    "✔",  "✔",   "",   "",   "",  "✔"),
        (12,    "",   "",   "",   "",  "✔",   ""),
        (100,  "✔", "✔*",  "✔",  "✔",   "",   ""),
        (101,  "✔",   "",   "",  "✔",   "",   ""),
        (102,  "✔", "✔*",  "✔",  "✔",   "",   ""),
        (104,  "✔", "✔*",  "✔",  "✔",   "",   ""),
        (106,   "", "✔*",  "✔",  "",   "",   ""),
        (150,  "✔",  "✔",  "✔",   "",   "",   ""),
        (151,  "✔",  "✔",  "✔",   "",   "",   ""),
        (152,  "✔",  "✔",  "✔",   "",   "",   ""),
        (153,  "✔",  "✔",  "✔",   "",   "",   ""),
        (154,  "✔", "✔*",   "",   "",   "",   ""),
        (155,   "",  "✔",  "✔",   "",   "",   ""),
        (156,   "",   "",   "",   "",   "",   ""),
        (160,  "✔",   "",   "",   "",   "",   ""),
        (161,  "✔",   "",   "",   "",   "",   ""),
    ),
    ("Worktype", "Mlucas", "GpuOwl", "PRPLL", "CUDALucas", "mfaktc/mfakto", "CUDAPm1"),
    headerrow=True,
)

(I really wish the check glyph used had a monospaced glyph in most of the fonts used in editors and stuff, lol)

tdulcet commented 3 months ago

would you be open to merging this into the 2.2 branch at some point soon, and doing more changes as another PR?

Sorry about the hassle. Yes, we can merge this soon and then make any additional improvements in another PR. If we are going to support mfakto, it might be good to get that working with the script. For now, I will wait to push any more changes to the 2.2 branch until this is merged.

I really wish the check glyph used had a monospaced glyph in most of the fonts used in editors and stuff, lol

Yeah, I liked the checkmark symbol, but I agree that it is annoying that this table does not align in editors, so feel free to use different symbol. You could also change the appearance of the table by adjusting some of the options for my library.