Skip to content

Commit d8207cf

Browse files
committed
Merge branch 'main' of github.com:input-output-hk/ouroboros-leios
2 parents 29dd4cc + 5b2df4d commit d8207cf

21 files changed

+1668
-47
lines changed

Logbook.md

+59-37
Large diffs are not rendered by default.

analysis/adversarial-quorum.svg

+284
Loading

analysis/alba-size.svg

+66
Loading

analysis/alba-success.svg

+104
Loading

analysis/committee_statistics-1000.svg

+83
Loading

analysis/committee_statistics-500.svg

+87
Loading

analysis/committee_statistics-750.svg

+80
Loading

analysis/honest-quorum.svg

+280
Loading

analysis/no-honest-quorum.svg

+276
Loading

cabal.project

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ source-repository-package
4040
type: git
4141
location: https://github.com/Saizan/io-sim.git
4242
tag: cb3926463e42d5eff98acdbdeadd4a05c7c81f90
43+
--sha256: 64IWzs36fLSvf1Jb5z1ajeBppMooFynN2/lgjlu3ojo=
4344
subdir:
4445
io-sim
45-
io-classes
46+
io-classes

delta_q/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,11 @@ You may want to copy the latest example from `models.txt`, taking the whole set
101101
## Known Shortcomings
102102

103103
- functional but ugly
104+
105+
## misc
106+
107+
### converting from latencies.json of the Haskell simulation
108+
109+
```sh
110+
jq -r '[.[]|.[1]]|sort|length as $l|[foreach .[] as $i (0;.+1;if .%100==0 or .==$l then "("+($i|tostring)+", "+(./$l|tostring)+")" else null end)|select(.)]|join(",")' latencies.json
111+
```

delta_q/comparison_hs.txt

+24
Large diffs are not rendered by default.

delta_q/comparison_rs.txt

+11
Large diffs are not rendered by default.

delta_q/src/bin/editor-web.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ fn edit_expression(props: &EditExpressionProps) -> HtmlResult {
395395
<pre>{ &*result }</pre>
396396
</div>
397397
} else {
398-
<span class={classes!("dq_show")} onclick={cloned!(editing; move |_| editing.set(true))}>{ value.to_string() }</span>
398+
<span class={classes!("dq_show")} onclick={cloned!(editing; move |_| editing.set(true))}>{ format!("{:#}", *value) }</span>
399399
}
400400
})
401401
}

delta_q/src/cdf.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ impl Default for CDF {
6262
impl fmt::Display for CDF {
6363
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6464
write!(f, "CDF")?;
65-
write!(f, "{}", self.steps)?;
65+
if f.alternate() {
66+
write!(f, "{:#}", self.steps)?;
67+
} else {
68+
write!(f, "{}", self.steps)?;
69+
}
6670
Ok(())
6771
}
6872
}

delta_q/src/delta_q.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,11 @@ impl DeltaQ {
470470
}
471471
}
472472
DeltaQExpr::Outcome(outcome) => {
473-
write!(f, "{}", outcome)
473+
if f.alternate() {
474+
write!(f, "{:#}", outcome)
475+
} else {
476+
write!(f, "{}", outcome)
477+
}
474478
}
475479
DeltaQExpr::Seq(first, load, second) => {
476480
if parens {

delta_q/src/outcome.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,16 @@ impl Outcome {
160160
}
161161
impl Display for Outcome {
162162
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
163-
write!(f, "{}", self.cdf)?;
164-
for (metric, load) in self.load.iter() {
165-
write!(f, " WITH {metric}{load}")?;
163+
if f.alternate() {
164+
write!(f, "{:#}", self.cdf)?;
165+
for (metric, load) in self.load.iter() {
166+
write!(f, " WITH {metric}{load:#}")?;
167+
}
168+
} else {
169+
write!(f, "{}", self.cdf)?;
170+
for (metric, load) in self.load.iter() {
171+
write!(f, " WITH {metric}{load}")?;
172+
}
166173
}
167174
Ok(())
168175
}

delta_q/src/render.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ pub fn cdf_component(props: &CdfProps) -> Html {
196196

197197
html! {
198198
<div class={classes!("cdf", "anchor")} onclick={cloned!(popup; move |_| if !*popup { popup.set(true) })}>
199-
{ format!("{}", props.outcome) }
199+
{ format!("{:#}", props.outcome) }
200200
if *popup {
201201
<div class={classes!("popup")}>
202202
<button onclick={cloned!(popup; move |_| popup.set(false))}>{ "abort" }</button>

delta_q/src/step_function.rs

+9
Original file line numberDiff line numberDiff line change
@@ -352,17 +352,26 @@ where
352352
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
353353
let mut scratch = String::new();
354354

355+
let mut written = 1;
355356
write!(f, "[")?;
356357
for (i, (x, y)) in self.data().iter().enumerate() {
357358
if i > 0 {
358359
write!(f, ", ")?;
360+
written += 2;
359361
}
360362
write!(&mut scratch, "{:.5}", x)?;
361363
write!(f, "({}, ", trim(&scratch))?;
364+
written += 3 + scratch.len();
362365
scratch.clear();
363366
y.pretty_print(&mut scratch)?;
364367
write!(f, "{})", trim(&scratch))?;
368+
written += 1 + scratch.len();
365369
scratch.clear();
370+
371+
if f.alternate() && written > 80 {
372+
write!(f, " ...")?;
373+
break;
374+
}
366375
}
367376
write!(f, "]")?;
368377
Ok(())

docs/technical-report-1.md

+272-1
Large diffs are not rendered by default.

sim-rs/txn_diffusion.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jq --unbuffered -rc 'select(.message.type=="TransactionGenerated") | (.message.i
66
echo $id $t
77
CDF=`(
88
echo $t
9-
jq -c 'select(.message|.type=="TransactionReceived" and .id=='$id') | {time,id:.message.id}' < "$1"
9+
jq -c $id' as $id|select(.message|{type,id}|. == {type: "TransactionReceived", id: $id|tostring}) | {time,id:.message.id}' < "$1"
1010
) | jq -srf convert.jq`
1111
if [ -z "$RET" ]; then
1212
RET="$CDF"

0 commit comments

Comments
 (0)