egraphs-good / egglog

egraphs + datalog!
https://egraphs-good.github.io/egglog/
MIT License
458 stars 54 forks source link

Make "declared function" printouts debug mode #472

Open oflatt opened 3 days ago

oflatt commented 3 days ago

The eggcc project relies on info printing, and the declared function print outs are becoming super verbose (one per variable, which we generate tens of thousands of) This PR makes these prints debug instead of info

It also slightly cleans up a confusing error message in the extractor

codspeed-hq[bot] commented 3 days ago

CodSpeed Performance Report

Merging #472 will not alter performance

Comparing oflatt-less-verbose (4a194a3) with main (1d31817)

Summary

✅ 8 untouched benchmarks

yihozhang commented 3 days ago

I'm not sure if this should be in the main. Right now info is mostly used for responding to user commands (i.e., if it succeed), while debug is for recording internal processing information. We should generate at least one INFO message per user command. If you want a less overwhelming log, you should probably make egglog print desired log info to stdout via some commands, and then redirect egglog's stdout to e.g., a log file

Alex-Fischman commented 3 days ago

We should generate at least one INFO message per user command.

Is this documented anywhere? Why would this be the case?

oflatt commented 2 days ago

@yihozhang is this for the web demo? Or for sidecar egglog? Sidecar egglog shouldn't use info prints, it should use the normal stdout right? Perhaps we've been abusing log::info

yihozhang commented 2 days ago

Sidecar egglog only uses stdout for communication. log::info is for CLI and web demo. I believe one of the original intentions of log::info is so that the user can see when each command has finished running (otherwise how would a REPL user know?), while stdout should be silent until the user expects a result (e.g., an extractant, run statistics). This is not documented.

oflatt commented 1 day ago

Racket's REPL, for example, doesn't print out something on each command, it just runs it. It's pretty verbose to print on each command unless you need that interactivity for sidecar egglog. Perhaps we should have a new interactive mode that is verbose and parse-able?