Skip to content

perf: reuse row-build buffers and scan auto-approve prompts once per feed - #71

Merged
simota merged 1 commit into
mainfrom
perf/render-scratch-reuse
Sep 5, 2026
Merged

perf: reuse row-build buffers and scan auto-approve prompts once per feed#71
simota merged 1 commit into
mainfrom
perf/render-scratch-reuse

Conversation

@simota

@simota simota commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • render: keep per-row capacity on full rebuildupdate_pane_cache used vec![Vec::new(); rows] on every full invalidation (selection/theme/search change), dropping all row buffers. Now resize_with, so same-size rebuilds refill the existing slots.
  • render: reuse row-build scratchRowBuildScratch (segment cells, RunPool of ShapeRuns incl. their inner Vecs, highlight buffer) lives on Renderer and is threaded through rebuild_row_instances, replacing per-row/per-run allocations. segment_row stays as the allocating wrapper for overlays/tests.
  • auto-approve: one viewport scan per feeddetect_and_update_any_agent previously called find_prompt (lowercases every row) in both the decision and the state update. The observed MatchedPrompt is now shared. Two-match rule and input-cooldown rescans unchanged. detect_any_agent removed (no remaining callers).

Tests

  • full_rebuild_keeps_per_row_buffer_capacity (capacity + allocation pointer unchanged, output identical)
  • run_pool_reuse_matches_fresh_segmentation
  • detect_and_update_scans_viewport_once_per_feed (Hold / Fire / Suppressed each scan once)
  • cargo test --workspace green (noa-ipc failures are the known sandbox loopback-bind issue, untouched); clippy/fmt clean for touched files.

No benchmark numbers yet — the change removes allocations structurally; measure with bench/run_all.sh if wanted.

https://claude.ai/code/session_01GBe292wmocEXM8SjBzjGq7

…feed

- render: keep per-row instance capacity on a full pane rebuild
  (resize_with instead of fresh Vecs) and thread a RowBuildScratch
  (segment cells, RunPool of ShapeRuns, highlight buffer) through
  rebuild_row_instances so dirty rows stop reallocating per row/run.
- auto-approve: detect_and_update_any_agent runs find_prompt at most
  once per feed, sharing the observed MatchedPrompt between the
  decision and the state update; two-match rule and cooldown rescans
  are unchanged.

Tests: full_rebuild_keeps_per_row_buffer_capacity,
run_pool_reuse_matches_fresh_segmentation,
detect_and_update_scans_viewport_once_per_feed.

Claude-Session: https://claude.ai/code/session_01GBe292wmocEXM8SjBzjGq7
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T21:04:51.288912Z 268bb32 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@simota
simota merged commit 0794087 into main Sep 5, 2026
1 check passed
@simota
simota deleted the perf/render-scratch-reuse branch September 5, 2026 21:07
@simota simota mentioned this pull request Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant