Skip to content

compare-ticks should feed on a list of name pairings

compare-ticks is really helpful in pinning down unique allocations of variant B vs. variant A. But it's not so good at matching up the names of bindings: Because it's (necessarily) purely syntactically matching up e.g. A.$wgo2 with B.$wgo2, it doesn't realise that A.$wgo2 acutally corresponds to B.$wgo3.

It's not the job of compare-ticks to figure that our either. Here's corediff, the corresponding thesis I supervised, that could figure out more semantically accurate pairings for us. A few issues:

  • It's a bit POCy, so probably has a few bugs
  • It operates on Core. But that should be moderately easy to fix. UNfortunately, I believe we need to extend ghc-dump-core for that, resp. write a ghc-dump-stg.
  • It probably needs to be adjusted a bit to emit a file of pairings, e.g.
    ...
    (M.$wgo2,M.$wgo3)
    ...

Then I imagine that compare-ticks could just take a --pairings pairings.txt flag and respect those pairings.