Skip to content

perf(hopper): stop repeating Hopper replies as raw_result - #1405

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
perf/hopper-raw-result
Oct 10, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
perf/hopper-raw-result

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Problem

In HopperProvider.execute, mapped is the reply itself (mapped = result) for every operation except address_to_file_offset, yet Evidence was built with

createAnalysisExecution(mapped.value, executionProvider, { rawResult: result.value, … })

so raw_result was the same object as normalized_result. Every Hopper Evidence record carried its complete result twice: decompilation, procedure/string listings, xrefs, call graphs and instructions. An MCP response repeats Evidence in text and structured content, so it carried the result four times. The duplicate also counted twice against the 10 MiB transport budget. Hopper is the primary deep-analysis provider, so this affects the largest everyday results.

Change

rawResult: mapped === result ? null : result.value. Only address_to_file_offset transforms Hopper's reply (mapHopperFileOffset), and it keeps the original reply as raw_result. Everything else records null, meaning no distinct provider representation (see #1402). normalized_result, the analysis profile and limitations are unchanged.

Tests

  • tests/acceptance/applications/runtime.test.ts ("returns the selected document on macOS through MCP…") drives the production stdio server with the fake Hopper launcher and now asserts raw_result === null. The assertion fails on main and passes here.
  • npx vitest run tests/boundary/providers/hopper src/hopper tests/boundary/mcp tests/composition: 641 passed, 4 skipped
  • npm run check:fast

Not verified with real Hopper (not installed on this machine). The change is confined to how REA records the reply after Hopper returns it; no bridge or protocol behavior changes.

Related: #1402 (createAnalysisExecution default copy) and #1404 (pwntools diagnostics). The three PRs are independent. Refs #723, #1065.

🤖 Generated with Claude Code

HopperProvider passed the bridge reply as rawResult and, for every
operation except address_to_file_offset, the same object as the result.
Every Hopper Evidence record (decompilation, procedure and string
listings, xrefs, ...) therefore carried its complete result twice, and
an MCP response four times counting its text copy.

raw_result is now null unless REA transformed the reply, which only the
file-offset mapping does; that case keeps Hopper's original reply.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 merged commit 1f0f728 into main Oct 10, 2026
19 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the perf/hopper-raw-result branch October 10, 2026 03:00
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
HopperProvider passed the bridge reply as rawResult and, for every
operation except address_to_file_offset, the same object as the result.
Every Hopper Evidence record (decompilation, procedure and string
listings, xrefs, ...) therefore carried its complete result twice, and
an MCP response four times counting its text copy.

raw_result is now null unless REA transformed the reply, which only the
file-offset mapping does; that case keeps Hopper's original reply.
@morluto morluto added performance Performance regressions, scaling limits, and bounded-resource work area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added the provider: hopper Analysis provider / engine: hopper label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior performance Performance regressions, scaling limits, and bounded-resource work provider: hopper Analysis provider / engine: hopper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants