Skip to content

Commit

Permalink
Add support for multilang validating runners, use stateful runners (#5)
Browse files Browse the repository at this point in the history
Co-authored-by: WeetHet <[email protected]>
Co-authored-by: Igor Engel <[email protected]>
  • Loading branch information
3 people authored Sep 17, 2024
1 parent 114b115 commit c9a19a3
Show file tree
Hide file tree
Showing 49 changed files with 3,136 additions and 906 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run pytest
name: Run pytest, ruff, and pyright

on: [push]

Expand All @@ -8,7 +8,7 @@ env:
POETRY_URL: https://install.python-poetry.org

jobs:
run-pytest:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -34,5 +34,11 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Dependencies
run: poetry install
- name: Run ruff format check
run: poetry run ruff format verified_cogen --check
- name: Run ruff linter
run: poetry run ruff check verified_cogen
- name: Run pyright
run: poetry run pyright verified_cogen
- name: Run pytest
run: poetry run pytest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ llm-generated
**/.DS_Store
pyrightconfig.json
benches/DafnyBench/
benches/HumanEval-Dafny-Mini/
break_assert.rs
.venv
**/target
Expand All @@ -17,3 +18,5 @@ run.sh
**/.pytest_cache
run_nagini.py
/tmp
results
results/*
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "Nagini-Conversion"]
path = Nagini-Conversion
url = https://github.com/alex28sh/Nagini-Convertion

[submodule "benches/HumanEval-Dafny"]
path = benches/HumanEval-Dafny
url = https://github.com/JetBrains-Research/HumanEval-Dafny
1 change: 1 addition & 0 deletions benches/HumanEval-Dafny
Submodule HumanEval-Dafny added at 197aca
12 changes: 12 additions & 0 deletions gui/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ anyhow = "1.0.86"
directories = "5.0.1"
eframe = { version = "0.28.1", features = ["persistence"] }
egui_extras = { version = "0.28.1", features = ["syntect"] }
egui_plot = "0.28.1"
env_logger = "0.11.3"
log = "0.4.22"
once_cell = "1.19.0"
Expand Down
18 changes: 16 additions & 2 deletions gui/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{
process::{Command, Output},
};

use eframe::egui::{self, TextEdit};
use eframe::egui::{self, TextEdit, Ui};

use crate::Settings;

Expand Down Expand Up @@ -59,12 +59,20 @@ fn add_common_arguments<'a>(
token: &str,
settings: &Settings,
) -> &'a mut Command {
let bench_type = if settings.incremental_run {
String::from("validating")
} else {
settings.bench_type.to_string()
};
if settings.do_filter {
cmd.args(["--filter-by-ext", &settings.filter_by_ext]);
}
cmd.args(["--verifier-command", &settings.verifier_command])
.args(["--prompts-directory", &settings.prompts_directory])
.args(["--insert-conditions-mode", "llm-single-step"])
.args(["--llm-profile", settings.llm_profile.as_grazie()])
.args(["--grazie-token", token])
.args(["--bench-type", &settings.bench_type.to_string()])
.args(["--bench-type", &bench_type])
.args(["--tries", &make_tries(&settings.tries)])
.args(["--retries", &make_retries(&settings.retries)])
.args(["--verifier-timeout", &make_timeout(&settings.timeout)])
Expand Down Expand Up @@ -130,3 +138,9 @@ pub fn integer_edit_field(
}
res
}

pub(crate) fn paint_code(ui: &mut Ui, code: &str, lang: &str) {
let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx());

egui_extras::syntax_highlighting::code_view_ui(ui, &theme, code, lang);
}
Loading

0 comments on commit c9a19a3

Please sign in to comment.