Repository navigation
default-on sweep: enable 10 angr structuring/switch flags by default (per-test opt-outs) - #110
Merged
Merged
Conversation
…per-test datatest opt-outs Flip these 10 settables from default-off to default-on (stages.toml + reset_defaults_internal): gotoreduce, crossjumprevert, taildup, dedupitetail, regionlooprefine, ifelseflatten, switchmultipred, tailcalljump, foldcallret, branchflip. 7 of the 10 change 0 datatests. The 3 that do (tailcalljump/foldcallret/branchflip) get per-test opt-outs via an <com>option <flag> off</com> line in the affected datatest scripts so they keep the upstream rendering: make test stays PARITY OK 675/675 with docs/baseline.json UNTOUCHED (opt-out, not re-pin). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…sertions.md - tests/stages: 12 stage testcases pinned the pre-sweep (flags-off) baseline in their pass-1 default decompile; add explicit 'option <flag> off' lines there so those assertions still hold (each pass-2 'option <flag> on' re-enables only the flag under test). docs/baseline-stages.json UNTOUCHED -> PARITY OK 235/235. - regenerate tests/fixtures/stage_catalog.json (the byte-exact catalog) and docs/assertions.md: the 10 flags' 'default' field flips off->on (only those lines change). catalog_bytecompat count test unaffected (65 settables). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…3 default-on flags reset_defaults_internal now sets all 10 flags on; move switch_multi_pred to the default-on assertion block and add the other 9 (tail_call_jumps, region_loop_refine, reduce_return_gotos, flatten_ifelse, revert_cross_jumps, dup_return_call_tails, dedup_ite_tail, fold_call_returns, branch_flip). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
DIV-14 records the ten default-on flags, the per-test datatest opt-outs (with the one-line reason each) and the per-test stage opt-outs, all gates green with both baselines untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…tension
Extends the DIV-14 sweep with four more previously default-off settables flipped
to default-on via the same three-place flip (stages.toml default="on" +
reset_defaults_internal + seam copy where one exists): stackguard,
noreturn_extern, noreturn_propagate, switchsharedcase. DIV-14 now covers 14 flags.
Three of the four REMOVE CODE from the emitted decompilation; per the user's ask
for downstream-LLM visibility, each one's catalog `summary` is prefixed
"REMOVES CODE:" (surfaced by `kuna catalog --json`):
- stackguard: strips the -fstack-protector canary epilogue.
- noreturn_extern: marks a matched extern call no-return, dropping the
post-call fall-through.
- noreturn_propagate: propagates no-return through the call graph, dropping
unreachable code after no-return calls.
switchsharedcase's summary notes it is slower on the functions whose switch it
recovers (kept on for quality).
Per-test opt-outs (NOT a baseline re-pin; docs/baseline.json + baseline-stages.json
UNTOUCHED):
- Datatest: only stackguard changes the corpus -> `option stackguard off` at
the top of tests/datatests/partialsplit.xml (Partial splitting #1/#2).
noreturn_extern/noreturn_propagate/switchsharedcase change 0 datatests.
- Stages: switchsharedcase-b2sum.xml (switchsharedcase off pass-1),
ghangr-incorrect-duplication-chcon-a0e113.xml (noreturn_extern off pass-1,
same name list/seam as the existing noreturn_externmatch off),
ghangr-x8664-cvs-863633.xml (stackguard off — canary strip changed the 0x3c
decl count).
Gates: make test PARITY OK 675/675, make test-stages PARITY OK 235/235,
make rust-test green (updated kuna_anchor_flags for the 4 new default-on fields;
fixed two kuna-console e2e tests whose OFF/Disc baselines now needed the
now-default-on noreturn_extern / noreturn_propagate explicitly disabled to
isolate the behaviour under test). kuna catalog --check OK; regenerated
stage_catalog.json fixture + docs/assertions.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jul 29, 2026
[PROPOSAL] angr-morton-my-message-callback-bfd2fa: SAILR-style goto-reduction (tail duplication)
#54
Closed
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.
Summary
User-directed "enable good flags by default" sweep. Flips ten previously default-off,
angr-derived settables to default-on in one group, using the per-testcase opt-out
mechanism (NOT a baseline re-pin) for the datatests they change:
gotoreduce,crossjumprevert,taildup,dedupitetail,regionlooprefine,ifelseflatten,switchmultipred,tailcalljump,foldcallret,branchflip.These are the SAILR/Phoenix goto-reduction passes (return-tail / cross-jump / return-call-tail
duplication + ITE-tail dedup + irreducible-loop refinement + guard-clause flattening), the
multi-predecessor unrolled-guard jump-table recovery, -O2 tail-call-jump recovery, call-return
expression folding, and negated-guard branch flipping — the angr readability layer that each
previously shipped opt-in behind
option <flag> on.option <flag> offstill restores thepre-flag (Ghidra/upstream) rendering per decompilation.
Mechanism
For each flag:
default = "on"instages.tomlAND the liveArchitecturefield set on inreset_defaults_internal(infra/architecture.rs). Nine are carried into the per-function seamin
build_arch_handle;tail_call_jumpsis read directly at the S2 flow seam. No CFG/SSA/typechange.
Per-test opt-outs (no baseline re-pin)
Seven of the ten change 0 datatests. The three that do are kept at parity by a single
<com>option <flag> off</com>line in each affected datatest's<script>(with a one-line XMLcomment explaining why).
docs/baseline.jsonis UNTOUCHED:tailcalljump→longdouble.xml(Long double ite-region-converter-missing-5db28e: strip -fstack-protector canary e… #1/Port to Rust #2)foldcallret→deindirect2.xml,inline.xml,varcross.xml,condconstsub.xml(Deindirect Output ite-region-converter-missing-5db28e: strip -fstack-protector canary e… #1, Inlining Perf/actionpool cursor #8, Local cross Port to Rust #2, Modified conditional constant Port to Rust #2/cleanup: Rust-first restructure + terminology refresh #3)
branchflip→bitfields.xml,bitfields2.xml,condexesub.xml,copytrim.xml,elseif.xml,forloop_varused.xml(Bitfields Analysis-tier: cross-arch _start→main idiom (AArch64/ARM/RISC-V) #19, MIPS Bitfields Analysis-tier: cross-arch _start→main idiom (AArch64/ARM/RISC-V) #19, Conditional Add ite-region-converter-missing-5db28e: strip -fstack-protector canary e… #1/cleanup: Rust-first restructure + terminology refresh #3,Copy trim Render unknown types as real C types (realtypes, DIV-6) #6/Fix test stages #7, Else-if ite-region-converter-missing-5db28e: strip -fstack-protector canary e… #1/Port to Rust #2/cleanup: Rust-first restructure + terminology refresh #3/Recover PLT/GOT import names in ELF decompilation #4/Stage reorg #5/Render unknown types as real C types (realtypes, DIV-6) #6/docs: exhaustive remaining-analyzer backlog (eventually do them all) #11/Analysis-tier: AArch64 PLT import-name e2e (linked fixture) #14, For-loop var used Port to Rust #2)
Twelve
tests/stages/testcases that assert the pre-sweep (flags-off) baseline in their pass-1default decompile each get an explicit
option <flag> offin that pass;docs/baseline-stages.jsonuntouched.
Gates (all green, both baselines untouched)
make test— PARITY OK 675/675 (via opt-outs only)make test-stages— PARITY OK 235/235make rust-test— green (updated thekuna_anchor_flagsunit test for the ten default-on fields)stage_catalog.json) anddocs/assertions.md(only the ten
defaultfields flipoff→on);kuna catalog --checkOKdocs/divergences.md+ adocs/PROGRESS.mdentryEvery datatest failure was exactly the documented mapping — no flag misbehaved or changed more
datatests than expected.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PBrckq3YYAzBLq5k4KpWac