[PR #5885] [MERGED] perf(apple): reuse retained Interface Builder graph validation #7100

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

📋 Pull Request Information

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

Base: main ← Head: perf/5855-interface-builder-views


📝 Commits (3)

  • 683f5f5 perf(apple): reuse retained Interface Builder graph validation
  • 6487aff docs(apple): record integrated retained-graph verification
  • 3ed3158 test(apple): require a baseline for each retained graph limit

📊 Changes

8 files changed (+2722 additions, -26 deletions)

View changed files

➕ experiments/analysis-efficiency/interface-builder-oracle.py (+50 -0)
➕ experiments/analysis-efficiency/interface-builder-views.json (+2039 -0)
➕ experiments/analysis-efficiency/interface-builder-views.md (+225 -0)
➕ experiments/analysis-efficiency/interface-builder-views.mjs (+238 -0)
📝 src/domain/analysisView/interfaceBuilderView.test.ts (+107 -1)
📝 src/domain/analysisView/interfaceBuilderView.ts (+53 -23)
📝 src/domain/immutableJson.test.ts (+6 -0)
📝 src/domain/immutableJson.ts (+4 -2)

📄 Description

Summary

Retained Interface Builder pages currently validate and clone every decoded document for each selected page. Reuse successful validation of the exact owned immutable parent, and collect only the requested document page. Fixes #5855.

Problem and expected behavior

A real XLD retained graph has 6,528 nodes and 1,378 edges. Reading one document should preserve its original rows, connections, Evidence and partial coverage without repeatedly interpreting the entire graph.

Change and scope

The view owner records successful, representation-preserving schema validation in a weak set. Current parent binding still runs for every view. Mutable imports, forged seals, parser normalization and schema/binding failures cannot establish reusable validation. Document paging uses the existing shared matching pager; unfiltered requests retain direct slicing. The snapshot comparison's generic type now accepts schemas with optional undefined members; runtime comparison remains unchanged.

Contract and boundary impact

  • Owner: shared domain Interface Builder view projection; CLI/MCP use the same application workflow.
  • Scope decision: not applicable; ordinary optimization of existing static, read-only capability.
  • Public contracts/catalog, target choices, source IDs, retained complete Evidence, coverage and unknowns: unchanged.
  • Compatibility: existing resource-only and executable-bound reports; no live-file cache or new provider/authority.
  • Lifecycle: weak membership follows Evidence reachability; no second retained graph or new index. Existing acquisition/cleanup remains unchanged.
  • Generated/package/install changes: none; no binaries, provider documents or build outputs committed.

Expected effects:

  • Read existing files or captured data.

Evidence and proof

Reproduction, all runs and limitations and machine-readable receipts.

  • Real official XLD 20250302, independent Python plist oracle for five outlets and the VBR action, exact endpoint UIDs and archive provenance. Complete parent Evidence and actual CLI/MCP page results remain equal.
  • Five large tasks per version: repeated four-page median 1,818 → 94 ms; sampled whole wall/CPU medians about 10% lower. Startup ranges overlap substantially; no general whole-task speed claim.
  • Four one-document controls per version: whole wall median 15.702 → 18.101 s, no warm-page latency benefit. Isolated owner projection CPU improves for both sizes; first large-summary CPU increases because representation comparison is paid up front. No token or stable memory improvement claimed.
  • All slow/failed attempts remain recorded. Experiments use one CPU with 4 GiB hard/3 GiB early memory bounds, verified payload cleanup and no observed limit/OOM events; final whole-scope counters are unavailable.
  • Measurements are pinned to f801b2fbf. Rebased onto latest main bcfcd8b6e and repeated real workflows; owned source fingerprints and full target Evidence remain equal. Native ibtool/macOS runtime behavior and unrelated decoder issues are not qualified here.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • Relevant exact-test suite: 204 passed in 12 files after the paging refactor.
  • Post-rebase scalar/Interface Builder/CLI/MCP subset: 78 passed in 6 files.
  • Real rebased SDK tasks (64 and 1 documents), complete CLI decode and portable CLI page: passed with exact parent/page equality.
  • Greptile baseline gap fixed: both sizes now require their pre-change complete Evidence; both real reruns passed, and an intentional wrong small baseline was rejected with cleanup verified. Production source is unchanged.
  • Latest-main integration: 211 tests passed; one PE resource acceptance case still exceeds 30 seconds under the bounded local run. The identical case also times out on untouched bcfcd8b6e under the same limits. #5845 is fixed upstream and now passes. No unrelated test deadline or production logic was changed here.
  • npm run build:cached, npm run check, npm run docs:check, npm run verify:test-discovery: passed on the rebased runtime.

Compatibility, safety, and release

No breaking changes, migration, installation changes, target execution or new target mutation. Archived wiring does not prove a runtime handler. macOS ibtool and native runtime UI remain unverified; this Linux static archive path needs neither Hopper nor Ghidra.

Author readiness

The following owner declarations are transcribed at the human owner's explicit standing instruction in this session. This records that instruction, not an independently witnessed human review by the agent.

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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/5885 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `perf/5855-interface-builder-views` --- ### 📝 Commits (3) - [`683f5f5`](https://github.com/morluto/rea/commit/683f5f5ee810b878332ccc41adfecc2e59f2c706) perf(apple): reuse retained Interface Builder graph validation - [`6487aff`](https://github.com/morluto/rea/commit/6487aff2b15da93b30aa679f6b72ccda18662fc4) docs(apple): record integrated retained-graph verification - [`3ed3158`](https://github.com/morluto/rea/commit/3ed3158a66f52cac31d5d4739d1629500b24058b) test(apple): require a baseline for each retained graph limit ### 📊 Changes **8 files changed** (+2722 additions, -26 deletions) <details> <summary>View changed files</summary> ➕ `experiments/analysis-efficiency/interface-builder-oracle.py` (+50 -0) ➕ `experiments/analysis-efficiency/interface-builder-views.json` (+2039 -0) ➕ `experiments/analysis-efficiency/interface-builder-views.md` (+225 -0) ➕ `experiments/analysis-efficiency/interface-builder-views.mjs` (+238 -0) 📝 `src/domain/analysisView/interfaceBuilderView.test.ts` (+107 -1) 📝 `src/domain/analysisView/interfaceBuilderView.ts` (+53 -23) 📝 `src/domain/immutableJson.test.ts` (+6 -0) 📝 `src/domain/immutableJson.ts` (+4 -2) </details> ### 📄 Description ## Summary Retained Interface Builder pages currently validate and clone every decoded document for each selected page. Reuse successful validation of the exact owned immutable parent, and collect only the requested document page. Fixes #5855. ## Problem and expected behavior A real XLD retained graph has 6,528 nodes and 1,378 edges. Reading one document should preserve its original rows, connections, Evidence and partial coverage without repeatedly interpreting the entire graph. ## Change and scope The view owner records successful, representation-preserving schema validation in a weak set. Current parent binding still runs for every view. Mutable imports, forged seals, parser normalization and schema/binding failures cannot establish reusable validation. Document paging uses the existing shared matching pager; unfiltered requests retain direct slicing. The snapshot comparison's generic type now accepts schemas with optional undefined members; runtime comparison remains unchanged. ## Contract and boundary impact - Owner: shared domain Interface Builder view projection; CLI/MCP use the same application workflow. - Scope decision: not applicable; ordinary optimization of existing static, read-only capability. - Public contracts/catalog, target choices, source IDs, retained complete Evidence, coverage and unknowns: unchanged. - Compatibility: existing resource-only and executable-bound reports; no live-file cache or new provider/authority. - Lifecycle: weak membership follows Evidence reachability; no second retained graph or new index. Existing acquisition/cleanup remains unchanged. - Generated/package/install changes: none; no binaries, provider documents or build outputs committed. Expected effects: - [x] Read existing files or captured data. ## Evidence and proof [Reproduction, all runs and limitations](https://github.com/morluto/rea/blob/3ed3158a66f52cac31d5d4739d1629500b24058b/experiments/analysis-efficiency/interface-builder-views.md) and [machine-readable receipts](https://github.com/morluto/rea/blob/3ed3158a66f52cac31d5d4739d1629500b24058b/experiments/analysis-efficiency/interface-builder-views.json). - Real official XLD 20250302, independent Python plist oracle for five outlets and the VBR action, exact endpoint UIDs and archive provenance. Complete parent Evidence and actual CLI/MCP page results remain equal. - Five large tasks per version: repeated four-page median 1,818 → 94 ms; sampled whole wall/CPU medians about 10% lower. Startup ranges overlap substantially; no general whole-task speed claim. - Four one-document controls per version: whole wall median 15.702 → 18.101 s, no warm-page latency benefit. Isolated owner projection CPU improves for both sizes; first large-summary CPU increases because representation comparison is paid up front. No token or stable memory improvement claimed. - All slow/failed attempts remain recorded. Experiments use one CPU with 4 GiB hard/3 GiB early memory bounds, verified payload cleanup and no observed limit/OOM events; final whole-scope counters are unavailable. - Measurements are pinned to f801b2fbf. Rebased onto latest main bcfcd8b6e and repeated real workflows; owned source fingerprints and full target Evidence remain equal. Native ibtool/macOS runtime behavior and unrelated decoder issues are not qualified here. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - Relevant exact-test suite: 204 passed in 12 files after the paging refactor. - Post-rebase scalar/Interface Builder/CLI/MCP subset: 78 passed in 6 files. - Real rebased SDK tasks (64 and 1 documents), complete CLI decode and portable CLI page: passed with exact parent/page equality. - Greptile baseline gap fixed: both sizes now require their pre-change complete Evidence; both real reruns passed, and an intentional wrong small baseline was rejected with cleanup verified. Production source is unchanged. - Latest-main integration: 211 tests passed; one PE resource acceptance case still exceeds 30 seconds under the bounded local run. The identical case also times out on untouched bcfcd8b6e under the same limits. #5845 is fixed upstream and now passes. No unrelated test deadline or production logic was changed here. - `npm run build:cached`, `npm run check`, `npm run docs:check`, `npm run verify:test-discovery`: passed on the rebased runtime. ## Compatibility, safety, and release No breaking changes, migration, installation changes, target execution or new target mutation. Archived wiring does not prove a runtime handler. macOS ibtool and native runtime UI remain unverified; this Linux static archive path needs neither Hopper nor Ghidra. ## Author readiness The following owner declarations are transcribed at the human owner's explicit standing instruction in this session. This records that instruction, not an independently witnessed human review by the agent. 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. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:23 +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#7100
No description provided.