Skip to content
Snippets Groups Projects

iFrame: Do not call `cbv` on user terms in contexts

I cannot believe these cbv calls survived for a such a long time!

I didn't find this due to the performance issues of calling cbv on user terms, oddly enough. I was investigating why relatively small proofs were taking upwards of 10GB of memory (with pretty permissive GC parameters).

Here's the change as reported by memtrace on a small file with a total of 6 iFrame calls throughout the proof. All calls are on pretty a small goals with <20 total premises but I guess the terms involved are not exactly trivial when fully normalized.

Before:

image

After:

image

The file also went from 1min to less than 45s.

Edited by Janno

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Janno changed the description

    changed the description

    • Author Maintainer
      Resolved by Robbert Krebbers

      (I cannot edit the MR any more because it has been recognized as spam. Who am I to judge? Either way, the timings in the description are incorrect: the proof originally took a little more than a minute, not 1min 15s)

  • Janno changed the description

    changed the description

    • Author Maintainer
      Resolved by Ralf Jung

      @jung could you run a performance test? I am satisfied with the change as far as our code base is concerned. We don't really use iFrame at all but this change still got us a ~2 minute overall improvement and it really cut down on memory usage.

    • Resolved by Robbert Krebbers

      FWIW here's a list of all eval cbv in the repo before this MR:

      iris/proofmode/ltac_tactics.v
      157:  | [] => eval cbv in Hs
      413:     let Hs := eval cbv in (env_dom (env_intuitionistic Δ)) in go Hs
      422:     let Hs := eval cbv in (env_dom (env_spatial Δ)) in go Hs
      888:       let Hs' := eval cbv in (if lr then Hs else Hs_frame ++ Hs) in
      1019:       let b := eval cbv [use_tac_specialize_intuitionistic_helper] in
      
      iris/proofmode/ident_name.v
      12:  eval cbv in (ltac:(clear; intros id; assumption) : unit → unit).
      
      iris/proofmode/intro_patterns.v
      182:  | intro_pat => eval cbv in (intro_pat_intuitionistic p)
      183:  | list intro_pat => eval cbv in (forallb intro_pat_intuitionistic p)
      186:     eval cbv in (forallb intro_pat_intuitionistic pat)
  • Robbert Krebbers
  • added 68 commits

    • 8178efc8...8890e30a - 66 commits from branch iris:master
    • 2fb6f61d - iFrame: Do not call `cbv` on user terms in contexts
    • 088230ae - Turn two more uses of `cbv` into `lazy` that involve user terms.

    Compare with previous version

  • I added documentation, please provide feedback.

    Edited by Robbert Krebbers
  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Ralf Jung
  • Ralf Jung
  • Ralf Jung
  • added 24 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Ralf Jung resolved all threads

    resolved all threads

  • LGTM, thanks!

  • mentioned in commit 657b34ad

  • @iris-users This is not a breaking change, but if you are writing your own Proof Mode tactics, you might want to check the new documentation in proofmode/reduction.v to see if you are using the reduction tactics correctly.

  • Please register or sign in to reply
    Loading