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

breedthreads = auto causes individuals getting lost, and few exceptions #77

Closed
ZvikaZ opened this issue May 23, 2021 · 8 comments
Closed

Comments

@ZvikaZ
Copy link

ZvikaZ commented May 23, 2021

Hi.

When I add breedthreads = auto, I see that some individuals are getting lost, and there are few exceptions. (evalthreads = auto is working well).

I've encountered this issue before, in a larger project; but it also appears in the small sample project that I've just created: https://github.com/ZvikaZ/ECJ-sample (see #76). Just run it, and it shortly fails. You can comment the breedthreads = auto in the params file, and see that everything is fine.

BTW,
I have encountered this on two different machines, running Linux and Windows.

@eclab
Copy link
Collaborator

eclab commented May 23, 2021 via email

@ZvikaZ
Copy link
Author

ZvikaZ commented May 24, 2021

Indeed, it seems to solve the problem. Thanks for the quick fix.
I got a lot of Yo mama prints, but as far as I understand the code that issues them, it should be harmless. Right?

BTW, it'd be nice to add this scenario to the tests, to avoid similar bug in the future.

@SigmaX
Copy link
Collaborator

SigmaX commented May 24, 2021 via email

@ZvikaZ
Copy link
Author

ZvikaZ commented May 24, 2021

BTW, it'd be nice to add this scenario to the tests, to avoid similar bug in the future.

Agreed! Your sample project should give us enough detail to create a test. Is it as simple as setting breedthreads = auto and watching the population size for a few generations? Thanks, Siggy

Yeah.
Note that it already contains a checker for this: https://github.com/ZvikaZ/ECJ-sample/blob/124008a98dcfca0c6d3378364f261879409a7409/src/main/java/SampleProblem.java#L22

    var p = state.population.subpops.get(0);
    if (p.initialSize != p.individuals.size()) {
        state.output.fatal("someone got lost!!! (you might want to comment `breedthreads = auto` in the params file)");
    }

Also note, that now my sample project doesn't fail, as it's using a .jar that I've compiled with the fixes suggested in this thread.

@ZvikaZ
Copy link
Author

ZvikaZ commented Aug 18, 2021

There are two bugs. What you see is a race condition. Fixing that revealed an underlying architectural issue with GroupedProblemForm which I have to think about, but in the meantime I've patched it with a hack.

Grab the following files from the repository and you should be good to go.

M src/main/java/ec/breed/BufferedBreedingPipeline.java
M src/main/java/ec/simple/SimpleEvaluator.java

Sean

Hi.
Any news with the long-term solution?
I think that I've found an issue with the hack, but I'm not sure it's worth reporting, if that hack will be replaced soon...

Thanks

@eclab
Copy link
Collaborator

eclab commented Aug 18, 2021 via email

@ZvikaZ
Copy link
Author

ZvikaZ commented Aug 18, 2021

Great. I didn't get an answer for my 2 PRs since May (and I have reminded in #79 few days ago), so I was afraid that the project has gone sleeping :-)

We're all busy, it's OK. I didn't want to be a nudge, so I hesitated with this.

It's a little bit related, since I'm working with a local version with those 2 PRs integrated. Thus, if you think that they will be reviewed soon, I prefer to report the details of the issue after that, so we will have the same version. Otherwise, I will run with the official master, to eliminate such influences.

@eclab
Copy link
Collaborator

eclab commented Aug 25, 2021

I've decided that the hack is in fact probably good enough for long-term. I modified it slightly (hope I didn't break anything) and have committed it with a bit of documentation as well. Reopen the issue if things aren't working right.

@eclab eclab closed this as completed Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants