From d3c687471b8c07571db6a4d2dff5be608c64ccf6 Mon Sep 17 00:00:00 2001 From: gtrepta <50716988+gtrepta@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:27:44 -0500 Subject: [PATCH 1/3] Fix output sorting for KPrint (#3653) fixes #3643 --- kernel/src/main/java/org/kframework/unparser/KPrint.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/main/java/org/kframework/unparser/KPrint.java b/kernel/src/main/java/org/kframework/unparser/KPrint.java index 67a2893a465..ee9882e9f76 100644 --- a/kernel/src/main/java/org/kframework/unparser/KPrint.java +++ b/kernel/src/main/java/org/kframework/unparser/KPrint.java @@ -196,7 +196,7 @@ private Term disambiguateForUnparse(Module mod, Term t) { private String unparseInternal(Module mod, K input, ColorSetting colorize) { ExpandMacros expandMacros = ExpandMacros.forNonSentences(mod, files, kompileOptions, true); return Formatter.format( - new AddBrackets(mod).addBrackets((ProductionReference) disambiguateForUnparse(mod, KOREToTreeNodes.apply(KOREToTreeNodes.up(mod, expandMacros.expand(input)), mod))), options.color(tty.stdout, files.getEnv())); + new AddBrackets(mod).addBrackets((ProductionReference) disambiguateForUnparse(mod, KOREToTreeNodes.apply(KOREToTreeNodes.up(mod, expandMacros.expand(input)), mod))), colorize); } public K abstractTerm(Module mod, K term) { From 8200fdb41f268a875044c18dda5dd206e5435d16 Mon Sep 17 00:00:00 2001 From: rv-jenkins Date: Thu, 21 Sep 2023 09:25:11 -0600 Subject: [PATCH 2/3] Update dependency: llvm-backend/src/main/native/llvm-backend (#3635) Co-authored-by: devops Co-authored-by: Guy Repta <50716988+gtrepta@users.noreply.github.com> --- flake.lock | 18 +++++++++--------- .../1_k/4_imp++/lesson_6/tests/spawn.imp.out | 16 ++++++++-------- llvm-backend/src/main/native/llvm-backend | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index 81dcae0dbb4..dfe25c9fae6 100644 --- a/flake.lock +++ b/flake.lock @@ -314,11 +314,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1692799911, - "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -784,11 +784,11 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1692976793, - "narHash": "sha256-ytl8wuFYYx9NAaIBLjil/UgZcK9fBgXDspDE1y+gNHM=", + "lastModified": 1695238986, + "narHash": "sha256-z/pK5vTyXUIvVk/UaqxJq3xOa08MBOyemeQSwg2+kfY=", "owner": "runtimeverification", "repo": "llvm-backend", - "rev": "f3e29231a9a8bc4373fbbc74866f96df454cbc7e", + "rev": "c603ac78f4c1e08ab90ca9083c1841399e236bf8", "type": "github" }, "original": { @@ -1227,11 +1227,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1694048570, - "narHash": "sha256-PEQptwFCVaJ+jLFJgrZll2shQ9VI/7xVhrCYkJo8iIw=", + "lastModified": 1694937365, + "narHash": "sha256-iHZSGrb9gVpZRR4B2ishUN/1LRKWtSHZNO37C8z1SmA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4f77ea639305f1de0a14d9d41eef83313360638c", + "rev": "5d017a8822e0907fb96f7700a319f9fe2434de02", "type": "github" }, "original": { diff --git a/k-distribution/pl-tutorial/1_k/4_imp++/lesson_6/tests/spawn.imp.out b/k-distribution/pl-tutorial/1_k/4_imp++/lesson_6/tests/spawn.imp.out index 7552e7a23a0..eba23e61a03 100644 --- a/k-distribution/pl-tutorial/1_k/4_imp++/lesson_6/tests/spawn.imp.out +++ b/k-distribution/pl-tutorial/1_k/4_imp++/lesson_6/tests/spawn.imp.out @@ -1,13 +1,13 @@ { Out:String #Equals - "x = 21\n" + "x = 11\n" } #And { Store:Map #Equals - 0 |-> 21 + 0 |-> 11 } #Or { @@ -19,7 +19,7 @@ { Store:Map #Equals - 0 |-> 11 + 0 |-> 21 } #Or { @@ -31,31 +31,31 @@ { Store:Map #Equals - 0 |-> 21 + 0 |-> 33 } #Or { Out:String #Equals - "x = 11\n" + "x = 16\n" } #And { Store:Map #Equals - 0 |-> 33 + 0 |-> 16 } #Or { Out:String #Equals - "x = 16\n" + "x = 21\n" } #And { Store:Map #Equals - 0 |-> 16 + 0 |-> 21 } #Or { diff --git a/llvm-backend/src/main/native/llvm-backend b/llvm-backend/src/main/native/llvm-backend index f3e29231a9a..c603ac78f4c 160000 --- a/llvm-backend/src/main/native/llvm-backend +++ b/llvm-backend/src/main/native/llvm-backend @@ -1 +1 @@ -Subproject commit f3e29231a9a8bc4373fbbc74866f96df454cbc7e +Subproject commit c603ac78f4c1e08ab90ca9083c1841399e236bf8 From 7c0bc445e98b05d51d8dc93e2e71a66094f0d6fd Mon Sep 17 00:00:00 2001 From: Roberto Rosmaninho Date: Thu, 21 Sep 2023 17:24:15 -0300 Subject: [PATCH 3/3] Fixing `develop.yml` workflow (#3655) This PR fixes the develop workflow by: - Modifying the `post_results_to_develop.py` script to get only the branch's name without the user and adding one more logging message. - Modifying the `develop.yml` to set the `${COMMIT_SHA}` env variable and use it as a parameter to the above script, so we don't have to use the `git` command inside the container raising ownership issues and fixing a mismatch of `'` and `"` on the `bencher run` posting command. --- .github/workflows/develop.yml | 8 ++++---- .../tests/profiling/post_results_to_develop.py | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 117e4c975d5..818ce174543 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -54,8 +54,7 @@ jobs: BENCHER_ADAPTER: json run: | set -euxo pipefail - workspace=$(pwd) - docker run --name k-posting-profiling-tests-${GITHUB_SHA} \ + docker run --name k-posting-profiling-tests-${GITHUB_SHA} \ --rm -it --detach \ -e BENCHER_API_TOKEN=$BENCHER_API_TOKEN \ -e BENCHER_PROJECT=$BENCHER_PROJECT \ @@ -67,6 +66,7 @@ jobs: -e GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME \ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \ -e GITHUB_REF=$GITHUB_REF \ + -e GITHUB_SHA=${GITHUB_SHA} \ --workdir /opt/workspace \ -v "${workspace}:/opt/workspace" \ ${BASE_OS}:${BASE_DISTRO} @@ -77,14 +77,14 @@ jobs: - name: 'Getting Performance Tests Results' run: | set -euxo pipefail - docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c './k-distribution/tests/profiling/post_results_to_develop.py' + docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c './k-distribution/tests/profiling/post_results_to_develop.py ${GITHUB_SHA}' - name: 'Posting Performance Tests Results' run: | set -euxo pipefail docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c 'bencher run \ --if-branch "develop" --else-if-branch "master" \ --file .profiling-results.json --err --ci-only-on-alert \ - --github-actions "${GITHUB_TOKEN}" 'echo "Exporting report"' + --github-actions "${GITHUB_TOKEN}" "echo Exporting report"' - name: 'Tear down Docker' if: always() run: | diff --git a/k-distribution/tests/profiling/post_results_to_develop.py b/k-distribution/tests/profiling/post_results_to_develop.py index 37104b56def..21716a86ba9 100755 --- a/k-distribution/tests/profiling/post_results_to_develop.py +++ b/k-distribution/tests/profiling/post_results_to_develop.py @@ -1,8 +1,9 @@ #!/usr/bin/env python3 import json +import sys import subprocess -COMMIT_SHA='' +COMMIT_SHA = sys.argv[1] FROM_BRANCH='' TO_BRANCH='develop' @@ -24,10 +25,6 @@ def execute_command(command): return result.stdout -# git command to get the last commit in develop -commit_command = [ 'git', 'log', '--format=\"%H\"', '-n', '1' ] -COMMIT_SHA = execute_command(commit_command).strip('\"').strip('\"\n') - # curl command to get the branch name of last commit in develop API_URL = 'https://api.github.com/repos/runtimeverification/k/commits/' \ + COMMIT_SHA + '/pulls' @@ -36,6 +33,9 @@ def execute_command(command): '\"X-GitHub-Api-Version:', '2022-11-28\"', API_URL] FROM_BRANCH = json.loads(execute_command(branch_command))[0]['head']['label'] +# If FROM_BRANCH contains user information get only the branch name +if ':' in FROM_BRANCH: FROM_BRANCH = FROM_BRANCH.split(':')[1] + print("Exporting last bencher report from", FROM_BRANCH, "to", TO_BRANCH) # This command will generate a JSON file with a list containing the last reports @@ -49,6 +49,8 @@ def execute_command(command): k_framework = [item for item in data if item['project']['slug'] == 'k-framework' and item['branch']['slug'] == FROM_BRANCH] +print("Found", len(k_framework), "reports for k-framework in", FROM_BRANCH) + # Append the last 6 reports to the list, they correspond to the last performance # execution on the last commit in FROM_BRANCH def get_name_and_value(item): @@ -64,7 +66,7 @@ def get_name_and_value(item): branch = item['branch'] print("Appended:", benchmark_name, "created in", item['created'], - "on branch", branch['name'], "with version", branch['version']['number']) + "on branch", branch['name'], "with id", branch['version']['number']) data.update({benchmark_name: {metric_name_size: {"value": value_size}, metric_name_memory: {"value": value_memory}}