Repository navigation
[AUTOMATED] Drop more rotation guards and test more loops at the top when it is provably the same program (looptest) - #1963
Merged
Merged
Conversation
…ill in) [AUTOMATED] Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
…purity; same storage for visible outputs [AUTOMATED] Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
…red chain, disjoint stores) [AUTOMATED] Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
[AUTOMATED] Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
[AUTOMATED] Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
[AUTOMATED] Extends looptest proven: a guard drops when the skip path equals the exit path run zero times (returns, return blocks with calls, joins); empty-body loops; recomputed latch inputs; linear sums and constant comparisons in the entry normal form; wider fresh loads; the frame-counter rule limited to unoptimized functions. Stage tests, unit tests, spec prose, catalog row. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
[AUTOMATED] Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU # Conflicts: # docs/baseline-stages.json
[AUTOMATED] Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU # Conflicts: # decompiler/crates/kuna-base/src/xml.rs # docs/baseline-stages.json
[AUTOMATED] Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
[AUTOMATED] The DOS timer-tick wait has an empty body and now prints
`while (v1 == dat_46c) {}`; the i386 trampoline function loses a dropped
loop guard, so its joined warnings sit one line higher.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
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.
gcc copies a loop's test into a guard and often gives the skip path its own copy of the code after the loop, so
looptestcould not prove the guard droppable and printed a guarded do-while with two returns. gcc -O2 fordouble dsum(const double *a, long n) { double s = 0; for (long i = 0; i < n; i++) s += a[i]; return s; }:Before:
After:
All of this is part of
looptest proven; there is no new option or value, and every step is a proof that the printed loop is the same program.return sagainstreturn 0.0), two return blocks whose calls and stores pair up (return report(head, n)againstreturn report(NULL, 0), usinghead == NULLfrom the failed guard), or a join where each merged value agrees (anelsearm that sets the counter to its start value). This replaces the stricter rule for variables written before the loop. The skip-side code that disappears may not call or store, and exit-side code that now also runs on the skip path may not read memory.do {} while (f());, prints aswhile (f()) {}: both runfthe same number of times.&v2[1]besidev1 = &v2[1]) prints that variable at the top.s + 0x48 != s + 8). A guard's load also counts as reading the loop's memory when it sits in an earlier block that leads only to the guard, or when a store in between writes other bytes of the same base.Tests: two new stage tests,
kuna-looptest-zerotripandkuna-looptest-entry, built from gcc -O2 code (one function at -O0), each step with a control that must stay a do-while; the base build fails 19 of their 25 assertions and passes the six controls. Five existing stage tests whose assertions spelled out the old loop form now match either form, and two CLI tests expect the new form (a DOS timer-tick wait printswhile (v1 == dat_46c) {}; a dropped guard moves an i386 function's joined warnings up one line). Unit tests cover the new normal-form rules. 0/675 datatest assertions move.On the decbench O2 corpus 183 more functions match the source's control flow exactly (gained 191, lost 8; the eight are sources that spell an empty polling loop
do { r = REG; } while (...)orwhile (...) continue;); at O0, 87 more (gained 98, lost 11), almost all empty-body polling loops.Model:
anthropic/claude-opus-5-5🤖 Generated with Claude Code
https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU