Skip to content
Snippets Groups Projects
Verified Commit bc330007 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

return all the run context

parent ba4874da
Branches
No related tags found
No related merge requests found
......@@ -481,7 +481,12 @@ export def plot [
--src-hash-pattern (-s) : string = '',
--rust-build (-r) : string = '',
--no-title (-T),
]: [ nothing -> table<name: string, out: path, title: string> ] {
]: [
nothing -> table<
run : table<git: string, cpu: string, src: string, build: string>,
figures : record<name: string, out: string, title: string>,
>
] {
let benches = match [ $all, ($benches | length) ] {
[ false, 0 ] => {
log error "nothing to do"
......@@ -519,10 +524,10 @@ export def plot [
--src $src_hash_pattern
--build $rust_build
)
let run_params = $data | select git cpu src build | uniq
let run_hash = $run_params | sort | to nuon | hash sha256
let hash = $data | select git cpu src build | uniq | sort | to nuon | hash sha256
match $b {
let figures = match $b {
"field" => {
[
[ name , include , exclude ];
......@@ -531,7 +536,7 @@ export def plot [
[ "complex-operations" , $BASIC_OPERATIONS.field.complex , [] ],
] | each { |it|
let name = $"field-($it.name)"
let out = out ($hash + $name | hash sha256)
let out = out ($run_hash + $name | hash sha256)
let title = $data | (plot-bars
-o $out
-t $"($it.name) in $($FIELD)_r$ \(time in %unit\)"
......@@ -565,7 +570,7 @@ export def plot [
[ "complex-operations" , $BASIC_OPERATIONS.group.complex , $BASIC_OPERATIONS.group.reject ],
] | each { |it|
let name = $"group-($it.name)"
let out = out ($hash + $name | hash sha256)
let out = out ($run_hash + $name | hash sha256)
let title = $data | (plot-bars
-o $out
-t $"($it.name) in $($GROUP)$ \($($FIELD)_q$\) \(time in %unit\)"
......@@ -592,7 +597,7 @@ export def plot [
}
},
"setup" | "commit" => {
let out = out ($hash + $b | hash sha256)
let out = out ($run_hash + $b | hash sha256)
let title = $data | (__plot
-o $out
-t (if $b == "setup" {
......@@ -625,7 +630,7 @@ export def plot [
[ "transpose" , $'time to transpose matrix $M \in ($MATRIX_FIELD_R)$' ],
] | each { |op|
let name = $"linalg-($op.name)"
let out = out ($hash + $name | hash sha256)
let out = out ($run_hash + $name | hash sha256)
let title = $data | (__plot
-o $out
-t $op.title
......@@ -650,7 +655,7 @@ export def plot [
},
"fec" => {
let name_encode = "fec-encode"
let out_encode = out ($hash + $name_encode | hash sha256)
let out_encode = out ($run_hash + $name_encode | hash sha256)
let title_encode = $data | (__plot
-o $out_encode
-t $"time to \\textit{encode} data of size $|D|$ on \\textbf{BN254} \(r: $(curve-to-field-modulus 'BN254' | get r)$ bits\)"
......@@ -690,7 +695,7 @@ export def plot [
)
let name_decode = "fec-decode"
let out_decode = out ($hash + $name_decode | hash sha256)
let out_decode = out ($run_hash + $name_decode | hash sha256)
let title_decode = $data | (__plot
-o $out_decode
-t $"time to \\textit{decode} data of size $|D|$ on \\textbf{BN254} \(r: $(curve-to-field-modulus 'BN254' | get r)$ bits, $\\rho$ is irrelevant\)"
......@@ -726,7 +731,7 @@ export def plot [
)
let name_recode = "fec-recode"
let out_recode = out ($hash + $name_recode | hash sha256)
let out_recode = out ($run_hash + $name_recode | hash sha256)
let title_recode = $data | (__plot
-o $out_recode
-t $"time to \\textit{recode} data of size $|D|$ on \\textbf{BN254} \(r: $(curve-to-field-modulus 'BN254' | get r)$ bits, $\\rho$ is irrelevant, $x = \\frac{\\#shards}{k}$\)"
......@@ -793,7 +798,7 @@ export def plot [
{ nb_bytes: 130023424 , k: 8 , n: 16 },
] | each { | params|
let name = $"protocols-b($params.nb_bytes)-k($params.k)-n($params.n)"
let out = out ($hash + $name | hash sha256)
let out = out ($run_hash + $name | hash sha256)
let title = $data | (plot-bars
-o $out
-t $"time to run cryptographic \\textit{protocols} on data of size $($params.nb_bytes)$ \(($params.nb_bytes | pretty-filesize)\), $k = ($params.k)$ on \\textbf{BN254} \(r: $(curve-to-field-modulus 'BN254' | get r)$ bits\), $\\rho = \\frac{1}{2}$"
......@@ -835,6 +840,11 @@ export def plot [
log hint $" choose one of these: ($BENCHES | each { str color green })"
},
}
{
run: $run_params,
figures: ($figures | flatten),
}
| flatten
}
| flatten figures
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment