Skip to content

perf(ghidra): omit redundant raw results - #5355

Merged
gensokyo-dev merged 1 commit into
mainfrom
perf/5337-ghidra-raw-evidence-20261020
Oct 20, 2026
Merged

gensokyo-dev merged 1 commit into
mainfrom
perf/5337-ghidra-raw-evidence-20261020

Conversation

@gensokyo-dev

Copy link
Copy Markdown
Collaborator

Problem and change

Ghidra repeated complete inventories and function observations in raw_result, despite preserving their facts in normalized_result and canonical Evidence metadata. Let the bridge parsers own independent upstream representations and use named execution metadata. Ordinary results now have raw_result: null; overview details, attestation inputs, file-offset roles and pre-overlay database types remain available. CLI/MCP share this implementation. Existing retained Evidence is not rewritten.

Fixes #5337. Ordinary fix within existing analysis boundaries; no new capability or authority.

Evidence and validation

  • A 30,000-row production-boundary regression fails on unchanged main with resource_constraint and passes completely on the candidate at the same 10 MiB budget. This uses a simulated bridge, not a real 30,000-function analysis.
  • Real Ghidra 12.1.4 stdio MCP tasks on true and official jq 1.8.2 preserve every selected normalized fact and provenance field, excluding only record ID/raw representation. Exported Evidence and unchanged source hashes validate. For jq, RPC replies are 2,375,466 → 1,264,884 bytes; catalog + arguments + replies are 5,639,932 → 4,529,351 bytes (19.7% lower). Actual model tokens are unmeasured.
  • No latency/CPU/peak-memory gain is claimed: jq scope wall was 279.699 → 399.097 s, concentrated in the first preparation query. A subsequent unchanged-main repeat differed by three discovered procedures and failed the strict oracle. That control, an earlier SDK deadline and all harness/resource-stop attempts are retained.
  • npm run check, final npm run check:fast, 247 source/MCP assertions and npm run docs:check pass. Real oversized-result retention/recovery and complete CLI readback pass; the public real file-offset/address-context CLI/MCP verifier also passes, with unchanged source and verified cleanup.

Measurements, driver, receipt and limitations. Heavy work is serial under CPU/family-memory guards. Real Windows/macOS, other engine versions, real NativeAOT overlays and post-GC retained heap remain unqualified. Read function results from normalized_result, rather than raw_result.value.

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.

Let the bridge parsers own independent raw representations and pass named execution metadata. Preserve overview details, attestation inputs, file-offset roles and derived-type source observations.

Record real CLI/MCP verification, complete paired source facts, response capacity regression and measured task costs with explicit cold-analysis and failed-control limits. Fixes #5337.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
@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-20T05:00:16.483017Z ce97c2d PR opened
ℹ️ 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

Copy link
Copy Markdown
Collaborator Author

The human owner explicitly authorized initial readiness, recording the Author readiness declarations on their behalf, and opening this PR ready for review in the current working session. These declarations are recorded at their direction; CI and automated reviews remain separate verification.

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no actionable regressions were found.

Summary

Removes duplicate Ghidra results from raw_result while keeping facts in normalized_result and Evidence metadata.

  • Ghidra results skip a duplicate raw copy when normalized facts are complete.
  • The Ghidra comparison records real-run reply sizes and their limits.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Java bridge reply] --> B[Ghidra parsers]
  B --> C[Normalized facts and metadata]
  B --> D{Distinct original facts?}
  D -->|No| E[raw_result is null]
  D -->|Yes| F[Keep original reply]
  C --> G[Analysis execution]
  E --> G
  F --> G
  G --> H[Session Evidence and snapshots]
  H --> I[CLI and MCP]
Loading

Reviews (1) · Last reviewed commit: "perf(ghidra): omit redundant raw results" · Reviewed by Greptile

@gensokyo-dev
gensokyo-dev merged commit 58d6043 into main Oct 20, 2026
42 checks passed
@gensokyo-dev
gensokyo-dev deleted the perf/5337-ghidra-raw-evidence-20261020 branch October 20, 2026 05:14
@github-actions github-actions Bot mentioned this pull request Oct 20, 2026
3 tasks done
kaoru0822-kitauji added a commit to L13an/rea that referenced this pull request Oct 21, 2026
main (morluto#5378) moved official tools onto shared Evidence registration with native-inventory summaries, and morluto#5355 stopped repeating raw results that equal the normalized observation. Resolve by:
- adding procedure_pseudo_code to main's official summary operations;
- registering the pseudocode summary schema in main's per-operation summary union and view projector table;
- continuing pseudocode overflow to the native pseudocode page beside main's native-inventory continuation;
- applying this branch's description wording to main's inspect_analysis_view text;
- treating main's nullable view artifact when filtering scalar pseudocode locations;
- dropping a duplicate analysisDetailSchema import;
- expecting no raw_result copy and sizing the overflow fixture above the 10 MiB stdio budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@morluto morluto added performance Performance regressions, scaling limits, and bounded-resource work provider: ghidra Analysis provider / engine: ghidra labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance regressions, scaling limits, and bounded-resource work provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Ghidra Evidence repeats the full result in raw_result, halving the inventory that fits in one response

2 participants