Skip to content

Commit

Permalink
Update name (#118)
Browse files Browse the repository at this point in the history
* Update name

* Fix test

* Try fixing issues

* Allow duplicate fingerprints on all z3 >= v4.12.0

* Allow congr mismatch in z3 <= v4.8.17

* Fix help dialog title
  • Loading branch information
JonasAlaif authored Feb 13, 2025
1 parent 33697d9 commit d20a494
Show file tree
Hide file tree
Showing 29 changed files with 539 additions and 353 deletions.
147 changes: 24 additions & 123 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
pull_request:
branches: [main]
workflow_dispatch:
# Run once a month to regenerate the cached log files for PRs to use
schedule:
- cron: "0 0 1 * *"

jobs:
format:
Expand All @@ -32,35 +29,45 @@ jobs:
- run: cargo clippy -- -D warnings

test:
# will wait for new cache on push to main branch, otherwise will run straight away with existing cache
needs: generate_log
if: ${{ always() && !failure() && !cancelled() }}
strategy:
fail-fast: false
matrix:
z3version: ['4.8.7', '4.8.17', '4.11.2', '4.12.2', '4.12.4', '4.13.3']
z3version:
- version: '4.8.7'
old: true # required for versions up to `4.8.9`
- version: '4.8.17'
- version: '4.11.2'
- version: '4.12.2'
- version: '4.12.4'
- version: '4.13.3'
distribution: 'glibc-2.35'
# Linux, Processor (CPU): 4, Memory (RAM): 16 GB, Storage (SSD): 14 GB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- id: configure-z3-id
run: echo "z3_v_clean=$(echo "${{ matrix.z3version }}" | sed 's/\./_/g')" >> $GITHUB_OUTPUT

- name: Install Z3 for older version
uses: pavpanchekha/[email protected] # see GitHub Action "Install Z3"
if: ${{ matrix.z3version.old == true }}
with:
version: ${{ matrix.z3version.version }}

- name: Install Z3 for newer version
uses: pavpanchekha/[email protected] # see GitHub Action "Install Z3"
if: ${{ !(matrix.z3version.old == true) }}
with:
version: ${{ matrix.z3version.version }}
distribution: ${{ matrix.z3version.distribution == '' && 'glibc-2.31' || matrix.z3version.distribution }}

- name: Setup `Cargo.lock` for caching
run: cargo generate-lockfile
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: "shared"
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: actions/cache/restore@v4
with:
path: logs
key: use-restore-key-instead
restore-keys: logs-${{ steps.configure-z3-id.outputs.z3_v_clean }}-
- id: check-logs-cached
run: ls -la logs
- run: cargo version && SLP_MEMORY_LIMIT_GB=16 cargo test --workspace -- --nocapture

# Failure
Expand All @@ -69,112 +76,6 @@ jobs:
- uses: actions/[email protected]
if: failure()
with:
name: "logs_z3_v${{ matrix.z3version }}"
name: "logs_z3_v${{ matrix.z3version.version }}"
path: failing_logs.tar.bz2
retention-days: 1


generate_log:
# only run this job on push to main branch
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
z3version:
- version: '4.8.7'
old: true # required for versions up to `4.8.9`
- version: '4.8.17'
- version: '4.11.2'
- version: '4.12.2'
- version: '4.12.4'
- version: '4.13.3'
distribution: 'glibc-2.35'

# for versions of Z3 at least 4.9.0 we need v1.3 of the GitHub action, for older versions of Z3, 1.2.2
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Z3 for older version
uses: pavpanchekha/[email protected] # see GitHub Action "Install Z3"
if: ${{ matrix.z3version.old == true }}
with:
version: ${{ matrix.z3version.version }}

- name: Install Z3 for newer version
uses: pavpanchekha/[email protected] # see GitHub Action "Install Z3"
if: ${{ !(matrix.z3version.old == true) }}
with:
version: ${{ matrix.z3version.version }}
distribution: ${{ matrix.z3version.distribution == '' && 'glibc-2.31' || matrix.z3version.distribution }}

- name: Configure Z3 version environment variable
id: configure-z3-id
run: |
# Generate filename comaptible version: 4.8.7 -> 4_8_7
echo "z3_v_clean=$(echo "${{ matrix.z3version.version }}" | sed 's/\./_/g')" >> $GITHUB_OUTPUT
# Generate regex compatible version: 4.8.7 -> 4\.8\.7
echo "z3_v_regex=$(echo "${{ matrix.z3version.version }}" | sed 's/\./\\./g')" >> $GITHUB_OUTPUT
- name: Cache log files
id: cache-log
uses: actions/cache@v4
with:
path: logs
key: logs-${{ steps.configure-z3-id.outputs.z3_v_clean }}-${{ hashFiles('smt-problems/**/*.smt2') }}
restore-keys: logs-${{ steps.configure-z3-id.outputs.z3_v_clean }}-

- name: Create logs directory if it doesn't exist
id: make_logs_dir
run: |
# Create the 'logs' directory
test -d "logs" || mkdir "logs"
- name: Run Z3 solver on changed smt2 files and compress
id: run_z3_and_upload
run: |
# Loop through all files and check that log exists
for file in `find ./smt-problems -name "*.smt2" -type f`; do
test -f "$file"
# Skip if the file if the first line is a comment with
[ "$(sed -n '/^;[^\n]*${{ steps.configure-z3-id.outputs.z3_v_regex }}/p;q' $file)" ] && echo "Skipping $file since the first line contains \"${{ matrix.z3version.version }}\"" && continue || true
# Get the file hash
file_hash=$(shasum -a 256 "$file" | cut -d' ' -f1)
# Get the filename without extension
base_name=$(basename "${file%.*}")
# Log file name
log_file_name="logs/${base_name}_fHash_${file_hash}.log"
# Skip if log file exists and is not empty
test -s "${log_file_name}" && echo "Skipping \"$file\" as \"$log_file_name\" exists" && continue || true
rm -f "logs/${base_name}_fHash_*.log"
echo "Processing \"$file\" to \"$log_file_name\""
# Run Z3 solver for the file and save the log in the 'logs' directory.
# The memory limit is set to 15.5GB and the timeout is set to 30 seconds
# (this limits the log file size to roughly <=4GB). We redirect
# the output so that it doesn't get printed and listen for a
# timeout message in which case we remove the last line of the log
# file since it may be incomplete (and cause parsing errors).
z3 trace=true proof=true -memory:15872 -T:10 trace-file-name=${log_file_name} ./$file \
> >(grep -q "timeout" && echo "[Timeout] Removing last line of logfile" && tail -n 1 "${log_file_name}" | wc -c | xargs -I {} truncate -s -{} "${log_file_name}") \
|| echo "!!! Error processing \"$file\""
test -s "${log_file_name}" || echo "!!! Log file not created for \"$file\""
done
# TODO: not enough permission for this.
# - name: Delete old cache
# run: |
# echo "Fetching list of cache key"
# cacheKeys=$(gh cache list -R $REPO | cut -f 1)

# ## Setting this to not fail the workflow while deleting cache keys.
# set +e
# for cacheKey in $cacheKeys; do
# echo "Deleting $cacheKey"
# gh cache delete $cacheKey -R $REPO
# done
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# REPO: ${{ github.repository }}
Binary file modified axiom-profiler-GUI/assets/html/favicon.ico
Binary file not shown.
Binary file modified axiom-profiler-GUI/assets/html/logo_side_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed axiom-profiler-GUI/assets/html/logo_small.png
Binary file not shown.
Binary file added axiom-profiler-GUI/assets/html/logo_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions axiom-profiler-GUI/assets/html/perfetto.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ h1, h2, h3 {
.topbar .omnibox input {
grid-area: input;
border: 0;
padding: 0 10px;
padding: 0 8px;
font-size: 18px;
font-family: "Roboto Condensed", sans-serif;
font-weight: 300;
Expand Down Expand Up @@ -345,7 +345,7 @@ table {
}

.home-page .home-page-center .logo {
height: 2em;
height: 6em;
margin-top: -0.4em;
margin-right: 0.1rem;
}
Expand Down Expand Up @@ -504,7 +504,7 @@ table {
height: var(--topbar-height);
line-height: var(--topbar-height);
vertical-align: middle;
padding: 0 12px;
padding: 0 10px;
color: #000;
overflow: visible;
display: flex;
Expand All @@ -527,6 +527,7 @@ table {

.sidebar > header .brand {
height: 36px;
padding: 2px 0;
margin-top: calc((var(--topbar-height) - 36px) / 2);
}

Expand Down
Binary file modified axiom-profiler-GUI/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed axiom-profiler-GUI/assets/logo.psd
Binary file not shown.
Binary file removed axiom-profiler-GUI/assets/logo_side.png
Binary file not shown.
Binary file modified axiom-profiler-GUI/assets/logo_side.psd
Binary file not shown.
Binary file added axiom-profiler-GUI/assets/logo_square.psd
Binary file not shown.
Binary file removed axiom-profiler-GUI/assets/logo_tmp.png
Binary file not shown.
Binary file removed axiom-profiler-GUI/assets/logo_tmp.psd
Binary file not shown.
2 changes: 1 addition & 1 deletion axiom-profiler-GUI/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl Component for Window {
timestamp.format("%H:%M %-d %b %y")
);
let version_link = format!(
"https://github.com/viperproject/axiom-profiler-2/tree/{}",
"https://github.com/viperproject/smt-scope/tree/{}",
env!("VERGEN_GIT_SHA")
);
let is_canary = version().is_none();
Expand Down
5 changes: 2 additions & 3 deletions axiom-profiler-GUI/src/screen/homepage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,7 @@ impl Homepage {
disabled: false,
click: Action::Href(
true,
"https://github.com/viperproject/axiom-profiler-2/blob/main/README.md"
.to_string(),
"https://github.com/viperproject/smt-scope/blob/main/README.md".to_string(),
),
}),
ElementKind::Simple(SimpleButton {
Expand All @@ -483,7 +482,7 @@ impl Homepage {
disabled: false,
click: Action::Href(
true,
"https://github.com/viperproject/axiom-profiler-2/issues/new".to_string(),
"https://github.com/viperproject/smt-scope/issues/new".to_string(),
),
}),
],
Expand Down
20 changes: 10 additions & 10 deletions axiom-profiler-GUI/src/screen/homepage/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn HomepageScreen() -> Html {
let versions_state = versions.clone();
wasm_bindgen_futures::spawn_local(async move {
let Ok(response) = gloo::net::http::Request::get(
"https://api.github.com/repos/viperproject/axiom-profiler-2/git/refs/tags/v",
"https://api.github.com/repos/viperproject/smt-scope/git/refs/tags/v",
)
.send()
.await
Expand All @@ -87,15 +87,15 @@ pub fn HomepageScreen() -> Html {
if is_canary {
gloo::utils::window()
.location()
.set_href("/axiom-profiler-2/")
.set_href("/smt-scope/")
.unwrap();
}
});
let canary = Callback::from(move |_| {
if !is_canary {
gloo::utils::window()
.location()
.set_href("/axiom-profiler-2/canary/")
.set_href("/smt-scope/canary/")
.unwrap();
}
});
Expand Down Expand Up @@ -128,9 +128,9 @@ pub fn HomepageScreen() -> Html {
let onclick = Callback::from(move |_| {
if is_canary || this_version_index != i {
let href = if i == last_idx {
String::from("/axiom-profiler-2/")
String::from("/smt-scope/")
} else {
format!("/axiom-profiler-2/{version_text}")
format!("/smt-scope/{version_text}")
};
gloo::utils::window().location().set_href(&href).ok();
}
Expand Down Expand Up @@ -166,7 +166,7 @@ pub fn HomepageScreen() -> Html {
html! {
<div class="home-page"><div class="home-page-center">
<div class="home-page-title">
<img src="html/logo_small.png" class="logo" />{"Axiom Profiler"}</div>
<img src="html/logo_square.png" class="logo" /></div>
<HomepageHints />
<div class="channel-select">
<div>{switch_text}</div>
Expand Down Expand Up @@ -220,21 +220,21 @@ fn test_versions() -> Vec<VersionEntry> {
let v0_1_0 = VersionEntry {
r#ref: "refs/tags/v0.1.0".to_string(),
node_id: "REF_kwDOKNVs07ByZWZzL3RhZ3MvdjAuMS4w".to_string(),
url: "https://api.github.com/repos/viperproject/axiom-profiler-2/git/refs/tags/v0.1.0".to_string(),
url: "https://api.github.com/repos/viperproject/smt-scope/git/refs/tags/v0.1.0".to_string(),
object: VersionObject {
sha: "cf6cf11427abd96a26037f6c47422b7506f890ef".to_string(),
r#type: "tag".to_string(),
url: "https://api.github.com/repos/viperproject/axiom-profiler-2/git/tags/cf6cf11427abd96a26037f6c47422b7506f890ef".to_string(),
url: "https://api.github.com/repos/viperproject/smt-scope/git/tags/cf6cf11427abd96a26037f6c47422b7506f890ef".to_string(),
},
};
let v0_1_3 = VersionEntry {
r#ref: "refs/tags/v0.1.3".to_string(),
node_id: "REF_kwDOKNVs07ByZWZzL3RhZ3MvdjAuMS4z".to_string(),
url: "https://api.github.com/repos/viperproject/axiom-profiler-2/git/refs/tags/v0.1.3".to_string(),
url: "https://api.github.com/repos/viperproject/smt-scope/git/refs/tags/v0.1.3".to_string(),
object: VersionObject {
sha: "68babe1a367cbafb71d92b798784c87d3131a57f".to_string(),
r#type: "tag".to_string(),
url: "https://api.github.com/repos/viperproject/axiom-profiler-2/git/tags/68babe1a367cbafb71d92b798784c87d3131a57f".to_string(),
url: "https://api.github.com/repos/viperproject/smt-scope/git/tags/68babe1a367cbafb71d92b798784c87d3131a57f".to_string(),
},
};
vec![v0_1_0, v0_1_3]
Expand Down
2 changes: 1 addition & 1 deletion axiom-profiler-GUI/src/shortcuts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct ShortcutsProps {
pub fn Shortcuts(props: &ShortcutsProps) -> Html {
html! {
<section class="modal-dialog" tabindex="0">
<MatDialog heading={"Axiom Profiler Help"} dialog_link={props.noderef.clone()} onopened={props.onopened.clone()} onclosed={props.onclosed.clone()}>
<MatDialog heading={"SMT Scope Help"} dialog_link={props.noderef.clone()} onopened={props.onopened.clone()} onclosed={props.onclosed.clone()}>
<main><div class="help">
<h2>{"Navigation"}</h2>
<table>
Expand Down
4 changes: 3 additions & 1 deletion smt-log-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ strum = { version = "0.26", features = ["derive"] }
# For the command line interface
clap = { version = "4.5.4", features = ["derive"] }
tempfile = "3"
# For `debug_assertions` builds which are used for testing
cap = "0.1.2"

[dev-dependencies]
memory-stats = "1.1.0"
cap = "0.1.2"
serde_json = "1.0"
rand = "0.8"
assert_cmd = "2.0.16"
smt-log-parser = { path = ".", features = ["mem_dbg", "serde"] }

[features]
Expand Down
2 changes: 1 addition & 1 deletion smt-log-parser/src/analysis/graph/analysis/reconnect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub struct ReconnectFrom {
/// A visible node to reconnect from.
pub visible: RawNodeIndex,
/// A non-visible child of `from_v`, set only if
/// `from_v.reconnect_children()`.
/// `from_v.reconnect_child()`.
pub hidden: Option<RawNodeIndex>,
}

Expand Down
Loading

0 comments on commit d20a494

Please sign in to comment.