From e1ed49fd41ada94e164a0406c997085e1f2f1106 Mon Sep 17 00:00:00 2001 From: Lukas Abelt Date: Tue, 30 Jan 2024 13:42:35 +0100 Subject: [PATCH 1/7] - Added class for adapted picosat project --- varats/varats/projects/c_projects/picosat.py | 116 +++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/varats/varats/projects/c_projects/picosat.py b/varats/varats/projects/c_projects/picosat.py index 71de307e6..7649a4849 100644 --- a/varats/varats/projects/c_projects/picosat.py +++ b/varats/varats/projects/c_projects/picosat.py @@ -189,3 +189,119 @@ def get_release_revisions( return [(FullCommitHash(h), tag) for h, tag in tagged_commits if re.match(release_regex, tag)] + + +class PicoSATVaRA(VProject, ReleaseProviderHook): + """Adapted version of picoSAT that has been refactored, such that it does + not require a field-sensitive analysis.""" + + NAME = 'picosat' + GROUP = 'c_projects' + DOMAIN = ProjectDomains.SOLVER + + SOURCE = [ + PaperConfigSpecificGit( + project_name="picosat-vara", + remote="https://github.com/se-sic/picoSAT-vara", + local="picosat", + refspec="origin/HEAD", + limit=None, + shallow=False + ), + FeatureSource(), + HTTP( + local="example.cnf", + remote={ + "1.0": + "https://github.com/se-sic/picoSAT-mirror/releases/" + "download/picoSAT-965/example.cnf" + } + ), + HTTPUntar( + local="abw-N-bcsstk07.mtx-w44.cnf", + remote={ + "1.0": + "https://github.com/se-sic/picoSAT-mirror/releases/" + "download/picoSAT-965/abw-N-bcsstk07.mtx-w44.cnf.tar.gz" + } + ), + HTTPUntar( + local="traffic_kkb_unknown.cnf", + remote={ + "1.0": + "https://github.com/se-sic/picoSAT-mirror/releases/" + "download/picoSAT-965/traffic_kkb_unknown.cnf.tar.gz" + } + ), + HTTPUntar( + local="UNSAT_H_instances_childsnack_p11.hddl_1.cnf", + remote={ + "1.0": + "https://github.com/se-sic/picoSAT-mirror/releases/" + "download/picoSAT-965/" + "UNSAT_H_instances_childsnack_p11.hddl_1.cnf.tar.gz" + } + ), + HTTPUntar( + local="UNSAT_H_instances_childsnack_p12.hddl_1.cnf", + remote={ + "1.0": + "https://github.com/se-sic/picoSAT-mirror/releases/" + "download/picoSAT-965/" + "UNSAT_H_instances_childsnack_p12.hddl_1.cnf.tar.gz" + } + ), + ] + + WORKLOADS = PicoSAT.WORKLOADS + + @staticmethod + def binaries_for_revision( + revision: ShortCommitHash + ) -> tp.List[ProjectBinaryWrapper]: + binary_map = RevisionBinaryMap(get_local_project_git_path(PicoSAT.NAME)) + binary_map.specify_binary( + 'picosat', BinaryType.EXECUTABLE, valid_exit_codes=[0, 10, 20] + ) + + return binary_map[revision] + + def run_tests(self) -> None: + pass + + def compile(self) -> None: + """Compile the project.""" + picosat_source = local.path(self.source_of(self.primary_source)) + + c_compiler = bb.compiler.cc(self) + cxx_compiler = bb.compiler.cxx(self) + + with local.cwd(picosat_source): + revisions_with_new_config_name = get_all_revisions_between( + "33c685e82213228726364980814f0183e435de78", "", ShortCommitHash + ) + picosat_version = ShortCommitHash(self.version_of_primary) + if picosat_version in revisions_with_new_config_name: + config_script_name = "./configure.sh" + else: + config_script_name = "./configure" + + with local.cwd(picosat_source): + with local.env(CC=str(c_compiler), CXX=str(cxx_compiler)): + bb.watch(local[config_script_name])(["--trace", "--stats"]) + bb.watch(make)("-j", get_number_of_jobs(bb_cfg())) + + with local.cwd(picosat_source): + verify_binaries(self) + + @classmethod + def get_release_revisions( + cls, release_type: ReleaseType + ) -> tp.List[tp.Tuple[FullCommitHash, str]]: + release_regex = "^picoSAT-[0-9]+$" + + tagged_commits = get_tagged_commits(cls.NAME) + + return [(FullCommitHash(h), tag) + for h, tag in tagged_commits + if re.match(release_regex, tag)] From d03d059aa14e381e2eab425d5ebbdab119ad3408 Mon Sep 17 00:00:00 2001 From: Lukas Abelt Date: Tue, 30 Jan 2024 14:03:47 +0100 Subject: [PATCH 2/7] - Adapted project name for picosat fork --- varats/varats/projects/c_projects/picosat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/varats/varats/projects/c_projects/picosat.py b/varats/varats/projects/c_projects/picosat.py index 7649a4849..9806cb1f2 100644 --- a/varats/varats/projects/c_projects/picosat.py +++ b/varats/varats/projects/c_projects/picosat.py @@ -195,7 +195,7 @@ class PicoSATVaRA(VProject, ReleaseProviderHook): """Adapted version of picoSAT that has been refactored, such that it does not require a field-sensitive analysis.""" - NAME = 'picosat' + NAME = 'picosat-vara' GROUP = 'c_projects' DOMAIN = ProjectDomains.SOLVER From 0d281f64617f24b823cc21d20ea5a125d0bb54ed Mon Sep 17 00:00:00 2001 From: Lukas Abelt Date: Tue, 6 Feb 2024 16:41:17 +0100 Subject: [PATCH 3/7] - Updated project name for Picosat load time version --- varats/varats/projects/c_projects/picosat.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/varats/varats/projects/c_projects/picosat.py b/varats/varats/projects/c_projects/picosat.py index 9806cb1f2..e19c272a0 100644 --- a/varats/varats/projects/c_projects/picosat.py +++ b/varats/varats/projects/c_projects/picosat.py @@ -191,19 +191,19 @@ def get_release_revisions( if re.match(release_regex, tag)] -class PicoSATVaRA(VProject, ReleaseProviderHook): +class PicoSATLT(VProject, ReleaseProviderHook): """Adapted version of picoSAT that has been refactored, such that it does not require a field-sensitive analysis.""" - NAME = 'picosat-vara' + NAME = 'PicosatLT' GROUP = 'c_projects' DOMAIN = ProjectDomains.SOLVER SOURCE = [ PaperConfigSpecificGit( - project_name="picosat-vara", + project_name="PicosatLT", remote="https://github.com/se-sic/picoSAT-vara", - local="picosat", + local="PicosatLT", refspec="origin/HEAD", limit=None, shallow=False @@ -259,7 +259,9 @@ class PicoSATVaRA(VProject, ReleaseProviderHook): def binaries_for_revision( revision: ShortCommitHash ) -> tp.List[ProjectBinaryWrapper]: - binary_map = RevisionBinaryMap(get_local_project_git_path(PicoSAT.NAME)) + binary_map = RevisionBinaryMap( + get_local_project_git_path(PicoSATLT.NAME) + ) binary_map.specify_binary( 'picosat', BinaryType.EXECUTABLE, valid_exit_codes=[0, 10, 20] ) From 0f5158da1882f820689c25008ec3790a658775df Mon Sep 17 00:00:00 2001 From: Lukas Abelt Date: Wed, 7 Feb 2024 10:18:15 +0100 Subject: [PATCH 4/7] - Updated workloads for Picosat LT and added recompile --- varats/varats/projects/c_projects/picosat.py | 38 +++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/varats/varats/projects/c_projects/picosat.py b/varats/varats/projects/c_projects/picosat.py index e19c272a0..42b19b855 100644 --- a/varats/varats/projects/c_projects/picosat.py +++ b/varats/varats/projects/c_projects/picosat.py @@ -3,7 +3,7 @@ import typing as tp import benchbuild as bb -from benchbuild.command import WorkloadSet, Command, SourceRoot +from benchbuild.command import WorkloadSet, SourceRoot from benchbuild.source import HTTP from benchbuild.source.http import HTTPUntar from benchbuild.utils.cmd import make @@ -21,6 +21,7 @@ verify_binaries, ) from varats.project.sources import FeatureSource +from varats.project.varats_command import VCommand from varats.project.varats_project import VProject from varats.provider.release.release_provider import ( ReleaseProviderHook, @@ -98,39 +99,39 @@ class PicoSAT(VProject, ReleaseProviderHook): WORKLOADS = { WorkloadSet(WorkloadCategory.EXAMPLE): [ - Command( + VCommand( SourceRoot("picosat") / RSBinary("picosat"), "example.cnf", label="example.cnf", ) ], WorkloadSet(WorkloadCategory.SMALL): [ - Command( + VCommand( SourceRoot("picosat") / RSBinary("picosat"), "aim-100-1_6-no-1.cnf", label="aim-100-1-6-no-1.cnf", ) ], WorkloadSet(WorkloadCategory.MEDIUM): [ - Command( + VCommand( SourceRoot("picosat") / RSBinary("picosat"), "traffic_kkb_unknown.cnf/traffic_kkb_unknown.cnf", label="traffic-kkb-unknow.cnf", ), - Command( + VCommand( SourceRoot("picosat") / RSBinary("picosat"), "abw-N-bcsstk07.mtx-w44.cnf/abw-N-bcsstk07.mtx-w44.cnf", label="abw-N-bcsstk07.mtx-w44.cnf", ), ], WorkloadSet(WorkloadCategory.LARGE): [ - Command( + VCommand( SourceRoot("picosat") / RSBinary("picosat"), "UNSAT_H_instances_childsnack_p11.hddl_1.cnf/" "UNSAT_H_instances_childsnack_p11.hddl_1.cnf", label="UNSAT-H-instances-childsnack-p11.hddl-1.cnf", ), - Command( + VCommand( SourceRoot("picosat") / RSBinary("picosat"), "UNSAT_H_instances_childsnack_p12.hddl_1.cnf/" "UNSAT_H_instances_childsnack_p12.hddl_1.cnf", @@ -253,7 +254,15 @@ class PicoSATLT(VProject, ReleaseProviderHook): ), ] - WORKLOADS = PicoSAT.WORKLOADS + WORKLOADS = { + WorkloadSet(WorkloadCategory.MEDIUM): [ + VCommand( + SourceRoot("PicosatLT") / RSBinary("picosat"), + "abw-N-bcsstk07.mtx-w44.cnf/abw-N-bcsstk07.mtx-w44.cnf", + label="abw-N-bcsstk07.mtx-w44.cnf", + ), + ], + } @staticmethod def binaries_for_revision( @@ -296,6 +305,19 @@ def compile(self) -> None: with local.cwd(picosat_source): verify_binaries(self) + def recompile(self) -> None: + """Re-Compile the project.""" + picosat_source = local.path(self.source_of(self.primary_source)) + c_compiler = bb.compiler.cc(self) + cxx_compiler = bb.compiler.cxx(self) + + with local.cwd(picosat_source): + with local.env(CC=str(c_compiler), CXX=str(cxx_compiler)): + bb.watch(make)("-j", get_number_of_jobs(bb_cfg())) + + with local.cwd(picosat_source): + verify_binaries(self) + @classmethod def get_release_revisions( cls, release_type: ReleaseType From 6088be84f5a0b45de362660460959935b19164ef Mon Sep 17 00:00:00 2001 From: Lukas Abelt Date: Tue, 13 Feb 2024 09:51:51 +0100 Subject: [PATCH 5/7] - Updated workloads for Picosat LT --- .../experiments/vara/feature_perf_precision.py | 4 ++-- varats/varats/projects/c_projects/picosat.py | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/varats/varats/experiments/vara/feature_perf_precision.py b/varats/varats/experiments/vara/feature_perf_precision.py index 2c58fcee4..c74884407 100644 --- a/varats/varats/experiments/vara/feature_perf_precision.py +++ b/varats/varats/experiments/vara/feature_perf_precision.py @@ -99,9 +99,9 @@ def get_threshold(project: VProject) -> int: if project.DOMAIN is ProjectDomains.TEST: if project.name in [ "SynthSAFieldSensitivity", "SynthIPRuntime", "SynthIPTemplate", - "SynthIPTemplate2", "SynthIPCombined" + "SynthIPTemplate2", "SynthIPCombined", "PicosatLT" ]: - # Don't instrument everything for these synthtic projects + # Don't instrument everything for these synthetic projects return 10 return 0 diff --git a/varats/varats/projects/c_projects/picosat.py b/varats/varats/projects/c_projects/picosat.py index 42b19b855..05dcf0d22 100644 --- a/varats/varats/projects/c_projects/picosat.py +++ b/varats/varats/projects/c_projects/picosat.py @@ -218,6 +218,14 @@ class PicoSATLT(VProject, ReleaseProviderHook): "download/picoSAT-965/example.cnf" } ), + HTTP( + local="ibm-2004-03-k70.cnf", + remote={ + "1.0": + "https://github.com/se-sic/picoSAT-vara/releases/" + "download/workloads-sat-race-2006/ibm-2004-03-k70.cnf" + } + ), HTTPUntar( local="abw-N-bcsstk07.mtx-w44.cnf", remote={ @@ -255,11 +263,11 @@ class PicoSATLT(VProject, ReleaseProviderHook): ] WORKLOADS = { - WorkloadSet(WorkloadCategory.MEDIUM): [ + WorkloadSet(WorkloadCategory.SMALL): [ VCommand( SourceRoot("PicosatLT") / RSBinary("picosat"), - "abw-N-bcsstk07.mtx-w44.cnf/abw-N-bcsstk07.mtx-w44.cnf", - label="abw-N-bcsstk07.mtx-w44.cnf", + "ibm-2004-03-k70.cnf", + label="ibm-2004-03-k70.cnf", ), ], } From 8d6774756111f9bb8c8c3ec174702b3bab8920aa Mon Sep 17 00:00:00 2001 From: Lukas Abelt Date: Mon, 19 Feb 2024 14:50:00 +0100 Subject: [PATCH 6/7] - Updated project name for alternative PicoSAT project as suggested in PR --- varats/varats/projects/c_projects/picosat.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/varats/varats/projects/c_projects/picosat.py b/varats/varats/projects/c_projects/picosat.py index 05dcf0d22..7909c40f2 100644 --- a/varats/varats/projects/c_projects/picosat.py +++ b/varats/varats/projects/c_projects/picosat.py @@ -192,19 +192,19 @@ def get_release_revisions( if re.match(release_regex, tag)] -class PicoSATLT(VProject, ReleaseProviderHook): +class PicoSATLoadTime(VProject, ReleaseProviderHook): """Adapted version of picoSAT that has been refactored, such that it does not require a field-sensitive analysis.""" - NAME = 'PicosatLT' + NAME = 'PicoSATLoadTime' GROUP = 'c_projects' DOMAIN = ProjectDomains.SOLVER SOURCE = [ PaperConfigSpecificGit( - project_name="PicosatLT", + project_name="PicoSATLoadTime", remote="https://github.com/se-sic/picoSAT-vara", - local="PicosatLT", + local="PicoSATLoadTime", refspec="origin/HEAD", limit=None, shallow=False @@ -265,7 +265,7 @@ class PicoSATLT(VProject, ReleaseProviderHook): WORKLOADS = { WorkloadSet(WorkloadCategory.SMALL): [ VCommand( - SourceRoot("PicosatLT") / RSBinary("picosat"), + SourceRoot("PicoSATLoadTime") / RSBinary("picosat"), "ibm-2004-03-k70.cnf", label="ibm-2004-03-k70.cnf", ), @@ -277,7 +277,7 @@ def binaries_for_revision( revision: ShortCommitHash ) -> tp.List[ProjectBinaryWrapper]: binary_map = RevisionBinaryMap( - get_local_project_git_path(PicoSATLT.NAME) + get_local_project_git_path(PicoSATLoadTime.NAME) ) binary_map.specify_binary( 'picosat', BinaryType.EXECUTABLE, valid_exit_codes=[0, 10, 20] From 45d111b4c90ec8d4117a90ba7b7f073356b67d89 Mon Sep 17 00:00:00 2001 From: Lukas Abelt Date: Mon, 19 Feb 2024 14:52:17 +0100 Subject: [PATCH 7/7] Update varats/varats/experiments/vara/feature_perf_precision.py --- varats/varats/experiments/vara/feature_perf_precision.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/varats/varats/experiments/vara/feature_perf_precision.py b/varats/varats/experiments/vara/feature_perf_precision.py index c74884407..52a01ff3a 100644 --- a/varats/varats/experiments/vara/feature_perf_precision.py +++ b/varats/varats/experiments/vara/feature_perf_precision.py @@ -99,7 +99,7 @@ def get_threshold(project: VProject) -> int: if project.DOMAIN is ProjectDomains.TEST: if project.name in [ "SynthSAFieldSensitivity", "SynthIPRuntime", "SynthIPTemplate", - "SynthIPTemplate2", "SynthIPCombined", "PicosatLT" + "SynthIPTemplate2", "SynthIPCombined", "PicoSATLoadTime" ]: # Don't instrument everything for these synthetic projects return 10