Skip to content

Collect Statistics for the Core pipeline#870

Merged
aqjune-aws merged 13 commits intomainfrom
jlee/profile2
Apr 16, 2026
Merged

Collect Statistics for the Core pipeline#870
aqjune-aws merged 13 commits intomainfrom
jlee/profile2

Conversation

@aqjune-aws
Copy link
Copy Markdown
Contributor

@aqjune-aws aqjune-aws commented Apr 14, 2026

This patch collects statistics for the Core pipeline, which includes:

  • Transformations
  • Proof obligation generation
  • Discharging proof obligations

This patch defines a new Statistics data structure, which is simply a HashMap from String to Int.
For transformations, the CoreTransformState keeps the Statistics data structure and transforms can read/write to it because they live in CoreTransformM monad.
For proof obligation generator/discharger, they are simply modeled to return a partial Statistics that only record the counters of interest, and then it is the Statistics.merge function that merges the results with others.

The statistics is printed when the existing --profile flag is set. An example output is as follows:

[statistics] Evaluator.axioms: 4                                                                                                                                                                                                                    
[statistics] Evaluator.factoryOps: 195                                                                                                                                                                                                              
[statistics] Evaluator.functions: 58                                                                                                                                                                                                                
[statistics] Evaluator.procedures: 6                                                                                                                                                                                                                
[statistics] Evaluator.processIteBranches_diverged: 4                                                                                                                                                                                               
[statistics] Evaluator.recursiveFunctions: 11                                                                                                                                                                                                       
[statistics] Evaluator.simulatedStmts: 885                                                                                                                                                                                                          
[statistics] Evaluator.smtProofObligation_numAssumptions: 2189                                                                                                                                                                                      
[statistics] Evaluator.typeDecls: 9                                                                                                                                                                                                                 
[statistics] Evaluator.verificationEnvironments: 1                                                                                                                                                                                                  
[statistics] Evaluator.verify_numObligations: 561                                                                                                                                                                                                   
[statistics] FilterProcedures.erasedProcedures: 22                                                                                                                                                                                                  
[statistics] FilterProcedures.visitedProcedures: 34                                                                                                                                                                                                 
[statistics] PrecondElim.callSiteAssertsEmitted: 339
[statistics] PrecondElim.numFuncsRemovedAfterPrecondStripped: 10
[statistics] PrecondElim.wfProcedureBodyStmtsEmitted: 19
[statistics] PrecondElim.wfProceduresGenerated: 9
[statistics] ProcedureInlining.inlinedCalls: 24
[statistics] ProcedureInlining.visitedCalls: 24

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aqjune-aws aqjune-aws requested a review from a team April 14, 2026 04:12
@keyboardDrummer
Copy link
Copy Markdown
Contributor

What's the use-case of these statistics?

@aqjune-aws
Copy link
Copy Markdown
Contributor Author

Discussed internally

Comment thread Strata/Languages/Core/Statistics.lean Outdated
Comment thread Strata/Languages/Core/StatementEval.lean
Comment thread Strata/Transform/LoopElim.lean
Comment thread Strata/Util/Statistics.lean
Comment thread Strata/Languages/Core/Core.lean
Comment thread Strata/Transform/CallElim.lean
Comment thread Strata/Transform/LoopElim.lean
Comment thread Strata/Transform/LoopElim.lean Outdated
Comment thread Strata/Languages/Core/ProgramEval.lean
@aqjune-aws
Copy link
Copy Markdown
Contributor Author

Addressed comments

Comment thread Strata/Util/Statistics.lean
@aqjune-aws aqjune-aws enabled auto-merge April 16, 2026 00:01
@aqjune-aws aqjune-aws added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit d468108 Apr 16, 2026
21 of 27 checks passed
@aqjune-aws aqjune-aws deleted the jlee/profile2 branch April 16, 2026 00:37
MikaelMayer added a commit that referenced this pull request Apr 16, 2026
…ould-b

Resolve conflicts with Statistics PR (#870):
- Core.lean: keep ObligationExtraction import + add Statistics import, return stats tuple
- StatementEval.lean: keep branch ITE restructuring + add Statistics return types
- Verifier.lean: keep ObligationExtraction + add Statistics tracking
- PEAssumeTest.lean: destructure (pEs, _) from new return type
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.

5 participants