Repository navigation
[AUTOMATED] feat(p4): decompile callees first and type call-site arguments from the callee's recovered prototype (protoorder) - #669
Conversation
24f612d to
474ba00
Compare
|
[AUTOMATED] Review round 2 — every required change, with what it cost. 1. "Add a guard that can actually fire on stripped input." Two, both from the Partly refuted: the forwarding thunk cannot be declined from this evidence. A 2. "Never let a park REDUCE the argument count." Structural, not a rule: the Deleted-argument count as a first-class number, twelve binaries, 44,772 3. "Replace the tautological arity statistic." Gone. New instrument
4. Catalog row. Rewritten; it stated rejected arm A. 5. Caller-side metric. Item 3. 6. Speed. Interleaved min-of-11, large call graphs included: +1.2% kmod, 7. Spec + hunks. One thing your round did not ask about, found while checking the witness. Rebased onto |
|
[AUTOMATED] Round 3 — the blocker is fixed in code, not in prose. 1. WRONG OUTPUT (blocker) — fixed. The trim had the burden of proof $ kuna decompile-all .../O2/findutils/stripped/find --reachable-from 0x24720 --option protoorder on
v2 = setfilecon(v4,a2); # was setfilecon(v4)
if (sub_24230(v8)) # was sub_24230((int *)v9,v10,v11)
2. Spec invariant (major) — deleted. 3. Residual characterisation (major) — re-stated with the split. All 11 sites One more measure, since the 4. Regression pin (required) — added. The fixture grows 5. Inert surfaces (minor) — they say so now. 6. 7. Body (minor) — rewritten. Three sections, 78 lines, repro first, the Two things I did not do. I did not gate the park behind an arity ceiling — Gates on the rebased tree: 🤖 Generated with Claude Code |
|
[AUTOMATED] Round 4 — every required change, and one refutation. 1. The register-file-saturating variadic — closed in code, option (b). Your 25-line repro is in the bundle ( Cost: 46 perfect on the campaign typesweep (+151 → +105) and 25 on 2 and 3. Re-measured, and the metric's blindness is where the number is.
x86-64 userland is a win by every column, I did not fix the ARM case, and the PR says so. The mechanism is not the 4. 5. 6. The string row was a cast artifact, as you said. On the info item: agreed, and the proposal already trades the 2/2/2 witness Gates, all re-run on this tree: Still a |
70518e0 to
e69eab1
Compare
18b0173 to
1b03942
Compare
|
Round 5 replaces the design the first four rounds measured, because that design could not What changed. The option is now The arity counters, 22 binaries / 14,142 functions:
And it scores better than the locking design did: 444-slice The three review points from earlier rounds:
The 42 worse
|
9527491 to
0560fcf
Compare
fd698ad to
56e61ac
Compare
…call-site arguments from the callee's recovered prototype Squash of the protoorder branch (rounds 1-11) before rebasing onto main d96e340. Round 11: a pointer vote is refused where the caller's loads and stores disagree with a float or composite pointee (an access or address outside it, across or inside members, a step of other than one element, a pointer member's own pointee, sibling loads of the same field, integer bits moved through a float member); a float type never lands on a caller parameter in a register the convention would not give a float; a NaN constant never takes a float vote. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…arbyte (223) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…96e340 (charbyte): off==main 60/60, same classes, arity and typesweep Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…e 60-binary re-measure found Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…hin +5%) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…, stages 1177/1177, cli 202/202, rust-test 7,234/0) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…e caller stores a wider constant through A vote whose pointee is a non-character integer, bool or pointer is refused when the caller stores a constant wider than it through the pointer at a fixed place or a record stride: SplitDatatype printed such stores one per element (gzip ".tar", betaflight 1.0f; bzip2 and tar with ptrfromuse on). Taken from the ptrfromuse-on evaluation (cde5761), without its default flip. Fixture protoorder_narrowvote_x86_64, CLI test a_byte_pointee_vote_keeps_the_callers_wide_stores (default and ptrfromuse void), probe protoorder-types-keeps-a-wide-store-whole. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… narrow-pointee rule Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…e refusal (corpus, typesweep both ptrfromuse arms, arity) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…row-pointee refusal Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… a real one (libselinux), betaflight's 1.0f is refused now Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…nd 11, all within +5%) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… on the re-run binaries Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…, stages 1177/1177, cli 203/203, rust-test 7,235/0) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…n): same typesweep, off == main, same arity Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… on d6c5862 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…wide constant store, and when the walk runs out The narrow primitive pointee rule let a vote through when the access walk gave up (more than 511 derived addresses) and when a constant was stored at a stride of its own width; both printed each eight-byte store as eight byte stores. Fixture protoorder_widefill_x86_64 carries both shapes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…heir wide stores (CLI test, probe, spec 04, analysis §3g) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… protoorder row Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…s refusal as a measured follow-up Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…/60 off == main, 4 functions move, typesweep 988 -> 1,107) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…3bf6a1 (all within +5%) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…s convergence sweep decompile-all's callee-first path decompiled each target with decompile_entry and never reached the batch's converge_synthesized_structs (#675), so under the protoorder default a function kept a structure a later, larger one had superseded (tests/cli/structsynth-sweep-mints-no-third-name failed). The sweep now runs at the end of the callee-first path, in plan order with each target's own park decision; not under lock, where a parked prototype is declared. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…e callee-first convergence sweep Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… on 3831d70 with the callee-first sweep Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…tages 1212/1212, cli 205/205, rust-test 7,264/0) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…weep (all within +5%, tar +3.6-3.8%) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
33f0e4b to
33aca0c
Compare
…ain 60/60, typesweep 1,026 -> 1,147, arity equal Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…ut base-specific counts Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… libselinux +4.1%, +2.7% on a re-run) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…tages 1250/1250, cli 206/206, rust-test 7,285/0) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
The problem
decompile-alltypes each function from its own evidence, so what a calleerecovered about its parameters never reaches the calls to it:
The fix
decompile-alldecompiles callees before callers (Tarjan SCCs over the callgraph
kuna xrefspublishes); output stays in address order.argument when position and storage agree. Nothing is locked, so no call gains
or loses an argument. A winning vote can add a cast at the argument.
memory, a declared or global value, another call reading the value as a
different kind, a constant inside code, a float that the caller uses as an
integer (or stores, or passes on outside a float register), and a pointer whose
pointee disagrees with the caller's own loads and stores (an access outside it
or across its members, integer bits moved through a float member, or a
constant stored wider than a non-character pointee, which printed as one store
per byte). A caller with too many addresses to check is refused too.
--jobsstates nothing and says so.--option protoorder lock(opt-in) alsostates the arity. The callee-first run ends with structsynth's convergence
sweep, like an address-order run.
The tests
tests/cliprobes over 10 fixtures; compile-back round trips for floats ingeneral registers and float pointees; CLI tests that keep wide constant stores
whole, at the default and with
--option ptrfromuse void, and one for thestructsynth sweep. Each round trip and CLI test fails without its fix.
--option protoorder offis byte-identical to main, andno call gains or loses an argument.
type_matchover 444 slices: perfect1,026 → 1,147, 2 worse. Speed within +5% of main (worst
libselinux, +4.1%, +2.7% on a re-run).
🤖 Generated with Claude Code
https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG