Skip to content

perf(acpmux): use fuller pages for large session censuses - #30482

Merged
teamleaderleo merged 2 commits into
feat-cmux-nextfrom
lane/cpu-audit-ls-pages
Nov 1, 2026
Merged

teamleaderleo merged 2 commits into
feat-cmux-nextfrom
lane/cpu-audit-ls-pages

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

A full acpmux ls on a host with about 8,000 mirrored sessions took roughly 70 seconds, while ls --live took 2 seconds. The CLI always requested 1,000 rows per page, requiring eight separately paced list requests; active sessions can invalidate the shared snapshot between requests. --json --fields sessionId,name,status also requested usage refresh even though it displayed none.

Full census reads now measure the first successful reply and size subsequent pages to use the existing wire-size headroom. Explicit single-page reads keep their requested count. The existing byte bounds and halve-on-too-large fallback remain authoritative; after a refusal, the reader keeps the smaller page size rather than growing again. Field projections request usage refresh only when they include usageStats.

Leo's request: "optimize against that for acpmux/cmux-next and whatever agents try to do".

Performance

metric before after delta harness
requests for 8,000 synthetic census rows, about 3 KB each 8 3 -62.5% an_eight_thousand_row_peer_census_uses_fuller_pages, same fake daemon with fixed versus adaptive request sizes

| harness wall time, same 8,000 rows | 157.491 ms | 88.787 ms | -43.6% | same fleet harness |

The harness also prints wall time for both arms and verifies identical rows and message sizes below the cap. This measures CLI pagination, not the end-to-end time on the reporting Mac. The companion #30470 fixes stale list-pacing debt independently.

Validation and risk

Validation route: fast_checks_fleet.run_on_fleet through the fleet controller, Linux pool job 54e5fdd3937a2ad537ca2682 at the pushed head. This replaces the fast-checks Actions dispatch that queued without a runner; passed: 18 tests, 0 failures (the 8,000-row reply peaked at 11,814,426 bytes).

Focused fleet tests: ls_pages, projected_listings_only_refresh_usage_when_they_show_it. Existing tests cover old daemons, oversized replies, duplicate cursors, explicit pages, limits and filters. Added coverage checks an 8,000-row mirror and much larger rows after the first page.

No timer, observer or retained cache is added. The byte estimate runs once per full listing, using a counting writer that allocates no serialized copy. Risk: heterogeneous rows can make the estimate too large, handled by the existing smaller-page retry. No sessions are omitted or expired.

Prior art: #28373 introduced safe paging against old daemons; #28831 bounds every server list page by bytes. Both remain in effect.

Agent session: agent session

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 24394b3: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr30482 -f ref=lane/cpu-audit-ls-pages -f platform=macos -f backend_mode=local

Shipped in:

@teamleaderleo teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (claude-opus-5-5 medium): SHIP at 24394b3

Review (subagent claude-opus-5-5 medium): SHIP at 24394b3

Carried from an independent Opus 5.5 medium subagent review supplied by the coordinating session. No correctness blockers: adaptive enumeration matches the fixed reader on 8,000 rows; byte bounds, halving fallback, explicit cursor/limit behavior and usage projection remain correct.

Follow-ups: target roughly 90% of NEAR_CAP_BYTES to avoid routine near-cap warnings and reduce expensive oversized-page retries on heterogeneous peer rows. Synthetic test timings do not include transport and must not stand in for end-to-end latency. The PR labels those timings accordingly.

@teamleaderleo
teamleaderleo merged commit bb6e46e into feat-cmux-next Nov 1, 2026
112 of 137 checks passed
@teamleaderleo
teamleaderleo deleted the lane/cpu-audit-ls-pages branch November 1, 2026 09:13
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review follow-up tracked in #30520: leave additional headroom below the near-cap warning threshold and extend mixed-size census coverage. The measured harness wall time excludes transport; updated-build end-to-end measurements remain separate.

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 1, 2026
lawrencecchen added a commit that referenced this pull request Nov 1, 2026
lawrencecchen added a commit that referenced this pull request Nov 1, 2026
…ures sized from the limit (#30808)

* Re-land #29670: remove the 15 MiB message cap (31 MiB)

Re-applies b9d493d, taken back in #30184 because send_attach_family's
too-large fixture still sent 15.7 MiB. ls_pages_tests keeps #30482's page
wording with #29670's 31 MiB fixture. The next commit sizes the attach fixture
from the limit.

* send_attach_family's too-large send is sized from the message limit

#29670 raised rpc::MAX_MESSAGE_BYTES from 15 to 31 MiB; this fixture still
sent 5 MiB of text and an 8 MiB file (about 15.7 MiB), which then fit, so
attach.tooLarge never came (the reason #30184 took #29670 back). It is now
half the limit as text and half as a file, about 1.2 times the limit.

* re-land #29670: the 8,000-row census reads in 2 fuller pages at the 31 MiB limit (#30482's count was for 15 MiB)

This branch was successfully deployed

2 inactive deployments
sentry-dsyms — 24394b34 Deployed Nov 1, 2026 by teamleaderleo via upload cmux-tui dSYMs to Sentry #94767
artifacts — 24394b34 Deployed Nov 1, 2026 by teamleaderleo via publish to R2 #94767
ci-routing-agent — 24394b34 Deployed Nov 1, 2026 by teamleaderleo via cmux-tui tree preflight #94767
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant