Skip to content

feat(decompiler): Rec 34 #34-5b — extend v1 response codec with the pcode body#217

Merged
CryptoJones merged 1 commit into
masterfrom
feat/34-5b-response-pcode-body
May 31, 2026
Merged

feat(decompiler): Rec 34 #34-5b — extend v1 response codec with the pcode body#217
CryptoJones merged 1 commit into
masterfrom
feat/34-5b-response-pcode-body

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #216.

Increment 2 of the Rec 34 response path (#34-5b): extend the worker-side response codec additively from the #34-5a envelope to carry DecompileFunctionResponse.pcode — the PcodeOp array.

What

  • schema/ipc_response_codec.hDecompileResponseV1 gains VarnodeV1 / PcodeOpV1 views and a pcode list; encode/decode walk it.
  • Each PcodeOp: opcode, sequence number, optional output Varnode, inputs Varnode list.
  • PcodeOpV1.has_output distinguishes "no output varnode" from a zero-valued one — encode emits no output table when false, decode reports presence — so the schema's optional-table semantics survive instead of fabricating a varnode.

Scope

The high_function tree (HighFunction/HighSymbol/DataType/Storage) is still deferred to #34-5c; a response encoded here leaves high_function unset and decode does not touch it. Test-only and inert: nothing in the production decompiler includes the codec yet — command-loop wiring deferred per DD-0005.

Test plan

  • make decomp_test_dbg — clean compile, no warnings on the new TU
  • 3 new pcode tests + the 6 envelope tests pass; full unit suite 276/276
  • scripts/local-precheck.sh --full — 677/677 datatests, OK

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

Grow the worker-side response codec additively from the #34-5a envelope to
carry DecompileFunctionResponse.pcode — the PcodeOp array. Each op carries an
opcode, a sequence number, an optional output Varnode, and an inputs Varnode
list.

schema/ipc_response_codec.h gains VarnodeV1 / PcodeOpV1 native views and
extends encode/decode to walk the pcode vector. The schema's output is an
optional table, so PcodeOpV1.has_output distinguishes "no output varnode"
from a zero-valued one; encode emits no output table when has_output is false
and decode reports has_output from the table's presence, preserving the
optional-table semantics rather than fabricating a varnode. Varnode is a flat
leaf table; inputs round-trips in order, empty list included.

testipc_response_codec.cc adds three cases — an op with an output and
multiple inputs, an op with no output, and multiple ops including one with
empty inputs — bringing the unit suite to 276 tests, all green.

The HighFunction/HighSymbol/DataType/Storage tree is still deferred to
#34-5c; a response encoded here leaves high_function unset and decode does
not touch it. Test-only and inert: nothing in the production decompiler
includes the codec yet — the command-loop wiring is the end-to-end-only
change deferred per DD-0005.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit f352dc6 into master May 31, 2026
16 checks passed
@CryptoJones CryptoJones deleted the feat/34-5b-response-pcode-body branch May 31, 2026 21:03
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 34 #34-5b: extend v1 response codec with the pcode body (PcodeOp/Varnode)

1 participant