Files
reverse-engineering-anything/tests/conformance
morluto 06fa8d0634 perf(ghidra): decompile upcoming export functions in parallel (#14847)
* 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.
2026-11-27 10:39:26 +00:00
..

Source-built conformance fixtures

These sources are deliberately small semantic oracles for REA providers. Run npm run verify:fixtures on macOS or Linux to compile them into the ignored build/conformance/ directory, emit a hash-and-toolchain manifest, and verify their platform-native symbols and strings with local command-line tools. The portable C, version, and large-inventory fixtures build as Mach-O on macOS and ELF on Linux; Objective-C, Swift, and N-API-like fixtures remain macOS-only.

Only source files are versioned. Generated binaries, generated large-fixture source, debug information, and manifests must remain under build/.

ghidra/inventory.c is also compiled into temporary Linux ELF debug and stripped variants by npm run verify:ghidra. It fixes local functions, external puts linkage, defined strings, and writable/executable memory needed to prove the read-only Ghidra inventory contracts without committing a binary.

scripts/create-ghidra-windows-fixture.mjs separately emits a deterministic, ignored native x86-64 PE application for the controlled Windows Ghidra P0 lane. The generator and fixed SHA-256 are versioned; the .exe is never committed or executed. npm run verify:ghidra:windows uses it to verify the admitted read-only operation inventory, digest linkage, transport, and cleanup on the self-hosted real-Ghidra runner.

The C fixture fixes a known call chain and strings. The version pair fixes an added symbol, changed string, and changed call relationship. The generated large fixture contains 1,205 uniquely named functions and strings to verify that providers return complete inventories. Objective-C, Swift, and N-API-like fixtures provide metadata-oriented inputs without package or network dependencies.

readiness/ adds source-only generated JavaScript CLI and Electron fixtures for the repository's reconstruction-readiness verifier. npm run verify:readiness inspects the compiled native fixture through CLI and checks JavaScript/Electron static-analysis Evidence identity through CLI and MCP. It does not execute the fixture applications. The development-owned evaluator under readiness/report/ separately checks synthetic report conformance; its nine stages do not describe observed runtime journeys. The report keeps these scopes separate as documented in docs/development/reconstruction-readiness.md.