Skip to content

perf(analysis-view): reuse validated immutable captures - #5349

Merged
gensokyo-dev merged 2 commits into
mainfrom
perf/3133-retained-capture-validation-20261020
Oct 20, 2026
Merged

gensokyo-dev merged 2 commits into
mainfrom
perf/3133-retained-capture-validation-20261020

Conversation

@gensokyo-dev

@gensokyo-dev gensokyo-dev commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and change

Retained HAR/SAZ/qlog pages revalidate and copy the entire capture for each selected query. Reuse successful validation at the capture format owner for the exact immutable object, using the existing sealing and normalization proof. Mutable/external-freeze inputs still validate normally; subject, coverage and budget checks remain per request. CLI/MCP share the projection. One-shot producer/environment-file admission keeps ordinary schema validation.

Refs #3133; its broader model-workflow research remains open.

Evidence and validation

Final adjacent main/candidate tasks on the same public 30,753-event qlog preserve all selected Evidence and original-record round trips:

Metric Before After
14 warm queries 5.998 s 0.108 s
Complete scope wall 18.870 s 14.242 s
Payload-family CPU 18.519 s 14.048 s
Kernel family peak 1722.1 MiB 1147.0 MiB

First view is slower: 2.797 → 4.041 s. This is one final pair, not a distribution. Earlier three-run cohorts, small-input limits and a slower unpaired replay remain in the report. No model-token saving is claimed.

  • Full npm run check, 252 source assertions in two invocations, 63 compiled CLI/MCP/decoder assertions (one inapplicable guard-unavailable case skipped), 10 receipt regressions and test discovery pass. Both public recordings have exact real CLI/MCP Evidence agreement.

  • A combined source run exposed an existing cancellation-spy loading-order failure, reproduced on unchanged main with environmentReplay loaded first. The service file passes 48 assertions alone and the other files pass 204. No unrelated repair is included.

  • Pinned audit, driver, every run and limits. Query experiments are serial, one CPU, 4 GiB hard/3 GiB early memory, no swap; static checks use a separate 8 GiB cap. Guard stops and unavailable final counters remain explicit. Other capture formats/platforms and post-GC retained heap are not performance-qualified.

  • Review correction: require both selected records per page. The revised oracle rechecked 22 archived completed transcripts (198 pages/396 records); empty/short response controls fail. Both real MCP tasks passed again with identical Evidence and verified cleanup.

Author readiness

Human owner: @gensokyo-dev

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Reuse complete capture validation at the format owner for exact authenticated immutable results. Keep per-parent subject and resource admission checks, mutable-input validation, source Evidence and existing CLI/MCP contracts.

Record 12 real public-qlog import/query/export comparisons, first-view and small-input costs, CPU/family-memory observations, and executed source, compiled and real CLI/MCP verification. Refs #3133.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the follow-up fixes the missing-record check without changing production behavior.

Summary

Reuses successful capture validation for the exact owned immutable object. Mutable and externally frozen inputs still use ordinary validation.

  • Repeated capture views reuse validation for the same sealed capture.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Capture input] --> B{Exact object already validated?}
  B -->|Yes| C[Reuse immutable capture]
  B -->|No| D[Run complete schema validation]
  D --> E{Valid and owned immutable proof matches?}
  E -->|Yes| F[Remember exact object in WeakSet]
  F --> C
  E -->|No| G[Return ordinary parse result]
  C --> H[Check each request's subject and limits]
Loading

Reviews (2) · Last reviewed commit: "test(perf): require every selected captu..." · Reviewed by Greptile

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

The human owner explicitly confirmed readiness and authorized recording the Author readiness declarations and marking this PR ready in the current working session. The declaration is recorded at their direction; CI and automated review remain separate verification.

@gensokyo-dev
gensokyo-dev marked this pull request as ready for review October 20, 2026 03:16
@chatgpt-codex-connector

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 ⚠️ Failed 2026-10-20T03:17:01.788868Z 8d1c21a Draft marked ready
ℹ️ 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.

@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.

@gensokyo-dev
gensokyo-dev merged commit 4e716b0 into main Oct 20, 2026
44 of 45 checks passed
@gensokyo-dev
gensokyo-dev deleted the perf/3133-retained-capture-validation-20261020 branch October 20, 2026 03:32
@github-actions github-actions Bot mentioned this pull request Oct 20, 2026
3 tasks done
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 20, 2026
…t-state-serve

morluto#5319 is on main as one squashed commit with the same content as the
branch this work was stacked on, so the branch's side of each overlapping
hunk is kept; morluto#5349's analysis-view changes merge as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 20, 2026
…t-state-coverage

morluto#5319 is on main as one squashed commit with the same content as the
branch this work was stacked on, so the branch's side of each overlapping
hunk is kept; morluto#5349's analysis-view changes merge as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@morluto morluto added area: runtime Process capture and runtime observation performance Performance regressions, scaling limits, and bounded-resource work labels Nov 23, 2026
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.

2 participants