Fix #21, long-standing mismatch in assumptions in LLL demand-matcher.

The LLL demand-matcher has two pieces: a `default-task-supervisor`
which does the work of figuring out what to do for a given change in
an instance of demand, and a driver which computes demand instances
and calls `default-task-supervisor` for each.

An `actions` accumulator is threaded through the
`default-task-supervisor` calls. However, the driver code mistakenly
believed that the result of `default-task-supervisor` calls was a
collection of fresh actions only, and therefore consed together the
previous collection of actions with the "new" ones. Because the
`default-task-supervisor` was returning an unmodified accumulator from
time to time, any actions in the accumulator across a call to
`default-task-supervisor` would end up duplicated.

This change favours the thread-the-accumulator-through perspective,
and changes the way the driver uses `new-actions` to match.
This commit is contained in:
Tony Garnock-Jones 2017-08-14 17:17:49 -04:00
parent cb3eee64dc
commit 8cbabafbab
1 changed files with 1 additions and 1 deletions

View File

@ -182,7 +182,7 @@
on-task-exit
actions))
(values (hash-set/remove supervision-states captures new-supervision-state)
(cons actions new-actions))))
new-actions)))
(transition (struct-copy demand-matcher d
[current-demand