Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename bubble sort to quadratic sort #820

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion ceno_host/tests/test_elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fn test_bubble_sorting() -> Result<()> {

let all_messages = messages_to_strings(&ceno_host::run(
CENO_PLATFORM,
ceno_examples::bubble_sorting,
ceno_examples::quadratic_sorting,
&hints,
));
for msg in &all_messages {
Expand Down
3 changes: 3 additions & 0 deletions examples-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ license.workspace = true
name = "ceno-examples"
repository.workspace = true
version.workspace = true

[build-dependencies]
glob = "0.3"
24 changes: 7 additions & 17 deletions examples-builder/build.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
use glob::glob;
use std::{
fs::{File, read_dir},
io::{self, Write},
path::Path,
process::Command,
};

/// Add each example to this list.
///
/// Contact Matthias, if your examples get complicated enough to need their own crates, instead of just being one file.
const EXAMPLES: &[&str] = &[
"ceno_rt_alloc",
"ceno_rt_io",
"ceno_rt_mem",
"ceno_rt_mini",
"ceno_rt_panic",
"ceno_rt_keccak",
"hints",
"sorting",
"median",
"bubble_sorting",
"hashing",
];
const CARGO_MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR");

fn rerun_all_but_target(dir: &Path) {
Expand Down Expand Up @@ -51,7 +36,12 @@ fn build_elfs() {
io::stderr().write_all(&output.stderr).unwrap();
panic!("cargo build of examples failed.");
}
for example in EXAMPLES {
// Contact Matthias, if your examples get complicated enough to need their own crates, instead of just being one file.
for example in glob("../examples/examples/*.rs")
.unwrap()
.map(Result::unwrap)
{
let example = example.file_stem().unwrap().to_str().unwrap();
writeln!(
dest,
r#"#[allow(non_upper_case_globals)]
Expand Down