Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: push down lets #1111

Closed
wants to merge 34 commits into from
Closed

Commits on Aug 10, 2023

  1. test: extra case/let tests

    This is in preparation for rethinking how we evaluate let bindings.
    
    Signed-off-by: Ben Price <[email protected]>
    brprice committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    c45f948 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2023

  1. evalFullTestExactSteps

    we do this because we are changing eval a lot shortly, and want to be able to see changes. is also easier to update when bounds are broken!
    brprice committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    3ac2cd6 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2023

  1. feat: evaluate lets by "pushing down", with opt TODO: squash this w…

    …ith next commit!
    
    This can be seen as an explicit-substitution style operational
    semantics.
    
    This change in approach means that our evaluation rules are much more
    local, and will enable some future simplifications. In particular we
    will avoid using the `Accum` machinery, simplify the eval `Cxt` and not
    have to have a separate eval mode for substitutions.
    
    We temporarily disable EvalFull.unit_8. It does pass (note that the step
    count is bumped), but takes a long time (almost 10 minutes on my
    machine!). This will be massively improved shortly, by being more
    aggressive in eliding pointless `let`s.
    
    Signed-off-by: Ben Price <[email protected]>
    
    pushMulti opt
    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    5b31878 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    372f360 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8bb497c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a9d0111 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    04dc304 View commit details
    Browse the repository at this point in the history
  6. disable unit 9 for now

    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    490029f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c96b24c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    587abf6 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1fe5230 View commit details
    Browse the repository at this point in the history
  10. add some option plumbing

    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    47bad07 View commit details
    Browse the repository at this point in the history
  11. pushMulti opt, library

    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    bbdbca1 View commit details
    Browse the repository at this point in the history
  12. option plumb testsuite

    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    bfd8224 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    681eb1e View commit details
    Browse the repository at this point in the history
  14. plumb more testsuite

    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    d45dc43 View commit details
    Browse the repository at this point in the history
  15. fixup! pushMulti opt, library

    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    34c8dbd View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    0b35405 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    b73d143 View commit details
    Browse the repository at this point in the history
  18. todo/review notes - I need to flesh out into a note

    Signed-off-by: Ben Price <[email protected]>
    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    0736afe View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    120b54d View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    6651d90 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    210b92a View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    63d8e2b View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    10a8173 View commit details
    Browse the repository at this point in the history
  24. update testsuite for aggressive elision. some justifications:

    bump limit on unit_prim_partial_map because...
    
    it turns out that on this workload the aggressive elision optimisation
    actually takes more step. However, the trees are somewhat smaller.
    this is because the optimisation makes no difference on terms like
      let x1=_ in ... let xn=_ in xi
    as `xi` is a leaf. This workload has many such subterms which get created when pushing lets down. Aggressive elision will remove some of the lets early, when they are (for example)
      let x1=_ in ... let xn=_ in C xi xj
    but this takes an extra step
    
    This phenomenon is also seen in unit_type_preservation_BETA_regression
    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    1b6f562 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    a2837c3 View commit details
    Browse the repository at this point in the history
  26. fixup! pushMulti opt, library

    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    9da8eb3 View commit details
    Browse the repository at this point in the history
  27. feat: eval combines push and elide

    Since we are eliding aggressively, we may as well not create the
    pointless lets in the first place. (Note that we may still create
    pointless lets when renaming binders.)
    
    This again noticably speeds up unit_8 and unit_9.
    
    Signed-off-by: Ben Price <[email protected]>
    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    7297eae View commit details
    Browse the repository at this point in the history
  28. fix: change eval cxts to match push-down-lets

    This fixes unit_redexes_lettype_capture, where we want to not consider a
    burried binder renamable.
    
    Signed-off-by: Ben Price <[email protected]>
    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    db35ff0 View commit details
    Browse the repository at this point in the history
  29. refactor: simplify eval Cxt

    Now we are pushing down lets, we do not need so much information about
    bindings. In particular, we do not need to record the original binding
    location, or the original binding's context, since we do not do
    long-range substitution where care is needed to avoid capture.
    
    Signed-off-by: Ben Price <[email protected]>
    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    eb18e6b View commit details
    Browse the repository at this point in the history
  30. fix: Eval.Cxt is a list, can record shadowed lets

    This fixes a rare issue that if one has two adjacent lets with the same
    name, we would only record one of them in the `Cxt`, and thus
    miscalculate whether a binder they immediately contain needs to be
    renamed before we can push the lets under.
    
    Signed-off-by: Ben Price <[email protected]>
    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    622e34d View commit details
    Browse the repository at this point in the history
  31. refactor: special 'subst' handling is now unneeded

    This is because we "push down lets", rather than doing long-range substitutions.
    
    Signed-off-by: Ben Price <[email protected]>
    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    9719b72 View commit details
    Browse the repository at this point in the history
  32. fixup! todo/review notes

    brprice committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    ac6aea5 View commit details
    Browse the repository at this point in the history