Skip to content

[MAY-CHERRYPICK-UPSTREAM] Enhance kmir show with --statistics and --leaves#707

Merged
automergerpr-permission-manager[bot] merged 2 commits into
feature/p-tokenfrom
feature/better-show
Sep 30, 2025
Merged

[MAY-CHERRYPICK-UPSTREAM] Enhance kmir show with --statistics and --leaves#707
automergerpr-permission-manager[bot] merged 2 commits into
feature/p-tokenfrom
feature/better-show

Conversation

@Stevengre
Copy link
Copy Markdown
Contributor

It is used to print better proof_status.md for solana-token, aiming to include all the information useful to fast investigate the result and update tests.md.

Example output with --statistics and --leaves:

STATISTICS
-----------
Total nodes: 10

Node roles (exclusive):
  failing : 2  ids: 10, 12
  split   : 1  ids: 6
  normal  : 7  ids: 3, 4, 5, 7, 8, 9, 11
  (root nodes omitted from totals: 1, 2)

Leaf paths from init:
  total leaves (non-root): 2
  reachable leaves       : 2
  total steps            : 2193

  leaf 10: steps 893, path 1 -> 3 -> 4 -> 5 -> 6 -> 8 -> 10
  leaf 12: steps 1300, path 1 -> 3 -> 4 -> 5 -> 6 -> 7 -> 9 -> 11 -> 12

LEAF <k> CELLS
---------------
Node 10:
  #traverseProjection ( toLocal ( 2 ) , AllocRef ( allocId ( 600719 ) , .ProjectionElems , noMetadata ) , projectionElemDeref  .ProjectionElems , .Contexts )
  ~> #readProjection ( false )
  ~> #freezer#discriminant(_,_)_RT-DATA_Evaluation_Evaluation_MaybeTy0_ ( ty ( 600110 ) ~> .K )
  ~> #freezer#setLocalValue(_,_)_RT-DATA_KItem_Place_Evaluation1_ ( place ( ... local: local ( 4 ) , projection: .ProjectionElems ) ~> .K )
  ~> #execStmts ( statement ( ... kind: statementKindAssign ( ... place: place ( ... local: local ( 0 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpEq , operandCopy ( place ( ... local: local ( 3 ) , projection: .ProjectionElems ) ) , operandCopy ( place ( ... local: local ( 4 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 621308 ) )  .Statements )
  ~> #execTerminator ( terminator ( ... kind: terminatorKindReturn , span: span ( 621307 ) ) )

Node 12:
  #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandConstant ( constOperand ( ... span: span ( 603598 ) , userTy: noUserTypeAnnotationIndex , const: mirConst ( ... kind: constantKindZeroSized , ty: ty ( 600118 ) , id: mirConstId ( 39 ) ) ) ) , args: operandConstant ( constOperand ( ... span: span ( 603599 ) , userTy: noUserTypeAnnotationIndex , const: mirConst ( ... kind: constantKindAllocated ( allocation ( ... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap ( ... ptrs: provenanceMapEntry ( ... offset: 0 , allocId: allocId ( 600074 ) )  .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 600073 ) , id: mirConstId ( 474 ) ) ) )  operandMove ( place ( ... local: local ( 5 ) , projection: .ProjectionElems ) )  .Operands , destination: place ( ... local: local ( 4 ) , projection: .ProjectionElems ) , target: noBasicBlockIdx , unwind: unwindActionCleanup ( basicBlockIdx ( 4 ) ) ) , span: span ( 603600 ) ) ) ~> .K

@Stevengre Stevengre self-assigned this Sep 30, 2025
@Stevengre Stevengre marked this pull request as ready for review September 30, 2025 07:27
@Stevengre Stevengre removed the request for review from tothtamas28 September 30, 2025 07:32
@jberthold
Copy link
Copy Markdown
Collaborator

Definitely very useful for our p-token work.
Can we add a small test on a proof with known fixed outcome to make sure we don't break it in the future?

Copy link
Copy Markdown
Collaborator

@dkcumming dkcumming left a comment

Choose a reason for hiding this comment

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

I love this! As Jost said with a test I think we should merge this!

@Stevengre Stevengre requested a review from dkcumming September 30, 2025 14:20
Copy link
Copy Markdown
Collaborator

@dkcumming dkcumming left a comment

Choose a reason for hiding this comment

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

Not sure if this yes is ever expected to pass int he future put happy to have the update!

@automergerpr-permission-manager automergerpr-permission-manager Bot merged commit 4a6892b into feature/p-token Sep 30, 2025
5 checks passed
@automergerpr-permission-manager automergerpr-permission-manager Bot deleted the feature/better-show branch September 30, 2025 15:01
Stevengre added a commit that referenced this pull request Oct 14, 2025
…--leaves` (#707)

It is used to print better `proof_status.md` for solana-token, aiming to
include all the information useful to fast investigate the result and
update `tests.md`.

Example output with `--statistics` and `--leaves`:

```
STATISTICS
-----------
Total nodes: 10

Node roles (exclusive):
  failing : 2  ids: 10, 12
  split   : 1  ids: 6
  normal  : 7  ids: 3, 4, 5, 7, 8, 9, 11
  (root nodes omitted from totals: 1, 2)

Leaf paths from init:
  total leaves (non-root): 2
  reachable leaves       : 2
  total steps            : 2193

  leaf 10: steps 893, path 1 -> 3 -> 4 -> 5 -> 6 -> 8 -> 10
  leaf 12: steps 1300, path 1 -> 3 -> 4 -> 5 -> 6 -> 7 -> 9 -> 11 -> 12

