Skip to content

[WIP] Cache proofs using canonicalized ASTs#1974

Closed
jacobhinkle wants to merge 21 commits intomainfrom
simplification_ast
Closed

[WIP] Cache proofs using canonicalized ASTs#1974
jacobhinkle wants to merge 21 commits intomainfrom
simplification_ast

Conversation

@jacobhinkle
Copy link
Collaborator

No description provided.

This just defines the basic Term and Program types that can later be
used for tracking simplifications.

TODO: convenience operators for doing things like (a + b) % c using
const Term& s.
Sizes of relevant types:
```
sizeof(PrimDataType)=4
sizeof(DataType)=96
sizeof(Val)=272
sizeof(TensorView)=368
sizeof(PolymorphicValue)=96
sizeof(FunctionSymbol)=8
sizeof(Term)=56
sizeof(std::vector<Term*>)=24
sizeof(std::vector<Val*>)=24
sizeof(std::vector<std::optional<int64_t>>)=16
sizeof(int64_t)=8
sizeof(std::variant<int64_t,bool>)=16
sizeof(std::variant<std::monostate,int64_t,bool>)=16
sizeof(std::variant<double,int64_t,bool>)=16
sizeof(std::variant<std::monostate,double,int64_t,bool>)=16
sizeof(RealPolymorphicScalar)=16
sizeof(simplification::ConstantValue)=16
```
This is all we need for now I think. Next up is to add methods for
recording proofs and simplifications, then I'll start to hack at
expr_simplifier.cpp.
Note that this does not add initialization of a Program during lowering
yet. Many tests are failing.
This also makes it so that simplifyExpr will work in standalone mode
(i.e. all proofs are from scratch) if no ProgramGuard is active.
@jacobhinkle
Copy link
Collaborator Author

This was an experiment in using a lightweight AST and some e-graph machinery for simplification. It was not meant to be merged so I am closing now.

@jacobhinkle jacobhinkle closed this Oct 1, 2025
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.

1 participant