summaryrefslogtreecommitdiff
path: root/src/server/render_scale_benchmark.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-21 20:47:14 +0300
committerGitHub <noreply@github.com>2026-09-21 20:47:14 +0300
commit28360107c1bfab57fb0de99d74bfa48e74423ca8 (patch)
tree30f9d953e48fb81b32f2a663500c6cff6f447f8f /src/server/render_scale_benchmark.rs
parent309749ad65f3aa596f077ec23a1bf3ee428b7a04 (diff)
fix: distinguish agent completion from startup and session changes (#4457)
refs #3338 refs #3990 refs #3916
Diffstat (limited to 'src/server/render_scale_benchmark.rs')
-rw-r--r--src/server/render_scale_benchmark.rs29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/server/render_scale_benchmark.rs b/src/server/render_scale_benchmark.rs
index 5c3935de..dcafa1a9 100644
--- a/src/server/render_scale_benchmark.rs
+++ b/src/server/render_scale_benchmark.rs
@@ -233,13 +233,36 @@ fn profile_snapshot_encoding(
count: usize,
client_count: usize,
) -> StageStats {
- let pipeline = RenderPipeline::new(build(count));
+ let mut pipeline = RenderPipeline::new(build(count));
+ pipeline.app.state.ensure_test_terminals();
+ for terminal in pipeline.app.state.terminals.values_mut() {
+ terminal.set_detected_state(
+ Some(crate::detect::Agent::Pi),
+ crate::detect::AgentState::Idle,
+ );
+ terminal.last_agent_state_change_seq = Some(1);
+ terminal.last_agent_completion_seq = Some(1);
+ }
let run = || {
let started = Instant::now();
- let template = super::client_shell::snapshot(&pipeline.app, "bench-boot", 1, None, None);
+ let (template, completions) = super::client_shell::snapshot_with_completions(
+ &pipeline.app,
+ "bench-boot",
+ 1,
+ None,
+ None,
+ );
for client_index in 0..client_count {
let mut snapshot = template.clone();
snapshot.revision = client_index as u64 + 1;
+ let mut completions = completions.clone();
+ completions.revision = snapshot.revision;
+ let companion = crate::protocol::endpoint::agent_completions_message(&completions)
+ .expect("benchmark completion projection should serialize");
+ black_box(
+ bincode::serde::encode_to_vec(companion, bincode::config::standard())
+ .expect("benchmark completion projection should frame"),
+ );
let message = crate::protocol::endpoint::snapshot_message(&snapshot)
.expect("benchmark snapshot should serialize");
black_box(
@@ -256,7 +279,7 @@ fn profile_snapshot_encoding(
}
fn print_snapshot_encoding_profiles(label: &str, build: fn(usize) -> Vec<Workspace>) {
- println!("{label} snapshot projection + JSON framing");
+ println!("{label} populated agent snapshots + completions + JSON framing");
println!(" panes clients median_us p95_us max_us");
for count in CARDINALITIES {
for client_count in CLIENT_CARDINALITIES {