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

Add storage for encoding/decoding should_skip #2905

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mgarrard
Copy link
Contributor

Summary: This is the fiinal p0 follow up to the stack from 52-57, and in this diff we add storage for this field :)

Differential Revision: D64519394

Summary:

There are some cases where the input constructor returns n=o, specifically for repeat arms, this is currently causing an issue in generaiton strategy gen method because if we don't generate from a node we can't meet the TC, and move forward, however, we don't actually want to generate from that node.

This simply exposes a prop on gen node to expose this, and default it to false

Following diffs will:
- update TC.is_met() to accept a GenNode instead of just the name
- update input constructor to properly set should skip
- update the gs to appropiately handle resetting to false after a gen is completed

Reviewed By: lena-kashtelyan

Differential Revision: D64444258
…ebook#2893)

Summary:

**Context:** There are some cases where the input constructor returns n=o, specifically for repeat arms, this is currently causing an issue in generation strategy gen method because if we don't generate from a node we can't meet the TC, and move forward, however, we don't actually want to generate from that node.

**This diff** updates tc.is_met() to accept a full generation node which allows us to access the should_skip property we added in the previous diff

Following diffs will:
- update input constructor to properly set should skip
- update the gs to appropiately handle resetting to false after a gen is completed

Reviewed By: lena-kashtelyan

Differential Revision: D64445871
Summary:




**Context:** There are some cases where the input constructor returns n=o, specifically for repeat arms, this is currently causing an issue in generation strategy gen method because if we don't generate from a node we can't meet the TC, and move forward, however, we don't actually want to generate from that node.

**This diff** adds the setting of should skip to repeat_arm_n input constructor as it's currently the only input constructor that could enter a condition that creates a skippable node

Following diffs will:
- update the gs to appropiately handle resetting to false after a gen is completed

Reviewed By: lena-kashtelyan

Differential Revision: D64475782
…number of arms is 0 (facebook#2895)

Summary:


**Context:** There are some cases where the input constructor returns n=o, specifically for repeat arms, this is currently causing an issue in generation strategy gen method because if we don't generate from a node we can't meet the TC, and move forward, however, we don't actually want to generate from that node.


This diff updates a few things:
1. updates gs.gen_with_multiple_nodes to be able to handle cases where the input constructor specifies 0 arms requested from a node, and then transition away from this skipped node
2. unsets a node's skipped property upon retraversing it -- we do this upon a retraverse instead of at the end of a gen to allow us to inspect a gs at any time and know the most recent occurances of a node. I could see knowing if a node was skipped or not to be pretty important to debugging down the line, so decided it was worth the slighly uglier looking if statement to only reset upon a retraverse
3. updates nodes to not be marked as compeleted if they have an autoaftergen tc. This is safe for now as it's only used by online gs which should never complete, we should revisit how we want to handle node completion and gs completion moving forward as a follow up

Followup diffs will:

- factor out tc.is_met() code that's repeated a few places in gennode
- improve signature on tc.is_met now that we are passing in the node
- handle case where arms_per_node passes in 0 arms for a node

Reviewed By: lena-kashtelyan

Differential Revision: D64484544
…k#2902)

Summary:

In a previous diff in this stack (52) we added an argument to pass the current node into tc.is_met(). This is actually great news because now we don't need a lot of these other optional parameters!

This diff cleans up those optional parameters, and replaces their usage by directly pulling it from the node object.

We also fix all calls to tc.is_met() to use the new signature

Differential Revision: D64491588
…acebook#2903)

Summary:

in the previous diff we clean up the signature on the is_met() method, during that i also noticed that the trials_from_node property must have been updated sometime in the last couple months (probably by me) to return an empty dict instead of none if there aren't any trials from node.

This means we can make this not an optional field on the tc

Differential Revision: D64496943
Summary: This is the fiinal p0 follow up to the stack from 52-57, and in this diff we add storage for this field :)

Differential Revision: D64519394
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Oct 17, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64519394

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.78%. Comparing base (52444a4) to head (1cc13ef).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2905   +/-   ##
=======================================
  Coverage   95.78%   95.78%           
=======================================
  Files         504      504           
  Lines       49790    49817   +27     
=======================================
+ Hits        47692    47718   +26     
- Misses       2098     2099    +1     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants