feat(decompiler): Rec 34 #34-6c — host-side v1 request encoders for the six non-DecompileAt commands#225
Merged
Conversation
…pileAt commands (#34-6c) Java half of #34-6, mirroring DecompileRequestCodec (#34-4). A new CommandRequestCodec provides one static encoder per command — RegisterProgram, DeregisterProgram, FlushNative, StructureGraph, SetAction, and SetOptions — each building the v1 FlatBuffers payload the C++ worker decodes (#34-6a/#34-6b). Encode-only: in the protocol the host writes requests and the worker reads them, and the vendored flatbuffers-java bindings are generated without a verifier, so a host-side decoder would have no production caller and could not safely reject a malformed buffer anyway (the worker's verified decode is covered by the C++ test*ipc_*codec.cc). None of these tables is the schema root_type (only DecompileFunctionRequest is), so the generic FlatBufferBuilder.finish(int) roots the buffer rather than a generated finish*Buffer helper. A null argument leaves its field unset (read back as null), distinct from a present-but-empty string. A new fast-suite test (CommandRequestCodecTest) reads each payload back with the generated accessors to pin the round-trip and the null-vs-empty contract. Test-only and inert, like the rest of #34-4..#34-6: nothing in DecompileProcess calls this 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>
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 #224.
The Java half of
#34-6, mirroringDecompileRequestCodec(#34-4): a newCommandRequestCodecprovides one static encoder per non-DecompileAtcommand—
RegisterProgram,DeregisterProgram,FlushNative,StructureGraph,SetAction,SetOptions— each building the v1 FlatBuffers payload the C++worker decodes (
#34-6a/#34-6b). With this, the request-encode/decode pairexists end-to-end for every command in the schema.
Encode-only. In the protocol the host writes requests and the worker reads
them, and the vendored flatbuffers-java bindings are generated without a
verifier, so a host-side decoder would have no production caller and could not
safely reject a malformed buffer anyway (the worker's verified decode is covered
by the C++
testipc_lifecycle_codec.cc/testipc_config_codec.cc).Wire details. None of these tables is the schema
root_type(onlyDecompileFunctionRequestis), so the genericFlatBufferBuilder.finish(int)roots the buffer rather than a generated
finish*Bufferhelper. Anullargument leaves its field unset (read back as null), distinct from a
present-but-empty string.
Test-only and inert. Nothing in
DecompileProcesscalls this yet — thecommand-loop wiring is the end-to-end-only change deferred per DD-0005.
Test plan
gradle :Decompiler:testgreen locally (JDK 21,--no-configuration-cache)CommandRequestCodecTest(14 tests) passes: round-trip + null-vs-empty for all six commandsDecompileRequestCodecTeststill green (no regression)Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/