Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close default kcfg minimization 4 cse #885

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Stevengre
Copy link
Contributor

@Stevengre Stevengre commented Nov 18, 2024

Now, the --cse option don't provide more functionality more than
(1) generating the summary rules from KCFG Edges of the external function;
(2) using these rules to reducing the rewriting steps for the functions / tests that calls them.

Some activities to achieve this:

  • don't minimize proof during CSE;
  • select some tests for --cse;
  • checked all the correctness / rationale of the generated KCFG using CSE.

@@ -0,0 +1,5 @@
AssertTest.test_assert_false()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this file used for? I think foundry-dependency-* stores the test function names for CSE tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted

@@ -477,7 +477,7 @@ def create_kcfg_explore() -> KCFGExplore:
if progress is not None and task is not None:
progress.update(task, advance=1, status='Finished')

if options.minimize_proofs or options.config_type == ConfigType.SUMMARY_CONFIG:
if options.minimize_proofs:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Close default minimize_proofs for SUMMARY_CONFIG.

@@ -23,3 +23,4 @@ InterfaceTagTest.testInterface()
ConstructorTest.init
ImportedContract.init
StaticCallContract.set(uint256)
MergeKCFGTest.test_branch_merge(uint256,uint256,bool)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

introduce a new test for CSE.

@Stevengre Stevengre mentioned this pull request Nov 19, 2024
5 tasks
Comment on lines +55 to +68
│ k: #execute ~> #return 128 32 ~> #pc [ STATICCALL ] ~> #execute ~> CONTINUATION:K
│ pc: 0
│ callDepth: 1
│ statusCode: STATUSCODE:StatusCode
│ src: test/nested/SimpleNested.t.sol:7:11
│ method: src%ArithmeticContract.add(uint256,uint256)
│ (1 step)
├─ 15 (split)
│ k: JUMPI 570 bool2Word ( KV0_x:Int <=Int ( maxUInt256 -Int KV1_y:Int ) ) ~> #pc [ J ...
│ pc: 562
│ callDepth: 1
│ statusCode: STATUSCODE:StatusCode
│ method: src%ArithmeticContract.add(uint256,uint256)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSE ed

'max_iterations': 100,
'bug_report': bug_report,
'cse': True,
'minimize_proofs': False,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSE CI test without minimization

┃ │ statusCode: STATUSCODE:StatusCode
┃ │ method: src%ArithmeticContract.add(uint256,uint256)
┃ │
┃ │ (3 steps)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the summary!

┃ │ src: test/nested/SimpleNested.t.sol:7:11
┃ │ method: src%ArithmeticContract.add(uint256,uint256)
┃ │
┃ │ (1 step)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the summary.

┃ ┃ │ statusCode: EVMC_SUCCESS
┃ ┃ │ method: src%ArithmeticContract.add(uint256,uint256)
┃ ┃ │
┃ ┃ │ (3 steps)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the summary.

┃ │ statusCode: EVMC_SUCCESS
┃ │ method: src%ArithmeticContract.add(uint256,uint256)
┃ │
┃ │ (3 steps)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the summary.

│ statusCode: STATUSCODE:StatusCode
│ method: src%ArithmeticContract.add(uint256,uint256)
│ (3 steps)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the summary.

│ src: test/nested/SimpleNested.t.sol:7:11
│ method: src%ArithmeticContract.add_sub_external(uint256,uint256,uint256)
│ (3 steps)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the summary!

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.

2 participants