Repository navigation
[AUTOMATED] Report the bytes each decompiled function decodes, and the binary's code coverage - #1959
Conversation
…overage [AUTOMATED] The flow keeps the extents of every instruction it decodes on the function (`Funcdata::flow_ranges`), delay slots included. A function's JSON record lists them as `ranges`, in the units of `address`. A whole-binary `decompile-all --json` run carries a `coverage` object: the image's executable bytes, the parts decoded and decompiled, and the NUL bytes nothing decoded, which the shares leave out of their total. A whole-binary project export's completion line ends with the two shares. `--omit ranges` drops the records' key. The ranges ride the `--jobs` wire and the result store (KUNAJOBRES13).
…ort counts The docs now say that a callee folded onto its call (no branch or call of its own) adds no ranges, that two records' ranges can overlap and coverage counts such a byte once, that a triage filter dropping nothing still measures the whole binary, and that non-NUL fill (x86 NOPs and INT3s) and data in code stay in the share's total. The pinned wire-layout test is renamed for version 13. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
|
[AUTOMATED] Pushed 872215d, on top of ca4c9f9: the run-level
|
[AUTOMATED] A one-function image's `kuna decompile --json` and its whole-binary `decompile-all --json` are one document (mapped_flow_boundary), so the run-level `coverage` object is opt-in: `decompile-all --json --coverage`. It is refused with --functions or --addr, and fails a run whose triage filter drops a function. Without the flag a document gains only each record's `ranges`.
|
[AUTOMATED] Pushed ca4c9f9 on top of 807a3b0: docs and a test name only, no code change. |
A function's
sizeis an upper bound that runs on through the padding to the next entry, and nothing says how much of a binary's code a whole-binary run decoded. After this change, each record lists the bytes its decompile decoded, and a whole-binary run can say what share of the executable bytes that is.visitedmap on theFuncdata(flow::decoded_ranges,Funcdata::flow_ranges).FuncResult::rangescarries the ranges in the units ofaddress, also for a function whose C failed to render. They travel over the--jobswire and through the result store (KUNAJOBRES13).kuna_coverage::Codekeeps one bit per executable byte (is it NUL?), so a--jobsparent can measure after it drops its program. It reads the CODE spansfuncextent::spansuses. NUL bytes that nothing decoded (alignment fill, zero-filled tails) are left out of the share's total.ranges;--omit rangesdrops it for a caller who wants the document small.coverageis opt-in.decompile-all --json --coverageadds it. It measures the whole binary, so it is refused with--functionsor--addr, and fails a run whose triage filter drops a function. Without the flag, a document is unchanged apart fromranges, sodecompile --jsonanddecompile-all --jsonstill answer a one-function image with the same document.fauxware,rust_fmt_pieces_1.90.0andmcount_x86_64are byte-identical to main's.Tests:
coverage_clichecks the run's figures against fauxware's sections and NUL bytes, read withobject. It also checks:main's ranges equal its symbol's extent, as do MIPSmain's (whose last 4 bytes are the delay slot ofjr $ra);thumb_helper's ranges, at its even address;--omit ranges, the refusal of a narrowed--coverage(and a no-op filter still measuring), and that--jobs 2reports what a serial run does;Speed,
decompile-all --json --coverage(ranges and the measure) at the test profile, median of alternating runs against main:rust_fmt_pieces_1.90.0(572 functions) 87.6 s → 88.4 s (+0.9%),mcount_x86_64(1,074 functions) 73.3 s → 74.3 s (+1.4%). Both are within this machine's run-to-run spread of ±10%.Model:
anthropic/claude-opus-5-5