Skip to content

feat(decompiler): add DecompileBudget to the v1 request schema (#35-2)#229

Merged
CryptoJones merged 2 commits into
masterfrom
feat/rec35-2-budget-schema
Jun 1, 2026
Merged

feat(decompiler): add DecompileBudget to the v1 request schema (#35-2)#229
CryptoJones merged 2 commits into
masterfrom
feat/rec35-2-budget-schema

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #228.

First slice of Rec 35 (bounded decompilation). Adds an optional
DecompileBudget table to the FlatBuffers DecompileFunctionRequest
carrying the five per-function caps from
DECOMPILER_BUDGETS.md — each
defaulted in the schema so an absent budget reads back as the
defaults rather than zero-by-omission:

Field Default
wall_clock_ms 30000
wall_clock_hard_ms 60000
rss_max_mb 4096
pcode_op_limit 1000000
iteration_limit_per_pass 100

What changed

  • decompile.fbs: new DecompileBudget table (define-before-use) + an
    optional budget field on DecompileFunctionRequest.
  • Regenerated bindings with the version-matched flatc — C++ v25.12.19,
    Java v25.2.10 — so each language's FLATBUFFERS_VERSION static_assert
    stays satisfied against its vendored runtime. New generated
    ghidra.ipc.DecompileBudget (Java) + updated decompile_generated.h
    and DecompileFunctionRequest.java.
  • Worker codec schema/ipc_request_codec.h: DecompileBudgetV1 native
    view + optional encode/decode (decode reads req->budget(); absent
    leaves the struct defaults). The generated Verify recurses into the
    sub-table, so a malformed budget is rejected by the same
    verify-before-read contract.
  • Host codec DecompileRequestCodec: budget-carrying encodeRequest
    overload; the existing four-arg overload leaves the budget unset.

Schema/codec only — nothing reads the budget into the analysis loop yet
(that is #35-3).

Test plan

  • C++ decomp_test_dbg: full suite 677/677, including new
    ipc_codec_budget_roundtrip, ipc_codec_budget_absent_defaults,
    ipc_codec_budget_default_values_roundtrip, and the unchanged
    schema_fb_* round-trips.
  • Java gradle :Decompiler:test for DecompileRequestCodecTest
    (+ CommandRequestCodecTest): BUILD SUCCESSFUL, including new
    testBudgetRoundtrip, testAbsentBudgetReadsNull,
    testBudgetDefaultValuesReadBack.
  • gradle :cppRaiiAudit: 228 protected files clean.

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

CryptoJones and others added 2 commits June 1, 2026 01:05
First slice of Rec 35 (bounded decompilation). Adds an optional
DecompileBudget table to DecompileFunctionRequest carrying the five
per-function caps from docs/decompiler/DECOMPILER_BUDGETS.md:
wall_clock_ms (30000), wall_clock_hard_ms (60000), rss_max_mb (4096),
pcode_op_limit (1000000), iteration_limit_per_pass (100). Each cap is
defaulted in the schema, so an absent budget sub-table reads back as the
defaults rather than zero-by-omission.

Bindings regenerated with the version-matched flatc — C++ v25.12.19
(matching the vendored headers) and Java v25.2.10 (matching the vendored
jar); the FLATBUFFERS_VERSION static_assert pins each language to its
runtime. The worker codec schema/ipc_request_codec.h gains a
DecompileBudgetV1 native view plus optional encode/decode of the
sub-table, and the host DecompileRequestCodec gains a budget-carrying
encodeRequest overload (the four-arg overload leaves the budget unset).
The generated Verify recurses into the sub-table, so a malformed budget
is rejected by the same verify-before-read contract as the rest of the
request.

Schema/codec only: nothing reads the budget into the analysis loop yet
(that is #35-3). Covered by new round-trip and absent-defaults tests on
both sides (testipc_codec.cc, DecompileRequestCodecTest).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The new flatc-generated ghidra.ipc.DecompileBudget binding has no license
header, so the :Decompiler:ip audit (part of buildGhidra) rejected it with
"No IP found ... in module" and failed Build Ghidra on all three
platforms. Add its certification.manifest entry as GHIDRA-owned, matching
the 25 sibling ghidra.ipc.* generated files registered in #34-3.

Schema/codec content unchanged; this only adds the IP attribution the
audit requires. Verified locally with `gradle :Decompiler:ip` green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 6768246 into master Jun 1, 2026
16 checks passed
@CryptoJones CryptoJones deleted the feat/rec35-2-budget-schema branch June 1, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rec 35 (#35-2): add DecompileBudget to the v1 request schema

1 participant