Skip to content

Fix fib_iterative programs#520

Merged
MauroToscano merged 2 commits into
mainfrom
fix_fib_iterative_programs
Apr 22, 2026
Merged

Fix fib_iterative programs#520
MauroToscano merged 2 commits into
mainfrom
fix_fib_iterative_programs

Conversation

@gabrielbosio

Copy link
Copy Markdown
Collaborator

Some fib_iterative programs didn't have the halt instruction which caused verification to fail. This PR adds that instruction to the problematic fib_iterative programs.

Comment thread executor/programs/asm/fib_iterative_250k.s
@yetanotherco yetanotherco deleted a comment from github-actions Bot Apr 21, 2026
Comment thread executor/programs/asm/fib_iterative_250k.s Outdated
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
@gabrielbosio
gabrielbosio marked this pull request as ready for review April 21, 2026 22:11
@github-actions

Copy link
Copy Markdown

Codex Code Review

Findings

  1. Low – Comment/code mismatch can mislead correctness assumptions

    • fib_iterative_500k.s:24
    • fib_iterative_2M.s:24
    • These still say “halt with result in a0”, but a0 is now explicitly set to 0 just before ecall ([line 22] in each file). This can cause incorrect expectations for anyone using these as result-returning samples.
  2. Low – Redundant instruction / dead write

Security

  • No security vulnerabilities identified in this diff.

Performance

  • No significant performance issues identified in this diff.

Comment thread executor/programs/asm/fib_iterative_500k.s
Comment thread executor/programs/asm/fib_iterative_2M.s
@claude

claude Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Review

The core fix is correct: the prover HALT table enforces x10 (a0) == 0 at halt time, so these three programs were failing verification without the 'li a0, 0' before ecall. Good catch.

Two minor issues left to clean up (inline comments added):

  • fib_iterative_500k.s and fib_iterative_2M.s: The 'mv a0, t1' is now a dead instruction (immediately overwritten by 'li a0, 0'), and the ecall comment still says 'halt with result in a0' which is now inaccurate. The 250k file in this PR was updated correctly but the other two were not. Suggestions attached.

@MauroToscano
MauroToscano added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit d531a2c Apr 22, 2026
13 checks passed
@MauroToscano
MauroToscano deleted the fix_fib_iterative_programs branch April 22, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants