Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ mod set_cost;
pub use set_cost::*;
mod size;
pub use size::*;
mod stats;
pub use stats::*;
Comment on lines +37 to +38

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

The code references a stats module and uses EgraphDetailedStats struct, but the src/stats.rs file is not included in this PR and does not exist in the repository. This will cause a compilation error. The implementation of the stats module containing the EgraphDetailedStats command needs to be added.

Copilot uses AI. Check for mistakes.

pub fn new_experimental_egraph() -> EGraph {
let mut egraph = EGraph::default();
Expand All @@ -48,4 +50,7 @@ pub fn new_experimental_egraph() -> EGraph {
.add_command("run-schedule".into(), Arc::new(RunExtendedSchedule))
.unwrap();
egraph
.add_command("egraph-detailed-stats".into(), Arc::new(EgraphDetailedStats))
.unwrap();
egraph
}
4 changes: 4 additions & 0 deletions tests/herbie-rational.egg
Original file line number Diff line number Diff line change
Expand Up @@ -567,4 +567,8 @@
(let tgt (Div one sqrt5))
(run 6)
(check (= e14 tgt))

; Get detailed statistics
(egraph-detailed-stats)

(pop)
20 changes: 20 additions & 0 deletions tests/web-demo/detailed-stats.egg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; Test the egraph-detailed-stats command

(datatype Math)
(constructor add (Math Math) Math)
(constructor mul (Math Math) Math)
(constructor num (i64) Math)

; Add some terms
(num 1)
(num 2)
(add (num 1) (num 2))
(mul (num 1) (num 2))

; Create some equality classes
(union (num 1) (num 2))

(run-schedule (saturate (run)))

; Get detailed statistics
(egraph-detailed-stats)

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

The test for the new egraph-detailed-stats command doesn't include any assertions to verify the command's output or behavior. Consider adding checks to validate that the command executes successfully and potentially verify aspects of the returned statistics, similar to how get-size! is validated in other tests.

Copilot uses AI. Check for mistakes.
Loading