Repository navigation
Add opt-in range proof for Thumb byte-loop decrement flags - #409
Merged
MatyMeatBoy merged 1 commit intoNov 4, 2026
Merged
MatyMeatBoy merged 1 commit into
MatyMeatBoy merged 1 commit into
Conversation
Prove a byte seed, one counter decrement and a guarded repeat edge before reusing signed SUB flags. Audit outside entries, counter changes and both-path carry liveness within fixed bounds. Add runtime and exclusion fixtures without changing production module flags. Co-Authored-By: Codex <noreply@openai.com>
MatyMeatBoy
merged commit Nov 4, 2026
ee44a1e
into
claude/rom-decompilation-research-obsal6
4 checks passed
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.
A zero comparison after a loop decrement is redundant only when signed overflow is impossible. Add default-off
-fthumb-loop-cc-reuseto the isolated SDK compiler, requiring base CC reuse. Production module flags remain unchanged.The proof requires a nonvolatile unsigned-byte seed before a single-entry bounded region, no counter changes except SUB #1, and a signed GT repeat edge. A whole-function audit rejects outside entries into region labels and unknown indirect control flow. Full-INSN register-set checks include writeback. Region, seed and function scans have fixed bounds, and both successors must prove old carry unobserved. Induction bounds each decrement result to -1..254, making NZV equal to CMP(result,0); arbitrary word counters at INT_MIN are excluded.
Validation: separately hashed patch and fresh zero-fuzz installation; six profiles totaling 385,056 execution cases, all byte seeds and incoming NZCV, return PC/SP/r4-r11 and memory. Negative controls cover word/INT_MIN counters, changed counters, inner-label entries, body/exit ASM, volatile seeds, real C calls and budget exhaustion. A spinning negative control must fail return validation. Reference bytes are unchanged with the option off or without base reuse. The existing 563,760 CC cases, normal ROM compare, NONMATCHING build, tree check and three strict SDK oracles pass. Normal and NONMATCHING engine objects remain byte-identical with production flags.
A private full-module ply_note candidate reaches 538 bytes versus the original 536: its extra loop comparison is removed, but literal-pool placement still differs. It remains NONMATCHING; this compiler PR adds no matching credit and enables no production flag.