Skip to content

fix(test): honor Ghidra startup budgets in Windows verification - #3417

Merged
N0zoM1z0 merged 10 commits into
mainfrom
fix/windows-ghidra-byte-coverage-2903
Oct 14, 2026
Merged

N0zoM1z0 merged 10 commits into
mainfrom
fix/windows-ghidra-byte-coverage-2903

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes the remaining Windows Ghidra verifier deadline mismatch from #2903. Main already restored the missing search_bytes coverage; this PR makes the real verifier honor the caller-selected Ghidra startup budget across direct startup, MCP initialization, every MCP tool call, and the existing file-offset CLI operations.

Cold file-offset workflows previously had three independent deadline representations. Ghidra startup could legitimately outlast the helper's fixed 240-second request deadline, and the MCP SDK initialization handshake still used its 60-second default even after later tool requests received the extended budget.

Change and scope

The verifier now resolves one policy through the production configuration parser before target I/O or allocation:

  • direct GhidraClient startup receives the selected startup timeout;
  • public MCP initialization and every tool call share startup + 240s request options;
  • both existing CLI subprocesses use that same combined timeout;
  • combined values beyond Node's signed timer range fail before reading the target.

The MCP operation binding also removes direct-call branches that had bypassed the shared request budget. Default production deadlines, analysis settings, queries, assertions, CLI/MCP schemas, Evidence, provider capabilities, package metadata, and installer behavior are unchanged. This is verifier-only code and adds no authority.

Validation

  • Pinned Node 24.18.0/npm 11.16.0: focused timeout ownership tests pass 4/4. They cover a selected 600,000 ms startup budget, the exact 2,147,483,647 ms timer limit, one-millisecond overflow before target access, and exact forwarding into MCP initialization plus every tool call.
  • npm run check:fast and the focused 4/4 tests pass after the latest normal merge from main (efbc486b9).
  • Exact head 1991f20fcf19a9e745503dc294707cda11350351: all 37 checks pass, including source tests, 5/5 shards, Portable, Windows capability/package, three native package baselines, Apple E2E, Greptile, and CI required. The first browser lane attempt hit a transient CDP target-navigation error; the same base passed its concurrent scheduled browser lane and the failed-only rerun passed without a code change.
  • Real ordinary-user Windows 11, Ghidra 12.1.4/JDK 21, controlled public x64 and x86 PE DLL fixtures. The complete workflows at head 4bb211c8 pass all 26 read-only operations, bounded wildcard/mask byte-search coverage, file-offset MCP and two CLI paths, invalid/unmapped/header cases, source immutability, and cleanup:
    • x64: 2,029.76 s; 798.22 s sampled process-family CPU; 2,029.03 MiB peak native Job commit; 1,090.83 MiB sampled peak working set; minimum host free memory 8,164.69 MiB; Job0.
    • x86: 2,511.81 s; 1,716.84 s sampled CPU; 2,025.93 MiB peak Job commit; 963.55 MiB sampled peak working set; minimum host free memory 8,504.15 MiB; Job0.
    • Both used two logical CPUs, BelowNormal priority, Node/Java 768 MiB limits, a 3 GiB enclosing Job limit, and a caller-selected 900,000 ms startup budget. Sampling at two-second intervals can miss short-lived children. Whole-agent token use was not measured, and these are not speedup claims.

The merge through main 75104040d did not change the Ghidra provider, verifier scripts, bridge, configuration, package version, or dependency lock; their hashes match the complete runs. It did change the shared MCP catalog/server implementation, so the affected public file-offset MCP/CLI subworkflow was rerun at 37d0b9112 for both architectures, with all semantic/cleanup assertions passing. The later main commits through efbc486b9 only changed analysis-view, contracts, and Apple keyed-archive code, leaving these inputs unchanged:

  • x64 helper: 612.92 s; 232.66 s sampled CPU; 2,009.80 MiB peak Job commit; 981.15 MiB sampled working set; Job0.
  • x86 helper: 542.24 s; 267.56 s sampled CPU; 2,003.98 MiB peak Job commit; 1,317.85 MiB sampled working set; Job0.

The first exact-head x64 run reached the final mapped-header CLI assertion but returned a transient provider_unavailable instead of the expected semantic error. A separately bounded reproduction of that exact public CLI request returned the expected invalid_request with complete mapping diagnostics in 312.74 s and Job0; one evidence-based full rerun then passed. The failed full attempt also ended with Job0. No assertion or resource bound was weakened.

Earlier actual npm-tarball installation and explicit installed-root x64/x86 package workflows passed on a preceding candidate whose runtime behavior is unchanged outside this verifier helper. Whole EXE completion remains independently blocked by #3204; direct byte-search CLI parity, real Hopper, and non-Windows engines are not claimed here. Complete-run receipts and transient diagnostics are under /tmp/rea-windows-e2e-20261013/results/issue2903-final4bb211c8; exact-head helper receipts are under /tmp/rea-windows-e2e-20261013/results/issue2903-final37d0b9112.

Author readiness

Human owner: @N0zoM1z0

  • 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.

@N0zoM1z0 N0zoM1z0 changed the title fix(test): honor Ghidra startup budgets in file-offset verification fix(test): honor Ghidra startup budgets in Windows verification Oct 14, 2026
@N0zoM1z0
N0zoM1z0 marked this pull request as ready for review October 14, 2026 14:21
@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.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue was identified.

Summary

The PR gives the Windows Ghidra verifier one timeout policy:

  • Windows Ghidra verification now follows the caller’s startup budget.

The earlier request for focused regression tests is addressed. No new actionable issue or security issue was identified. Supersession could not be checked because GitHub access was unavailable. Tests were inspected, not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Environment] --> B[Production configuration parser]
  B --> C[Check combined timer limit]
  C -->|Too large| D[Reject before target access]
  C -->|Within limit| E[Selected startup budget]
  C -->|Within limit| F[Startup plus 240 seconds]
  E --> G[Direct GhidraClient startup]
  F --> H[MCP initialization and tool calls]
  F --> I[Both file-offset CLI calls]
Loading

Reviews (6) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@N0zoM1z0
N0zoM1z0 merged commit d9cd239 into main Oct 14, 2026
71 of 73 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/windows-ghidra-byte-coverage-2903 branch October 14, 2026 19:50
@morluto morluto added area: tests Test suite and verification bug Something isn't working 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

area: tests Test suite and verification bug Something isn't working provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants