penguin.graph_search module¶
- class penguin.graph_search.Worker(global_state, config_manager, proj_dir, run_base, max_iters, run_index, timeout, active_worker_count, verbose=False, thread_id=None, logger=None)[source]¶
Bases:
object- static analyze_failures(run_dir, node, n_config_tests, logger=None)[source]¶
After we run a configuration, do our post-run analysis of failures. Run each PyPlugin that has a PenguinAnalysis implemented. Have each identify failures.
Staticmethod with logger arg so we can call from other search algos too. Maybe worth refactoring into manager or something more generic?
- find_best_score(run_dir, run_idx, n_config_tests, is_exclusive)[source]¶
Look acrous our n_config_tests runs. Calculate the maximal score for each score type our various metrics. Note n_config_tests is 1 for now. Later we might increase depending on expected non-determinism.
- find_mitigations_f(failure, config)[source]¶
- Parameters:
failure (Failure)
config (Configuration)
- Return type:
List[Mitigation]
- find_new_configs_f(failure, mitigation, parent_config)[source]¶
Given a failure and mitigation, find new configurations to explore
- Parameters:
failure (Failure)
mitigation (Mitigation)
parent_config (Configuration)
- Return type:
List[Configuration]
- run_config_f(config)[source]¶
Run a given configuration, collect details of it’s failures and calculate score
- Parameters:
config (Configuration)
- Return type:
Tuple[List[Failure], float]
- penguin.graph_search.add_init_options_to_graph(config_manager, proj_dir, base_config)[source]¶
A config needs to have an [‘env’][‘igloo_init’] in order to do anything useful. We might have a single option already set or we might have multiple options stored proj_dir/static/InitFinder.yaml (based on static analysis).
If we have no value set and no potential values, we raise an error.
Otherwise we’ll create a fake failure for “init” and a mitigation node to add each of the init options. Then we’ll create configs with each init and add the necessary graph edges. This means we’ll start our search with multiple configuration options (nodes) to explore.
If an igloo_init is set in the initial config, we’ll assume that’s right and leave it alone.