[PR #5349] [MERGED] perf(analysis-view): reuse validated immutable captures #6887

Closed
opened 2026-11-01 21:43:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5349
Author: @gensokyo-dev
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @gensokyo-dev

Base: main ← Head: perf/3133-retained-capture-validation-20261020


📝 Commits (2)

  • da86250 perf(analysis-view): reuse validated immutable captures
  • 8d1c21a test(perf): require every selected capture record

📊 Changes

9 files changed (+1557 additions, -4 deletions)

View changed files

📝 experiments/analysis-efficiency/README.md (+5 -0)
➕ experiments/analysis-efficiency/retained-capture-validation.json (+894 -0)
➕ experiments/analysis-efficiency/retained-capture-validation.md (+238 -0)
➕ experiments/analysis-efficiency/retained-capture-validation.mjs (+251 -0)
📝 src/domain/analysisView/WebNetworkProjectionAccumulator.ts (+2 -2)
📝 src/domain/analysisView/webNetworkCaptureView.test.ts (+24 -0)
📝 src/domain/analysisView/webNetworkCaptureView.ts (+2 -2)
➕ src/domain/webNetworkCapture.test.ts (+118 -0)
📝 src/domain/webNetworkCapture.ts (+23 -0)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5349 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `perf/3133-retained-capture-validation-20261020` --- ### 📝 Commits (2) - [`da86250`](https://github.com/morluto/rea/commit/da8625019c86ff8e6eae3ac335e646e21605c8e9) perf(analysis-view): reuse validated immutable captures - [`8d1c21a`](https://github.com/morluto/rea/commit/8d1c21a5fb4cf22ff5206f0e2c59e074bffc220a) test(perf): require every selected capture record ### 📊 Changes **9 files changed** (+1557 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `experiments/analysis-efficiency/README.md` (+5 -0) ➕ `experiments/analysis-efficiency/retained-capture-validation.json` (+894 -0) ➕ `experiments/analysis-efficiency/retained-capture-validation.md` (+238 -0) ➕ `experiments/analysis-efficiency/retained-capture-validation.mjs` (+251 -0) 📝 `src/domain/analysisView/WebNetworkProjectionAccumulator.ts` (+2 -2) 📝 `src/domain/analysisView/webNetworkCaptureView.test.ts` (+24 -0) 📝 `src/domain/analysisView/webNetworkCaptureView.ts` (+2 -2) ➕ `src/domain/webNetworkCapture.test.ts` (+118 -0) 📝 `src/domain/webNetworkCapture.ts` (+23 -0) </details> ### 📄 Description ## 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](https://github.com/morluto/rea/blob/8d1c21a5fb4cf22ff5206f0e2c59e074bffc220a/experiments/analysis-efficiency/retained-capture-validation.md). 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 - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:43:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6887
No description provided.