* fix(ghidra): reuse completed decompiles and decompile code outside functions * perf(ghidra): decompile upcoming export functions in parallel * fix(ghidra): say what the procedure inventory omits and how to reach it * fix(ghidra): say when a file offset maps to code outside every function A file-offset selector that mapped to disassembled code without a function failed with advice to choose an inventory procedure, which cannot name that code. The failure now states the fact and that procedure_pseudo_code can decompile it by the mapped analysis address. One predicate now decides that an address holds code outside every function for the address, file-offset and procedure_not_found paths, and the bridge imports UndefinedFunction and SoftReference like its other dependencies. * fix(ghidra): scope decompile read-ahead to the operation it prepares The bridge ran the read-ahead window in the generic serve loop, before the ping, analysis-incomplete and read-only checks and for any method that carried the field. It now runs only for procedure_pseudo_code, after those checks. The pool state sits with the other decompiler fields and its Ghidra types are imported. The export tests now cover consecutive windows, a limit that ends inside a window and a window whose first function sends no decompile request. The provider guide states that a function failing or timing out inside a window is attempted again by its own request, and how long the pool lives. * fix(ghidra): decompile code outside functions selected by file offset A file offset names the same location as its mapped analysis address, but an offset that mapped to code Ghidra disassembled without a function was refused while the address decompiled. The offset now resolves through the same on-the-fly UndefinedFunction path and limitation, and its selection reports the inferred entry as procedure_address. The refusal that sent the caller back to the address form is removed. * fix(ghidra): bound decompile read-ahead by the carrying request's deadline A request that carried a read-ahead window waited for every function in it, then decompiled its own function again when the window's attempt failed or timed out, so one configured deadline could elapse twice. That request now waits only within its own deadline, consumes the window's outcome for its function whatever it is, and cancels siblings still running once it has its result and the deadline has passed; they stay uncached for their own requests. The hint is advisory, so selectors past one window are now ignored instead of refusing the request. Pooled decompilers run on a private thread pool rather than resizing Ghidra's shared "Parallel Decompiler" pool, and are released after 30 seconds without a window. * test(ghidra): cover read-ahead deadline and hint clamp on real Ghidra The decompiler failure probe now injects a read-ahead window whose carrying function times out beside a sibling that never finishes. It checks that the request reports the timeout without decompiling again, waits only within its deadline, leaves the cancelled sibling uncached, uses REA's own thread pool, and that a longer hint is clamped to one window. The probe no longer ran against the current bridge: it used a removed three-argument Request constructor, expected the old timeout and failure wording, and injected decompilers that completed-result reuse never called. It now builds full requests, matches the current messages by prefix and clears reused results before each injection. * fix(ghidra): keep reused decompiles across reads without decompiler options A request that omits decompile_max_payload_mib now leaves the session's payload limit unchanged instead of resetting it to the Ghidra default, so an instruction or metadata read no longer discards completed decompiles. An explicit null still selects the installed default. Boundary limitations for a reused decompile of code outside every function now use the function the decompile widened, not a fresh entry-only UndefinedFunction. * docs(ghidra): state what an omitted decompiler payload option means * fix(decompile-all): plan read-ahead from the decision the export loop makes The read-ahead window decided which functions would be requested from journal history alone. A journaled write whose file was later deleted is requested again, and file problems spend the caller's limit, so a resume could prepare functions outside its limit while the ones it requested got no preparation. Each function is now decided once by the same check the loop uses. The window keeps those decisions for the loop, counts every attempt against the limit, and names only functions that will be decompiled. * test(ghidra): cover payload-option omission and reused undefined-function bodies * fix(decompile-all): start each read-ahead hint at the function that sends it A function the window named first could send no decompile request, for example when procedure_info classifies it as external, so the next request sent a hint headed by that function. A provider reads the head as the carrying request's own function, so the bridge could not keep that request's window result and might decompile it again. The request now takes the planned window from its own function on.
Ghidra conformance corpus
These source-owned fixtures are compiled at verification time; generated binaries and Ghidra projects are never committed.
For the one-shot function bundle handoff, run npm run build:cached and then
node scripts/verify-real-ghidra-function-bundle.mjs with GHIDRA_INSTALL_DIR
and JAVA_HOME set. The verifier compiles its own target, creates a project
with a synthetic history report, and exercises complete, summary, and
no-overwrite CLI delivery. It checks the target and project files for changes.
-
../c/riscv.candriscv-probe.Sproduce source-owned RV32/RV64 ELF images with double-float ABI declarations and an independently known instruction.../c/riscv-float-abi.c,riscv-probe.Sandriscv-isa-probe.Sproduce typed and stripped RV32 ilp32 and ilp32f images whose calls cover every rule of the ilp32 and ilp32f policies, and an ilp32f image the bridge must refuse;riscv-checks.mjsholds each policy's expected storage and the call-site oracle.npm run verify:ghidra:riscvexercises real CLI/MCP discovery, decompilation, argument storage, output schemas, profile and snapshot identity, admission and refusal diagnostics, immutable source bytes, and owned cleanup. It requires BYO Ghidra 12.2/JDK 25+ and RISC-V Clang/LLD/LLVM readelf/LLVM objdump;REA_RISCV_CLANG,REA_RISCV_LLD,REA_RISCV_READELFandREA_RISCV_OBJDUMPselect existing tool commands. -
../c/ppc64.candppc64-probe.Sproduce source-owned ELFv2 PPC64 executables in both byte orders, with TOC-using functions that have separate global and local entries and a VSX instruction only Power ISA languages decode.npm run verify:ghidra:ppc64exercises real CLI/MCP discovery, decompilation, the bound language, instruction bytes in file byte order, ELFv2 entry thunks, snapshot identity and shared-object refusal. It requires BYO Ghidra 12.2/JDK 25+, PowerPC Clang/LLD and GNU readelf;REA_PPC_CLANGandREA_PPC_READELFselect existing tool commands. -
ReaInstructionContextProbe.javainspects source-owned ARM, Thumb, MIPS32 and MIPS16 instructions through the production bridge in an ephemeral, read-only Ghidra project. It checks exact decoder-context register names, values and provenance; the ARM lane also injects an unavailable provider value. Theghidra-bridge-sourcesCI job runs both processor families. The input bytes are never executed. -
ReaDecodeProbe.javadecodes source-owned instruction bytes from a language's default context and checks each mnemonic, length and optional complete operand. Theghidra-bridge-sourcesCI job runs it forARM:LE:32:Cortex,ARM:LE:32:v8-mandXtensa:LE:32:default; the bytes are never executed. -
ReaComputedCallCoverageProbe.javadecodes source-owned x86-64 calls through a writable slot, a register and a direct target, injects only the slot call's recordedCOMPUTED_CALLtarget, and reads callees through the production bridge. The recorded target stays an observed callee while callee coverage ispartialand names the call site; the targetless call stayspartialwithout that candidate limitation, and the direct call stayscomplete. Theghidra-bridge-sourcesCI job runs it; the bytes are never executed. It does not establish which references Ghidra's own analysis records for other slot shapes. -
inventory.cproduces separate x86-64 debug and stripped ELF executables. It covers imports, an externalputsfunction, linker thunks, source symbols, direct calls, a targetless callback call, two referenced strings, and a multi-block branch. -
entry-aliases.cpreserves secondary imported entry labels, a bare-hex alias, and an interior label. The native CLI/MCP lane verifies entry selection, procedure search and feature tracing by the secondary name, annotation, interior-label rejection, and unchanged source bytes. -
cross-format.cis freestanding so the verifier can produce AArch64 ELF, x86-64 PE, and x86-64 Mach-O targets from the same semantics. It preserves an exported entry, direct and indirect calls, a volatile string reference, and a multi-block branch across loaders. -
relocation-symbol.cbuilds an x86-64 ELF with named and unnamed dynamic relocations. The cross-format verifier checks their Ghidra observations through the public CLI without executing the artifact. -
no-return.candReaNoReturnProbe.javainject incorrect import flags into a real ELF or Mach-O analysis database, verify caller recovery, propagated flag repair and signature preservation, and retain genuine/unknown no-return calls and independently identified entries. Runnpm run build:cached, thennode scripts/verify-real-ghidra-noreturn.mjswith the Ghidra/JDK environment below on Linux or macOS x64/arm64. On Linux, use a procps-compatible process table that exposes REA's current process for owned cleanup. It also checks named limitations through the real read-only TCP bridge and provider Evidence projection; default Unix-socket transport, Windows, and the reported Amethyst artifact need separate verification. Fixture target code is never executed. -
ReaDecompilerFailureProbe.javareplaces the bridge decompiler after a real import ofcross-format.c, so one function's decompilation fails. It checks thatanalyze_functionstill returns that function's assembly, callers, callees, references and basic blocks unchanged, marks pseudocode, native API and p-code value flow unavailable with the decompiler's reason, and that cancellation still ends the request. It also injects a read-ahead window whose carrying function times out beside a sibling that never finishes, and checks that the request reports that timeout without decompiling again, waits only within its own deadline, leaves the cancelled sibling uncached, uses REA's own thread pool, and clamps a longer hint to one window. It checks that a read without decompiler options keeps the configured payload limit and completed decompiles while an explicitnullrestores the Ghidra default, and that a repeated decompile of code outside every function keeps the body Ghidra widened. Runnpm run build:cached, thennode scripts/verify-real-ghidra-decompiler-failure.mjson Linux or macOS x64/arm64. The lane also parses the degraded dossier with REA's Ghidra output contract and checks the healthy provider path through the real read-only TCP bridge. Decompiler failure marks only that observation as live: retain its Evidence, retry after backend recovery, and keep healthy dossier snapshot reuse. The injection does not establish which natural inputs make the decompiler fail. -
node scripts/verify-real-ghidra-decompile-timeout.mjs(afternpm run build:cached, Linux or macOS x64/arm64) compiles a generated shared library whoserea_slowfunction has thousands of branches and analyzes it withREA_GHIDRA_DECOMPILE_TIMEOUT_SECONDS=1through the real read-only TCP provider. Ghidra's own decompiler stops at the limit with no injection:analyze_functionreturns the listing facets with pseudocode unavailable and a live cache policy,procedure_pseudo_codefails with a message naming the setting, and the same session then decompilesrea_small. SetREA_DECOMPILE_TIMEOUT_BRANCHESto change the fixture size. The verifier budgets 1 MiB for generated C source and derives the maximum branch count from the worst-case line size before allocating the source. Larger or invalid counts are rejected before installation inspection or compilation. -
loader-relocation.c,loader-relocation-provider.candReaLoaderRelocationProbe.javaexercise the productionReaGhidraBridgeagainst a real imported Linux full-RELRO PIE ELF and a small shared library. The fixture's.data.rel.ropointer is populated by an importer-created relocation. The probe proves that theET_DYNprogram is marked relocatable by Ghidra but is still protected, checks the relocation byte range and read/write reference handling, and compares baseline/protected pseudocode. It also checks that a-fno-pltGOT caller retains identical pseudocode when its relocation blocks become volatile. SourceFileBytesand block permissions must remain unchanged.npm run verify:ghidra:loader-relocationrequires Linux, BYO Ghidra/JDK with its native decompiler, and a C compiler; the fixture is never executed.
scripts/verify-real-ghidra.mjs uses cc, clang, and lld-link by default;
REA_CC, REA_CLANG, and REA_LLD_LINK can select alternate commands. The
verifier requires the verified bring-your-own Ghidra 12.2 installation through
GHIDRA_INSTALL_DIR and validates header classification before starting the
provider. Provider admission accepts other 12.x (>=12.2) builds with an unverified-build limitation; this lane does
not.
Conformance compares semantic facts: provider/profile identity, function classification, resolved call edges, typed references, strings/xrefs, and CFG topology. It only requires provider pseudocode and assembly to be non-empty, bounded, and address-bearing; it never compares their text with Hopper. The callback fixture also proves that an unresolved targetless flow is not silently promoted to a direct callee. Every target runs in a separate owned project and must leave no process, socket, project, or runtime root after close.
relative-switch-signed.S covers signed halfword offsets, the CBZ zero-entry
route, and selector biases of 0, 2 and 10 in the AArch64 jump-table lane. The
nonzero biases exercise overlapping and disjoint typed label/index ranges. REA
retains Ghidra's typed labels when the compared selector has an earlier register
definition; additional labels remain unknown until their relationship to the
typed switch selector can be proved. The oracle rejects extra numeric labels
and verifies each retained target against the source instruction immediate.