[PR #4080] [MERGED] perf(tests): reuse CLI compilation for exported binding checks #6043

Closed
opened 2026-10-31 01:11:25 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4080
Author: @N0zoM1z0
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @N0zoM1z0

Base: main ← Head: perf/4079-export-bindings-cli-cache


📝 Commits (1)

  • d000a72 perf(tests): reuse CLI compilation for exported binding checks

📊 Changes

2 files changed (+50 additions, -17 deletions)

View changed files

📝 tests/acceptance/applications/exportedFunctionBindingsCli.test.ts (+38 -12)
📝 tests/support/cli/cliFixture.ts (+12 -5)

📄 Description

Summary

Fixes #4079; focused performance follow-up to #2190.

Reuse Node compilation across the exported binding acceptance file's CLI launches. Keep all 92 cases, CLI/MCP requests, real Node-loader oracles and assertions. This removes repeated preparation while continuing to execute each analysis.

Problem and expected behavior

This family took 202.177s in scheduled run 38714082679. It already shares MCP setup but recompiles the CLI for repeated launches. Reuse immutable compilation without reusing analysis results or changing caller cache/coverage choices.

Change and scope

Extract the existing CLI fixture's environment policy for reuse. Own one fresh temporary cache per file execution; attempt its removal even if MCP teardown fails, using the existing aggregate cleanup helper. No runtime/product or workflow-selection changes; maintainer capability-scope decision is not applicable.

Contract and boundary impact

  • Owner: test CLI environment projection and file-owned temporary resources.
  • CLI/MCP, Evidence, provider authority, generated metadata, installation and package contracts: unchanged.
  • Compatibility: preserve explicit NODE_COMPILE_CACHE, NODE_DISABLE_COMPILE_CACHE and child NODE_V8_COVERAGE; automatic caching is omitted for requested child coverage.
  • Existing test effects: read fixtures, launch CLI/MCP/Node-loader processes and write temporary files. The added files contain Node compilation data, removed at file teardown.

Evidence and regression coverage

Four alternating complete workloads on cb18d4c9c4ee399d81ebaf0888117d52d990e442, each 92 passed:

Variant Wall seconds CPU user + system seconds Sampled peak family RSS MiB
Original A 227.485 384.808 1453.7
Cache A 207.022 357.749 1418.3
Original B 273.958 449.239 1438.6
Cache B 210.125 363.266 1464.3

Linux x64, 16 CPUs/64 GiB RAM, pinned Node 24.18.0/npm 11.16.0, warm shared build/OS caches. Fresh processes and an empty private compilation cache per cache run; cache warms within the family. No other task-owned checks ran concurrently. Shared-host variation is substantial; n=2 per variant supports this local family improvement, not a CI-wide estimate. Memory has no consistent improvement. CPU is wait-accounted child usage; family RSS is sampled through /proc descendants with a 100ms pause between scans, can miss brief/reparented processes and double-count shared pages. Wrapper overhead is excluded.

Observed a 3.25MB private cache during execution and confirmed removal of observed private paths. Existing public-CLI controls cover caller cache selection, disabled cache and requested child coverage. Existing cleanup controls cover independent failures. Token payloads are unchanged by source inspection; agent token cost, cold OS/install, other OS and whole-CI performance are unmeasured. #3543 remains a separate unresolved timeout; this PR does not claim to fix it.

Validation performed

  • npm run test:focused -- tests/acceptance/applications/exportedFunctionBindingsCli.test.ts — all four measured runs passed all 92 cases.

  • npm run test:focused -- tests/boundary/cli/cliCompileCache.test.ts tests/boundary/cli/nativeDemangleCli.test.ts tests/boundary/process/verifierCleanup.test.ts — 6 passed, 1 Darwin-only skipped.

  • npm run check:fast — typecheck and lint passed.

  • npm run check:ci — all 8 static tasks and architecture guards passed.

  • npm run test:ci:shard:run -- --project acceptance tests/acceptance/applications/exportedFunctionBindingsCli.test.ts --shard=1/1 — 92 passed with V8 coverage, 312.17s total. This focused shard uses zero local thresholds; it does not establish global coverage qualification.

  • Integration candidate with latest main f255899ee849aaef4a23fc385c62616ccf089e16 (tree c40c57353bb996fce3c9f54f950d7d367f240e89): re-ran the 92-case family, three policy/cleanup files and two new native CLI files — 98 passed, 3 Darwin-only skipped; npm run check:fast passed.

  • PR CI 38722525981 — success: 1,334 files, 15,401 passed / 138 skipped, all five shards, inventory/report merge and required gate passed. Fast-tier run without global coverage qualification. Executed merge 8189ca3eb129686e156c6dcc03dc6c1d41ef562f has the same tree as the local integration candidate. Codex review completed without findings; Greptile passed with no actionable issues.

Compatibility, safety, and release

Test-only change; no migration or release metadata impact. Real public CLI, stdio MCP and Node module loading ran against generated JavaScript application fixtures. Real Hopper/Ghidra/browser and Windows/macOS execution were not performed locally. No new target authority or network access.

Author readiness

Human owner: @N0zoM1z0. The user explicitly authorized delegated readiness completion, ready-for-review publication and merge. Technical diff/evidence review was performed by Codex under that instruction; no separate independent human review is claimed.

  • 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

  • Concrete focused problem and related issue identified.
  • Existing contribution boundaries retained; no additional scope decision required.
  • Relevant contracts and generated metadata require no changes.
  • Final diff inspected for unrelated changes, secrets and unsupported claims.
  • Current-head CI and actionable automated review findings complete.

🔄 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/4080 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `perf/4079-export-bindings-cli-cache` --- ### 📝 Commits (1) - [`d000a72`](https://github.com/morluto/rea/commit/d000a72cd781f409b3d8fcc86730e6ff5a7a9cfd) perf(tests): reuse CLI compilation for exported binding checks ### 📊 Changes **2 files changed** (+50 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `tests/acceptance/applications/exportedFunctionBindingsCli.test.ts` (+38 -12) 📝 `tests/support/cli/cliFixture.ts` (+12 -5) </details> ### 📄 Description ## Summary Fixes #4079; focused performance follow-up to #2190. Reuse Node compilation across the exported binding acceptance file's CLI launches. Keep all 92 cases, CLI/MCP requests, real Node-loader oracles and assertions. This removes repeated preparation while continuing to execute each analysis. ## Problem and expected behavior This family took 202.177s in scheduled run [38714082679](https://github.com/morluto/rea/actions/runs/38714082679). It already shares MCP setup but recompiles the CLI for repeated launches. Reuse immutable compilation without reusing analysis results or changing caller cache/coverage choices. ## Change and scope Extract the existing CLI fixture's environment policy for reuse. Own one fresh temporary cache per file execution; attempt its removal even if MCP teardown fails, using the existing aggregate cleanup helper. No runtime/product or workflow-selection changes; maintainer capability-scope decision is not applicable. ## Contract and boundary impact - Owner: test CLI environment projection and file-owned temporary resources. - CLI/MCP, Evidence, provider authority, generated metadata, installation and package contracts: unchanged. - Compatibility: preserve explicit `NODE_COMPILE_CACHE`, `NODE_DISABLE_COMPILE_CACHE` and child `NODE_V8_COVERAGE`; automatic caching is omitted for requested child coverage. - Existing test effects: read fixtures, launch CLI/MCP/Node-loader processes and write temporary files. The added files contain Node compilation data, removed at file teardown. ## Evidence and regression coverage Four alternating complete workloads on `cb18d4c9c4ee399d81ebaf0888117d52d990e442`, each **92 passed**: | Variant | Wall seconds | CPU user + system seconds | Sampled peak family RSS MiB | | --- | ---: | ---: | ---: | | Original A | 227.485 | 384.808 | 1453.7 | | Cache A | 207.022 | 357.749 | 1418.3 | | Original B | 273.958 | 449.239 | 1438.6 | | Cache B | 210.125 | 363.266 | 1464.3 | Linux x64, 16 CPUs/64 GiB RAM, pinned Node 24.18.0/npm 11.16.0, warm shared build/OS caches. Fresh processes and an empty private compilation cache per cache run; cache warms within the family. No other task-owned checks ran concurrently. Shared-host variation is substantial; n=2 per variant supports this local family improvement, not a CI-wide estimate. Memory has no consistent improvement. CPU is wait-accounted child usage; family RSS is sampled through `/proc` descendants with a 100ms pause between scans, can miss brief/reparented processes and double-count shared pages. Wrapper overhead is excluded. Observed a 3.25MB private cache during execution and confirmed removal of observed private paths. Existing public-CLI controls cover caller cache selection, disabled cache and requested child coverage. Existing cleanup controls cover independent failures. Token payloads are unchanged by source inspection; agent token cost, cold OS/install, other OS and whole-CI performance are unmeasured. #3543 remains a separate unresolved timeout; this PR does not claim to fix it. ## Validation performed - `npm run test:focused -- tests/acceptance/applications/exportedFunctionBindingsCli.test.ts` — all four measured runs passed all 92 cases. - `npm run test:focused -- tests/boundary/cli/cliCompileCache.test.ts tests/boundary/cli/nativeDemangleCli.test.ts tests/boundary/process/verifierCleanup.test.ts` — 6 passed, 1 Darwin-only skipped. - `npm run check:fast` — typecheck and lint passed. - `npm run check:ci` — all 8 static tasks and architecture guards passed. - `npm run test:ci:shard:run -- --project acceptance tests/acceptance/applications/exportedFunctionBindingsCli.test.ts --shard=1/1` — 92 passed with V8 coverage, 312.17s total. This focused shard uses zero local thresholds; it does not establish global coverage qualification. - Integration candidate with latest main `f255899ee849aaef4a23fc385c62616ccf089e16` (tree `c40c57353bb996fce3c9f54f950d7d367f240e89`): re-ran the 92-case family, three policy/cleanup files and two new native CLI files — 98 passed, 3 Darwin-only skipped; `npm run check:fast` passed. - [PR CI 38722525981](https://github.com/morluto/rea/actions/runs/38722525981) — success: 1,334 files, 15,401 passed / 138 skipped, all five shards, inventory/report merge and required gate passed. Fast-tier run without global coverage qualification. Executed merge `8189ca3eb129686e156c6dcc03dc6c1d41ef562f` has the same tree as the local integration candidate. Codex review completed without findings; Greptile passed with no actionable issues. ## Compatibility, safety, and release Test-only change; no migration or release metadata impact. Real public CLI, stdio MCP and Node module loading ran against generated JavaScript application fixtures. Real Hopper/Ghidra/browser and Windows/macOS execution were not performed locally. No new target authority or network access. ## Author readiness Human owner: @N0zoM1z0. The user explicitly authorized delegated readiness completion, ready-for-review publication and merge. Technical diff/evidence review was performed by Codex under that instruction; no separate independent human review is claimed. - [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] Concrete focused problem and related issue identified. - [x] Existing contribution boundaries retained; no additional scope decision required. - [x] Relevant contracts and generated metadata require no changes. - [x] Final diff inspected for unrelated changes, secrets and unsupported claims. - [x] Current-head CI and actionable automated review findings complete. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:11:25 +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#6043
No description provided.