Skip to content

perf(process): reuse capture-local text normalization matchers - #2965

Closed
rudycelekli wants to merge 2 commits into
morluto:mainfrom
rudycelekli:candidate/rea-next10-normalization-20261013
Closed

rudycelekli wants to merge 2 commits into
morluto:mainfrom
rudycelekli:candidate/rea-next10-normalization-20261013

Conversation

@rudycelekli

Copy link
Copy Markdown

Repeated terminal updates rebuild the same path, PID and caller-pattern matchers. Prepare immutable scenario-dependent matchers once per capture and share them between renderer and retained-event consumers, while keeping the PID lookup live during terminal startup. Sample PID matchers are prepared only when PID normalization is selected. Output/provenance equivalence passes 9,035 adversarial producer assertions; no target authority or capture contract changes. AI-assisted implementation and verification with OpenAI Codex.

Verified on current main 8fef2aa6: npm run check and 13 focused normalization tests pass. The executed macOS PTY suite passed 6 cases with 2 Linux-only skips before the clean rebase; all touched producer/consumer bytes are unchanged. No Windows/Linux runtime claim.

Two 24-trial actual TerminalRenderer measurements preserve identical output digests. First warm elapsed medians for 0/4/64 observed paths were 136→134,151→260 and 315→201ms; the four-path result regressed. A subsequent bounded run measured 160→171,189→160 and 218→145ms, with a zero-path regression. Both host measurements and CPU samples are retained; peak process RSS was 162/163 MB for the combined runs. These are producer measurements on a contended host, not universal speedups or whole-task savings. Task tokens and process-capture cost remain unmeasured.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-10-13T18:20:00.200934Z ff68121 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.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] The test-only changes appear safe to merge.

Summary

The current diff adds two tests to ProcessNormalization.test.ts; it changes no production code.

  • Normalization tests track PID changes during terminal startup.
  • Normalization tests keep path aliases separate between captures.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@morluto morluto added area: runtime Process capture and runtime observation performance Performance regressions, scaling limits, and bounded-resource work labels Oct 14, 2026
morluto added a commit that referenced this pull request Oct 14, 2026
Retain unresolved process identity and launch evidence through retryable cleanup. Share capture path normalization and preserve failed filesystem observations. Bound child output and drain Windows pipes without one-chunk throttling.

Reviewed fixes include #1628, #2632, #2644, #2784, #2928, #2931, #2965, #2992, and #3011.

Validation: 92 focused source tests passed; four platform-specific skips. Real Windows and Hopper lifecycle coverage was not rerun.
@kaoru0822-kitauji kaoru0822-kitauji added the ci-fix-wip Claimed by the CI-fix track label Oct 14, 2026
# Conflicts:
#	src/process/capture/ProcessCaptureLifecycle.ts
#	src/process/capture/ProcessHarness.ts
#	src/process/capture/ProcessNormalization.ts
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

CI-fix track: none of the failures came from this PR. The test shards failed on reconstructionVerification.functionSources.test.ts, which main was failing at the time and passes on current main. The real-web-runtime (Invalid URL: undefined), real-web-source-map (owned-browser startup) and Windows inspection retry lanes failed the same way on unrelated PRs. I merged main to clear the conflicts. Main already took this change in 599a8ee and goes further by sharing one createProcessTextNormalizer between the renderer and terminal frame capture, so the three source files now match main. What's left is the two new ProcessNormalization.test.ts cases (live terminal PID lookup and per-capture matchers), which pass against main's normalizer. Locally: 144 tests in the process capture and reconstruction files passed, and check:fast is clean.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@kaoru0822-kitauji kaoru0822-kitauji removed the ci-fix-wip Claimed by the CI-fix track label Oct 14, 2026
@CassieFox23

Copy link
Copy Markdown
Contributor

Heads up: main already has this change in 599a8ee. The code is in src/process/capture/ProcessNormalization.ts, and reuses matchers while observing the terminal PID after launch covers it. It is listed on tracker #3582. If this PR still adds something main doesn't have, please say so here and I'll take it off the list. Thanks for the fix!

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

@rudycelekli

Copy link
Copy Markdown
Author

Closing: main already contains this change, so this PR is superseded. Thanks for the review.

@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Thanks @rudycelekli for identifying repeated matcher construction in terminal updates. Main now shares capture-local normalization work across the renderer and retained-event consumers (main).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants