From 91b67cd29bffe99836f2ee3ef6859b68f9d52aa6 Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 12 Feb 2021 10:50:46 +0100 Subject: [PATCH 01/68] [issue1000] Use hash map for faster access. --- src/search/landmarks/landmark_factory_rpg_sasp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search/landmarks/landmark_factory_rpg_sasp.h b/src/search/landmarks/landmark_factory_rpg_sasp.h index 5dee045258..9f48d3321b 100644 --- a/src/search/landmarks/landmark_factory_rpg_sasp.h +++ b/src/search/landmarks/landmark_factory_rpg_sasp.h @@ -12,7 +12,7 @@ class LandmarkFactoryRpgSasp : public LandmarkFactoryRelaxation { std::list open_landmarks; std::vector> disjunction_classes; - std::map> forward_orders; + std::unordered_map> forward_orders; // dtg_successors[var_id][val] contains all successor values of val in the // domain transition graph for the variable From c61a23fc5cfdb82ca0a854269f2eab0b7fd6506a Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 12 Feb 2021 11:01:16 +0100 Subject: [PATCH 02/68] [issue1000] Inline getter function. --- src/search/landmarks/landmark_status_manager.cc | 8 -------- src/search/landmarks/landmark_status_manager.h | 7 ++++++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/search/landmarks/landmark_status_manager.cc b/src/search/landmarks/landmark_status_manager.cc index 8d65b4d9e7..8b3e7d077c 100644 --- a/src/search/landmarks/landmark_status_manager.cc +++ b/src/search/landmarks/landmark_status_manager.cc @@ -1,7 +1,5 @@ #include "landmark_status_manager.h" -#include "landmark_graph.h" - #include "../utils/logging.h" using namespace std; @@ -17,12 +15,6 @@ LandmarkStatusManager::LandmarkStatusManager(LandmarkGraph &graph) lm_graph(graph) { } -landmark_status LandmarkStatusManager::get_landmark_status( - size_t id) const { - assert(static_cast(id) < lm_graph.get_num_landmarks()); - return lm_status[id]; -} - BitsetView LandmarkStatusManager::get_reached_landmarks(const State &state) { return reached_lms[state]; } diff --git a/src/search/landmarks/landmark_status_manager.h b/src/search/landmarks/landmark_status_manager.h index ff5177f0e2..15368b5605 100644 --- a/src/search/landmarks/landmark_status_manager.h +++ b/src/search/landmarks/landmark_status_manager.h @@ -1,6 +1,8 @@ #ifndef LANDMARKS_LANDMARK_STATUS_MANAGER_H #define LANDMARKS_LANDMARK_STATUS_MANAGER_H +#include "landmark_graph.h" + #include "../per_state_bitset.h" namespace landmarks { @@ -44,7 +46,10 @@ class LandmarkStatusManager { desired state is returned at all times, or an error is thrown if the desired information does not exist. */ - landmark_status get_landmark_status(size_t id) const; + landmark_status get_landmark_status(size_t id) const { + assert(static_cast(id) < lm_graph.get_num_landmarks()); + return lm_status[id]; + } }; } From 603708732daabe0ab0116d2bf64b21a7f5f336ca Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 12 Feb 2021 11:04:46 +0100 Subject: [PATCH 03/68] [issue1000] Loop over IDs instead of nodes. --- src/search/landmarks/landmark_status_manager.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/search/landmarks/landmark_status_manager.cc b/src/search/landmarks/landmark_status_manager.cc index 8b3e7d077c..22c9cf332c 100644 --- a/src/search/landmarks/landmark_status_manager.cc +++ b/src/search/landmarks/landmark_status_manager.cc @@ -107,15 +107,12 @@ bool LandmarkStatusManager::update_reached_lms(const State &parent_ancestor_stat void LandmarkStatusManager::update_lm_status(const State &ancestor_state) { const BitsetView reached = get_reached_landmarks(ancestor_state); - const LandmarkGraph::Nodes &nodes = lm_graph.get_nodes(); - /* This first loop is necessary as setup for the *needed again* check in the second loop. */ for (int id = 0; id < lm_graph.get_num_landmarks(); ++id) { lm_status[id] = reached.test(id) ? lm_reached : lm_not_reached; } - for (auto &node : nodes) { - int id = node->get_id(); + for (int id = 0; id < lm_graph.get_num_landmarks(); ++id) { if (lm_status[id] == lm_reached && landmark_needed_again(id, ancestor_state)) { lm_status[id] = lm_needed_again; From ec1c009098b2f01f35527de3274e55e9d7e39ece Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 12 Feb 2021 11:11:15 +0100 Subject: [PATCH 04/68] [issue1000] Change loop to only trace pointer when needed. --- src/search/landmarks/landmark_count_heuristic.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/search/landmarks/landmark_count_heuristic.cc b/src/search/landmarks/landmark_count_heuristic.cc index 9634f6829d..c0297680be 100644 --- a/src/search/landmarks/landmark_count_heuristic.cc +++ b/src/search/landmarks/landmark_count_heuristic.cc @@ -109,15 +109,11 @@ int LandmarkCountHeuristic::get_heuristic_value(const State &ancestor_state) { return static_cast(ceil(h_val - epsilon)); } else { int h = 0; - for (auto &lm : lgraph->get_nodes()) { - switch (lm_status_manager->get_landmark_status( - lm->get_id())) { - case lm_reached: - break; - case lm_not_reached: - case lm_needed_again: - h += lm->cost; - break; + for (int id = 0; id < lgraph->get_num_landmarks(); ++id) { + landmark_status status = + lm_status_manager->get_landmark_status(id); + if (status == lm_not_reached || status == lm_needed_again) { + h += lgraph->get_landmark(id)->cost; } } return h; From 1a5a31455d4a343e4fafc571912153b5413ba28e Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 12 Feb 2021 11:15:26 +0100 Subject: [PATCH 05/68] [issue1000] Fuse function split in issue988. --- .../landmarks/landmark_count_heuristic.cc | 4 +-- .../landmarks/landmark_status_manager.cc | 30 ++++++++----------- .../landmarks/landmark_status_manager.h | 9 +++--- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/search/landmarks/landmark_count_heuristic.cc b/src/search/landmarks/landmark_count_heuristic.cc index c0297680be..438e54f8fc 100644 --- a/src/search/landmarks/landmark_count_heuristic.cc +++ b/src/search/landmarks/landmark_count_heuristic.cc @@ -98,8 +98,8 @@ int LandmarkCountHeuristic::get_heuristic_value(const State &ancestor_state) { // they do not get counted as reached in that case). However, we // must return 0 for a goal state. - lm_status_manager->update_lm_status(ancestor_state); - if (lm_status_manager->dead_end_exists()) { + bool dead_end = lm_status_manager->update_lm_status(ancestor_state); + if (dead_end) { return DEAD_END; } diff --git a/src/search/landmarks/landmark_status_manager.cc b/src/search/landmarks/landmark_status_manager.cc index 22c9cf332c..9f9c91314d 100644 --- a/src/search/landmarks/landmark_status_manager.cc +++ b/src/search/landmarks/landmark_status_manager.cc @@ -104,7 +104,7 @@ bool LandmarkStatusManager::update_reached_lms(const State &parent_ancestor_stat return true; } -void LandmarkStatusManager::update_lm_status(const State &ancestor_state) { +bool LandmarkStatusManager::update_lm_status(const State &ancestor_state) { const BitsetView reached = get_reached_landmarks(ancestor_state); /* This first loop is necessary as setup for the *needed again* @@ -112,17 +112,14 @@ void LandmarkStatusManager::update_lm_status(const State &ancestor_state) { for (int id = 0; id < lm_graph.get_num_landmarks(); ++id) { lm_status[id] = reached.test(id) ? lm_reached : lm_not_reached; } - for (int id = 0; id < lm_graph.get_num_landmarks(); ++id) { - if (lm_status[id] == lm_reached - && landmark_needed_again(id, ancestor_state)) { - lm_status[id] = lm_needed_again; - } - } -} -bool LandmarkStatusManager::dead_end_exists() { + bool dead_end_exists = false; for (auto &node : lm_graph.get_nodes()) { int id = node->get_id(); + if (lm_status[id] == lm_reached + && landmark_needed_again(*node, ancestor_state)) { + lm_status[id] = lm_needed_again; + } /* This dead-end detection works for the following case: @@ -138,23 +135,22 @@ bool LandmarkStatusManager::dead_end_exists() { if (!node->is_derived) { if ((lm_status[id] == lm_not_reached) && node->first_achievers.empty()) { - return true; + dead_end_exists = true; } if ((lm_status[id] == lm_needed_again) && node->possible_achievers.empty()) { - return true; + dead_end_exists = true; } } } - return false; + return dead_end_exists; } bool LandmarkStatusManager::landmark_needed_again( - int id, const State &state) { - LandmarkNode *node = lm_graph.get_landmark(id); - if (node->is_true_in_state(state)) { + const LandmarkNode &node, const State &state) { + if (node.is_true_in_state(state)) { return false; - } else if (node->is_true_in_goal) { + } else if (node.is_true_in_goal) { return true; } else { /* @@ -162,7 +158,7 @@ bool LandmarkStatusManager::landmark_needed_again( true, since A is a necessary precondition for actions achieving B for the first time, it must become true again. */ - for (const auto &child : node->children) { + for (const auto &child : node.children) { if (child.second >= EdgeType::GREEDY_NECESSARY && lm_status[child.first->get_id()] == lm_not_reached) { return true; diff --git a/src/search/landmarks/landmark_status_manager.h b/src/search/landmarks/landmark_status_manager.h index 15368b5605..2bd3e3c7bd 100644 --- a/src/search/landmarks/landmark_status_manager.h +++ b/src/search/landmarks/landmark_status_manager.h @@ -17,15 +17,16 @@ class LandmarkStatusManager { LandmarkGraph &lm_graph; - bool landmark_is_leaf(const LandmarkNode &node, const BitsetView &reached) const; - bool landmark_needed_again(int id, const State &state); + bool landmark_is_leaf(const LandmarkNode &node, + const BitsetView &reached) const; + bool landmark_needed_again(const LandmarkNode &node, + const State &state); public: explicit LandmarkStatusManager(LandmarkGraph &graph); BitsetView get_reached_landmarks(const State &state); - void update_lm_status(const State &ancestor_state); - bool dead_end_exists(); + bool update_lm_status(const State &ancestor_state); void set_landmarks_for_initial_state(const State &initial_state); bool update_reached_lms(const State &parent_ancestor_state, From aab263ddc6d51bcf5246189e35343d594b9ae0bc Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 12 Feb 2021 11:50:53 +0100 Subject: [PATCH 06/68] [issue1000] Add experiment. --- experiments/issue1000/common_setup.py | 398 +++++++++++++++++++++++++ experiments/issue1000/optimal.py | 69 +++++ experiments/issue1000/requirements.txt | 11 + experiments/issue1000/satisficing.py | 70 +++++ 4 files changed, 548 insertions(+) create mode 100644 experiments/issue1000/common_setup.py create mode 100755 experiments/issue1000/optimal.py create mode 100644 experiments/issue1000/requirements.txt create mode 100755 experiments/issue1000/satisficing.py diff --git a/experiments/issue1000/common_setup.py b/experiments/issue1000/common_setup.py new file mode 100644 index 0000000000..f2bbda8569 --- /dev/null +++ b/experiments/issue1000/common_setup.py @@ -0,0 +1,398 @@ +# -*- coding: utf-8 -*- + +import itertools +import os +import platform +import subprocess +import sys + +from lab.experiment import ARGPARSER +from lab import tools + +from downward.experiment import FastDownwardExperiment +from downward.reports.absolute import AbsoluteReport +from downward.reports.compare import ComparativeReport +from downward.reports.scatter import ScatterPlotReport + + +def parse_args(): + ARGPARSER.add_argument( + "--test", + choices=["yes", "no", "auto"], + default="auto", + dest="test_run", + help="test experiment locally on a small suite if --test=yes or " + "--test=auto and we are not on a cluster") + return ARGPARSER.parse_args() + +ARGS = parse_args() + + +DEFAULT_OPTIMAL_SUITE = [ + 'agricola-opt18-strips', 'airport', 'barman-opt11-strips', + 'barman-opt14-strips', 'blocks', 'childsnack-opt14-strips', + 'data-network-opt18-strips', 'depot', 'driverlog', + 'elevators-opt08-strips', 'elevators-opt11-strips', + 'floortile-opt11-strips', 'floortile-opt14-strips', 'freecell', + 'ged-opt14-strips', 'grid', 'gripper', 'hiking-opt14-strips', + 'logistics00', 'logistics98', 'miconic', 'movie', 'mprime', + 'mystery', 'nomystery-opt11-strips', 'openstacks-opt08-strips', + 'openstacks-opt11-strips', 'openstacks-opt14-strips', + 'openstacks-strips', 'organic-synthesis-opt18-strips', + 'organic-synthesis-split-opt18-strips', 'parcprinter-08-strips', + 'parcprinter-opt11-strips', 'parking-opt11-strips', + 'parking-opt14-strips', 'pathways-noneg', 'pegsol-08-strips', + 'pegsol-opt11-strips', 'petri-net-alignment-opt18-strips', + 'pipesworld-notankage', 'pipesworld-tankage', 'psr-small', 'rovers', + 'satellite', 'scanalyzer-08-strips', 'scanalyzer-opt11-strips', + 'snake-opt18-strips', 'sokoban-opt08-strips', + 'sokoban-opt11-strips', 'spider-opt18-strips', 'storage', + 'termes-opt18-strips', 'tetris-opt14-strips', + 'tidybot-opt11-strips', 'tidybot-opt14-strips', 'tpp', + 'transport-opt08-strips', 'transport-opt11-strips', + 'transport-opt14-strips', 'trucks-strips', 'visitall-opt11-strips', + 'visitall-opt14-strips', 'woodworking-opt08-strips', + 'woodworking-opt11-strips', 'zenotravel'] + +DEFAULT_SATISFICING_SUITE = [ + 'agricola-sat18-strips', 'airport', 'assembly', + 'barman-sat11-strips', 'barman-sat14-strips', 'blocks', + 'caldera-sat18-adl', 'caldera-split-sat18-adl', 'cavediving-14-adl', + 'childsnack-sat14-strips', 'citycar-sat14-adl', + 'data-network-sat18-strips', 'depot', 'driverlog', + 'elevators-sat08-strips', 'elevators-sat11-strips', + 'flashfill-sat18-adl', 'floortile-sat11-strips', + 'floortile-sat14-strips', 'freecell', 'ged-sat14-strips', 'grid', + 'gripper', 'hiking-sat14-strips', 'logistics00', 'logistics98', + 'maintenance-sat14-adl', 'miconic', 'miconic-fulladl', + 'miconic-simpleadl', 'movie', 'mprime', 'mystery', + 'nomystery-sat11-strips', 'nurikabe-sat18-adl', 'openstacks', + 'openstacks-sat08-adl', 'openstacks-sat08-strips', + 'openstacks-sat11-strips', 'openstacks-sat14-strips', + 'openstacks-strips', 'optical-telegraphs', + 'organic-synthesis-sat18-strips', + 'organic-synthesis-split-sat18-strips', 'parcprinter-08-strips', + 'parcprinter-sat11-strips', 'parking-sat11-strips', + 'parking-sat14-strips', 'pathways', 'pathways-noneg', + 'pegsol-08-strips', 'pegsol-sat11-strips', 'philosophers', + 'pipesworld-notankage', 'pipesworld-tankage', 'psr-large', + 'psr-middle', 'psr-small', 'rovers', 'satellite', + 'scanalyzer-08-strips', 'scanalyzer-sat11-strips', 'schedule', + 'settlers-sat18-adl', 'snake-sat18-strips', 'sokoban-sat08-strips', + 'sokoban-sat11-strips', 'spider-sat18-strips', 'storage', + 'termes-sat18-strips', 'tetris-sat14-strips', + 'thoughtful-sat14-strips', 'tidybot-sat11-strips', 'tpp', + 'transport-sat08-strips', 'transport-sat11-strips', + 'transport-sat14-strips', 'trucks', 'trucks-strips', + 'visitall-sat11-strips', 'visitall-sat14-strips', + 'woodworking-sat08-strips', 'woodworking-sat11-strips', + 'zenotravel'] + + +def get_script(): + """Get file name of main script.""" + return tools.get_script_path() + + +def get_script_dir(): + """Get directory of main script. + + Usually a relative directory (depends on how it was called by the user.)""" + return os.path.dirname(get_script()) + + +def get_experiment_name(): + """Get name for experiment. + + Derived from the absolute filename of the main script, e.g. + "/ham/spam/eggs.py" => "spam-eggs".""" + script = os.path.abspath(get_script()) + script_dir = os.path.basename(os.path.dirname(script)) + script_base = os.path.splitext(os.path.basename(script))[0] + return "%s-%s" % (script_dir, script_base) + + +def get_data_dir(): + """Get data dir for the experiment. + + This is the subdirectory "data" of the directory containing + the main script.""" + return os.path.join(get_script_dir(), "data", get_experiment_name()) + + +def get_repo_base(): + """Get base directory of the repository, as an absolute path. + + Search upwards in the directory tree from the main script until a + directory with a subdirectory named ".git" is found. + + Abort if the repo base cannot be found.""" + path = os.path.abspath(get_script_dir()) + while os.path.dirname(path) != path: + if os.path.exists(os.path.join(path, ".git")): + return path + path = os.path.dirname(path) + sys.exit("repo base could not be found") + + +def is_running_on_cluster(): + node = platform.node() + return node.endswith(".scicore.unibas.ch") or node.endswith(".cluster.bc2.ch") + + +def is_test_run(): + return ARGS.test_run == "yes" or ( + ARGS.test_run == "auto" and not is_running_on_cluster()) + + +def get_algo_nick(revision, config_nick): + return "{revision}-{config_nick}".format(**locals()) + + +class IssueConfig(object): + """Hold information about a planner configuration. + + See FastDownwardExperiment.add_algorithm() for documentation of the + constructor's options. + + """ + def __init__(self, nick, component_options, + build_options=None, driver_options=None): + self.nick = nick + self.component_options = component_options + self.build_options = build_options + self.driver_options = driver_options + + +class IssueExperiment(FastDownwardExperiment): + """Subclass of FastDownwardExperiment with some convenience features.""" + + DEFAULT_TEST_SUITE = ["depot:p01.pddl", "gripper:prob01.pddl"] + + DEFAULT_TABLE_ATTRIBUTES = [ + "cost", + "coverage", + "error", + "evaluations", + "expansions", + "expansions_until_last_jump", + "initial_h_value", + "generated", + "memory", + "planner_memory", + "planner_time", + "quality", + "run_dir", + "score_evaluations", + "score_expansions", + "score_generated", + "score_memory", + "score_search_time", + "score_total_time", + "search_time", + "total_time", + ] + + DEFAULT_SCATTER_PLOT_ATTRIBUTES = [ + "evaluations", + "expansions", + "expansions_until_last_jump", + "initial_h_value", + "memory", + "search_time", + "total_time", + ] + + PORTFOLIO_ATTRIBUTES = [ + "cost", + "coverage", + "error", + "plan_length", + "run_dir", + ] + + def __init__(self, revisions=None, configs=None, path=None, **kwargs): + """ + + You can either specify both *revisions* and *configs* or none + of them. If they are omitted, you will need to call + exp.add_algorithm() manually. + + If *revisions* is given, it must be a non-empty list of + revision identifiers, which specify which planner versions to + use in the experiment. The same versions are used for + translator, preprocessor and search. :: + + IssueExperiment(revisions=["issue123", "4b3d581643"], ...) + + If *configs* is given, it must be a non-empty list of + IssueConfig objects. :: + + IssueExperiment(..., configs=[ + IssueConfig("ff", ["--search", "eager_greedy(ff())"]), + IssueConfig( + "lama", [], + driver_options=["--alias", "seq-sat-lama-2011"]), + ]) + + If *path* is specified, it must be the path to where the + experiment should be built (e.g. + /home/john/experiments/issue123/exp01/). If omitted, the + experiment path is derived automatically from the main + script's filename. Example:: + + script = experiments/issue123/exp01.py --> + path = experiments/issue123/data/issue123-exp01/ + + """ + + path = path or get_data_dir() + + FastDownwardExperiment.__init__(self, path=path, **kwargs) + + if (revisions and not configs) or (not revisions and configs): + raise ValueError( + "please provide either both or none of revisions and configs") + + for rev in revisions: + for config in configs: + self.add_algorithm( + get_algo_nick(rev, config.nick), + get_repo_base(), + rev, + config.component_options, + build_options=config.build_options, + driver_options=config.driver_options) + + self._revisions = revisions + self._configs = configs + + @classmethod + def _is_portfolio(cls, config_nick): + return "fdss" in config_nick + + @classmethod + def get_supported_attributes(cls, config_nick, attributes): + if cls._is_portfolio(config_nick): + return [attr for attr in attributes + if attr in cls.PORTFOLIO_ATTRIBUTES] + return attributes + + def add_absolute_report_step(self, **kwargs): + """Add step that makes an absolute report. + + Absolute reports are useful for experiments that don't compare + revisions. + + The report is written to the experiment evaluation directory. + + All *kwargs* will be passed to the AbsoluteReport class. If the + keyword argument *attributes* is not specified, a default list + of attributes is used. :: + + exp.add_absolute_report_step(attributes=["coverage"]) + + """ + kwargs.setdefault("attributes", self.DEFAULT_TABLE_ATTRIBUTES) + report = AbsoluteReport(**kwargs) + outfile = os.path.join( + self.eval_dir, + get_experiment_name() + "." + report.output_format) + self.add_report(report, outfile=outfile) + self.add_step( + 'publish-absolute-report', subprocess.call, ['publish', outfile]) + + def add_comparison_table_step(self, **kwargs): + """Add a step that makes pairwise revision comparisons. + + Create comparative reports for all pairs of Fast Downward + revisions. Each report pairs up the runs of the same config and + lists the two absolute attribute values and their difference + for all attributes in kwargs["attributes"]. + + All *kwargs* will be passed to the CompareConfigsReport class. + If the keyword argument *attributes* is not specified, a + default list of attributes is used. :: + + exp.add_comparison_table_step(attributes=["coverage"]) + + """ + kwargs.setdefault("attributes", self.DEFAULT_TABLE_ATTRIBUTES) + + def make_comparison_tables(): + for rev1, rev2 in itertools.combinations(self._revisions, 2): + compared_configs = [] + for config in self._configs: + config_nick = config.nick + compared_configs.append( + ("%s-%s" % (rev1, config_nick), + "%s-%s" % (rev2, config_nick), + "Diff (%s)" % config_nick)) + report = ComparativeReport(compared_configs, **kwargs) + outfile = os.path.join( + self.eval_dir, + "%s-%s-%s-compare.%s" % ( + self.name, rev1, rev2, report.output_format)) + report(self.eval_dir, outfile) + + def publish_comparison_tables(): + for rev1, rev2 in itertools.combinations(self._revisions, 2): + outfile = os.path.join( + self.eval_dir, + "%s-%s-%s-compare.html" % (self.name, rev1, rev2)) + subprocess.call(["publish", outfile]) + + self.add_step("make-comparison-tables", make_comparison_tables) + self.add_step( + "publish-comparison-tables", publish_comparison_tables) + + def add_scatter_plot_step(self, relative=False, attributes=None, additional=[]): + """Add step creating (relative) scatter plots for all revision pairs. + + Create a scatter plot for each combination of attribute, + configuration and revisions pair. If *attributes* is not + specified, a list of common scatter plot attributes is used. + For portfolios all attributes except "cost", "coverage" and + "plan_length" will be ignored. :: + + exp.add_scatter_plot_step(attributes=["expansions"]) + + """ + if relative: + scatter_dir = os.path.join(self.eval_dir, "scatter-relative") + step_name = "make-relative-scatter-plots" + else: + scatter_dir = os.path.join(self.eval_dir, "scatter-absolute") + step_name = "make-absolute-scatter-plots" + if attributes is None: + attributes = self.DEFAULT_SCATTER_PLOT_ATTRIBUTES + + def make_scatter_plot(config_nick, rev1, rev2, attribute, config_nick2=None): + name = "-".join([self.name, rev1, rev2, attribute, config_nick]) + if config_nick2 is not None: + name += "-" + config_nick2 + print("Make scatter plot for", name) + algo1 = get_algo_nick(rev1, config_nick) + algo2 = get_algo_nick(rev2, config_nick if config_nick2 is None else config_nick2) + report = ScatterPlotReport( + filter_algorithm=[algo1, algo2], + attributes=[attribute], + relative=relative, + get_category=lambda run1, run2: run1["domain"]) + report( + self.eval_dir, + os.path.join(scatter_dir, rev1 + "-" + rev2, name)) + + def make_scatter_plots(): + for config in self._configs: + print(config) + for rev1, rev2 in itertools.combinations(self._revisions, 2): + print(rev1, rev2) + for attribute in self.get_supported_attributes( + config.nick, attributes): + print(attribute) + make_scatter_plot(config.nick, rev1, rev2, attribute) + for nick1, nick2, rev1, rev2, attribute in additional: + make_scatter_plot(nick1, rev1, rev2, attribute, config_nick2=nick2) + + self.add_step(step_name, make_scatter_plots) diff --git a/experiments/issue1000/optimal.py b/experiments/issue1000/optimal.py new file mode 100755 index 0000000000..b0e1f9d702 --- /dev/null +++ b/experiments/issue1000/optimal.py @@ -0,0 +1,69 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + + +import os + +from lab.environments import LocalEnvironment, BaselSlurmEnvironment + +import common_setup +from common_setup import IssueConfig, IssueExperiment + + +def make_comparison_table(): + report = common_setup.ComparativeReport( + algorithm_pairs=[ + ("issue1000-base-seq-opt-bjolp", "issue1000-v11-seq-opt-bjolp"), + ("issue1000-base-seq-opt-bjolp", "issue1000-v12-seq-opt-bjolp"), + ("issue1000-base-seq-opt-bjolp", "issue1000-v13-seq-opt-bjolp"), + ], attributes=IssueExperiment.DEFAULT_TABLE_ATTRIBUTES, + ) + outfile = os.path.join( + exp.eval_dir, "%s-compare.%s" % (exp.name, report.output_format) + ) + report(exp.eval_dir, outfile) + + exp.add_report(report) + + +DIR = os.path.dirname(os.path.abspath(__file__)) +SCRIPT_NAME = os.path.splitext(os.path.basename(__file__))[0] +BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"] +REVISIONS = ["issue1000-base", "issue1000-v11", "issue1000-v12", + "issue1000-v13"] + +CONFIGS = [ + IssueConfig("seq-opt-bjolp", [], + driver_options=["--alias", "seq-opt-bjolp"]), +] + +SUITE = common_setup.DEFAULT_OPTIMAL_SUITE +ENVIRONMENT = BaselSlurmEnvironment( + partition="infai_2", + email="clemens.buechner@unibas.ch", + export=["PATH", "DOWNWARD_BENCHMARKS"], +) + +if common_setup.is_test_run(): + SUITE = IssueExperiment.DEFAULT_TEST_SUITE + ENVIRONMENT = LocalEnvironment(processes=2) + +exp = common_setup.IssueExperiment( + revisions=REVISIONS, + configs=CONFIGS, + environment=ENVIRONMENT, +) + +exp.add_suite(BENCHMARKS_DIR, SUITE) + +exp.add_parser(exp.EXITCODE_PARSER) +exp.add_parser(exp.PLANNER_PARSER) +exp.add_parser(exp.SINGLE_SEARCH_PARSER) + +exp.add_step("build", exp.build) +exp.add_step("start", exp.start_runs) +exp.add_fetcher(name="fetch") +exp.add_step("comparison table", make_comparison_table) + +exp.run_steps() + diff --git a/experiments/issue1000/requirements.txt b/experiments/issue1000/requirements.txt new file mode 100644 index 0000000000..d201a74510 --- /dev/null +++ b/experiments/issue1000/requirements.txt @@ -0,0 +1,11 @@ +cycler==0.10.0 +kiwisolver==1.3.1 +lab==6.2 +matplotlib==3.3.3 +numpy==1.19.5 +Pillow==8.1.0 +pyparsing==2.4.7 +python-dateutil==2.8.1 +simplejson==3.17.2 +six==1.15.0 +txt2tags==3.7 diff --git a/experiments/issue1000/satisficing.py b/experiments/issue1000/satisficing.py new file mode 100755 index 0000000000..dc64a5349f --- /dev/null +++ b/experiments/issue1000/satisficing.py @@ -0,0 +1,70 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + + +import os + +from lab.environments import LocalEnvironment, BaselSlurmEnvironment + +import common_setup +from common_setup import IssueConfig, IssueExperiment + + +def make_comparison_table(): + report = common_setup.ComparativeReport( + algorithm_pairs=[ + ("issue1000-base-lama-first", "issue1000-v11-lama-first"), + ("issue1000-base-lama-first", "issue1000-v12-lama-first"), + ("issue1000-base-lama-first", "issue1000-v13-lama-first"), + ], attributes=IssueExperiment.DEFAULT_TABLE_ATTRIBUTES, + ) + outfile = os.path.join( + exp.eval_dir, "%s-compare.%s" % (exp.name, report.output_format) + ) + report(exp.eval_dir, outfile) + + exp.add_report(report) + + +DIR = os.path.dirname(os.path.abspath(__file__)) +SCRIPT_NAME = os.path.splitext(os.path.basename(__file__))[0] +BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"] +REVISIONS = ["issue1000-base", "issue1000-v11", "issue1000-v12", + "issue1000-v13"] + +CONFIGS = [ + IssueConfig("lama-first", [], + driver_options=["--alias", "lama-first"]), +] + +SUITE = common_setup.DEFAULT_SATISFICING_SUITE +ENVIRONMENT = BaselSlurmEnvironment( + partition="infai_2", + email="clemens.buechner@unibas.ch", + export=["PATH", "DOWNWARD_BENCHMARKS"], +) + +if common_setup.is_test_run(): + SUITE = IssueExperiment.DEFAULT_TEST_SUITE + ENVIRONMENT = LocalEnvironment(processes=2) + +exp = common_setup.IssueExperiment( + revisions=REVISIONS, + configs=CONFIGS, + environment=ENVIRONMENT, +) + +exp.add_suite(BENCHMARKS_DIR, SUITE) + +exp.add_parser(exp.ANYTIME_SEARCH_PARSER) +exp.add_parser(exp.EXITCODE_PARSER) +exp.add_parser(exp.PLANNER_PARSER) +exp.add_parser(exp.SINGLE_SEARCH_PARSER) + +exp.add_step("build", exp.build) +exp.add_step("start", exp.start_runs) +exp.add_fetcher(name="fetch") +exp.add_step("comparison table", make_comparison_table) + +exp.run_steps() + From db53ba02176207187411c6cecd4fc9fbb22051a9 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Wed, 17 Feb 2021 10:45:46 +0100 Subject: [PATCH 07/68] [main] Remove duplicate standard config. --- misc/tests/configs.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/misc/tests/configs.py b/misc/tests/configs.py index 934ee87550..0bfa4b29ab 100644 --- a/misc/tests/configs.py +++ b/misc/tests/configs.py @@ -126,11 +126,6 @@ def configs_satisficing_core(): def configs_optimal_extended(): return { - "astar_lmcount_lm_merged_rhw_hm_no_order": [ - "--evaluator", - "lmc=lmcount(lm_merged([lm_rhw(),lm_hm(m=1)]),admissible=true)", - "--search", - "astar(lmc,lazy_evaluator=lmc)"], "astar_cegar": [ "--search", "astar(cegar())"], From 96c3302afb0e8a0042a412e468dcd26644807502 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Tue, 9 Feb 2021 10:53:19 +0100 Subject: [PATCH 08/68] [issue1003] Windows workflow: set CC and CXX variables to use MSVC. --- .github/workflows/windows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 47971e07f7..e1e5afeaa7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -24,6 +24,9 @@ jobs: - name: compile shell: cmd + env: + CC: cl + CXX: cl run: | "${{ env.VC }}" ${{ env.ARCH }} & python build.py ${{ matrix.build-version }} From 417abb27f39173d999c94e61ddf03dd2ab7727ab Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Tue, 9 Feb 2021 11:23:56 +0100 Subject: [PATCH 09/68] [issue1003] Ubuntu workflow: set CC and CXX environment variables --- .github/workflows/ubuntu.yml | 37 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 3c29a0539c..d4baadd61a 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -17,13 +17,17 @@ jobs: strategy: matrix: ubuntu-version: [ubuntu-18.04, ubuntu-20.04] - compiler-version: [gcc, gcc-10, clang, clang-11] + compiler-version: + - {cc: gcc, cxx: g++} + - {cc: gcc-10, cxx: g++-10} + - {cc: clang, cxx: clang++} + - {cc: clang-11, cxx: clang++-11} python-version: [3.6] exclude: - ubuntu-version: ubuntu-18.04 - compiler-version: gcc-10 + compiler-version: {cc: gcc-10, cxx: g++-10} - ubuntu-version: ubuntu-18.04 - compiler-version: clang-11 + compiler-version: {cc: clang-11, cxx: clang++-11} steps: # each - is a new sequentially run step - name: clone-repo uses: actions/checkout@v1 @@ -37,16 +41,7 @@ jobs: run: | sudo apt-get update sudo apt-get -y install zlib1g-dev libgmp3-dev - sudo apt-get -y install ${{ matrix.compiler-version }} - export CC=${{ matrix.compiler-version }} - if [[ $CC == gcc* ]]; then - export CXX="$(echo "${CC}" | sed "s/cc/++/g")"; - elif [[ $CC == clang* ]]; then - export CXX="$(echo "${CC}" | sed "s/clang/clang++/g")"; - else - echo "Unknown compiler version"; - exit 1; - fi + sudo apt-get -y install ${{ matrix.compiler-version.cc }} mkdir /home/runner/work/downward/lib # We only want to setup osi if both LP solvers are set, hence @@ -54,6 +49,8 @@ jobs: # are set. - name: setup-cplex env: + CC: ${{ matrix.compiler-version.cc }} + CXX: ${{ matrix.compiler-version.cxx }} CPLEX_URL: ${{ secrets.CPLEX_URL }} SOPLEX_URL: ${{ secrets.SOPLEX_URL }} DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129 @@ -68,6 +65,8 @@ jobs: - name: setup-soplex env: + CC: ${{ matrix.compiler-version.cc }} + CXX: ${{ matrix.compiler-version.cxx }} CPLEX_URL: ${{ secrets.CPLEX_URL }} SOPLEX_URL: ${{ secrets.SOPLEX_URL }} DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 @@ -87,6 +86,8 @@ jobs: - name: setup-osi env: + CC: ${{ matrix.compiler-version.cc }} + CXX: ${{ matrix.compiler-version.cxx }} CPLEX_URL: ${{ secrets.CPLEX_URL }} SOPLEX_URL: ${{ secrets.SOPLEX_URL }} DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex @@ -116,6 +117,8 @@ jobs: - name: compile env: + CC: ${{ matrix.compiler-version.cc }} + CXX: ${{ matrix.compiler-version.cxx }} DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin @@ -156,17 +159,17 @@ jobs: - name: archive-files # We only run tests on the version compiled with gcc, so we # only need to archive that one. - if: ${{ matrix.compiler-version }} == gcc + if: ${{ matrix.compiler-version.cc == 'gcc' }} run: | cd ../ - tar cfz ${{ matrix.compiler-version }}.tar.gz downward lib + tar cfz ${{ matrix.compiler-version.cc }}.tar.gz downward lib - name: upload-files - if: ${{ matrix.compiler-version }} == gcc + if: ${{ matrix.compiler-version.cc == 'gcc' }} uses: actions/upload-artifact@v1 with: name: compiled-planner-${{ matrix.ubuntu-version }} - path: /home/runner/work/downward/${{ matrix.compiler-version }}.tar.gz + path: /home/runner/work/downward/${{ matrix.compiler-version.cc }}.tar.gz test: From fb68005403064c39af5dd5a1fda7941d16b6fe0a Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Tue, 9 Feb 2021 14:04:49 +0100 Subject: [PATCH 10/68] [issue1003] Run two versions of Windows. --- .github/workflows/ubuntu.yml | 7 ----- .github/workflows/windows.yml | 53 ++++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d4baadd61a..7f645a581e 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -3,13 +3,6 @@ name: ubuntu on: [push, pull_request] -## Unfortunately, we didn't manage to use something like "variables" -## globally. Github actions can set environment variables globally, -## but they can only be single values, not lists, and ideally we would -## like to have something like COMPILER_VERSIONS = [gcc, ..]. -## Now, whenever we change versions, we have to remember to do this -## *everywhere* in this file. - jobs: compile: # identifier of the job. Jobs run in parallel unless specified otherwise. name: compile diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e1e5afeaa7..33e5442aa7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,18 +1,22 @@ --- -name: windows-latest +name: windows on: [push, pull_request] + env: ARCH: "x64" - VC: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" + VC2019: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" + VC2016: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" + jobs: compile: # name of the job. Jobs run in parallel unless specified otherwise. name: compile - runs-on: windows-latest + runs-on: ${{ matrix.windows-version }} strategy: matrix: - python-version: ['3.6'] - build-version: ["release", "debug"] + windows-version: [windows-2016, windows-2019] + python-version: [3.6] + build-version: [release, debug] steps: # each - is a new sequentially run step - uses: actions/checkout@master @@ -20,7 +24,6 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - architecture: ${{ env.ARCH }} - name: compile shell: cmd @@ -28,22 +31,28 @@ jobs: CC: cl CXX: cl run: | - "${{ env.VC }}" ${{ env.ARCH }} & python build.py ${{ matrix.build-version }} + IF "${{ matrix.windows-version }}" == "windows-2016" ( + "${{ env.VC2016 }}" ${{ env.ARCH }} & python build.py ${{ matrix.build-version }} + ) + IF "${{ matrix.windows-version }}" == "windows-2019" ( + "${{ env.VC2019 }}" ${{ env.ARCH }} & python build.py ${{ matrix.build-version }} + ) - name: upload-planner uses: actions/upload-artifact@master with: - name: ${{ matrix.build-version }} - path: builds/${{ matrix.build-version }} + name: compiled-planner-${{ matrix.windows-version }}-${{ matrix.build-version }} + path: builds/ tests: # name of the job. Jobs run in parallel unless specified otherwise. name: test - runs-on: windows-latest + runs-on: ${{ matrix.windows-version }} needs: compile strategy: matrix: - python-version: ['3.6'] + windows-version: [windows-2016, windows-2019] + python-version: [3.6] steps: # each - is a new sequentially run step - uses: actions/checkout@master @@ -51,24 +60,36 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - architecture: ${{ env.ARCH }} - name: setup run: | pip3 install pytest tox mkdir builds - - name: download-planner + - name: download-debug + uses: actions/download-artifact@master + with: + name: compiled-planner-${{ matrix.windows-version }}-debug + path: builds/ + + - name: download-release uses: actions/download-artifact@master with: - # without 'name' attribute all artifacts are downloaded and the - # artifact name is used as directory name. + name: compiled-planner-${{ matrix.windows-version }}-release path: builds/ - name: test shell: cmd + env: + CC: cl + CXX: cl run: | cd misc/ - "${{ env.VC }}" ${{ env.ARCH }} & tox -e search,translator + IF "${{ matrix.windows-version }}" == "windows-2016" ( + "${{ env.VC2016 }}" ${{ env.ARCH }} & tox -e search,translator + ) + IF "${{ matrix.windows-version }}" == "windows-2019" ( + "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e search,translator + ) ... From 0b4cca858df4697186b759b53c2e0219ca4bb14e Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 10 Feb 2021 16:39:56 +0100 Subject: [PATCH 11/68] [issue1003] Code review. --- .github/workflows/mac.yml | 4 +--- .github/workflows/ubuntu.yml | 6 ++++-- .github/workflows/windows.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 4db43f45fe..c15942469e 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -1,5 +1,5 @@ --- -name: macos-latest +name: macos on: [push, pull_request] @@ -45,12 +45,10 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - architecture: x64 - name: setup run: | pip3 install pytest tox - #brew install valgrind # TODO: does not work mkdir builds - name: download-planner diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 7f645a581e..5ab94eebac 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -4,7 +4,7 @@ name: ubuntu on: [push, pull_request] jobs: - compile: # identifier of the job. Jobs run in parallel unless specified otherwise. + compile: # Identifier of the job. Jobs run in parallel unless specified otherwise. name: compile runs-on: ${{ matrix.ubuntu-version }} strategy: @@ -16,12 +16,14 @@ jobs: - {cc: clang, cxx: clang++} - {cc: clang-11, cxx: clang++-11} python-version: [3.6] + # Unfortunately, we couldn't figure out if there is a way to + # name the compiler versions so that we don't have to copy them here. exclude: - ubuntu-version: ubuntu-18.04 compiler-version: {cc: gcc-10, cxx: g++-10} - ubuntu-version: ubuntu-18.04 compiler-version: {cc: clang-11, cxx: clang++-11} - steps: # each - is a new sequentially run step + steps: # Eeach - is a new sequentially run step - name: clone-repo uses: actions/checkout@v1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 33e5442aa7..aaaa922f00 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -6,7 +6,7 @@ on: [push, pull_request] env: ARCH: "x64" VC2019: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" - VC2016: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" + VC2017: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" jobs: compile: # name of the job. Jobs run in parallel unless specified otherwise. @@ -32,7 +32,7 @@ jobs: CXX: cl run: | IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2016 }}" ${{ env.ARCH }} & python build.py ${{ matrix.build-version }} + "${{ env.VC2017 }}" ${{ env.ARCH }} & python build.py ${{ matrix.build-version }} ) IF "${{ matrix.windows-version }}" == "windows-2019" ( "${{ env.VC2019 }}" ${{ env.ARCH }} & python build.py ${{ matrix.build-version }} @@ -86,7 +86,7 @@ jobs: run: | cd misc/ IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2016 }}" ${{ env.ARCH }} & tox -e search,translator + "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e search,translator ) IF "${{ matrix.windows-version }}" == "windows-2019" ( "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e search,translator From aae2c6e4b8fb341f54fa639dd511186a5a312801 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 11 Feb 2021 12:10:28 +0100 Subject: [PATCH 12/68] [issue1003] code review and some more polishing --- .github/workflows/mac.yml | 33 ++++++++++++++++----------------- .github/workflows/ubuntu.yml | 26 ++++++++------------------ .github/workflows/windows.yml | 25 ++++++++++++------------- 3 files changed, 36 insertions(+), 48 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index c15942469e..a8f4eb4cfc 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -4,20 +4,21 @@ name: macos on: [push, pull_request] jobs: - compile: # name of the job. Jobs run in parallel unless specified otherwise. + compile: name: compile - runs-on: macos-latest + runs-on: macos-10.15 strategy: matrix: python-version: ['3.6'] build-version: ["release", "debug"] - steps: # each - is a new sequentially run step - - uses: actions/checkout@master - - name: Setup python - uses: actions/setup-python@v1 + steps: + - name: clone-repo + uses: actions/checkout@master + + - name: setup-python + uses: actions/setup-python@master with: python-version: ${{ matrix.python-version }} - architecture: x64 - name: compile run: | @@ -31,24 +32,22 @@ jobs: path: builds/${{ matrix.build-version }} - test: # name of the job. Jobs run in parallel unless specified otherwise. + test: name: test - runs-on: macos-latest + runs-on: macos-10.15 needs: compile strategy: matrix: python-version: ['3.6'] - steps: # each - is a new sequentially run step - - uses: actions/checkout@master - - - name: Setup python - uses: actions/setup-python@v1 + steps: + - name: setup-python + uses: actions/setup-python@master with: python-version: ${{ matrix.python-version }} - - name: setup + - name: setup-dependencies run: | - pip3 install pytest tox + pip3 install tox mkdir builds - name: download-planner @@ -63,6 +62,6 @@ jobs: chmod +x builds/debug/bin/downward chmod +x builds/release/bin/downward cd misc/ - tox -e search,translator + tox -e translator,search ... diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5ab94eebac..42c9ea7481 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -23,7 +23,7 @@ jobs: compiler-version: {cc: gcc-10, cxx: g++-10} - ubuntu-version: ubuntu-18.04 compiler-version: {cc: clang-11, cxx: clang++-11} - steps: # Eeach - is a new sequentially run step + steps: # Eeach "-" is a new sequentially run step - name: clone-repo uses: actions/checkout@v1 @@ -148,7 +148,6 @@ jobs: make -j8 mv validate ../ cd ../ - ls -la rm -rf VAL - name: archive-files @@ -185,6 +184,12 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: setup-dependencies + run: | + pip3 install tox + sudo apt-get -y install clang-tidy-8 valgrind zlib1g-dev libgmp3-dev + sudo apt-get -y install ${{ matrix.compiler-version }} + - name: download-files uses: actions/download-artifact@v1 with: @@ -203,13 +208,6 @@ jobs: cd ../ rm -r compiled-planner-${{ matrix.ubuntu-version }} - - name: setup-dependencies - run: | - pip3 install pytest tox - sudo apt-get update - sudo apt-get -y install clang-tidy-8 valgrind zlib1g-dev libgmp3-dev - sudo apt-get -y install ${{ matrix.compiler-version }} - - name: test env: DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex @@ -218,14 +216,6 @@ jobs: run: | export PATH="$(pwd):$PATH" # Add uncrustify and VAL to PATH. cd misc/ - python_version=${{ matrix.python-version }} - if [[ $python_version=="3.6" ]]; then - tox -e py36,translator,search,style - elif [[ $python_version=="3.8" ]]; then - tox -e py38,translator,search,style - else - echo "Unknown Python version"; - exit 1; - fi + tox -e py,translator,search,style ... diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index aaaa922f00..9033485ac8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -18,10 +18,11 @@ jobs: python-version: [3.6] build-version: [release, debug] steps: # each - is a new sequentially run step - - uses: actions/checkout@master + - name: clone-repo + uses: actions/checkout@master - - name: Setup python - uses: actions/setup-python@v1 + - name: setup-python + uses: actions/setup-python@master with: python-version: ${{ matrix.python-version }} @@ -45,7 +46,7 @@ jobs: path: builds/ - tests: # name of the job. Jobs run in parallel unless specified otherwise. + tests: name: test runs-on: ${{ matrix.windows-version }} needs: compile @@ -53,17 +54,15 @@ jobs: matrix: windows-version: [windows-2016, windows-2019] python-version: [3.6] - steps: # each - is a new sequentially run step - - uses: actions/checkout@master - - - name: Setup python - uses: actions/setup-python@v1 + steps: + - name: setup-python + uses: actions/setup-python@master with: python-version: ${{ matrix.python-version }} - - name: setup + - name: setup-dependencies run: | - pip3 install pytest tox + pip3 install tox mkdir builds - name: download-debug @@ -86,10 +85,10 @@ jobs: run: | cd misc/ IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e search,translator + "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e translator,search ) IF "${{ matrix.windows-version }}" == "windows-2019" ( - "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e search,translator + "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e translator,search ) ... From a53df3be0d5dbe61398e15139ed9fb1788853b06 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 11 Feb 2021 14:27:36 +0100 Subject: [PATCH 13/68] [issue1003] fix workflows; code review --- .github/workflows/mac.yml | 7 +++++-- .github/workflows/ubuntu.yml | 5 +++++ .github/workflows/windows.yml | 7 +++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index a8f4eb4cfc..cb998604a2 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -40,6 +40,9 @@ jobs: matrix: python-version: ['3.6'] steps: + - name: clone-repo + uses: actions/checkout@master + - name: setup-python uses: actions/setup-python@master with: @@ -61,7 +64,7 @@ jobs: run: | chmod +x builds/debug/bin/downward chmod +x builds/release/bin/downward - cd misc/ - tox -e translator,search + cd misc + tox -e py,translator,search ... diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 42c9ea7481..7e4601d592 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -185,6 +185,9 @@ jobs: python-version: ${{ matrix.python-version }} - name: setup-dependencies + # We install the right compiler so that CMake doesn't complain + # when asked to compile as part of the tox search tests, even + # though the planner is already built. run: | pip3 install tox sudo apt-get -y install clang-tidy-8 valgrind zlib1g-dev libgmp3-dev @@ -210,6 +213,8 @@ jobs: - name: test env: + CC: ${{ matrix.compiler-version.cc }} + CXX: ${{ matrix.compiler-version.cxx }} DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9033485ac8..234df7ac87 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -55,6 +55,9 @@ jobs: windows-version: [windows-2016, windows-2019] python-version: [3.6] steps: + - name: clone-repo + uses: actions/checkout@master + - name: setup-python uses: actions/setup-python@master with: @@ -85,10 +88,10 @@ jobs: run: | cd misc/ IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e translator,search + "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e py,translator,search ) IF "${{ matrix.windows-version }}" == "windows-2019" ( - "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e translator,search + "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e py,translator,search ) ... From cd9a0deb902cfb9135d1b9735ba966b1f8dd1741 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 11 Feb 2021 14:41:22 +0100 Subject: [PATCH 14/68] [issue1003] do not use py test of tox --- .github/workflows/mac.yml | 2 +- .github/workflows/windows.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index cb998604a2..722a4612af 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -65,6 +65,6 @@ jobs: chmod +x builds/debug/bin/downward chmod +x builds/release/bin/downward cd misc - tox -e py,translator,search + tox -e translator,search ... diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 234df7ac87..d89a38deea 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -88,10 +88,10 @@ jobs: run: | cd misc/ IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e py,translator,search + "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e translator,search ) IF "${{ matrix.windows-version }}" == "windows-2019" ( - "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e py,translator,search + "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e translator,search ) ... From 860149bb54a409f9779603315203c2242000f5e3 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 11 Feb 2021 16:02:35 +0100 Subject: [PATCH 15/68] [issue1003] add comment --- .github/workflows/mac.yml | 4 +++- .github/workflows/windows.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 722a4612af..9456139fa0 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -56,11 +56,13 @@ jobs: - name: download-planner uses: actions/download-artifact@master with: - # without 'name' attribute all artifacts are downloaded and the + # Without 'name' attribute all artifacts are downloaded and the # artifact name is used as directory name. path: builds/ - name: test + # We do not run py tests here because that would require VAL + # to be installed. run: | chmod +x builds/debug/bin/downward chmod +x builds/release/bin/downward diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d89a38deea..1d267c0f68 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -85,6 +85,8 @@ jobs: env: CC: cl CXX: cl + # We do not run py tests here because that would require VAL + # to be installed. run: | cd misc/ IF "${{ matrix.windows-version }}" == "windows-2016" ( From abd17e2d72a6400190c259b9d6b7fdee906a7516 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Mon, 15 Feb 2021 11:35:10 +0100 Subject: [PATCH 16/68] [issue1003] code review --- .github/workflows/ubuntu.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 7e4601d592..d3177bbd6e 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -34,7 +34,6 @@ jobs: - name: setup-dependencies run: | - sudo apt-get update sudo apt-get -y install zlib1g-dev libgmp3-dev sudo apt-get -y install ${{ matrix.compiler-version.cc }} mkdir /home/runner/work/downward/lib @@ -105,7 +104,7 @@ jobs: --with-soplex-lib="-lsoplex" \ --with-cplex-incdir=$DOWNWARD_CPLEX_ROOT/include/ilcplex \ --with-cplex-lib="-lcplex -lm -ldl" # -ldl is only needed for CPLEX >= 12.8 - make + make -j2 make install cd ../ rm -r Osi-0.107.9.tgz Osi-0.107.9 @@ -131,7 +130,7 @@ jobs: mkdir build cd build cmake ../ - make -j8 + make -j2 mv uncrustify ../../ cd ../../ rm -rf uncrustify-0.67.tar.gz uncrustify-uncrustify-0.67 @@ -145,7 +144,7 @@ jobs: git checkout a5565396007eee73ac36527fbf904142b3077c74 make clean # Remove old build artifacts and binaries. sed -i 's/-Werror //g' Makefile # Ignore warnings. - make -j8 + make -j2 mv validate ../ cd ../ rm -rf VAL From bb6448f21e2c6eb2bbdc41bb12749d5fe9e7aadf Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Mon, 15 Feb 2021 11:41:54 +0100 Subject: [PATCH 17/68] [issue1003] use job-wide environment variables; use single apt-get install --- .github/workflows/ubuntu.yml | 55 ++++++++++++------------------------ 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d3177bbd6e..13baec3d45 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -23,6 +23,14 @@ jobs: compiler-version: {cc: gcc-10, cxx: g++-10} - ubuntu-version: ubuntu-18.04 compiler-version: {cc: clang-11, cxx: clang++-11} + env: + CC: ${{ matrix.compiler-version.cc }} + CXX: ${{ matrix.compiler-version.cxx }} + CPLEX_URL: ${{ secrets.CPLEX_URL }} + SOPLEX_URL: ${{ secrets.SOPLEX_URL }} + DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129 + DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 + DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin steps: # Eeach "-" is a new sequentially run step - name: clone-repo uses: actions/checkout@v1 @@ -34,20 +42,13 @@ jobs: - name: setup-dependencies run: | - sudo apt-get -y install zlib1g-dev libgmp3-dev - sudo apt-get -y install ${{ matrix.compiler-version.cc }} + sudo apt-get -y install zlib1g-dev libgmp3-dev ${{ matrix.compiler-version.cc }} mkdir /home/runner/work/downward/lib # We only want to setup osi if both LP solvers are set, hence # we execute the following three steps only if both secrets # are set. - name: setup-cplex - env: - CC: ${{ matrix.compiler-version.cc }} - CXX: ${{ matrix.compiler-version.cxx }} - CPLEX_URL: ${{ secrets.CPLEX_URL }} - SOPLEX_URL: ${{ secrets.SOPLEX_URL }} - DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129 if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | # We redirect output of wget to hide the secret URLs. @@ -58,12 +59,6 @@ jobs: rm $CPLEX_INSTALLER - name: setup-soplex - env: - CC: ${{ matrix.compiler-version.cc }} - CXX: ${{ matrix.compiler-version.cxx }} - CPLEX_URL: ${{ secrets.CPLEX_URL }} - SOPLEX_URL: ${{ secrets.SOPLEX_URL }} - DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | # We redirect output of wget to hide the secret URLs. @@ -79,14 +74,6 @@ jobs: rm -r soplex-3.1.1 - name: setup-osi - env: - CC: ${{ matrix.compiler-version.cc }} - CXX: ${{ matrix.compiler-version.cxx }} - CPLEX_URL: ${{ secrets.CPLEX_URL }} - SOPLEX_URL: ${{ secrets.SOPLEX_URL }} - DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex - DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 - DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | wget http://www.coin-or.org/download/source/Osi/Osi-0.107.9.tgz @@ -110,12 +97,6 @@ jobs: rm -r Osi-0.107.9.tgz Osi-0.107.9 - name: compile - env: - CC: ${{ matrix.compiler-version.cc }} - CXX: ${{ matrix.compiler-version.cxx }} - DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex - DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 - DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin run: | export CXXFLAGS="-Werror" # Treat compilation warnings as errors. ./build.py --debug @@ -172,11 +153,18 @@ jobs: strategy: matrix: ubuntu-version: [ubuntu-18.04, ubuntu-20.04] - compiler-version: [gcc] + compiler-version: + - {cc: gcc, cxx: g++} python-version: [3.6, 3.8] exclude: - ubuntu-version: ubuntu-18.04 python-version: 3.8 + env: + CC: ${{ matrix.compiler-version.cc }} + CXX: ${{ matrix.compiler-version.cxx }} + DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129 + DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 + DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin steps: - name: setup-python uses: actions/setup-python@v1 @@ -189,8 +177,7 @@ jobs: # though the planner is already built. run: | pip3 install tox - sudo apt-get -y install clang-tidy-8 valgrind zlib1g-dev libgmp3-dev - sudo apt-get -y install ${{ matrix.compiler-version }} + sudo apt-get -y install clang-tidy-8 valgrind zlib1g-dev libgmp3-dev ${{ matrix.compiler-version }} - name: download-files uses: actions/download-artifact@v1 @@ -211,12 +198,6 @@ jobs: rm -r compiled-planner-${{ matrix.ubuntu-version }} - name: test - env: - CC: ${{ matrix.compiler-version.cc }} - CXX: ${{ matrix.compiler-version.cxx }} - DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex - DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 - DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin run: | export PATH="$(pwd):$PATH" # Add uncrustify and VAL to PATH. cd misc/ From 423e0e1fd36d3c7ae19be9fb436eea353cbbfef5 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Mon, 15 Feb 2021 11:52:54 +0100 Subject: [PATCH 18/68] [issue1003] compile VAL with GCC --- .github/workflows/ubuntu.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 13baec3d45..e68c276e24 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -28,7 +28,7 @@ jobs: CXX: ${{ matrix.compiler-version.cxx }} CPLEX_URL: ${{ secrets.CPLEX_URL }} SOPLEX_URL: ${{ secrets.SOPLEX_URL }} - DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129 + DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin steps: # Eeach "-" is a new sequentially run step @@ -50,12 +50,14 @@ jobs: # are set. - name: setup-cplex if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} + env: + CPLEX_STUDIO: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129 run: | # We redirect output of wget to hide the secret URLs. wget $CPLEX_URL &> /dev/null export CPLEX_INSTALLER=cplex_studio129.linux-x86-64.bin chmod +x $CPLEX_INSTALLER - ./$CPLEX_INSTALLER -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=${DOWNWARD_CPLEX_ROOT} -i silent + ./$CPLEX_INSTALLER -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=${CPLEX_STUDIO} -i silent rm $CPLEX_INSTALLER - name: setup-soplex @@ -117,6 +119,10 @@ jobs: rm -rf uncrustify-0.67.tar.gz uncrustify-uncrustify-0.67 - name: setup-val + # VAL does not compile with clang-11. + env: + CC: gcc + CXX: g++ run: | # Set up VAL. sudo apt-get -y install flex bison From 89ebd96842e37eaebbc6abde468b21d0cfe42643 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 09:52:17 +0100 Subject: [PATCH 19/68] [issue1003] only pack binaries; use apt-get update --- .github/workflows/ubuntu.yml | 47 ++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e68c276e24..5cf0fc8a97 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -42,9 +42,33 @@ jobs: - name: setup-dependencies run: | - sudo apt-get -y install zlib1g-dev libgmp3-dev ${{ matrix.compiler-version.cc }} + pip3 install tox + sudo apt-get -y install clang-tidy-8 zlib1g-dev libgmp3-dev ${{ matrix.compiler-version.cc }} mkdir /home/runner/work/downward/lib + - name: setup-uncrustify + run: | + # Set up uncrustify. + wget https://github.com/uncrustify/uncrustify/archive/uncrustify-0.67.tar.gz + tar xzf uncrustify-0.67.tar.gz + cd uncrustify-uncrustify-0.67 + mkdir build + cd build + cmake ../ + make -j2 + mv uncrustify ../../ + cd ../../ + rm -rf uncrustify-0.67.tar.gz uncrustify-uncrustify-0.67 + + - name: test-style + if: ${{ matrix.compiler-version.cc == 'gcc' && matrix.ubuntu-version == 18.04 }} + run: | + export PATH="$(pwd):$PATH" # Add uncrustify + cd misc/ + tox -e style,clang-tidy + cd ../ + rm uncrustify + # We only want to setup osi if both LP solvers are set, hence # we execute the following three steps only if both secrets # are set. @@ -104,20 +128,6 @@ jobs: ./build.py --debug ./build.py - - name: setup-uncrustify - run: | - # Set up uncrustify. - wget https://github.com/uncrustify/uncrustify/archive/uncrustify-0.67.tar.gz - tar xzf uncrustify-0.67.tar.gz - cd uncrustify-uncrustify-0.67 - mkdir build - cd build - cmake ../ - make -j2 - mv uncrustify ../../ - cd ../../ - rm -rf uncrustify-0.67.tar.gz uncrustify-uncrustify-0.67 - - name: setup-val # VAL does not compile with clang-11. env: @@ -142,7 +152,7 @@ jobs: if: ${{ matrix.compiler-version.cc == 'gcc' }} run: | cd ../ - tar cfz ${{ matrix.compiler-version.cc }}.tar.gz downward lib + tar cfz ${{ matrix.compiler-version.cc }}.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ downward/validate lib - name: upload-files if: ${{ matrix.compiler-version.cc == 'gcc' }} @@ -183,6 +193,7 @@ jobs: # though the planner is already built. run: | pip3 install tox + sudo apt-get update sudo apt-get -y install clang-tidy-8 valgrind zlib1g-dev libgmp3-dev ${{ matrix.compiler-version }} - name: download-files @@ -205,8 +216,8 @@ jobs: - name: test run: | - export PATH="$(pwd):$PATH" # Add uncrustify and VAL to PATH. + export PATH="$(pwd):$PATH" # add VAL to PATH. cd misc/ - tox -e py,translator,search,style + tox -e py,translator,search ... From d622b06aa818f1d3c5418dc50d737de2aa5ab562 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 10:11:11 +0100 Subject: [PATCH 20/68] [issue1003] add apt repos; clean up --- .github/workflows/ubuntu.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5cf0fc8a97..7d3010e408 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -61,15 +61,15 @@ jobs: rm -rf uncrustify-0.67.tar.gz uncrustify-uncrustify-0.67 - name: test-style - if: ${{ matrix.compiler-version.cc == 'gcc' && matrix.ubuntu-version == 18.04 }} + if: ${{ matrix.compiler-version.cc == 'gcc' && matrix.ubuntu-version == '18.04' }} run: | - export PATH="$(pwd):$PATH" # Add uncrustify + export PATH="$(pwd):$PATH" # Add uncrustify to path. cd misc/ tox -e style,clang-tidy cd ../ rm uncrustify - # We only want to setup osi if both LP solvers are set, hence + # We only want to set up osi if both LP solvers are set, hence # we execute the following three steps only if both secrets # are set. - name: setup-cplex @@ -124,7 +124,7 @@ jobs: - name: compile run: | - export CXXFLAGS="-Werror" # Treat compilation warnings as errors. + export CXXFLAGS="-Werror" # Treat compilation warnings as errors. ./build.py --debug ./build.py @@ -194,7 +194,11 @@ jobs: run: | pip3 install tox sudo apt-get update - sudo apt-get -y install clang-tidy-8 valgrind zlib1g-dev libgmp3-dev ${{ matrix.compiler-version }} + sudo add-apt-repository main + sudo add-apt-repository universe + sudo add-apt-repository restricted + sudo add-apt-repository multiverse + sudo apt-get -y install valgrind zlib1g-dev libgmp3-dev ${{ matrix.compiler-version }} - name: download-files uses: actions/download-artifact@v1 @@ -216,7 +220,7 @@ jobs: - name: test run: | - export PATH="$(pwd):$PATH" # add VAL to PATH. + export PATH="$(pwd):$PATH" # Add VAL to path. cd misc/ tox -e py,translator,search From 96a4c3cf9e7d8a9ec4ed0a4acba74ecd33a29dc1 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 10:44:22 +0100 Subject: [PATCH 21/68] [issue1003] add style workflow; debug ubuntu workflow --- .github/workflows/style.yml | 44 ++++++++++++++++++++++++++++++++++++ .github/workflows/ubuntu.yml | 44 ++++++++++-------------------------- 2 files changed, 56 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/style.yml diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000000..e0f216aeb3 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,44 @@ +--- +name: style + +on: [push, pull_request] + +jobs: + style: + name: code-style + runs-on: ubuntu-18.04 + steps: + - name: clone-repo + uses: actions/checkout@v1 + + - name: setup-python + uses: actions/setup-python@v1 + with: + python-version: 3.6 + + - name: setup-dependencies + run: | + pip3 install tox + sudo apt-get -y install clang-tidy-8 + + - name: setup-uncrustify + run: | + # Set up uncrustify. + wget https://github.com/uncrustify/uncrustify/archive/uncrustify-0.67.tar.gz + tar xzf uncrustify-0.67.tar.gz + cd uncrustify-uncrustify-0.67 + mkdir build + cd build + cmake ../ + make -j2 + mv uncrustify ../../ + cd ../../ + rm -rf uncrustify-0.67.tar.gz uncrustify-uncrustify-0.67 + + - name: run-style-tests + run: | + export PATH="$(pwd):$PATH" # Add uncrustify to path. + cd misc/ + tox -e style,clang-tidy + +... diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 7d3010e408..3330608c6c 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -42,33 +42,9 @@ jobs: - name: setup-dependencies run: | - pip3 install tox - sudo apt-get -y install clang-tidy-8 zlib1g-dev libgmp3-dev ${{ matrix.compiler-version.cc }} + sudo apt-get -y install zlib1g-dev libgmp3-dev ${{ matrix.compiler-version.cc }} mkdir /home/runner/work/downward/lib - - name: setup-uncrustify - run: | - # Set up uncrustify. - wget https://github.com/uncrustify/uncrustify/archive/uncrustify-0.67.tar.gz - tar xzf uncrustify-0.67.tar.gz - cd uncrustify-uncrustify-0.67 - mkdir build - cd build - cmake ../ - make -j2 - mv uncrustify ../../ - cd ../../ - rm -rf uncrustify-0.67.tar.gz uncrustify-uncrustify-0.67 - - - name: test-style - if: ${{ matrix.compiler-version.cc == 'gcc' && matrix.ubuntu-version == '18.04' }} - run: | - export PATH="$(pwd):$PATH" # Add uncrustify to path. - cd misc/ - tox -e style,clang-tidy - cd ../ - rm uncrustify - # We only want to set up osi if both LP solvers are set, hence # we execute the following three steps only if both secrets # are set. @@ -193,12 +169,16 @@ jobs: # though the planner is already built. run: | pip3 install tox - sudo apt-get update - sudo add-apt-repository main - sudo add-apt-repository universe - sudo add-apt-repository restricted - sudo add-apt-repository multiverse - sudo apt-get -y install valgrind zlib1g-dev libgmp3-dev ${{ matrix.compiler-version }} + echo "install clang-tidy-8" + sudo apt-get -y install clang-tidy-8 + echo "install valgrind" + sudo apt-get -y install valgrind + echo "install zlib1g-dev" + sudo apt-get -y install zlib1g-dev + echo "install libgmp3-dev" + sudo apt-get -y install libgmp3-dev + echo "install compiler" + sudo apt-get -y install ${{ matrix.compiler-version }} - name: download-files uses: actions/download-artifact@v1 @@ -222,6 +202,6 @@ jobs: run: | export PATH="$(pwd):$PATH" # Add VAL to path. cd misc/ - tox -e py,translator,search + tox -e py,translator,search,valgrind ... From 6d68b2ae1ef774dde3fa6b5569be5104d480a084 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 17:24:15 +0100 Subject: [PATCH 22/68] [issue1003] reduce ubuntu artifact size --- .github/workflows/ubuntu.yml | 50 +++++++++++++----------------------- 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 3330608c6c..74209f00f0 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -104,31 +104,16 @@ jobs: ./build.py --debug ./build.py - - name: setup-val - # VAL does not compile with clang-11. - env: - CC: gcc - CXX: g++ - run: | - # Set up VAL. - sudo apt-get -y install flex bison - git clone https://github.com/KCL-Planning/VAL.git - cd VAL - git checkout a5565396007eee73ac36527fbf904142b3077c74 - make clean # Remove old build artifacts and binaries. - sed -i 's/-Werror //g' Makefile # Ignore warnings. - make -j2 - mv validate ../ - cd ../ - rm -rf VAL - - name: archive-files # We only run tests on the version compiled with gcc, so we # only need to archive that one. if: ${{ matrix.compiler-version.cc == 'gcc' }} + # We assume that CPLEX and Soplex are linked statically, even + # though we don't enforce it. Hence we only archive Osi, which + # is linked dynamically. run: | cd ../ - tar cfz ${{ matrix.compiler-version.cc }}.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ downward/validate lib + tar cfz ${{ matrix.compiler-version.cc }}.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/Osi-0.107.9/lib - name: upload-files if: ${{ matrix.compiler-version.cc == 'gcc' }} @@ -154,9 +139,6 @@ jobs: env: CC: ${{ matrix.compiler-version.cc }} CXX: ${{ matrix.compiler-version.cxx }} - DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129 - DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 - DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin steps: - name: setup-python uses: actions/setup-python@v1 @@ -169,16 +151,20 @@ jobs: # though the planner is already built. run: | pip3 install tox - echo "install clang-tidy-8" - sudo apt-get -y install clang-tidy-8 - echo "install valgrind" - sudo apt-get -y install valgrind - echo "install zlib1g-dev" - sudo apt-get -y install zlib1g-dev - echo "install libgmp3-dev" - sudo apt-get -y install libgmp3-dev - echo "install compiler" - sudo apt-get -y install ${{ matrix.compiler-version }} + sudo apt-get -y install valgrind zlib1g-dev libgmp3-dev ${{ matrix.compiler-version.cc }} flex bison + + # NOTE: VAL does not compile with clang-11. + - name: setup-val + run: | + git clone https://github.com/KCL-Planning/VAL.git + cd VAL + git checkout a5565396007eee73ac36527fbf904142b3077c74 + make clean # Remove old build artifacts and binaries. + sed -i 's/-Werror //g' Makefile # Ignore warnings. + make -j2 + mv validate ../ + cd ../ + rm -rf VAL - name: download-files uses: actions/download-artifact@v1 From dab7648bc07e510d8b760ea86dae9e4729a5e766 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 17:36:56 +0100 Subject: [PATCH 23/68] [issue1003] Polish macOS workflow --- .github/workflows/mac.yml | 63 ++++++++---------------------------- .github/workflows/ubuntu.yml | 3 ++ 2 files changed, 16 insertions(+), 50 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 9456139fa0..607c85bfd6 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -1,71 +1,34 @@ --- -name: macos +name: macOS on: [push, pull_request] jobs: - compile: - name: compile + test: + name: Test macOS + timeout-minutes: 60 runs-on: macos-10.15 - strategy: - matrix: - python-version: ['3.6'] - build-version: ["release", "debug"] steps: - - name: clone-repo + - name: Clone repository uses: actions/checkout@master - - name: setup-python + - name: Set up Python uses: actions/setup-python@master with: - python-version: ${{ matrix.python-version }} + python-version: 3.6 - - name: compile + - name: Compile planner run: | - export CXXFLAGS="-Werror" # Treat compilation warnings as errors. - ./build.py ${{ matrix.build-version }} - - - name: upload-planner - uses: actions/upload-artifact@master - with: - name: ${{ matrix.build-version }} - path: builds/${{ matrix.build-version }} - - - test: - name: test - runs-on: macos-10.15 - needs: compile - strategy: - matrix: - python-version: ['3.6'] - steps: - - name: clone-repo - uses: actions/checkout@master + export CXXFLAGS="-Werror" # Treat compilation warnings as errors. + ./build.py + ./build.py --debug - - name: setup-python - uses: actions/setup-python@master - with: - python-version: ${{ matrix.python-version }} - - - name: setup-dependencies + - name: Set up tox run: | pip3 install tox - mkdir builds - - - name: download-planner - uses: actions/download-artifact@master - with: - # Without 'name' attribute all artifacts are downloaded and the - # artifact name is used as directory name. - path: builds/ - - name: test - # We do not run py tests here because that would require VAL - # to be installed. + - name: Run tox tests run: | - chmod +x builds/debug/bin/downward - chmod +x builds/release/bin/downward cd misc tox -e translator,search diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 74209f00f0..725e16b3f3 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -103,6 +103,8 @@ jobs: export CXXFLAGS="-Werror" # Treat compilation warnings as errors. ./build.py --debug ./build.py + ldd builds/debug/bin/downward + ldd builds/release/bin/downward - name: archive-files # We only run tests on the version compiled with gcc, so we @@ -113,6 +115,7 @@ jobs: # is linked dynamically. run: | cd ../ + ls lib/coin/ tar cfz ${{ matrix.compiler-version.cc }}.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/Osi-0.107.9/lib - name: upload-files From 9f00b39ab8df1763ef830ec8dc2322ccfeb629f5 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 18:04:42 +0100 Subject: [PATCH 24/68] [issue1003] Add Patrick's changes from issue1005 regarding tests --- misc/autodoc/autodoc.py | 5 ----- misc/tests/configs.py | 6 ++--- misc/tests/test-standard-configs.py | 22 ++++++++++++++----- misc/tests/test-translator.py | 2 -- misc/tox.ini | 34 ++++++++++++++++++++++++----- 5 files changed, 48 insertions(+), 21 deletions(-) diff --git a/misc/autodoc/autodoc.py b/misc/autodoc/autodoc.py index c6a4a70cb5..055e5fc87f 100755 --- a/misc/autodoc/autodoc.py +++ b/misc/autodoc/autodoc.py @@ -124,9 +124,6 @@ def make_doc_link(m): text = re.sub(re_link % key, make_link, text) return text -def build_planner(build): - subprocess.check_call(["./build.py", build, "downward"], cwd=REPO_ROOT_DIR) - def get_pages_from_planner(build): out = subprocess.check_output( ["./fast-downward.py", "--build", build, "--search", "--", "--help", "--txt2tags"], @@ -164,8 +161,6 @@ def add_page(title, text): if __name__ == '__main__': args = parse_args() - logging.info("building planner...") - build_planner(args.build) logging.info("getting new pages from planner...") new_doc_pages = get_pages_from_planner(args.build) if args.dry_run: diff --git a/misc/tests/configs.py b/misc/tests/configs.py index 0bfa4b29ab..4dbd354622 100644 --- a/misc/tests/configs.py +++ b/misc/tests/configs.py @@ -197,10 +197,10 @@ def configs_satisficing_extended(): } -def configs_optimal_lp(): +def configs_optimal_lp(lp_solver="CPLEX"): return { - "divpot": ["--search", "astar(diverse_potentials())"], - "seq+lmcut": ["--search", "astar(operatorcounting([state_equation_constraints(), lmcut_constraints()]))"], + "divpot": ["--search", f"astar(diverse_potentials(lpsolver={lp_solver}))"], + "seq+lmcut": ["--search", f"astar(operatorcounting([state_equation_constraints(), lmcut_constraints()], lpsolver={lp_solver}))"], } diff --git a/misc/tests/test-standard-configs.py b/misc/tests/test-standard-configs.py index 503dba55ce..f8cb87020b 100644 --- a/misc/tests/test-standard-configs.py +++ b/misc/tests/test-standard-configs.py @@ -15,9 +15,9 @@ PLAN_FILE = os.path.join(REPO, "test.plan") TASK = os.path.join(BENCHMARKS_DIR, "miconic/s1-0.pddl") -CONFIGS = {} -CONFIGS.update(configs.default_configs_optimal(core=True, extended=True)) -CONFIGS.update(configs.default_configs_satisficing(core=True, extended=True)) +CONFIGS_NOLP = {} +CONFIGS_NOLP.update(configs.default_configs_optimal(core=True, extended=True)) +CONFIGS_NOLP.update(configs.default_configs_satisficing(core=True, extended=True)) def escape_list(l): @@ -52,9 +52,21 @@ def setup_module(module): translate(TASK) -@pytest.mark.parametrize("config", sorted(CONFIGS.values())) +@pytest.mark.parametrize("config", sorted(CONFIGS_NOLP.values())) @pytest.mark.parametrize("debug", [False, True]) -def test_configs(config, debug): +def test_configs_nolp(config, debug): + run_plan_script(SAS_FILE, config, debug) + + +@pytest.mark.parametrize("config", sorted(configs.configs_optimal_lp(lp_solver="CPLEX").values())) +@pytest.mark.parametrize("debug", [False, True]) +def test_configs_cplex(config, debug): + run_plan_script(SAS_FILE, config, debug) + + +@pytest.mark.parametrize("config", sorted(configs.configs_optimal_lp(lp_solver="SOPLEX").values())) +@pytest.mark.parametrize("debug", [False, True]) +def test_configs_soplex(config, debug): run_plan_script(SAS_FILE, config, debug) diff --git a/misc/tests/test-translator.py b/misc/tests/test-translator.py index caabf260eb..186e0138e1 100755 --- a/misc/tests/test-translator.py +++ b/misc/tests/test-translator.py @@ -3,7 +3,6 @@ HELP = """\ Check that translator is deterministic. - Run the translator multiple times to test that the log and the output file are the same for every run. Obviously, there might be false negatives, i.e., different runs might lead to the same nondeterministic results. @@ -123,7 +122,6 @@ def main(): args = parse_args() os.chdir(DIR) cleanup() - subprocess.check_call([sys.executable, "build.py", "translate"], cwd=REPO) for task in get_tasks(args): write_combined_output("base.sas", task) for iteration in range(2): diff --git a/misc/tox.ini b/misc/tox.ini index ae07969239..7a19257246 100644 --- a/misc/tox.ini +++ b/misc/tox.ini @@ -1,23 +1,31 @@ # Note that we can't run fast-downward.py from within the misc/ # directory because the driver confuses the misc/release with the # builds/release directory. +# All tests (except for 'build') assume that Fast Downward is already build. +# For the translator tests it is sufficient to build the 'translate' +# configuration. + [tox] -envlist = build, py36, py37, py38, translator, search, valgrind, clang-tidy, style +envlist = build, driver, translator, search, style, autodoc, clang-tidy basepython = python3 skip_missing_interpreters = true skipsdist = true -[testenv] +[testenv:autodoc] changedir = {toxinidir}/../ -deps = - pytest commands = - pytest driver/tests.py misc/tests/test-exitcodes.py bash -c "python3 misc/autodoc/autodoc.py --dry-run > /dev/null" whitelist_externals = bash +[testenv:driver] +changedir = {toxinidir}/../ +deps = + pytest +commands = + pytest driver/tests.py misc/tests/test-exitcodes.py + [testenv:build] changedir = {toxinidir}/../ passenv = @@ -39,7 +47,21 @@ changedir = {toxinidir}/tests/ deps = pytest commands = - pytest test-standard-configs.py + pytest test-standard-configs.py -k test_configs_nolp + +[testenv:cplex] +changedir = {toxinidir}/tests/ +deps = + pytest +commands = + pytest test-standard-configs.py -k test_configs_cplex + +[testenv:soplex] +changedir = {toxinidir}/tests/ +deps = + pytest +commands = + pytest test-standard-configs.py -k test_configs_soplex [testenv:valgrind] changedir = {toxinidir}/tests/ From ca21e04e5acf1cbd34664fb4847acfe62eaf557d Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 18:13:58 +0100 Subject: [PATCH 25/68] [issue1003] use new tests; add time limits; polish workflows --- .github/workflows/mac.yml | 8 ++-- .github/workflows/style.yml | 18 ++++----- .github/workflows/ubuntu.yml | 72 +++++++++++++++++------------------ .github/workflows/windows.yml | 5 ++- misc/tox.ini | 6 +-- 5 files changed, 55 insertions(+), 54 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 607c85bfd6..c0d4c4d181 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -5,14 +5,14 @@ on: [push, pull_request] jobs: test: - name: Test macOS + name: Compile and test planner timeout-minutes: 60 runs-on: macos-10.15 steps: - name: Clone repository uses: actions/checkout@master - - name: Set up Python + - name: Install Python uses: actions/setup-python@master with: python-version: 3.6 @@ -23,13 +23,13 @@ jobs: ./build.py ./build.py --debug - - name: Set up tox + - name: Install tox run: | pip3 install tox - name: Run tox tests run: | cd misc - tox -e translator,search + tox -e driver,translator,search ... diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index e0f216aeb3..8848ab4418 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -1,27 +1,27 @@ --- -name: style +name: Code style tests on: [push, pull_request] jobs: style: - name: code-style + name: Test code style runs-on: ubuntu-18.04 steps: - - name: clone-repo - uses: actions/checkout@v1 + - name: Clone repository + uses: actions/checkout@master - - name: setup-python - uses: actions/setup-python@v1 + - name: Install Python + uses: actions/setup-python@master with: python-version: 3.6 - - name: setup-dependencies + - name: Install dependencies run: | pip3 install tox sudo apt-get -y install clang-tidy-8 - - name: setup-uncrustify + - name: Install uncrustify run: | # Set up uncrustify. wget https://github.com/uncrustify/uncrustify/archive/uncrustify-0.67.tar.gz @@ -35,7 +35,7 @@ jobs: cd ../../ rm -rf uncrustify-0.67.tar.gz uncrustify-uncrustify-0.67 - - name: run-style-tests + - name: Run code style tests run: | export PATH="$(pwd):$PATH" # Add uncrustify to path. cd misc/ diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 725e16b3f3..1dbc8b7896 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,11 +1,12 @@ --- -name: ubuntu +name: Ubuntu on: [push, pull_request] jobs: compile: # Identifier of the job. Jobs run in parallel unless specified otherwise. - name: compile + name: Compile planner + timeout-minutes: 60 runs-on: ${{ matrix.ubuntu-version }} strategy: matrix: @@ -32,15 +33,15 @@ jobs: DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin steps: # Eeach "-" is a new sequentially run step - - name: clone-repo - uses: actions/checkout@v1 + - name: Clone repository + uses: actions/checkout@master - - name: setup-python - uses: actions/setup-python@v1 + - name: Install Python + uses: actions/setup-python@master with: python-version: ${{ matrix.python-version }} - - name: setup-dependencies + - name: Install dependencies run: | sudo apt-get -y install zlib1g-dev libgmp3-dev ${{ matrix.compiler-version.cc }} mkdir /home/runner/work/downward/lib @@ -48,7 +49,7 @@ jobs: # We only want to set up osi if both LP solvers are set, hence # we execute the following three steps only if both secrets # are set. - - name: setup-cplex + - name: Install CPLEX if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} env: CPLEX_STUDIO: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129 @@ -60,7 +61,7 @@ jobs: ./$CPLEX_INSTALLER -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=${CPLEX_STUDIO} -i silent rm $CPLEX_INSTALLER - - name: setup-soplex + - name: Install SoPlex if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | # We redirect output of wget to hide the secret URLs. @@ -75,7 +76,7 @@ jobs: cd ../../ rm -r soplex-3.1.1 - - name: setup-osi + - name: Install Osi if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | wget http://www.coin-or.org/download/source/Osi/Osi-0.107.9.tgz @@ -98,27 +99,23 @@ jobs: cd ../ rm -r Osi-0.107.9.tgz Osi-0.107.9 - - name: compile + - name: Compile planner run: | export CXXFLAGS="-Werror" # Treat compilation warnings as errors. ./build.py --debug ./build.py - ldd builds/debug/bin/downward - ldd builds/release/bin/downward - - name: archive-files + - name: Archive required files # We only run tests on the version compiled with gcc, so we # only need to archive that one. if: ${{ matrix.compiler-version.cc == 'gcc' }} - # We assume that CPLEX and Soplex are linked statically, even - # though we don't enforce it. Hence we only archive Osi, which - # is linked dynamically. + # We determined the dynamically linked libraries using ldd. run: | cd ../ ls lib/coin/ - tar cfz ${{ matrix.compiler-version.cc }}.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/Osi-0.107.9/lib + tar cfz ${{ matrix.compiler-version.cc }}.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ /home/runner/work/downward/lib/coin/lib/libOsiCpx.so.1 /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so /home/runner/work/downward/lib/coin/lib/libOsiSpx.so.1 /home/runner/work/downward/lib/coin/lib/libOsi.so.1 /home/runner/work/downward/lib/coin/lib/libCoinUtils.so.3 - - name: upload-files + - name: Upload archive if: ${{ matrix.compiler-version.cc == 'gcc' }} uses: actions/upload-artifact@v1 with: @@ -127,37 +124,29 @@ jobs: test: - name: test + name: Test planner runs-on: ${{ matrix.ubuntu-version }} needs: compile # TODO: this only depends on the compile step with gcc strategy: matrix: ubuntu-version: [ubuntu-18.04, ubuntu-20.04] - compiler-version: - - {cc: gcc, cxx: g++} python-version: [3.6, 3.8] exclude: - ubuntu-version: ubuntu-18.04 python-version: 3.8 - env: - CC: ${{ matrix.compiler-version.cc }} - CXX: ${{ matrix.compiler-version.cxx }} steps: - - name: setup-python + - name: Install Python uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - - name: setup-dependencies - # We install the right compiler so that CMake doesn't complain - # when asked to compile as part of the tox search tests, even - # though the planner is already built. + - name: Install dependencies run: | pip3 install tox - sudo apt-get -y install valgrind zlib1g-dev libgmp3-dev ${{ matrix.compiler-version.cc }} flex bison + sudo apt-get -y install zlib1g-dev libgmp3-dev gcc flex bison # NOTE: VAL does not compile with clang-11. - - name: setup-val + - name: Install VAL run: | git clone https://github.com/KCL-Planning/VAL.git cd VAL @@ -169,12 +158,12 @@ jobs: cd ../ rm -rf VAL - - name: download-files + - name: Download archive uses: actions/download-artifact@v1 with: name: compiled-planner-${{ matrix.ubuntu-version }} - - name: extract-files + - name: Extract archive # We need to make sure that paths are the same as in the first job, # otherwise cmake exits with an error when called during tests. # Alternatively, we could change the tests so that they don't build. @@ -187,10 +176,21 @@ jobs: cd ../ rm -r compiled-planner-${{ matrix.ubuntu-version }} - - name: test + - name: Test driver, translator and standard search configurations + run: | + export PATH="$(pwd):$PATH" # Add VAL to path. + cd misc/ + tox -e driver,translator,search + + - name: Test CPLEX configurations + run: | + export PATH="$(pwd):$PATH" # Add VAL to path. + cd misc/ + tox -e cplex + - name: Test SoPlex configurations run: | export PATH="$(pwd):$PATH" # Add VAL to path. cd misc/ - tox -e py,translator,search,valgrind + tox -e soplex ... diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1d267c0f68..1ba2a0c5c2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -11,6 +11,7 @@ env: jobs: compile: # name of the job. Jobs run in parallel unless specified otherwise. name: compile + timeout-minutes: 60 runs-on: ${{ matrix.windows-version }} strategy: matrix: @@ -90,10 +91,10 @@ jobs: run: | cd misc/ IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e translator,search + "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e driver,translator,search ) IF "${{ matrix.windows-version }}" == "windows-2019" ( - "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e translator,search + "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e driver,translator,search ) ... diff --git a/misc/tox.ini b/misc/tox.ini index 7a19257246..78a49592b5 100644 --- a/misc/tox.ini +++ b/misc/tox.ini @@ -1,9 +1,9 @@ # Note that we can't run fast-downward.py from within the misc/ # directory because the driver confuses the misc/release with the # builds/release directory. -# All tests (except for 'build') assume that Fast Downward is already build. -# For the translator tests it is sufficient to build the 'translate' -# configuration. +# All tests (except for 'build') assume that Fast Downward is already +# built. For the translator tests it is sufficient to build the +# 'translate' configuration. [tox] From c04819cb54eabd71a7727fc6ca67a7263b452c03 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 18:27:56 +0100 Subject: [PATCH 26/68] [issue1003] install VAL on macOS --- .github/workflows/mac.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index c0d4c4d181..0dc733020a 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -27,6 +27,18 @@ jobs: run: | pip3 install tox + - name: Install VAL + run: | + git clone https://github.com/KCL-Planning/VAL.git + cd VAL + git checkout a5565396007eee73ac36527fbf904142b3077c74 + make clean # Remove old build artifacts and binaries. + sed -i 's/-Werror //g' Makefile # Ignore warnings. + make -j2 + mv validate ../ + cd ../ + rm -rf VAL + - name: Run tox tests run: | cd misc From 482a8e7ebf82b9aac4bccec67bee4418034b3c14 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 18:39:02 +0100 Subject: [PATCH 27/68] [issue1003] use sys.executable for executing python scripts --- driver/tests.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/driver/tests.py b/driver/tests.py index c6bd6080ca..47a727ac36 100644 --- a/driver/tests.py +++ b/driver/tests.py @@ -6,6 +6,7 @@ import os import subprocess +import sys import pytest @@ -18,13 +19,13 @@ def translate(): """Create translated task.""" - cmd = ["./fast-downward.py", "--translate", + cmd = [sys.executable, "fast-downward.py", "--translate", "misc/tests/benchmarks/gripper/prob01.pddl"] subprocess.check_call(cmd, cwd=REPO_ROOT_DIR) def cleanup(): - subprocess.check_call(["./fast-downward.py", "--cleanup"], + subprocess.check_call([sys.executable, "fast-downward.py", "--cleanup"], cwd=REPO_ROOT_DIR) @@ -42,17 +43,17 @@ def test_commandline_args(): def test_aliases(): for alias, config in ALIASES.items(): - cmd = ["./fast-downward.py", "--alias", alias, "output.sas"] + cmd = [sys.executable, "fast-downward.py", "--alias", alias, "output.sas"] run_driver(cmd) def test_show_aliases(): - run_driver(["./fast-downward.py", "--show-aliases"]) + run_driver([sys.executable, "fast-downward.py", "--show-aliases"]) def test_portfolios(): for name, portfolio in PORTFOLIOS.items(): - cmd = ["./fast-downward.py", "--portfolio", portfolio, + cmd = [sys.executable, "fast-downward.py", "--portfolio", portfolio, "--search-time-limit", "30m", "output.sas"] run_driver(cmd) @@ -62,12 +63,12 @@ def preexec_fn(): limits.set_time_limit(10) cmd = [ - "./fast-downward.py", "--translate", "--translate-time-limit", + sys.executable, "fast-downward.py", "--translate", "--translate-time-limit", "10s", "misc/tests/benchmarks/gripper/prob01.pddl"] subprocess.check_call(cmd, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) cmd = [ - "./fast-downward.py", "--translate", "--translate-time-limit", + sys.executable, "fast-downward.py", "--translate", "--translate-time-limit", "20s", "misc/tests/benchmarks/gripper/prob01.pddl"] with pytest.raises(subprocess.CalledProcessError) as exception_info: subprocess.check_call(cmd, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) From ba22bc1c89d0208fbcb5f219557c988e4acca99c Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 18:48:13 +0100 Subject: [PATCH 28/68] [issue1003] attempt to fix names under Ubuntu; do not run driver tests under Windows --- .github/workflows/ubuntu.yml | 20 +++++++++++--------- .github/workflows/windows.yml | 11 +++++++---- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 1dbc8b7896..efef5ae46f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -113,14 +113,14 @@ jobs: run: | cd ../ ls lib/coin/ - tar cfz ${{ matrix.compiler-version.cc }}.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ /home/runner/work/downward/lib/coin/lib/libOsiCpx.so.1 /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so /home/runner/work/downward/lib/coin/lib/libOsiSpx.so.1 /home/runner/work/downward/lib/coin/lib/libOsi.so.1 /home/runner/work/downward/lib/coin/lib/libCoinUtils.so.3 + tar cfz archive.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ /home/runner/work/downward/lib/coin/lib/libOsiCpx.so.1 /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so /home/runner/work/downward/lib/coin/lib/libOsiSpx.so.1 /home/runner/work/downward/lib/coin/lib/libOsi.so.1 /home/runner/work/downward/lib/coin/lib/libCoinUtils.so.3 - name: Upload archive if: ${{ matrix.compiler-version.cc == 'gcc' }} - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@master with: name: compiled-planner-${{ matrix.ubuntu-version }} - path: /home/runner/work/downward/${{ matrix.compiler-version.cc }}.tar.gz + path: /home/runner/work/downward/archive.tar.gz test: @@ -136,7 +136,7 @@ jobs: python-version: 3.8 steps: - name: Install Python - uses: actions/setup-python@v1 + uses: actions/setup-python@master with: python-version: ${{ matrix.python-version }} @@ -159,17 +159,19 @@ jobs: rm -rf VAL - name: Download archive - uses: actions/download-artifact@v1 + uses: actions/download-artifact@master with: name: compiled-planner-${{ matrix.ubuntu-version }} - name: Extract archive - # We need to make sure that paths are the same as in the first job, - # otherwise cmake exits with an error when called during tests. - # Alternatively, we could change the tests so that they don't build. + # We need to make sure that paths are the same as in the first + # job, otherwise cmake exits with an error when called during + # tests. Alternatively, we could change the tests so that they + # don't build. run: | cd /home/runner/work/downward/downward/compiled-planner-${{ matrix.ubuntu-version }} - tar xfz ${{ matrix.compiler-version }}.tar.gz + ls + tar xfz archive.tar.gz shopt -s dotglob mv downward/* ../ mv lib/ ../../ diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1ba2a0c5c2..51d8e1d443 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -86,15 +86,18 @@ jobs: env: CC: cl CXX: cl - # We do not run py tests here because that would require VAL - # to be installed. + # We do not run driver tests here because that would require + # VAL to be installed, which currently cannot be easily done + # on Windows for the version of VAL we use. When the maintainers + # of VAL fix the latest version to accept plans without time + # steps, we hope to be able to install VAL natively on Windows. run: | cd misc/ IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e driver,translator,search + "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e translator,search ) IF "${{ matrix.windows-version }}" == "windows-2019" ( - "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e driver,translator,search + "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e translator,search ) ... From 30952af5213ea6965fa51f9b9a8ceb8da2610d64 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 19:05:34 +0100 Subject: [PATCH 29/68] [issue1003] install gsed on mac --- .github/workflows/mac.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 0dc733020a..50ac5fdde7 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -29,11 +29,12 @@ jobs: - name: Install VAL run: | + brew install gnu-sed git clone https://github.com/KCL-Planning/VAL.git cd VAL git checkout a5565396007eee73ac36527fbf904142b3077c74 make clean # Remove old build artifacts and binaries. - sed -i 's/-Werror //g' Makefile # Ignore warnings. + gsed -i 's/-Werror //g' Makefile # Ignore warnings. make -j2 mv validate ../ cd ../ From 0ee4443083806b7ee655192484334b48d37a0f62 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 19:19:48 +0100 Subject: [PATCH 30/68] [issue1003] fix driver to better support Windows --- driver/portfolio_runner.py | 6 +++--- driver/tests.py | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/driver/portfolio_runner.py b/driver/portfolio_runner.py index a1665278e9..3fd7900609 100644 --- a/driver/portfolio_runner.py +++ b/driver/portfolio_runner.py @@ -15,8 +15,8 @@ __all__ = ["run"] -import os import subprocess +import sys from . import call from . import limits @@ -219,8 +219,8 @@ def run(portfolio, executable, sas_file, plan_manager, time, memory): "Please pass a time limit to fast-downward.py.") if time is None: - if os.name == "nt": - returncodes.exit_with_driver_unsupported_error(limits.RESOURCE_MODULE_MISSING_MSG) + if sys.platform == "win32": + returncodes.exit_with_driver_unsupported_error(limits.CANNOT_LIMIT_TIME_MSG) else: returncodes.exit_with_driver_input_error( "Portfolios need a time limit. Please pass --search-time-limit " diff --git a/driver/tests.py b/driver/tests.py index 47a727ac36..026bcc0339 100644 --- a/driver/tests.py +++ b/driver/tests.py @@ -59,6 +59,11 @@ def test_portfolios(): def test_hard_time_limit(): + # We cannot test this on systems like Windows where we cannot + # enforce time limits. + if not limits.can_set_time_limit(): + return + def preexec_fn(): limits.set_time_limit(10) From d8d4d0fc85e0c8dc0f3a702a2c05b2a5e236c003 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 19:31:05 +0100 Subject: [PATCH 31/68] [issue1003] attempt to fix ubuntu uploading and downloading --- .github/workflows/ubuntu.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index efef5ae46f..879a2aebca 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -169,14 +169,12 @@ jobs: # tests. Alternatively, we could change the tests so that they # don't build. run: | - cd /home/runner/work/downward/downward/compiled-planner-${{ matrix.ubuntu-version }} ls + pwd tar xfz archive.tar.gz shopt -s dotglob - mv downward/* ../ - mv lib/ ../../ - cd ../ - rm -r compiled-planner-${{ matrix.ubuntu-version }} + mv downward/* . + mv lib/ ../ - name: Test driver, translator and standard search configurations run: | From fcef5bdde7fb61aab621696c77a6c043f3f4f6bd Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 19:32:19 +0100 Subject: [PATCH 32/68] [issue1003] add VAL to path --- .github/workflows/mac.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 50ac5fdde7..1a4e642c43 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -42,6 +42,7 @@ jobs: - name: Run tox tests run: | + export PATH="$(pwd):$PATH" # Add VAL to path. cd misc tox -e driver,translator,search From 74bb3f5952deaa4c380d155153ff17be62dad993 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 19:59:09 +0100 Subject: [PATCH 33/68] [issue1003] fix archiving --- .github/workflows/ubuntu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 879a2aebca..95d721c10d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -112,8 +112,7 @@ jobs: # We determined the dynamically linked libraries using ldd. run: | cd ../ - ls lib/coin/ - tar cfz archive.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ /home/runner/work/downward/lib/coin/lib/libOsiCpx.so.1 /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so /home/runner/work/downward/lib/coin/lib/libOsiSpx.so.1 /home/runner/work/downward/lib/coin/lib/libOsi.so.1 /home/runner/work/downward/lib/coin/lib/libCoinUtils.so.3 + tar cfz archive.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/lib/libOsiCpx.so.1 lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so lib/coin/lib/libOsiSpx.so.1 lib/coin/lib/libOsi.so.1 lib/coin/lib/libCoinUtils.so.3 - name: Upload archive if: ${{ matrix.compiler-version.cc == 'gcc' }} @@ -172,6 +171,7 @@ jobs: ls pwd tar xfz archive.tar.gz + ls shopt -s dotglob mv downward/* . mv lib/ ../ From c25aa44452dc13035cd3eb43144c1cdcdae8f169 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 20:01:50 +0100 Subject: [PATCH 34/68] [issue1003] comment --- .github/workflows/ubuntu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 95d721c10d..716ef04c55 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -17,8 +17,8 @@ jobs: - {cc: clang, cxx: clang++} - {cc: clang-11, cxx: clang++-11} python-version: [3.6] - # Unfortunately, we couldn't figure out if there is a way to - # name the compiler versions so that we don't have to copy them here. + # Unfortunately, we couldn't figure out a way to name the + # compiler versions so that we don't have to copy them here. exclude: - ubuntu-version: ubuntu-18.04 compiler-version: {cc: gcc-10, cxx: g++-10} From 4bce226f6e3b36997a5dd22f42fec1d99e81fc00 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 21:05:45 +0100 Subject: [PATCH 35/68] [issue1003] also archive driver and misc --- .github/workflows/ubuntu.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 716ef04c55..55cacaebd2 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -112,7 +112,7 @@ jobs: # We determined the dynamically linked libraries using ldd. run: | cd ../ - tar cfz archive.tar.gz downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/lib/libOsiCpx.so.1 lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so lib/coin/lib/libOsiSpx.so.1 lib/coin/lib/libOsi.so.1 lib/coin/lib/libCoinUtils.so.3 + tar cfz archive.tar.gz downward/driver downward/misc downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/lib/libOsiCpx.so.1 lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so lib/coin/lib/libOsiSpx.so.1 lib/coin/lib/libOsi.so.1 lib/coin/lib/libCoinUtils.so.3 - name: Upload archive if: ${{ matrix.compiler-version.cc == 'gcc' }} @@ -168,16 +168,15 @@ jobs: # tests. Alternatively, we could change the tests so that they # don't build. run: | - ls - pwd tar xfz archive.tar.gz - ls shopt -s dotglob mv downward/* . mv lib/ ../ - name: Test driver, translator and standard search configurations run: | + pwd + ls export PATH="$(pwd):$PATH" # Add VAL to path. cd misc/ tox -e driver,translator,search From 34bcf0a999884ae432f7de2386743cce0704d4c5 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Wed, 17 Feb 2021 21:18:49 +0100 Subject: [PATCH 36/68] [issue1003] Add list of tested versions to README. --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index a87ce409f9..b9073c0a6c 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,24 @@ For further information: - Fast Downward main repository: +## Tested software versions + +This version of Fast Downward has been tested with the following systems, +compilers and tools: + +- Ubuntu: multiple versions of Python, GCC and Clang (see below) on Ubuntu 18.04 and 20.04 +- macOS: Catalina 10.15 with AppleClang 12.0.0.12000032 +- Windows: Visual Studio Enterprise 2017 (MSVC 19.16.27045.0) and + 2019 (MSVC 19.28.29336.0) +- Python: 3.6, 3.7, 3.8 +- GCC: 7, 9, 10 +- Clang: 6, 10, 11 +- CPLEX: 12.9 +- SoPlex: 3.1.1 +- OSI: 0.107.9 +- CMake: 3.10, 3.16, 3.19 + + ## Contributors The following list includes all people that actively contributed to From 7d7ccff919602318545b6306e055c7aa4f990a50 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Wed, 17 Feb 2021 22:32:51 +0100 Subject: [PATCH 37/68] [issue1003] need fast-downward.py --- .github/workflows/ubuntu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 55cacaebd2..c2da6a4237 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -32,7 +32,7 @@ jobs: DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin - steps: # Eeach "-" is a new sequentially run step + steps: # Each "-" is a new sequentially run step - name: Clone repository uses: actions/checkout@master @@ -112,7 +112,7 @@ jobs: # We determined the dynamically linked libraries using ldd. run: | cd ../ - tar cfz archive.tar.gz downward/driver downward/misc downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/lib/libOsiCpx.so.1 lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so lib/coin/lib/libOsiSpx.so.1 lib/coin/lib/libOsi.so.1 lib/coin/lib/libCoinUtils.so.3 + tar cfz archive.tar.gz downward/fast-downward.py downward/driver downward/misc downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/lib/libOsiCpx.so.1 lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so lib/coin/lib/libOsiSpx.so.1 lib/coin/lib/libOsi.so.1 lib/coin/lib/libCoinUtils.so.3 - name: Upload archive if: ${{ matrix.compiler-version.cc == 'gcc' }} From cc2fed36b297a07ca1907afff33aa9c2eddd2642 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 08:15:54 +0100 Subject: [PATCH 38/68] [issue1003] add retention time; attemp to use GITHUB_PATH for VAL --- .github/workflows/ubuntu.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c2da6a4237..67eb32e3f0 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -46,7 +46,7 @@ jobs: sudo apt-get -y install zlib1g-dev libgmp3-dev ${{ matrix.compiler-version.cc }} mkdir /home/runner/work/downward/lib - # We only want to set up osi if both LP solvers are set, hence + # We only want to set up Osi if both LP solvers are set, hence # we execute the following three steps only if both secrets # are set. - name: Install CPLEX @@ -109,7 +109,7 @@ jobs: # We only run tests on the version compiled with gcc, so we # only need to archive that one. if: ${{ matrix.compiler-version.cc == 'gcc' }} - # We determined the dynamically linked libraries using ldd. + # We determined the dynamically-linked libraries using ldd. run: | cd ../ tar cfz archive.tar.gz downward/fast-downward.py downward/driver downward/misc downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/lib/libOsiCpx.so.1 lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so lib/coin/lib/libOsiSpx.so.1 lib/coin/lib/libOsi.so.1 lib/coin/lib/libCoinUtils.so.3 @@ -120,6 +120,7 @@ jobs: with: name: compiled-planner-${{ matrix.ubuntu-version }} path: /home/runner/work/downward/archive.tar.gz + retention-days: 1 test: @@ -156,6 +157,7 @@ jobs: mv validate ../ cd ../ rm -rf VAL + echo `pwd` >> $GITHUB_PATH - name: Download archive uses: actions/download-artifact@master @@ -163,10 +165,8 @@ jobs: name: compiled-planner-${{ matrix.ubuntu-version }} - name: Extract archive - # We need to make sure that paths are the same as in the first - # job, otherwise cmake exits with an error when called during - # tests. Alternatively, we could change the tests so that they - # don't build. + # We need to make sure that library paths are the same as + # during compilation. run: | tar xfz archive.tar.gz shopt -s dotglob @@ -177,18 +177,19 @@ jobs: run: | pwd ls - export PATH="$(pwd):$PATH" # Add VAL to path. + ls ../ + ldd builds/debug/bin/downward + ldd builds/release/bin/downward + echo $PATH cd misc/ tox -e driver,translator,search - name: Test CPLEX configurations run: | - export PATH="$(pwd):$PATH" # Add VAL to path. cd misc/ tox -e cplex - name: Test SoPlex configurations run: | - export PATH="$(pwd):$PATH" # Add VAL to path. cd misc/ tox -e soplex From 1b3dd48e785760af76e210513ce558c4c9519698 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 08:39:01 +0100 Subject: [PATCH 39/68] [issue1003] polish driver tests --- driver/arguments.py | 16 ++++++++-------- driver/tests.py | 39 +++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/driver/arguments.py b/driver/arguments.py index a85d129f96..ff4580ee91 100644 --- a/driver/arguments.py +++ b/driver/arguments.py @@ -52,25 +52,25 @@ EXAMPLES = [ ("Translate and find a plan with A* + LM-Cut:", - ["./fast-downward.py", "misc/tests/benchmarks/gripper/prob01.pddl", + ["misc/tests/benchmarks/gripper/prob01.pddl", "--search", '"astar(lmcut())"']), ("Translate and run no search:", - ["./fast-downward.py", "--translate", + ["--translate", "misc/tests/benchmarks/gripper/prob01.pddl"]), ("Run predefined configuration (LAMA-2011) on translated task:", - ["./fast-downward.py", "--alias", "seq-sat-lama-2011", "output.sas"]), + ["--alias", "seq-sat-lama-2011", "output.sas"]), ("Run a portfolio on a translated task:", - ["./fast-downward.py", "--portfolio", EXAMPLE_PORTFOLIO, + ["--portfolio", EXAMPLE_PORTFOLIO, "--search-time-limit", "30m", "output.sas"]), ("Run the search component in debug mode (with assertions enabled) " "and validate the resulting plan:", - ["./fast-downward.py", "--debug", "output.sas", "--search", '"astar(ipdb())"']), + ["--debug", "output.sas", "--search", '"astar(ipdb())"']), ("Pass options to translator and search components:", - ["./fast-downward.py", "misc/tests/benchmarks/gripper/prob01.pddl", + ["misc/tests/benchmarks/gripper/prob01.pddl", "--translate-options", "--full-encoding", "--search-options", "--search", '"astar(lmcut())"']), ("Find a plan and validate it:", - ["./fast-downward.py", "--validate", + ["--validate", "misc/tests/benchmarks/gripper/prob01.pddl", "--search", '"astar(cegar())"']), ] @@ -84,7 +84,7 @@ Examples: %s -""" % "\n\n".join("%s\n%s" % (desc, " ".join(cmd)) for desc, cmd in EXAMPLES) +""" % "\n\n".join("%s\n%s" % (desc, " ".join(["./fast-downward.py"] + parameters)) for desc, parameters in EXAMPLES) COMPONENTS_PLUS_OVERALL = ["translate", "search", "validate", "overall"] DEFAULT_SAS_FILE = "output.sas" diff --git a/driver/tests.py b/driver/tests.py index 026bcc0339..607caed2fc 100644 --- a/driver/tests.py +++ b/driver/tests.py @@ -29,7 +29,9 @@ def cleanup(): cwd=REPO_ROOT_DIR) -def run_driver(cmd): +def run_driver(parameters): + cmd = [sys.executable, "fast-downward.py"] + cmd.extend(parameters) cleanup() translate() return subprocess.check_call(cmd, cwd=REPO_ROOT_DIR) @@ -37,46 +39,43 @@ def run_driver(cmd): def test_commandline_args(): for description, cmd in EXAMPLES: - cmd = [x.strip('"') for x in cmd] - run_driver(cmd) + parameters = [x.strip('"') for x in cmd] + run_driver(parameters) def test_aliases(): for alias, config in ALIASES.items(): - cmd = [sys.executable, "fast-downward.py", "--alias", alias, "output.sas"] - run_driver(cmd) + parameters = ["--alias", alias, "output.sas"] + run_driver(parameters) def test_show_aliases(): - run_driver([sys.executable, "fast-downward.py", "--show-aliases"]) + run_driver(["--show-aliases"]) def test_portfolios(): for name, portfolio in PORTFOLIOS.items(): - cmd = [sys.executable, "fast-downward.py", "--portfolio", portfolio, - "--search-time-limit", "30m", "output.sas"] - run_driver(cmd) + parameters = ["--portfolio", portfolio, + "--search-time-limit", "30m", "output.sas"] + run_driver(parameters) +@pytest.mark.skipif(not limits.can_set_time_limit(), reason="Cannot set time limits on this system") def test_hard_time_limit(): - # We cannot test this on systems like Windows where we cannot - # enforce time limits. - if not limits.can_set_time_limit(): - return - def preexec_fn(): limits.set_time_limit(10) - cmd = [ - sys.executable, "fast-downward.py", "--translate", "--translate-time-limit", + driver = [sys.executable, "fast-downward.py"] + parameters = [ + "--translate", "--translate-time-limit", "10s", "misc/tests/benchmarks/gripper/prob01.pddl"] - subprocess.check_call(cmd, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) + subprocess.check_call(driver+parameters, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) - cmd = [ - sys.executable, "fast-downward.py", "--translate", "--translate-time-limit", + parameters = [ + "--translate", "--translate-time-limit", "20s", "misc/tests/benchmarks/gripper/prob01.pddl"] with pytest.raises(subprocess.CalledProcessError) as exception_info: - subprocess.check_call(cmd, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) + subprocess.check_call(driver+parameters, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) assert exception_info.value.returncode == returncodes.DRIVER_INPUT_ERROR From 63838775a723616564531c19bcbd8dc40971a3b3 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 08:46:01 +0100 Subject: [PATCH 40/68] [issue1003] debug lib paths --- .github/workflows/ubuntu.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 67eb32e3f0..fd034f397d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -104,6 +104,10 @@ jobs: export CXXFLAGS="-Werror" # Treat compilation warnings as errors. ./build.py --debug ./build.py + ldd builds/debug/bin/downward + ldd builds/release/bin/downward + echo "separator" + ls -la ../lib/coin/lib - name: Archive required files # We only run tests on the version compiled with gcc, so we @@ -177,7 +181,14 @@ jobs: run: | pwd ls + echo "separator" ls ../ + echo "separator" + ls ../lib/ + echo "separator" + ls ../lib/coin/ + echo "separator" + ls ../lib/coin/lib ldd builds/debug/bin/downward ldd builds/release/bin/downward echo $PATH From a07f5bbfa14fc8dca62956db0fed811de1360415 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 08:58:04 +0100 Subject: [PATCH 41/68] [issue1003] use single job in Windows workflow; polish names --- .github/workflows/windows.yml | 62 ++++++++--------------------------- 1 file changed, 13 insertions(+), 49 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 51d8e1d443..473a2b02c4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,5 +1,5 @@ --- -name: windows +name: Windows on: [push, pull_request] @@ -9,79 +9,43 @@ env: VC2017: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" jobs: - compile: # name of the job. Jobs run in parallel unless specified otherwise. - name: compile + test: + name: Compile and test planner timeout-minutes: 60 runs-on: ${{ matrix.windows-version }} strategy: matrix: windows-version: [windows-2016, windows-2019] python-version: [3.6] - build-version: [release, debug] - steps: # each - is a new sequentially run step - - name: clone-repo + steps: + - name: Clone repository uses: actions/checkout@master - - name: setup-python + - name: Install python uses: actions/setup-python@master with: python-version: ${{ matrix.python-version }} - - name: compile + - name: Compile planner shell: cmd env: CC: cl CXX: cl run: | IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2017 }}" ${{ env.ARCH }} & python build.py ${{ matrix.build-version }} + "${{ env.VC2017 }}" ${{ env.ARCH }} & python build.py debug + "${{ env.VC2017 }}" ${{ env.ARCH }} & python build.py release ) IF "${{ matrix.windows-version }}" == "windows-2019" ( - "${{ env.VC2019 }}" ${{ env.ARCH }} & python build.py ${{ matrix.build-version }} + "${{ env.VC2019 }}" ${{ env.ARCH }} & python build.py debug + "${{ env.VC2019 }}" ${{ env.ARCH }} & python build.py release ) - - name: upload-planner - uses: actions/upload-artifact@master - with: - name: compiled-planner-${{ matrix.windows-version }}-${{ matrix.build-version }} - path: builds/ - - - tests: - name: test - runs-on: ${{ matrix.windows-version }} - needs: compile - strategy: - matrix: - windows-version: [windows-2016, windows-2019] - python-version: [3.6] - steps: - - name: clone-repo - uses: actions/checkout@master - - - name: setup-python - uses: actions/setup-python@master - with: - python-version: ${{ matrix.python-version }} - - - name: setup-dependencies + - name: Install tox run: | pip3 install tox - mkdir builds - - - name: download-debug - uses: actions/download-artifact@master - with: - name: compiled-planner-${{ matrix.windows-version }}-debug - path: builds/ - - - name: download-release - uses: actions/download-artifact@master - with: - name: compiled-planner-${{ matrix.windows-version }}-release - path: builds/ - - name: test + - name: Run translator and search tests shell: cmd env: CC: cl From e702a9383fd521ab5267b973d625a2525b92b1bc Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 08:59:10 +0100 Subject: [PATCH 42/68] [issue1003] make step names consistent in all workflows --- .github/workflows/mac.yml | 2 +- .github/workflows/ubuntu.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 1a4e642c43..c8c33a2924 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -40,7 +40,7 @@ jobs: cd ../ rm -rf VAL - - name: Run tox tests + - name: Run driver, translator and search tests run: | export PATH="$(pwd):$PATH" # Add VAL to path. cd misc diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index fd034f397d..9d9f53c3c0 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -177,7 +177,7 @@ jobs: mv downward/* . mv lib/ ../ - - name: Test driver, translator and standard search configurations + - name: Run driver, translator and search tests run: | pwd ls @@ -195,11 +195,11 @@ jobs: cd misc/ tox -e driver,translator,search - - name: Test CPLEX configurations + - name: Run CPLEX tests run: | cd misc/ tox -e cplex - - name: Test SoPlex configurations + - name: Run SoPlex tests run: | cd misc/ tox -e soplex From f5f508feaaae517c2ee1305ed1a4ac1a46adebd6 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 09:12:14 +0100 Subject: [PATCH 43/68] [issue1003] archive the entire Osi lib directory; run LP solver tests conditionally --- .github/workflows/ubuntu.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 9d9f53c3c0..c9097c444f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -104,19 +104,17 @@ jobs: export CXXFLAGS="-Werror" # Treat compilation warnings as errors. ./build.py --debug ./build.py - ldd builds/debug/bin/downward - ldd builds/release/bin/downward - echo "separator" - ls -la ../lib/coin/lib - name: Archive required files # We only run tests on the version compiled with gcc, so we # only need to archive that one. if: ${{ matrix.compiler-version.cc == 'gcc' }} - # We determined the dynamically-linked libraries using ldd. + # We determined the dynamically-linked libraries using ldd. We + # archive the entire lib directory of Osi because we need all + # 4 large library files and several file links to these. run: | cd ../ - tar cfz archive.tar.gz downward/fast-downward.py downward/driver downward/misc downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/lib/libOsiCpx.so.1 lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so lib/coin/lib/libOsiSpx.so.1 lib/coin/lib/libOsi.so.1 lib/coin/lib/libCoinUtils.so.3 + tar cfz archive.tar.gz downward/fast-downward.py downward/driver downward/misc downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/lib/ lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so - name: Upload archive if: ${{ matrix.compiler-version.cc == 'gcc' }} @@ -138,6 +136,9 @@ jobs: exclude: - ubuntu-version: ubuntu-18.04 python-version: 3.8 + env: + CPLEX_URL: ${{ secrets.CPLEX_URL }} + SOPLEX_URL: ${{ secrets.SOPLEX_URL }} steps: - name: Install Python uses: actions/setup-python@master @@ -161,7 +162,7 @@ jobs: mv validate ../ cd ../ rm -rf VAL - echo `pwd` >> $GITHUB_PATH + echo `pwd` >> $GITHUB_PATH # Add VAL to path ob subsequent steps. - name: Download archive uses: actions/download-artifact@master @@ -176,9 +177,6 @@ jobs: shopt -s dotglob mv downward/* . mv lib/ ../ - - - name: Run driver, translator and search tests - run: | pwd ls echo "separator" @@ -191,15 +189,19 @@ jobs: ls ../lib/coin/lib ldd builds/debug/bin/downward ldd builds/release/bin/downward - echo $PATH + + - name: Run driver, translator and search tests + run: | cd misc/ tox -e driver,translator,search - name: Run CPLEX tests + if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | cd misc/ tox -e cplex - name: Run SoPlex tests + if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | cd misc/ tox -e soplex From 609ac363bca49fcbf0bfab37124d67b61acbd235 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 10:12:39 +0100 Subject: [PATCH 44/68] [issue1003] use a single path var for the cplex installation --- .github/workflows/ubuntu.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c9097c444f..09c4bca958 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -4,7 +4,7 @@ name: Ubuntu on: [push, pull_request] jobs: - compile: # Identifier of the job. Jobs run in parallel unless specified otherwise. + compile: name: Compile planner timeout-minutes: 60 runs-on: ${{ matrix.ubuntu-version }} @@ -32,7 +32,7 @@ jobs: DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin - steps: # Each "-" is a new sequentially run step + steps: - name: Clone repository uses: actions/checkout@master @@ -51,14 +51,12 @@ jobs: # are set. - name: Install CPLEX if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} - env: - CPLEX_STUDIO: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129 run: | # We redirect output of wget to hide the secret URLs. wget $CPLEX_URL &> /dev/null export CPLEX_INSTALLER=cplex_studio129.linux-x86-64.bin chmod +x $CPLEX_INSTALLER - ./$CPLEX_INSTALLER -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=${CPLEX_STUDIO} -i silent + ./$CPLEX_INSTALLER -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR="$(dirname "${DOWNWARD_CPLEX_ROOT}")" -i silent rm $CPLEX_INSTALLER - name: Install SoPlex From 5a9cb9c3a9ecbe3bf11987111af725d3bcc56fb4 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 10:14:36 +0100 Subject: [PATCH 45/68] [issue1003] space around + --- driver/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/tests.py b/driver/tests.py index 607caed2fc..a4ca83b450 100644 --- a/driver/tests.py +++ b/driver/tests.py @@ -69,7 +69,7 @@ def preexec_fn(): parameters = [ "--translate", "--translate-time-limit", "10s", "misc/tests/benchmarks/gripper/prob01.pddl"] - subprocess.check_call(driver+parameters, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) + subprocess.check_call(driver + parameters, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) parameters = [ "--translate", "--translate-time-limit", From 08db3eac0d49e646a721d5e3b6f71ef4ba44a976 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 10:32:24 +0100 Subject: [PATCH 46/68] [issue1003] only run py36 on u1804 and py38 on u2004; delete uploaded artifacts --- .github/workflows/ubuntu.yml | 40 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 09c4bca958..d37e0defc9 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -125,23 +125,31 @@ jobs: test: name: Test planner - runs-on: ${{ matrix.ubuntu-version }} + runs-on: ${{ matrix.version.ubuntu }} needs: compile # TODO: this only depends on the compile step with gcc strategy: matrix: - ubuntu-version: [ubuntu-18.04, ubuntu-20.04] - python-version: [3.6, 3.8] - exclude: - - ubuntu-version: ubuntu-18.04 - python-version: 3.8 + version: + - {ubuntu: ubuntu-18.04, python: 3.6} + - {ubuntu: ubuntu-20.04, python: 3.8} env: CPLEX_URL: ${{ secrets.CPLEX_URL }} SOPLEX_URL: ${{ secrets.SOPLEX_URL }} steps: + - name: Download archive + uses: actions/download-artifact@master + with: + name: compiled-planner-${{ matrix.version.ubuntu }} + + - name: Delete artifact + uses: geekyeggo/delete-artifact@master + with: + name: compiled-planner-${{ matrix.version.ubuntu }} + - name: Install Python uses: actions/setup-python@master with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.version.python }} - name: Install dependencies run: | @@ -162,11 +170,6 @@ jobs: rm -rf VAL echo `pwd` >> $GITHUB_PATH # Add VAL to path ob subsequent steps. - - name: Download archive - uses: actions/download-artifact@master - with: - name: compiled-planner-${{ matrix.ubuntu-version }} - - name: Extract archive # We need to make sure that library paths are the same as # during compilation. @@ -175,18 +178,6 @@ jobs: shopt -s dotglob mv downward/* . mv lib/ ../ - pwd - ls - echo "separator" - ls ../ - echo "separator" - ls ../lib/ - echo "separator" - ls ../lib/coin/ - echo "separator" - ls ../lib/coin/lib - ldd builds/debug/bin/downward - ldd builds/release/bin/downward - name: Run driver, translator and search tests run: | @@ -198,6 +189,7 @@ jobs: run: | cd misc/ tox -e cplex + - name: Run SoPlex tests if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | From a96cbc5221ead2c4c406cc0c251f6b6e4a93b127 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Thu, 18 Feb 2021 10:17:26 +0100 Subject: [PATCH 47/68] [issue1003] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b9073c0a6c..bb8aa1da0c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ compilers and tools: - macOS: Catalina 10.15 with AppleClang 12.0.0.12000032 - Windows: Visual Studio Enterprise 2017 (MSVC 19.16.27045.0) and 2019 (MSVC 19.28.29336.0) -- Python: 3.6, 3.7, 3.8 +- Python: 3.6, 3.8 - GCC: 7, 9, 10 - Clang: 6, 10, 11 - CPLEX: 12.9 From 19b082767f82cd6b96b37ff860dbb0a0d06d196e Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 12:16:32 +0100 Subject: [PATCH 48/68] [issue1003] add changelog entry --- CHANGES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 01f4f06508..e06ebb116a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -57,7 +57,9 @@ after the corresponding tracker issues. USE_GLIBCXX_DEBUG. The build configurations debugnolp and releasenolp have been removed, and the build configuration glibcxx_debug has been added. - +- For developers: decide on rules regarding software support and + improve Github actions accordingly + ## Fast Downward 20.06 From 1ee724e0cdea1ecbe8a5ed1fac4207d8f33926ed Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Thu, 18 Feb 2021 12:50:01 +0100 Subject: [PATCH 49/68] [issue1003] Turn list into table. --- README.md | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index bb8aa1da0c..1244d930e7 100644 --- a/README.md +++ b/README.md @@ -13,20 +13,17 @@ For further information: ## Tested software versions -This version of Fast Downward has been tested with the following systems, -compilers and tools: - -- Ubuntu: multiple versions of Python, GCC and Clang (see below) on Ubuntu 18.04 and 20.04 -- macOS: Catalina 10.15 with AppleClang 12.0.0.12000032 -- Windows: Visual Studio Enterprise 2017 (MSVC 19.16.27045.0) and - 2019 (MSVC 19.28.29336.0) -- Python: 3.6, 3.8 -- GCC: 7, 9, 10 -- Clang: 6, 10, 11 -- CPLEX: 12.9 -- SoPlex: 3.1.1 -- OSI: 0.107.9 -- CMake: 3.10, 3.16, 3.19 +This version of Fast Downward has been tested with the following software versions: + +| OS | Python | C++ compiler | CMake | +| ------------ | ------ | ---------------------------------------------------------------- | ----- | +| Ubuntu 20.04 | 3.8 | GCC 9, GCC 10, Clang 10, Clang 11 | 3.16 | +| Ubuntu 18.04 | 3.6 | GCC 7, Clang 6 | 3.10 | +| macOS 10.15 | 3.6 | AppleClang 12 | 3.19 | +| Windows 10 | 3.6 | Visual Studio Enterprise 2017 (MSVC 19.16) and 2019 (MSVC 19.28) | 3.19 | + +On Ubuntu and Windows we compile with LP support using CPLEX 12.9, SoPlex +3.1.1 and Osi 0.107.9. ## Contributors From 0db916d7782600821f8099bd150b1df143349739 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Thu, 18 Feb 2021 13:03:41 +0100 Subject: [PATCH 50/68] [issue1003] Update tests.py --- driver/tests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/driver/tests.py b/driver/tests.py index a4ca83b450..eaa74dcfa5 100644 --- a/driver/tests.py +++ b/driver/tests.py @@ -30,10 +30,9 @@ def cleanup(): def run_driver(parameters): - cmd = [sys.executable, "fast-downward.py"] - cmd.extend(parameters) cleanup() translate() + cmd = [sys.executable, "fast-downward.py"] + parameters return subprocess.check_call(cmd, cwd=REPO_ROOT_DIR) @@ -75,7 +74,7 @@ def preexec_fn(): "--translate", "--translate-time-limit", "20s", "misc/tests/benchmarks/gripper/prob01.pddl"] with pytest.raises(subprocess.CalledProcessError) as exception_info: - subprocess.check_call(driver+parameters, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) + subprocess.check_call(driver + parameters, preexec_fn=preexec_fn, cwd=REPO_ROOT_DIR) assert exception_info.value.returncode == returncodes.DRIVER_INPUT_ERROR From c21b9337bcad0276a62f69270bd3e8b8c7898332 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 13:42:47 +0100 Subject: [PATCH 51/68] [issue1003] fix typo --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d37e0defc9..3090fa3cf8 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -168,7 +168,7 @@ jobs: mv validate ../ cd ../ rm -rf VAL - echo `pwd` >> $GITHUB_PATH # Add VAL to path ob subsequent steps. + echo `pwd` >> $GITHUB_PATH # Add VAL to path of subsequent steps. - name: Extract archive # We need to make sure that library paths are the same as From 6923089e665c2f94730a3e77ca568bca481c10af Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 16:20:25 +0100 Subject: [PATCH 52/68] [issue1003] let autodoc build again --- misc/autodoc/autodoc.py | 5 +++++ misc/tox.ini | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/misc/autodoc/autodoc.py b/misc/autodoc/autodoc.py index 055e5fc87f..7084045b6a 100755 --- a/misc/autodoc/autodoc.py +++ b/misc/autodoc/autodoc.py @@ -124,6 +124,9 @@ def make_doc_link(m): text = re.sub(re_link % key, make_link, text) return text +def build_planner(build): + subprocess.check_call([sys.executable, "build.py", build, "downward"], cwd=REPO_ROOT_DIR) + def get_pages_from_planner(build): out = subprocess.check_output( ["./fast-downward.py", "--build", build, "--search", "--", "--help", "--txt2tags"], @@ -161,6 +164,8 @@ def add_page(title, text): if __name__ == '__main__': args = parse_args() + logging.info("building planner...") + build_planner(args.build) logging.info("getting new pages from planner...") new_doc_pages = get_pages_from_planner(args.build) if args.dry_run: diff --git a/misc/tox.ini b/misc/tox.ini index 78a49592b5..dd515e524e 100644 --- a/misc/tox.ini +++ b/misc/tox.ini @@ -1,9 +1,9 @@ # Note that we can't run fast-downward.py from within the misc/ # directory because the driver confuses the misc/release with the # builds/release directory. -# All tests (except for 'build') assume that Fast Downward is already -# built. For the translator tests it is sufficient to build the -# 'translate' configuration. +# All tests (except for 'build' and 'autocdoc') assume that Fast +# Downward is already built. For the translator tests it is sufficient +# to build the 'translate' configuration. [tox] From d1d538ef08d5c594e4c0abf22e43060492313540 Mon Sep 17 00:00:00 2001 From: Silvan Sievers Date: Thu, 18 Feb 2021 16:22:51 +0100 Subject: [PATCH 53/68] [issue1003] print fast-downward.py instead of ./fast-downward.py --- driver/arguments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/arguments.py b/driver/arguments.py index ff4580ee91..bfd38b4218 100644 --- a/driver/arguments.py +++ b/driver/arguments.py @@ -84,7 +84,7 @@ Examples: %s -""" % "\n\n".join("%s\n%s" % (desc, " ".join(["./fast-downward.py"] + parameters)) for desc, parameters in EXAMPLES) +""" % "\n\n".join("%s\n%s" % (desc, " ".join([os.path.basename(sys.argv[0])] + parameters)) for desc, parameters in EXAMPLES) COMPONENTS_PLUS_OVERALL = ["translate", "search", "validate", "overall"] DEFAULT_SAS_FILE = "output.sas" From 31853c99f1ccfddfdb38b03d66abdbef16e14b25 Mon Sep 17 00:00:00 2001 From: Patrick Ferber Date: Thu, 18 Feb 2021 18:01:06 +0100 Subject: [PATCH 54/68] [issue1005] fix issue1005 --- .../cplex129_windows_installer.properties | 58 +++++++ ...-visual-studio-static-runtime-libraries.py | 54 ++++++ .github/workflows/ubuntu.yml | 19 +-- .github/workflows/windows.yml | 161 +++++++++++++++--- CHANGES.md | 3 + README.md | 4 +- src/search/CMakeLists.txt | 3 + 7 files changed, 265 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/misc/cplex129_windows_installer.properties create mode 100644 .github/workflows/misc/set-visual-studio-static-runtime-libraries.py diff --git a/.github/workflows/misc/cplex129_windows_installer.properties b/.github/workflows/misc/cplex129_windows_installer.properties new file mode 100644 index 0000000000..71b40e8b4c --- /dev/null +++ b/.github/workflows/misc/cplex129_windows_installer.properties @@ -0,0 +1,58 @@ +# Thu Feb 11 12:01:26 CET 2021 +# Replay feature output +# --------------------- +# This file was built by the Replay feature of InstallAnywhere. +# It contains variables that were set by Panels, Consoles or Custom Code. +# +# To generate this file: +# 1. Install CPLEX from the command line: ./installer -r installer.properties +# 2. Adapt the directory paths in the resulting 'installer.properties' file +# 3. Add to the file: +# #Silent Installation +# INSTALLER_UI=silent +# For further information visit: +# https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.studio.help/Optimization_Studio/topics/td_silent_install.html + + +#Accept license agreement +#--------------------------------------------------- +LICENSE_ACCEPTED=TRUE + +#Choose installation directory +#----------------------------- +USER_INSTALL_DIR=D:\\a\\downward\\cplex_temp + +#Copy examples +#------------------- +CPLEX_STUDIO_EXAMPLES_DIR=D:\\a\\downward\\cplex_examples +CPLEX_STUDIO_SAMPLE_COPY_NOT_ACTIVATED=0 + +#Associate files with CPLEX +#-------------- +CPLEX_STUDIO_FILE_ASSOCIATION=0 + +#Update PATH variable +#-------------------- +CPLEX_STUDIO_PATH_UPDATE=1 + +#Silent Installation +INSTALLER_UI=silent + +#Install +#------------ +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\README.html=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\Uninstall\\Uninstall.lax=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\Uninstall\\resource\\iawin64_x64.dll=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\Uninstall\\resource\\iawin32.dll=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\Uninstall\\resource\\win64_32_x64.exe=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\Uninstall\\resource\\remove.exe=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\Uninstall\\resource\\invoker.exe=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\Uninstall\\ibm_uninsticon.ico=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\opl\\oplide\\oplide_installer.bat=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_temp\\opl\\oplide\\oplide.exe=Yes +-fileOverwrite_D\:\\a\\downward\\cplex_examples\\.samples=Yes + +#Post installation steps +#------------------------------- +CPLEX_STUDIO_README=0 +CPLEX_STUDIO_IDE=0 diff --git a/.github/workflows/misc/set-visual-studio-static-runtime-libraries.py b/.github/workflows/misc/set-visual-studio-static-runtime-libraries.py new file mode 100644 index 0000000000..1c40611d04 --- /dev/null +++ b/.github/workflows/misc/set-visual-studio-static-runtime-libraries.py @@ -0,0 +1,54 @@ +""" +Use this script to set the "RuntimeLibrary" property of a Visual Studio project +file to static linking libraries for all configurations. +""" +from xml.etree import ElementTree +import os +import sys + +ElementTree.register_namespace( + "", "http://schemas.microsoft.com/developer/msbuild/2003") + + +def adapt(in_project, out_project): + tree = ElementTree.parse(in_project) + + root = tree.getroot() + for item_definition_group in root.findall( + '{http://schemas.microsoft.com/developer/msbuild/2003}ItemDefinitionGroup'): + condition = item_definition_group.attrib["Condition"] + is_release = any(x in condition.lower() + for x in ["release", "minsizerel", "relwithdebinfo"]) + is_debug = "debug" in condition.lower() + assert is_release ^ is_debug, condition + + compiler_args = item_definition_group.findall( + '{http://schemas.microsoft.com/developer/msbuild/2003}ClCompile') + assert len(compiler_args) == 1, compiler_args + compiler_args = compiler_args[0] + + runtime_library = compiler_args.findall( + '{http://schemas.microsoft.com/developer/msbuild/2003}RuntimeLibrary') + if len(runtime_library) == 0: + runtime_library = ElementTree.Element("RuntimeLibrary") + compiler_args.append(runtime_library) + elif len(runtime_library) == 1: + runtime_library = runtime_library[0] + else: + assert False, runtime_library + + runtime_library.text = "MultiThreaded" + if is_debug: + runtime_library.text += "Debug" + + tree.write(out_project) + + +if __name__ == "__main__": + if len(sys.argv) != 3: + sys.exit(f"{sys.argv[0]} [OLD_VS_PROJECT_FILE] [OUTPUT_FILE]") + _, in_path, out_path = sys.argv + if not os.path.isfile(in_path): + sys.exit(f"{in_path} does not exist!") + + adapt(in_path, out_path) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 3090fa3cf8..e71c208f07 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -27,8 +27,8 @@ jobs: env: CC: ${{ matrix.compiler-version.cc }} CXX: ${{ matrix.compiler-version.cxx }} - CPLEX_URL: ${{ secrets.CPLEX_URL }} - SOPLEX_URL: ${{ secrets.SOPLEX_URL }} + CPLEX_URL: ${{ secrets.CPLEX129_LINUX_URL }} + SOPLEX_URL: ${{ secrets.SOPLEX311_URL }} DOWNWARD_CPLEX_ROOT: /home/runner/work/downward/lib/ibm/ILOG/CPLEX_Studio129/cplex DOWNWARD_SOPLEX_ROOT: /home/runner/work/downward/lib/soplex-3.1.1 DOWNWARD_COIN_ROOT: /home/runner/work/downward/lib/coin @@ -53,17 +53,16 @@ jobs: if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | # We redirect output of wget to hide the secret URLs. - wget $CPLEX_URL &> /dev/null - export CPLEX_INSTALLER=cplex_studio129.linux-x86-64.bin - chmod +x $CPLEX_INSTALLER - ./$CPLEX_INSTALLER -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR="$(dirname "${DOWNWARD_CPLEX_ROOT}")" -i silent - rm $CPLEX_INSTALLER + wget -O cplex_installer $CPLEX_URL &> /dev/null + chmod +x cplex_installer + ./cplex_installer -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR="$(dirname "${DOWNWARD_CPLEX_ROOT}")" -i silent + rm cplex_installer - name: Install SoPlex if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | # We redirect output of wget to hide the secret URLs. - wget $SOPLEX_URL &> /dev/null + wget -O soplex-3.1.1.tgz $SOPLEX_URL &> /dev/null tar xvzf soplex-3.1.1.tgz cd soplex-3.1.1 mkdir build @@ -133,8 +132,8 @@ jobs: - {ubuntu: ubuntu-18.04, python: 3.6} - {ubuntu: ubuntu-20.04, python: 3.8} env: - CPLEX_URL: ${{ secrets.CPLEX_URL }} - SOPLEX_URL: ${{ secrets.SOPLEX_URL }} + CPLEX_URL: ${{ secrets.CPLEX129_LINUX_URL }} + SOPLEX_URL: ${{ secrets.SOPLEX311_URL }} steps: - name: Download archive uses: actions/download-artifact@master diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 473a2b02c4..dec0016922 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -5,41 +5,144 @@ on: [push, pull_request] env: ARCH: "x64" - VC2019: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" - VC2017: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" + CC: cl + CXX: cl + + DOWNWARD_COIN_ROOT_RELEASE: D:\a\downward\osi_release + DOWNWARD_COIN_ROOT_DEBUG: D:\a\downward\osi_debug + DOWNWARD_CPLEX_ROOT: D:\a\downward\cplex + ZLIB_ROOT: D:\a\downward\zlib + + CPLEX_URL: "${{ secrets.CPLEX129_WINDOWS_URL }}" + OSI_URL: "https://www.coin-or.org/download/source/Osi/Osi-0.107.9.tgz" + ZLIB_URL: "https://www.zlib.net/zlib1211.zip" + jobs: test: name: Compile and test planner timeout-minutes: 60 - runs-on: ${{ matrix.windows-version }} + runs-on: ${{ matrix.platform.os }} strategy: matrix: - windows-version: [windows-2016, windows-2019] + platform: + - {os: "windows-2016", vc: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat"} + - {os: "windows-2019", vc: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat"} python-version: [3.6] steps: - name: Clone repository uses: actions/checkout@master - - name: Install python + - name: Install Python uses: actions/setup-python@master with: python-version: ${{ matrix.python-version }} + + - name: Install zlib + if: ${{ env.CPLEX_URL != 0 }} + shell: cmd + run: | + call "${{ matrix.platform.vc }}" %ARCH% + + cd .. + curl.exe --output zlib.zip %ZLIB_URL% + unzip zlib.zip + del zlib.zip + mkdir zlib + cd zlib + + echo "Set up zlib include directory" + move ../zlib-1.2.11 include + + echo "Compile zlib library" + cd include + nmake /f win32/Makefile.msc + mkdir ..\lib + move zdll.lib ..\lib\zdll.lib + move zlib.lib ..\lib\zlib.lib + move zlib1.dll ..\lib\zlib1.dll + + + - name: Install CPLEX + if: ${{ env.CPLEX_URL != 0 }} + run: | + echo "For information about the CPLEX silent installation consult:" + echo "https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.studio.help/Optimization_Studio/topics/td_silent_install.html" + curl.exe --output cplex.exe $ENV:CPLEX_URL + + echo "Install CPLEX" + Start-Process -FilePath .\cplex.exe -ArgumentList "-f", "D:\a\downward\downward\.github\workflows\misc\cplex129_windows_installer.properties" -PassThru | Wait-Process + del .\cplex.exe + + echo "Copy the relevant directory to a location which is not magically protected against cmake" + Xcopy /E /I ..\cplex_temp\cplex ..\cplex + + + - name: Install Coin + shell: cmd + if: ${{ env.CPLEX_URL != 0 }} + run: | + call "${{ matrix.platform.vc }}" %ARCH% + set SET_RUNTIME_LIBRARY=python D:\a\downward\downward\.github\workflows\misc\set-visual-studio-static-runtime-libraries.py + + cd .. + echo "Download OSI" + curl.exe --output osi.tgz %OSI_URL% + tar xf osi.tgz + del osi.tgz + cd Osi-0.107.9 + + echo "Set up Include Directory" + mkdir ..\osi_release\include + copy CoinUtils\src\*.hpp ..\osi_release\include + copy CoinUtils\src\*.h ..\osi_release\include + copy Osi\src\Osi\*.hpp ..\osi_release\include + copy Osi\src\Osi\*.h ..\osi_release\include + copy Osi\src\OsiCpx\*.hpp ..\osi_release\include + copy Osi\src\OsiCpx\*.h ..\osi_release\include + Xcopy /E /I ..\osi_release\include ..\osi_debug\include + + echo "Set up Lib Directory" + mkdir ..\osi_release\lib + mkdir ..\osi_debug\lib + + echo "Compile libOsi" + cd Osi\MSVisualStudio\v10\ + devenv Osi.sln /Upgrade + cd libOsi\ + %SET_RUNTIME_LIBRARY% libOsi.vcxproj libOsi.vcxproj + msbuild libOsi.vcxproj /p:Configuration=Release /p:Platform=x64 /p:DefaultWindowsSDKVersion=%WindowsSDKVersion% /p:OutDir=lib + move lib\* ..\..\..\..\..\osi_release\lib\ + msbuild libOsi.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:DefaultWindowsSDKVersion=%WindowsSDKVersion% /p:OutDir=lib + move lib\* ..\..\..\..\..\osi_debug\lib\ + + echo "Compile libOsiCpx" + cd ..\..\..\src\OsiCpx + cl /EHsc OsiCpxSolverInterface.cpp /I ..\Osi /I ..\..\..\CoinUtils\src /I "%DOWNWARD_CPLEX_ROOT%\include\ilcplex" /c + lib OsiCpxSolverInterface.obj + move OsiCpxSolverInterface.lib ..\..\..\..\osi_release\lib\libOsiCpx.lib + cl /EHsc OsiCpxSolverInterface.cpp /I ..\Osi /I ..\..\..\CoinUtils\src /I "%DOWNWARD_CPLEX_ROOT%\include\ilcplex" /c /MTd + lib OsiCpxSolverInterface.obj + move OsiCpxSolverInterface.lib ..\..\..\..\osi_debug\lib\libOsiCpx.lib + + echo "Compile libCoinUtils" + cd ..\..\..\CoinUtils\MSVisualStudio\v10 + devenv CoinUtils.sln /Upgrade + cd libCoinUtils + %SET_RUNTIME_LIBRARY% libCoinUtils.vcxproj libCoinUtils.vcxproj + msbuild libCoinUtils.vcxproj /p:Configuration=Release /p:Platform=x64 /p:DefaultWindowsSDKVersion=%WindowsSDKVersion% /p:OutDir=lib + move lib\* ..\..\..\..\..\osi_release\lib\ + msbuild libCoinUtils.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:DefaultWindowsSDKVersion=%WindowsSDKVersion% /p:OutDir=lib + move lib\* ..\..\..\..\..\osi_debug\lib\ + + - name: Compile planner shell: cmd - env: - CC: cl - CXX: cl run: | - IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2017 }}" ${{ env.ARCH }} & python build.py debug - "${{ env.VC2017 }}" ${{ env.ARCH }} & python build.py release - ) - IF "${{ matrix.windows-version }}" == "windows-2019" ( - "${{ env.VC2019 }}" ${{ env.ARCH }} & python build.py debug - "${{ env.VC2019 }}" ${{ env.ARCH }} & python build.py release - ) + call "${{ matrix.platform.vc }}" %ARCH% + python build.py release + python build.py debug - name: Install tox run: | @@ -47,21 +150,29 @@ jobs: - name: Run translator and search tests shell: cmd - env: - CC: cl - CXX: cl # We do not run driver tests here because that would require # VAL to be installed, which currently cannot be easily done # on Windows for the version of VAL we use. When the maintainers # of VAL fix the latest version to accept plans without time # steps, we hope to be able to install VAL natively on Windows. run: | + call "${{ matrix.platform.vc }}" %ARCH% + rem "dumpbin /dependents builds\release\bin\downward.exe shows that" + rem "downward.exe depends on cplexXYZ.dll. Thus, we have to add it to" + rem "the PATH. On my local CPLEX installation this is done" + rem "automatically. For the GitHub Action we have to do it manually:" + set PATH=%PATH%;D:\a\downward\cplex_temp\opl\bin\x64_win64/ + cd misc/ + tox -e translator,search + + + - name: Run CPLEX tests + shell: cmd + if: ${{ env.CPLEX_URL != 0 }} + run: | + call "${{ matrix.platform.vc }}" %ARCH% + set PATH=%PATH%;D:\a\downward\cplex_temp\opl\bin\x64_win64/ cd misc/ - IF "${{ matrix.windows-version }}" == "windows-2016" ( - "${{ env.VC2017 }}" ${{ env.ARCH }} & tox -e translator,search - ) - IF "${{ matrix.windows-version }}" == "windows-2019" ( - "${{ env.VC2019 }}" ${{ env.ARCH }} & tox -e translator,search - ) + tox -e cplex ... diff --git a/CHANGES.md b/CHANGES.md index e06ebb116a..e73e98be9a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -60,6 +60,9 @@ after the corresponding tracker issues. - For developers: decide on rules regarding software support and improve Github actions accordingly + +- For developers: add CPLEX support to our GitHub Actions for Windows + ## Fast Downward 20.06 diff --git a/README.md b/README.md index 1244d930e7..e68e3c99fb 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ This version of Fast Downward has been tested with the following software versio | macOS 10.15 | 3.6 | AppleClang 12 | 3.19 | | Windows 10 | 3.6 | Visual Studio Enterprise 2017 (MSVC 19.16) and 2019 (MSVC 19.28) | 3.19 | -On Ubuntu and Windows we compile with LP support using CPLEX 12.9, SoPlex -3.1.1 and Osi 0.107.9. +We test LP support with CPLEX 12.9, SoPlex 3.1.1 and Osi 0.107.9. +On Ubuntu both CPLEX and SoPlex, on Windows only CPLEX is tested. ## Contributors diff --git a/src/search/CMakeLists.txt b/src/search/CMakeLists.txt index 29f1bdd597..9dc1ead9b8 100644 --- a/src/search/CMakeLists.txt +++ b/src/search/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 2.8.3) +# For Windows we require CMake 3.12, but this is currently not +# available for Ubuntu 18.04. if(NOT FAST_DOWNWARD_MAIN_CMAKELISTS_READ) message( @@ -40,6 +42,7 @@ endif() # On Windows, find the psapi library for determining peak memory. if(WIN32) + cmake_policy(SET CMP0074 NEW) target_link_libraries(downward psapi) endif() From 9d13ebeecfd0990667661443e5b0e11f92850c8d Mon Sep 17 00:00:00 2001 From: Patrick Ferber Date: Thu, 18 Feb 2021 18:48:43 +0100 Subject: [PATCH 55/68] [issue1005] ubuntu archive skip libs if no lp solver --- .github/workflows/ubuntu.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e71c208f07..a97ffde336 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -111,7 +111,15 @@ jobs: # 4 large library files and several file links to these. run: | cd ../ - tar cfz archive.tar.gz downward/fast-downward.py downward/driver downward/misc downward/builds/debug/bin/ downward/builds/release/bin/ lib/coin/lib/ lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so + libs="" + if [[ ! -z "${CPLEX_URL}" || ! -z "${SOPLEX_URL}" ]]; then + libs="${libs} lib/coin/lib/" + fi + if [[ ! -z "${CPLEX_URL}" ]]; then + libs="${libs} lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so" + fi + + tar cfz archive.tar.gz downward/fast-downward.py downward/driver downward/misc downward/builds/debug/bin/ downward/builds/release/bin/ ${libs} - name: Upload archive if: ${{ matrix.compiler-version.cc == 'gcc' }} @@ -176,7 +184,9 @@ jobs: tar xfz archive.tar.gz shopt -s dotglob mv downward/* . - mv lib/ ../ + if [[ ! -z "${CPLEX_URL}" || ! -z "${SOPLEX_URL}" ]]; then + mv lib/ ../ + fi - name: Run driver, translator and search tests run: | From 13756aa247771ee35540dd30887697b1a70ddf66 Mon Sep 17 00:00:00 2001 From: Patrick Ferber Date: Fri, 19 Feb 2021 11:15:05 +0100 Subject: [PATCH 56/68] [issue1005] Silvans comments --- .github/workflows/windows.yml | 1 - README.md | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index dec0016922..a633316303 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -165,7 +165,6 @@ jobs: cd misc/ tox -e translator,search - - name: Run CPLEX tests shell: cmd if: ${{ env.CPLEX_URL != 0 }} diff --git a/README.md b/README.md index e68e3c99fb..51aabc2c8e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ This version of Fast Downward has been tested with the following software versio | Windows 10 | 3.6 | Visual Studio Enterprise 2017 (MSVC 19.16) and 2019 (MSVC 19.28) | 3.19 | We test LP support with CPLEX 12.9, SoPlex 3.1.1 and Osi 0.107.9. -On Ubuntu both CPLEX and SoPlex, on Windows only CPLEX is tested. +On Ubuntu, we test both CPLEX and SoPlex. On Windows, we currently +only test CPLEX, and on macOS, we do not test LP solvers (yet). ## Contributors From 8860af7262df7d8762c2e21460deda41b84cfab4 Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 19 Feb 2021 12:21:18 +0100 Subject: [PATCH 57/68] [issue1000] Revert changes from v13. --- .../landmarks/landmark_count_heuristic.cc | 4 +-- .../landmarks/landmark_status_manager.cc | 30 +++++++++++-------- .../landmarks/landmark_status_manager.h | 9 +++--- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/search/landmarks/landmark_count_heuristic.cc b/src/search/landmarks/landmark_count_heuristic.cc index 438e54f8fc..c0297680be 100644 --- a/src/search/landmarks/landmark_count_heuristic.cc +++ b/src/search/landmarks/landmark_count_heuristic.cc @@ -98,8 +98,8 @@ int LandmarkCountHeuristic::get_heuristic_value(const State &ancestor_state) { // they do not get counted as reached in that case). However, we // must return 0 for a goal state. - bool dead_end = lm_status_manager->update_lm_status(ancestor_state); - if (dead_end) { + lm_status_manager->update_lm_status(ancestor_state); + if (lm_status_manager->dead_end_exists()) { return DEAD_END; } diff --git a/src/search/landmarks/landmark_status_manager.cc b/src/search/landmarks/landmark_status_manager.cc index 9f9c91314d..22c9cf332c 100644 --- a/src/search/landmarks/landmark_status_manager.cc +++ b/src/search/landmarks/landmark_status_manager.cc @@ -104,7 +104,7 @@ bool LandmarkStatusManager::update_reached_lms(const State &parent_ancestor_stat return true; } -bool LandmarkStatusManager::update_lm_status(const State &ancestor_state) { +void LandmarkStatusManager::update_lm_status(const State &ancestor_state) { const BitsetView reached = get_reached_landmarks(ancestor_state); /* This first loop is necessary as setup for the *needed again* @@ -112,14 +112,17 @@ bool LandmarkStatusManager::update_lm_status(const State &ancestor_state) { for (int id = 0; id < lm_graph.get_num_landmarks(); ++id) { lm_status[id] = reached.test(id) ? lm_reached : lm_not_reached; } - - bool dead_end_exists = false; - for (auto &node : lm_graph.get_nodes()) { - int id = node->get_id(); + for (int id = 0; id < lm_graph.get_num_landmarks(); ++id) { if (lm_status[id] == lm_reached - && landmark_needed_again(*node, ancestor_state)) { + && landmark_needed_again(id, ancestor_state)) { lm_status[id] = lm_needed_again; } + } +} + +bool LandmarkStatusManager::dead_end_exists() { + for (auto &node : lm_graph.get_nodes()) { + int id = node->get_id(); /* This dead-end detection works for the following case: @@ -135,22 +138,23 @@ bool LandmarkStatusManager::update_lm_status(const State &ancestor_state) { if (!node->is_derived) { if ((lm_status[id] == lm_not_reached) && node->first_achievers.empty()) { - dead_end_exists = true; + return true; } if ((lm_status[id] == lm_needed_again) && node->possible_achievers.empty()) { - dead_end_exists = true; + return true; } } } - return dead_end_exists; + return false; } bool LandmarkStatusManager::landmark_needed_again( - const LandmarkNode &node, const State &state) { - if (node.is_true_in_state(state)) { + int id, const State &state) { + LandmarkNode *node = lm_graph.get_landmark(id); + if (node->is_true_in_state(state)) { return false; - } else if (node.is_true_in_goal) { + } else if (node->is_true_in_goal) { return true; } else { /* @@ -158,7 +162,7 @@ bool LandmarkStatusManager::landmark_needed_again( true, since A is a necessary precondition for actions achieving B for the first time, it must become true again. */ - for (const auto &child : node.children) { + for (const auto &child : node->children) { if (child.second >= EdgeType::GREEDY_NECESSARY && lm_status[child.first->get_id()] == lm_not_reached) { return true; diff --git a/src/search/landmarks/landmark_status_manager.h b/src/search/landmarks/landmark_status_manager.h index 2bd3e3c7bd..15368b5605 100644 --- a/src/search/landmarks/landmark_status_manager.h +++ b/src/search/landmarks/landmark_status_manager.h @@ -17,16 +17,15 @@ class LandmarkStatusManager { LandmarkGraph &lm_graph; - bool landmark_is_leaf(const LandmarkNode &node, - const BitsetView &reached) const; - bool landmark_needed_again(const LandmarkNode &node, - const State &state); + bool landmark_is_leaf(const LandmarkNode &node, const BitsetView &reached) const; + bool landmark_needed_again(int id, const State &state); public: explicit LandmarkStatusManager(LandmarkGraph &graph); BitsetView get_reached_landmarks(const State &state); - bool update_lm_status(const State &ancestor_state); + void update_lm_status(const State &ancestor_state); + bool dead_end_exists(); void set_landmarks_for_initial_state(const State &initial_state); bool update_reached_lms(const State &parent_ancestor_state, From 49922f409efe71707fdfd76cd38d97a0b5376a46 Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 19 Feb 2021 12:26:56 +0100 Subject: [PATCH 58/68] [issue1000] Replace loop end condition to const int. --- src/search/landmarks/landmark_status_manager.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/search/landmarks/landmark_status_manager.cc b/src/search/landmarks/landmark_status_manager.cc index 22c9cf332c..7e78c3efe8 100644 --- a/src/search/landmarks/landmark_status_manager.cc +++ b/src/search/landmarks/landmark_status_manager.cc @@ -107,12 +107,13 @@ bool LandmarkStatusManager::update_reached_lms(const State &parent_ancestor_stat void LandmarkStatusManager::update_lm_status(const State &ancestor_state) { const BitsetView reached = get_reached_landmarks(ancestor_state); + const int num_landmarks = lm_graph.get_num_landmarks(); /* This first loop is necessary as setup for the *needed again* check in the second loop. */ - for (int id = 0; id < lm_graph.get_num_landmarks(); ++id) { + for (int id = 0; id < num_landmarks; ++id) { lm_status[id] = reached.test(id) ? lm_reached : lm_not_reached; } - for (int id = 0; id < lm_graph.get_num_landmarks(); ++id) { + for (int id = 0; id < num_landmarks; ++id) { if (lm_status[id] == lm_reached && landmark_needed_again(id, ancestor_state)) { lm_status[id] = lm_needed_again; From bc7ecb6fda438e55083f40af3dcd868cba3d6fe9 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Fri, 19 Feb 2021 12:30:19 +0100 Subject: [PATCH 59/68] [main] Translator tests: use f-strings. --- misc/tests/test-translator.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/misc/tests/test-translator.py b/misc/tests/test-translator.py index 186e0138e1..0d98bd5db8 100755 --- a/misc/tests/test-translator.py +++ b/misc/tests/test-translator.py @@ -10,7 +10,6 @@ import argparse from collections import defaultdict -from distutils.spawn import find_executable import itertools import os import re @@ -43,10 +42,9 @@ def get_task_name(path): def translate_task(task_file): - python = sys.executable - print("Translate {} with {}".format(get_task_name(task_file), python)) + print(f"Translate {get_task_name(task_file)}", flush=True) sys.stdout.flush() - cmd = [python, DRIVER, "--translate", task_file] + cmd = [sys.executable, DRIVER, "--translate", task_file] try: output = subprocess.check_output(cmd) except OSError as err: @@ -131,8 +129,7 @@ def main(): try: subprocess.check_call(["diff", "-q"] + files) except subprocess.CalledProcessError: - sys.exit( - "Error: Translator is nondeterministic for {task}.".format(**locals())) + sys.exit(f"Error: Translator is nondeterministic for {task}.") print(flush=True) cleanup() From a66cb0fb27047b9f0b0a8bad9627b8b7cfab1784 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Fri, 19 Feb 2021 12:35:04 +0100 Subject: [PATCH 60/68] [main] Translator tests: expose --runs-per-task parameter. --- misc/tests/test-translator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/tests/test-translator.py b/misc/tests/test-translator.py index 0d98bd5db8..def4d90afa 100755 --- a/misc/tests/test-translator.py +++ b/misc/tests/test-translator.py @@ -32,6 +32,10 @@ def parse_args(): help='Use "all" to test all benchmarks, ' '"first" to test the first task of each domain (default), ' 'or ":" to test individual tasks') + parser.add_argument( + "--runs-per-task", + help="translate each task this many times and compare the outputs", + type=int, default=3) args = parser.parse_args() args.benchmarks_dir = os.path.abspath(args.benchmarks_dir) return args @@ -122,7 +126,7 @@ def main(): cleanup() for task in get_tasks(args): write_combined_output("base.sas", task) - for iteration in range(2): + for iteration in range(args.runs_per_task - 1): write_combined_output("output{}.sas".format(iteration), task) print("Compare translator output", flush=True) files = ["base.sas", "output{}.sas".format(iteration)] From 8a0bd21ab4f47cb57e730899aa84b1f88842a42d Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Fri, 19 Feb 2021 12:52:00 +0100 Subject: [PATCH 61/68] [main] Translator tests: use more f-strings. --- misc/tests/test-translator.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/misc/tests/test-translator.py b/misc/tests/test-translator.py index def4d90afa..956f3225d4 100755 --- a/misc/tests/test-translator.py +++ b/misc/tests/test-translator.py @@ -52,7 +52,7 @@ def translate_task(task_file): try: output = subprocess.check_output(cmd) except OSError as err: - sys.exit("Call failed: {}\n{}".format(" ".join(cmd), err)) + sys.exit(f"Call failed: {' '.join(cmd)}\n{err}") output = str(output) # Remove information that may differ between calls. for pattern in [ @@ -127,14 +127,13 @@ def main(): for task in get_tasks(args): write_combined_output("base.sas", task) for iteration in range(args.runs_per_task - 1): - write_combined_output("output{}.sas".format(iteration), task) - print("Compare translator output", flush=True) - files = ["base.sas", "output{}.sas".format(iteration)] + write_combined_output(f"output{iteration}.sas", task) + files = ["base.sas", f"output{iteration}.sas"] try: subprocess.check_call(["diff", "-q"] + files) except subprocess.CalledProcessError: sys.exit(f"Error: Translator is nondeterministic for {task}.") - print(flush=True) + print("Outputs match\n", flush=True) cleanup() From 123b7c913c2a98c1c1f1a5afb905d4a2f1e32f4d Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Fri, 19 Feb 2021 12:59:08 +0100 Subject: [PATCH 62/68] [main] Translator tests: write strings instead of bytes to files. --- misc/tests/test-translator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/tests/test-translator.py b/misc/tests/test-translator.py index 956f3225d4..ef1f483bd0 100755 --- a/misc/tests/test-translator.py +++ b/misc/tests/test-translator.py @@ -50,10 +50,9 @@ def translate_task(task_file): sys.stdout.flush() cmd = [sys.executable, DRIVER, "--translate", task_file] try: - output = subprocess.check_output(cmd) + output = subprocess.check_output(cmd, encoding=sys.getfilesystemencoding()) except OSError as err: sys.exit(f"Call failed: {' '.join(cmd)}\n{err}") - output = str(output) # Remove information that may differ between calls. for pattern in [ r"\[.+s CPU, .+s wall-clock\]", From 506c445f077626f6f11d167a3881388c1be49bc3 Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 19 Feb 2021 13:14:44 +0100 Subject: [PATCH 63/68] [issue1000] Add this issue to changelog. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 01f4f06508..b79a126f83 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,6 +28,7 @@ after the corresponding tracker issues. - For developers: move functionality used during search away from LandmarkGraph, making it constant after creation. + - For developers: new state class From 43e57bdc46a7da36ce62c578d056253f3cf8493b Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Fri, 19 Feb 2021 13:20:12 +0100 Subject: [PATCH 64/68] [main] Translator tests: use pathlib. --- misc/tests/test-translator.py | 46 ++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/misc/tests/test-translator.py b/misc/tests/test-translator.py index ef1f483bd0..6e524e50d5 100755 --- a/misc/tests/test-translator.py +++ b/misc/tests/test-translator.py @@ -12,14 +12,15 @@ from collections import defaultdict import itertools import os +from pathlib import Path import re import subprocess import sys -DIR = os.path.dirname(os.path.abspath(__file__)) -REPO = os.path.dirname(os.path.dirname(DIR)) -DRIVER = os.path.join(REPO, "fast-downward.py") +DIR = Path(__file__).resolve().parent +REPO = DIR.parents[1] +DRIVER = REPO / "fast-downward.py" def parse_args(): @@ -37,12 +38,12 @@ def parse_args(): help="translate each task this many times and compare the outputs", type=int, default=3) args = parser.parse_args() - args.benchmarks_dir = os.path.abspath(args.benchmarks_dir) + args.benchmarks_dir = Path(args.benchmarks_dir).resolve() return args def get_task_name(path): - return "-".join(path.split("/")[-2:]) + return "-".join(str(path).split("/")[-2:]) def translate_task(task_file): @@ -73,17 +74,18 @@ def _get_all_tasks_by_domain(benchmarks_dir): "organic-synthesis-sat18-strips", "organic-synthesis-split-opt18-strips", "organic-synthesis-split-sat18-strips"] + benchmarks_dir = Path(benchmarks_dir) tasks = defaultdict(list) domains = [ - name for name in os.listdir(benchmarks_dir) - if os.path.isdir(os.path.join(benchmarks_dir, name)) and - not name.startswith((".", "_")) and - name not in blacklisted_domains] + name for name in benchmarks_dir.iterdir() + if name.is_dir() and + not str(name).startswith((".", "_")) and + str(name) not in blacklisted_domains] for domain in domains: - path = os.path.join(benchmarks_dir, domain) + path = benchmarks_dir / domain tasks[domain] = [ - os.path.join(benchmarks_dir, domain, f) - for f in sorted(os.listdir(path)) if "domain" not in f] + benchmarks_dir / domain / f + for f in sorted(path.iterdir()) if "domain" not in str(f)] return sorted(tasks.values()) @@ -100,15 +102,13 @@ def get_tasks(args): else: # Add task from command line. task = task.replace(":", "/") - suite.append(os.path.join(args.benchmarks_dir, task)) + suite.append(args.benchmarks_dir / task) return sorted(set(suite)) def cleanup(): - # We can't use the driver's cleanup function since the files are renamed. - for f in os.listdir("."): - if f.endswith(".sas"): - os.remove(f) + for f in Path(".").glob("translator-output-*.txt"): + f.unlink() def write_combined_output(output_file, task): @@ -124,16 +124,18 @@ def main(): os.chdir(DIR) cleanup() for task in get_tasks(args): - write_combined_output("base.sas", task) - for iteration in range(args.runs_per_task - 1): - write_combined_output(f"output{iteration}.sas", task) - files = ["base.sas", f"output{iteration}.sas"] + base_file = "translator-output-0.txt" + write_combined_output(base_file, task) + for i in range(1, args.runs_per_task): + compared_file = f"translator-output-{i}.txt" + write_combined_output(compared_file, task) + files = [base_file, compared_file] try: subprocess.check_call(["diff", "-q"] + files) except subprocess.CalledProcessError: sys.exit(f"Error: Translator is nondeterministic for {task}.") print("Outputs match\n", flush=True) - cleanup() + cleanup() if __name__ == "__main__": From 2745461d5a728a9a12f3a27e5d3ae8be876463fb Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Fri, 19 Feb 2021 13:53:42 +0100 Subject: [PATCH 65/68] [main] Translator tests: fix call for Windows. --- misc/tests/test-translator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/tests/test-translator.py b/misc/tests/test-translator.py index 6e524e50d5..454909951a 100755 --- a/misc/tests/test-translator.py +++ b/misc/tests/test-translator.py @@ -49,7 +49,7 @@ def get_task_name(path): def translate_task(task_file): print(f"Translate {get_task_name(task_file)}", flush=True) sys.stdout.flush() - cmd = [sys.executable, DRIVER, "--translate", task_file] + cmd = [sys.executable, str(DRIVER), "--translate", task_file] try: output = subprocess.check_output(cmd, encoding=sys.getfilesystemencoding()) except OSError as err: From eee13b67a0418357071349c2ede93db451866d46 Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 19 Feb 2021 14:27:40 +0100 Subject: [PATCH 66/68] [issue1000] Add final experiment. --- experiments/issue1000/v14-optimal.py | 52 +++++++++++++++++++++++ experiments/issue1000/v14-satisficing.py | 53 ++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100755 experiments/issue1000/v14-optimal.py create mode 100755 experiments/issue1000/v14-satisficing.py diff --git a/experiments/issue1000/v14-optimal.py b/experiments/issue1000/v14-optimal.py new file mode 100755 index 0000000000..8eea775de3 --- /dev/null +++ b/experiments/issue1000/v14-optimal.py @@ -0,0 +1,52 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + + +import os + +from lab.environments import LocalEnvironment, BaselSlurmEnvironment + +import common_setup +from common_setup import IssueConfig, IssueExperiment + + +DIR = os.path.dirname(os.path.abspath(__file__)) +SCRIPT_NAME = os.path.splitext(os.path.basename(__file__))[0] +BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"] +REVISIONS = ["issue1000-base", "issue1000-v14"] + +CONFIGS = [ + IssueConfig("seq-opt-bjolp", [], + driver_options=["--alias", "seq-opt-bjolp"]), +] + +SUITE = common_setup.DEFAULT_OPTIMAL_SUITE +ENVIRONMENT = BaselSlurmEnvironment( + partition="infai_2", + email="clemens.buechner@unibas.ch", + export=["PATH", "DOWNWARD_BENCHMARKS"], +) + +if common_setup.is_test_run(): + SUITE = IssueExperiment.DEFAULT_TEST_SUITE + ENVIRONMENT = LocalEnvironment(processes=2) + +exp = common_setup.IssueExperiment( + revisions=REVISIONS, + configs=CONFIGS, + environment=ENVIRONMENT, +) + +exp.add_suite(BENCHMARKS_DIR, SUITE) + +exp.add_parser(exp.EXITCODE_PARSER) +exp.add_parser(exp.PLANNER_PARSER) +exp.add_parser(exp.SINGLE_SEARCH_PARSER) + +exp.add_step("build", exp.build) +exp.add_step("start", exp.start_runs) +exp.add_fetcher(name="fetch") +exp.add_comparison_table_step() + +exp.run_steps() + diff --git a/experiments/issue1000/v14-satisficing.py b/experiments/issue1000/v14-satisficing.py new file mode 100755 index 0000000000..2caee9d733 --- /dev/null +++ b/experiments/issue1000/v14-satisficing.py @@ -0,0 +1,53 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + + +import os + +from lab.environments import LocalEnvironment, BaselSlurmEnvironment + +import common_setup +from common_setup import IssueConfig, IssueExperiment + + +DIR = os.path.dirname(os.path.abspath(__file__)) +SCRIPT_NAME = os.path.splitext(os.path.basename(__file__))[0] +BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"] +REVISIONS = ["issue1000-base", "issue1000-v14"] + +CONFIGS = [ + IssueConfig("lama-first", [], + driver_options=["--alias", "lama-first"]), +] + +SUITE = common_setup.DEFAULT_SATISFICING_SUITE +ENVIRONMENT = BaselSlurmEnvironment( + partition="infai_2", + email="clemens.buechner@unibas.ch", + export=["PATH", "DOWNWARD_BENCHMARKS"], +) + +if common_setup.is_test_run(): + SUITE = IssueExperiment.DEFAULT_TEST_SUITE + ENVIRONMENT = LocalEnvironment(processes=2) + +exp = common_setup.IssueExperiment( + revisions=REVISIONS, + configs=CONFIGS, + environment=ENVIRONMENT, +) + +exp.add_suite(BENCHMARKS_DIR, SUITE) + +exp.add_parser(exp.ANYTIME_SEARCH_PARSER) +exp.add_parser(exp.EXITCODE_PARSER) +exp.add_parser(exp.PLANNER_PARSER) +exp.add_parser(exp.SINGLE_SEARCH_PARSER) + +exp.add_step("build", exp.build) +exp.add_step("start", exp.start_runs) +exp.add_fetcher(name="fetch") +exp.add_comparison_table_step() + +exp.run_steps() + From bb7323edea58af2379bd9e00dc52329bace643ff Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Fri, 19 Feb 2021 15:52:53 +0100 Subject: [PATCH 67/68] [main] Translator tests: pass string to subprocess. --- misc/tests/test-translator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/tests/test-translator.py b/misc/tests/test-translator.py index 454909951a..011d8b2e34 100755 --- a/misc/tests/test-translator.py +++ b/misc/tests/test-translator.py @@ -49,7 +49,7 @@ def get_task_name(path): def translate_task(task_file): print(f"Translate {get_task_name(task_file)}", flush=True) sys.stdout.flush() - cmd = [sys.executable, str(DRIVER), "--translate", task_file] + cmd = [sys.executable, str(DRIVER), "--translate", str(task_file)] try: output = subprocess.check_output(cmd, encoding=sys.getfilesystemencoding()) except OSError as err: From f2dc7fda5a34a4500aaa9a2c3f9d0a38b09c02d2 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Sat, 20 Feb 2021 08:07:57 +0100 Subject: [PATCH 68/68] [main] Backport translator test fixes from issue1012. --- misc/tests/test-translator.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/misc/tests/test-translator.py b/misc/tests/test-translator.py index 011d8b2e34..52a5231563 100755 --- a/misc/tests/test-translator.py +++ b/misc/tests/test-translator.py @@ -69,18 +69,18 @@ def _get_all_tasks_by_domain(benchmarks_dir): # seems to be detrimental on some other domains. blacklisted_domains = [ "agricola-sat18-strips", - "citycar-opt14-adl", # cf. issue875 - "citycar-sat14-adl", # cf. issue875 + "citycar-opt14-adl", # cf. issue879 + "citycar-sat14-adl", # cf. issue879 "organic-synthesis-sat18-strips", "organic-synthesis-split-opt18-strips", "organic-synthesis-split-sat18-strips"] benchmarks_dir = Path(benchmarks_dir) tasks = defaultdict(list) domains = [ - name for name in benchmarks_dir.iterdir() - if name.is_dir() and - not str(name).startswith((".", "_")) and - str(name) not in blacklisted_domains] + domain_dir for domain_dir in benchmarks_dir.iterdir() + if domain_dir.is_dir() and + not str(domain_dir.name).startswith((".", "_", "unofficial")) and + str(domain_dir.name) not in blacklisted_domains] for domain in domains: path = benchmarks_dir / domain tasks[domain] = [