larcenists / larceny

Larceny Scheme implementation
Other
202 stars 32 forks source link

excessive mutator activity between regional collections #753

Open WillClinger opened 8 years ago

WillClinger commented 8 years ago

The regional collector allows excessive mutator activity between regional collections on the following benchmark:

../../../larceny --regional --annoy-user --r7rs --program srfi-128-benchmark.sps

This is probably related to the assignment-intensive style in which the sample implementation for SRFI 128 is written, but the regional collector is supposed to preserve its invariants regardless of what the mutator does.

The bug may be harmless for that particular benchmark, because the assignment (inside the code for make-hasher) always stores a fixnum, and it may be that it's just some kind of accounting bug in which some part of the regional collector is using accounting appropriate for the generational collector (which ignores such assignments) instead of the regional collector. But it's definitely a bug, and it could be a serious bug.

WillClinger commented 8 years ago

Here's another possible explanation: vector-map is probably being called with a vector that's too long to fit within a single region. The regional collector's invariants are guaranteed only if every object fits within a single region. We haven't yet changed Larceny's representations to make that possible for long vectors.

If that's the explanation, and it probably is, then it's still a bug but it's a well-understood bug, which is a lot less scary than some unknown bug in the regional collector. I'm downgrading the priority to minor.