#[cfg(feature = "std")]
use super::probes;
use super::readings::Readings;
#[cfg(feature = "std")]
pub(super) fn print_report(
r: &Readings,
order_calls_per_keystroke: usize,
order_node_visits: usize,
per_keystroke_bytes_per_dot: usize,
batch_bytes_per_dot: usize,
) {
let typed = r.typed;
let deleted = r.deleted;
let visible_len = r.visible_len;
let skeleton_len = r.skeleton_len;
let exceptions = &r.exceptions;
let holes = &r.holes;
let demo_exceptions = r.demo_exceptions;
let demo_holes = r.demo_holes;
let full_frame_bytes = r.full_frame_bytes;
let per_keystroke_dots = r.per_keystroke_dots;
let per_keystroke_bytes = r.per_keystroke_bytes;
let batch_dots = r.batch_dots;
let batch_bytes = r.batch_bytes;
let (
probe_len,
naive_index_visits_last,
cached_index_visits_last,
naive_index_visits_total,
cached_index_visits_total,
) = probes::index_cost_probe(r.skeleton_len);
std::println!("\n=== STUDIO MEASUREMENTS (S110, C8 update S116) ===");
std::println!("scale: typed={typed} deleted={deleted}");
std::println!("visible_len (replica 0): {visible_len}");
std::println!("skeleton_len (replica 0): {skeleton_len}");
std::println!("exceptions_len per replica: {exceptions:?} (steady state)");
std::println!("hole_count per replica: {holes:?} (steady state)");
std::println!(
"reorder-window reads track a genuine out-of-order receipt: {demo_exceptions} exceptions, {demo_holes} holes"
);
std::println!("full-state context frame: {full_frame_bytes} bytes");
let per_keystroke_context_bytes = r.per_keystroke_context_bytes;
let per_keystroke_floored_context_bytes = r.per_keystroke_floored_context_bytes;
std::println!(
"per-keystroke delta: {per_keystroke_dots} dot(s), ~{per_keystroke_bytes} bytes ({per_keystroke_bytes_per_dot} bytes/dot)"
);
std::println!(
"per-keystroke context frame: {per_keystroke_context_bytes} bytes empty-seeded (delta_for) -> {per_keystroke_floored_context_bytes} bytes floored (delta_for_since)"
);
std::println!(
"batched 50-keystroke: {batch_dots} dots, ~{batch_bytes} bytes ({batch_bytes_per_dot} bytes/dot)"
);
std::println!(
"order() calls/keystroke: {order_calls_per_keystroke} (walk visits {order_node_visits} nodes, O(n), unchanged)"
);
std::println!(
"child-index/keystroke (naive rebuild): {naive_index_visits_last} visits at the last of {probe_len} chars (total {naive_index_visits_total}, quadratic)"
);
std::println!(
"child-index/keystroke (S116 maintained): {cached_index_visits_last} visit(s) at the last char (total {cached_index_visits_total}, linear)"
);
std::println!("===================================\n");
}
pub(super) fn touch_report_values(
r: &Readings,
order_calls_per_keystroke: usize,
order_node_visits: usize,
per_keystroke_bytes_per_dot: usize,
batch_bytes_per_dot: usize,
) {
let _ = (
&r.exceptions,
&r.holes,
r.demo_exceptions,
r.demo_holes,
r.full_frame_bytes,
per_keystroke_bytes_per_dot,
batch_bytes_per_dot,
order_calls_per_keystroke,
order_node_visits,
);
}