ares icon indicating copy to clipboard operation
ares copied to clipboard

ares codegen redux

Open joemfb opened this issue 1 year ago • 0 comments

This PR is based on and supersedes #135. The diff relative to that PR is here: https://github.com/urbit/ares/compare/eamsden/codegen...jb/codegen-perf

Changes include:

  • spot-hint tracking for granular debug output
  • a second layer of memoization within the analysis of recursive computation ("meloization")
  • refactoring of the analysis into separate arms for profiling

The spot-hint handling and associated output provide a means for understanding incremental analysis results for a piece nock (when the hints are present). The additional memoization makes it possible to analyze massive instances of mutual recursion (like +ut). The refactoring supports profiling in vere with -j.

The changes relative to #135 are best understood in pieces:

  • https://github.com/urbit/ares/compare/eamsden/codegen...jb/codegen-memo adds initial debug output and memoization in a minimally intrusive way, making it possible to analyze hoon.hoon
  • 53ed575 splits the analysis into separate arms
  • https://github.com/urbit/ares/compare/53ed575...jb/codegen-perf cleans up the above, corrects the output, adds comments, &c

There are currently a handful of false positive "meloization" hits in the analysis of hoon.hoon. We have safety-checks in finalization that properly detect these, but we don't yet correctly turn all ancestor call sites indirect. This and other TODOs are noted in 8805494906713440846090af8472fc4b1381cc80. This PR will remain a draft until those issues are resolved.

joemfb avatar Jun 04 '24 21:06 joemfb