runtimeverification / runtimeverification/kontrol

Crashing exploration

Open
#102 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
122
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Crashing backend on KontrolTest.testFailQuadratic, bug report TAR here: https://s3.bithex-topnym.startram.io/bucket/2023.10.13..12.22.01-FailQuadratic.tar

The test (in Solidity):

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.2 <0.9.0;

import {Test} from "forge-std/Test.sol";
import "forge-std/Vm.sol";

contract KontrolTest is Test {

  function testFailOneRange(uint256 x) public {
    assertTrue(x > 1000);
    assertGt(5000, x);
  }

  function testFailLinear(uint256 x) public {
    Func f = new Func();
    uint256 res = f.linear(x);
    assertGt(res, 5000);
  }

  function testFailQuadratic(uint256 x) public {
    Func f = new Func();
    uint256 res = f.quadratic(x);
    assertGt(res, 5000);
  }

}

contract Func {

  function linear(uint256 x) public returns (uint256) {
    uint k = 3;
    uint k0 = 7;
    uint m = 99;
    unchecked { return 
      k*x/k0 + m;
    }
  }

  function quadratic(uint256 x) public returns (uint256) {
    uint a = 2;
    uint b = 5;
    uint c = 73;
    unchecked { return 
      a* x*x+ b * x + c;
    }
  }

}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the linked TAR reproduction and running the Solidity KontrolTest.testFailQuadratic case, especially the quadratic function in the supplied example. Compare its behavior with testFailLinear and determine what backend failure occurs; done means the quadratic exploration no longer crashes and the regression is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, solidity
Domain
backend, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.