notes

Incremental Computation with Adapton

Talk by Matthew A. Hammer, March 2015 [video]

PLDI, June 2014 [slides]

Goals of incremental computation

Convex Hull example

Convex Hull is very complex to manually implement incrementally (takes a 100-page dissertation of proofs)

Programmers deserve a systematic approach

Is there a unified, systematic approach?

Application domain Input Compute Output
spreadsheets data, formula evaluate formula plots, chart
build systems source files compile binaries, test results
databases tables evaluate query tables
web browsers HTML, CSS render rendering
games, simulations system state advance state system state
proof assistants proof script proof search proof object

Brief history of incremental computation

What we want as users

Adapton: interactive incremental computation

Programming abstractions

Uses a demanded computation graph (DCG) as its base

Demanded computation graph (DCG)

Represents a dynamic partial order of dependencies to propagate changes on demand.

Phases:

Compared to self-adjusting computation

In benchmarks of list and tree applications (filter, map, reduce min/sum, quicksort, and mergesort) and a simple interpreter, Adapton performs better than SAC, because the partial order allows for more reuse.

Adapton has a exponential speedup, because it gives you dynamic programming for free, while SAP has a 100x slowdown because it has no sharing.

Nominal Adapton

Adapton Classic:

Nominal Adapton:

For example, when inserting a value in incrementally-computed mergesort, by naming values, only new values receive fresh thunks and the propagated changes maintain the same names, so freshness is limited to the inserted element and there are less memo misses.

Adapton in Rust

Adapton for program analysis and verification

Applying IC with Adapton to systematic program analysis techniques for new IDE frameworks.

Complexity

The simple, correct, and efficient properties hinge on the from-scratch implementation. This is closely related to parallelism metrics: parallel algorithms can be measured by work and depth, while Adapton algorithms can be measured by work, depth, and “fan out” (i.e., how many values are affected on a change).

Implicit, universal IC

Information flow analysis from security analysis can be used to make a regular program incremental.