LEAF <k> CELLS
---------------
Node 10:
  #traverseProjection ( toLocal ( 2 ) , AllocRef ( allocId ( 600719 ) , .ProjectionElems , noMetadata ) , projectionElemDeref  .ProjectionElems , .Contexts )
  ~> #readProjection ( false )
  ~> #freezer#discriminant(_,_)_RT-DATA_Evaluation_Evaluation_MaybeTy0_ ( ty ( 600110 ) ~> .K )
  ~> #freezer#setLocalValue(_,_)_RT-DATA_KItem_Place_Evaluation1_ ( place ( ... local: local ( 4 ) , projection: .ProjectionElems ) ~> .K )
  ~> #execStmts ( statement ( ... kind: statementKindAssign ( ... place: place ( ... local: local ( 0 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpEq , operandCopy ( place ( ... local: local ( 3 ) , projection: .ProjectionElems ) ) , operandCopy ( place ( ... local: local ( 4 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 621308 ) )  .Statements )
  ~> #execTerminator ( terminator ( ... kind: terminatorKindReturn , span: span ( 621307 ) ) )

Node 12:
  #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandConstant ( constOperand ( ... span: span ( 603598 ) , userTy: noUserTypeAnnotationIndex , const: mirConst ( ... kind: constantKindZeroSized , ty: ty ( 600118 ) , id: mirConstId ( 39 ) ) ) ) , args: operandConstant ( constOperand ( ... span: span ( 603599 ) , userTy: noUserTypeAnnotationIndex , const: mirConst ( ... kind: constantKindAllocated ( allocation ( ... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap ( ... ptrs: provenanceMapEntry ( ... offset: 0 , allocId: allocId ( 600074 ) )  .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 600073 ) , id: mirConstId ( 474 ) ) ) )  operandMove ( place ( ... local: local ( 5 ) , projection: .ProjectionElems ) )  .Operands , destination: place ( ... local: local ( 4 ) , projection: .ProjectionElems ) , target: noBasicBlockIdx , unwind: unwindActionCleanup ( basicBlockIdx ( 4 ) ) ) , span: span ( 603600 ) ) ) ~> .K
```

(cherry picked from commit 4a6892b)
automergerpr-permission-manager Bot pushed a commit that referenced this pull request Oct 14, 2025
It is used to print better `proof_status.md` for solana-token, aiming to
include all the information useful to fast investigate the result and
update `tests.md`.

Example output with `--statistics` and `--leaves`:

```
STATISTICS
-----------
Total nodes: 10

Node roles (exclusive):
  failing : 2  ids: 10, 12
  split   : 1  ids: 6
  normal  : 7  ids: 3, 4, 5, 7, 8, 9, 11
  (root nodes omitted from totals: 1, 2)

Leaf paths from init:
  total leaves (non-root): 2
  reachable leaves       : 2
  total steps            : 2193

  leaf 10: steps 893, path 1 -> 3 -> 4 -> 5 -> 6 -> 8 -> 10
  leaf 12: steps 1300, path 1 -> 3 -> 4 -> 5 -> 6 -> 7 -> 9 -> 11 -> 12

LEAF <k> CELLS
---------------
Node 10:
  #traverseProjection ( toLocal ( 2 ) , AllocRef ( allocId ( 600719 ) , .ProjectionElems , noMetadata ) , projectionElemDeref  .ProjectionElems , .Contexts )
  ~> #readProjection ( false )
  ~> #freezer#discriminant(_,_)_RT-DATA_Evaluation_Evaluation_MaybeTy0_ ( ty ( 600110 ) ~> .K )
  ~> #freezer#setLocalValue(_,_)_RT-DATA_KItem_Place_Evaluation1_ ( place ( ... local: local ( 4 ) , projection: .ProjectionElems ) ~> .K )
  ~> #execStmts ( statement ( ... kind: statementKindAssign ( ... place: place ( ... local: local ( 0 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpEq , operandCopy ( place ( ... local: local ( 3 ) , projection: .ProjectionElems ) ) , operandCopy ( place ( ... local: local ( 4 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 621308 ) )  .Statements )
  ~> #execTerminator ( terminator ( ... kind: terminatorKindReturn , span: span ( 621307 ) ) )

Node 12:
  #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandConstant ( constOperand ( ... span: span ( 603598 ) , userTy: noUserTypeAnnotationIndex , const: mirConst ( ... kind: constantKindZeroSized , ty: ty ( 600118 ) , id: mirConstId ( 39 ) ) ) ) , args: operandConstant ( constOperand ( ... span: span ( 603599 ) , userTy: noUserTypeAnnotationIndex , const: mirConst ( ... kind: constantKindAllocated ( allocation ( ... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap ( ... ptrs: provenanceMapEntry ( ... offset: 0 , allocId: allocId ( 600074 ) )  .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 600073 ) , id: mirConstId ( 474 ) ) ) )  operandMove ( place ( ... local: local ( 5 ) , projection: .ProjectionElems ) )  .Operands , destination: place ( ... local: local ( 4 ) , projection: .ProjectionElems ) , target: noBasicBlockIdx , unwind: unwindActionCleanup ( basicBlockIdx ( 4 ) ) ) , span: span ( 603600 ) ) ) ~> .K
```

(cherry picked from commit 4a6892b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants