Skip to content

Commit

Permalink
addressed some code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanyli committed Jul 31, 2023
1 parent c8a036b commit 2377d32
Show file tree
Hide file tree
Showing 14 changed files with 3 additions and 43 deletions.
1 change: 0 additions & 1 deletion 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 examples/chi_sq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
sunscreen = { path = "../../sunscreen", features = ["debugger"] }
sunscreen = { path = "../../sunscreen" }
env_logger = "0.9.0"
1 change: 0 additions & 1 deletion examples/debugger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ edition = "2021"
[dependencies]
sunscreen = { path = "../../sunscreen", features = ["debugger"] }
tokio = {version = "1", features = ["macros"]}
actix-web = "4.3.1"
2 changes: 0 additions & 2 deletions sunscreen/src/zkp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,6 @@ pub(crate) fn compile(program: &ZkpFrontendCompilation) -> CompilationResult<Jit
// Convert in and out of Graph to compact all the node indices.
let jit = Graph::from(jit).into();

// let mut metadata = DebugData::new();

CompilationResult {
graph: jit,
#[cfg(feature = "debugger")]
Expand Down
1 change: 0 additions & 1 deletion sunscreen_backend/src/noise_model/measured_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ impl MeasuredModel {
} {
Ok(v) => v,
Err(e) => {
println!("Error occurred during run_program_unchecked: {:?}", e);
return Err(crate::Error::RuntimeError(e));
}
};
Expand Down
3 changes: 0 additions & 3 deletions sunscreen_compiler_common/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ where
* The stack ID associated with the ProgramNode.
*/
pub stack_id: u64,
// #[cfg(feature = "debugger")]
// pub index: u64,
}

impl<O: Operation> PartialEq for NodeInfo<O> {
Expand Down Expand Up @@ -370,7 +368,6 @@ where
pub fn add_node(&mut self, operation: O) -> NodeIndex {
#[cfg(feature = "debugger")]
{
// Capture backtrace and insert into lookup
// Capture backtrace and insert into lookup
let bt = Backtrace::new();
let mut hasher = DefaultHasher::new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ mod tests {
}

fn get_graph() -> CompilationResult<Operation> {
#[cfg(feature = "debugger")]
fn make_node(operation: Operation) -> NodeInfo<Operation> {
NodeInfo {
operation,
Expand Down
2 changes: 0 additions & 2 deletions sunscreen_compiler_macros/src/fhe_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ pub fn fhe_program_impl(
metadata: proc_macro::TokenStream,
input: proc_macro::TokenStream,
) -> proc_macro::TokenStream {
let _raw_fn = input.clone().to_string();

let input_fn = parse_macro_input!(input as ItemFn);
let raw_fn = input_fn.span().source_text().unwrap_or_default();

Expand Down
1 change: 0 additions & 1 deletion sunscreen_runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ bincode = "1.3.3"
crossbeam = "0.8.1"
log = "0.4.14"
seal_fhe = { version = "0.7", path = "../seal_fhe" }
# sunscreen = { path = "../sunscreen" }
sunscreen_fhe_program = { version = "0.7", path = "../sunscreen_fhe_program" }
sunscreen_compiler_common = { path = "../sunscreen_compiler_common" }
sunscreen_zkp_backend = { path = "../sunscreen_zkp_backend" }
Expand Down
4 changes: 0 additions & 4 deletions sunscreen_runtime/debugger-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"@devbookhq/splitter": "^1.4.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fortawesome/fontawesome": "^1.1.8",
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@msagl/core": "^1.1.16",
"@msagl/parser": "^1.1.16",
"@msagl/renderer-svg": "^1.1.18",
Expand Down
17 changes: 0 additions & 17 deletions sunscreen_runtime/debugger-frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ async function isProblematic(node, session: string) {

const App = () => {

// const exGraph = dataToGraph({}, true);
const [selectedLine, setLine] = useState<number>(0);
const [vertSize, setVertSize] = useState<any[]>();
const [horSize, setHorSize] = useState<any[]>();
Expand Down Expand Up @@ -317,14 +316,9 @@ const App = () => {

useEffect(() => {
const update = async () => {
console.log("New Session:" + session)
const graph = await updateProblematicNodes(dataToGraph(await fetch(`/sessions/${session}`).then(d => d.json())))
setGraph(graph)
setCode(await fetch(`/programs/${session}`).then(p => p.json()))

// const delay = ms => new Promise(res => setTimeout(res, ms));
// await delay(1000)
// alert(session)
}
update()
}, [session])
Expand Down Expand Up @@ -409,14 +403,3 @@ function infoToHtml(info: any) {
{info.stacktrace.map(c => (<p>{`${c.callee_name.split("::").at(-2)} @ ${c.callee_file}:${c.callee_lineno}`}</p>))}
</div>)
}

// async function getLine(filePath, lineNo) {
// const file = await open(filePath)
// let currLine = 0;
// for await (const line of file.readLines()) {
// currLine += 1;
// if (currLine === lineNo) {
// return line
// }
// }
// }
8 changes: 2 additions & 6 deletions sunscreen_runtime/src/debugger/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,8 @@ async fn get_session_data(session: web::Path<String>) -> impl Responder {
if sessions.contains_key(session.as_str()) {
let curr_session = sessions.get(session.as_str()).unwrap();
let graph_string = match curr_session {
Session::BfvSession(_) => {
serde_json::to_string_pretty(&curr_session.unwrap_bfv_session().graph.graph)
}
Session::ZkpSession(_) => {
serde_json::to_string_pretty(&curr_session.unwrap_zkp_session().graph.graph)
}
Session::BfvSession(s) => serde_json::to_string_pretty(&s.graph.graph),
Session::ZkpSession(s) => serde_json::to_string_pretty(&s.graph.graph),
};

HttpResponse::Ok().body(graph_string.unwrap().to_owned())
Expand Down
2 changes: 0 additions & 2 deletions sunscreen_runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use serde::{Deserialize, Serialize};
use sunscreen_zkp_backend::BigInt;

#[derive(Debug, Clone, PartialEq, Hash, Serialize, Deserialize, Eq)]
//#[serde(tag = "type")]
/**
* The underlying backend implementation of a plaintext (e.g. SEAL's [`Plaintext`](seal_fhe::Plaintext)).
*/
Expand Down Expand Up @@ -164,7 +163,6 @@ impl Plaintext {
}

#[derive(Clone, Deserialize, Serialize)]
//#[serde(tag = "type")]
/**
* The underlying backend implementation of a ciphertext (e.g SEAL's [`Ciphertext`](seal_fhe::Ciphertext)).
*/
Expand Down
1 change: 0 additions & 1 deletion sunscreen_zkp_backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ impl Serialize for dyn Gadget {
}

#[derive(Clone, Serialize, Deserialize)]
//#[serde(tag = "type")]
/**
* An R1CS proof.
*/
Expand Down

0 comments on commit 2377d32

Please sign in to comment.