Skip to content

Added functionality for Steal/Donate instructions to HealthHosts - #251

Merged
anyaevostinar merged 35 commits into
anyaevostinar:complex-syms-cleanfrom
EliasH-E:steal_instructions
Jul 18, 2025
Merged

Added functionality for Steal/Donate instructions to HealthHosts#251
anyaevostinar merged 35 commits into
anyaevostinar:complex-syms-cleanfrom
EliasH-E:steal_instructions

Conversation

@EliasH-E

@EliasH-E EliasH-E commented Jul 7, 2025

Copy link
Copy Markdown
Collaborator

Additionally added tests for these new instructions to HealthHost.test.cc

Comment thread source/sgp_mode/GenomeLibrary.h Outdated
Comment thread source/sgp_mode/GenomeLibrary.h Outdated
Comment thread source/sgp_mode/GenomeLibrary.h Outdated
Add("SharedIO");
}

void AddSteal(int steal_count){

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name should make it clear what the overall phenotype is since it's more than just adding a single steal instruction. And what is it actually doing since it has steal and donate?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I kind of actually forgot that this would be added to the pull request automatically on pushing. This was my current rusty implementation of placing steals throughout the genome. For some reason it was not letting me add nop inbetween, I was planning on asking about that in the slack today but it slipped my mind. I used donate because currently in my tests unless ALLOW_TRANSITION is on donate will do nothing.

Comment thread source/sgp_mode/GenomeLibrary.h Outdated
Comment thread source/sgp_mode/GenomeLibrary.h Outdated
Comment thread source/sgp_mode/GenomeLibrary.h Outdated
Comment thread source/sgp_mode/HealthHost.h Outdated
Comment thread source/sgp_mode/HealthHost.h
Comment thread source/sgp_mode/HealthHost.h Outdated
Comment thread source/sgp_mode/HealthHost.h Outdated
Comment thread source/sgp_mode/HealthHost.h
@anyaevostinar

Copy link
Copy Markdown
Owner

Looks like this has an error in the tests

Comment thread source/sgp_mode/HealthHost.h Outdated
Comment thread source/sgp_mode/HealthHost.h Outdated

}

//This sequence checks if the symbiont will recieve a cycle, if it has not then it checks if

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"receive"

Comment thread source/sgp_mode/SGPConfigSetup.h Outdated
Comment thread source/sgp_mode/SGPConfigSetup.h Outdated

SGPWorld world(random, &config, LogicTasks);

//Builds program that does both NOT and NAND operations

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are places where you could use the "GIVEN" catch command

Comment thread source/test/sgp_mode_test/SGPSymbiont.test.cc Outdated
Comment thread source/test/sgp_mode_test/SGPWorld.test.cc Outdated
host_baby->AddSymbiont(sym_baby);

WHEN("Host and Symbiont have both performed NOT"){
host->GetCPU().state.tasks_performed->Set(0);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's setting tasks_performed to 0?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are referring to line 109 I believe that Set(0) does not set tasks_performed to 0 but instead sets the 0th task (NOT) to 1.

Comment thread source/test/sgp_mode_test/SGPWorld.test.cc Outdated
Comment thread source/test/sgp_mode_test/SGPWorld.test.cc Outdated
Comment thread source/test/sgp_mode_test/SGPWorld.test.cc Outdated

@anyaevostinar anyaevostinar left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things to change, good progress!

@codecov

codecov Bot commented Jul 15, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 94.88189% with 26 lines in your changes missing coverage. Please review.

Project coverage is 86.31%. Comparing base (05cf3ba) to head (939728e).

Files with missing lines Patch % Lines
source/sgp_mode/SGPDataNodes.h 36.36% 14 Missing ⚠️
source/sgp_mode/GenomeLibrary.h 76.74% 10 Missing ⚠️
source/sgp_mode/HealthHost.h 93.93% 2 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           complex-syms-clean     #251      +/-   ##
======================================================
+ Coverage               85.91%   86.31%   +0.40%     
======================================================
  Files                     144      145       +1     
  Lines                   11231    11713     +482     
  Branches                  120      120              
======================================================
+ Hits                     9649    10110     +461     
- Misses                   1548     1569      +21     
  Partials                   34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

emp::Ptr<SGPSymbiont> sym = emp::NewPtr<SGPSymbiont>(&random, &world, &config, CreateNotProgram(100));


emp::Ptr<SGPSymbiont> sym_baby = emp::NewPtr<SGPSymbiont>(&random, &world, &config, CreateNotProgram(100));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like you use the babies in this test so you should not make them

@anyaevostinar
anyaevostinar merged commit 0b0a6b1 into anyaevostinar:complex-syms-clean Jul 18, 2025
1 of 2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants