feat(decompiler): add DecompileBudget to the v1 request schema (#35-2)#229
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #228.
First slice of Rec 35 (bounded decompilation). Adds an optional
DecompileBudgettable to the FlatBuffersDecompileFunctionRequestcarrying the five per-function caps from
DECOMPILER_BUDGETS.md— eachdefaulted in the schema so an absent budget reads back as the
defaults rather than zero-by-omission:
wall_clock_mswall_clock_hard_msrss_max_mbpcode_op_limititeration_limit_per_passWhat changed
decompile.fbs: newDecompileBudgettable (define-before-use) + anoptional
budgetfield onDecompileFunctionRequest.Java v25.2.10 — so each language's
FLATBUFFERS_VERSIONstatic_assertstays satisfied against its vendored runtime. New generated
ghidra.ipc.DecompileBudget(Java) + updateddecompile_generated.hand
DecompileFunctionRequest.java.schema/ipc_request_codec.h:DecompileBudgetV1nativeview + optional encode/decode (
decodereadsreq->budget(); absentleaves the struct defaults). The generated
Verifyrecurses into thesub-table, so a malformed budget is rejected by the same
verify-before-read contract.
DecompileRequestCodec: budget-carryingencodeRequestoverload; 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
decomp_test_dbg: full suite 677/677, including newipc_codec_budget_roundtrip,ipc_codec_budget_absent_defaults,ipc_codec_budget_default_values_roundtrip, and the unchangedschema_fb_*round-trips.gradle :Decompiler:testforDecompileRequestCodecTest(+
CommandRequestCodecTest): BUILD SUCCESSFUL, including newtestBudgetRoundtrip,testAbsentBudgetReadsNull,testBudgetDefaultValuesReadBack.gradle :cppRaiiAudit: 228 protected files clean.Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/