I just pushed some more changes to my branch at http://github.com/tilgovi/couchdb/tree/db_repair
At this point the algorithm is parallelized to configurable degree (right now defined as ?WORKERS at the top). On testwritesdb it seems to stop around 32M of written docs but the process keeps working for a long time after (I didn't let it finish). I suspect this is due to having found all (or most of all) of our documents by descending from the roots we've already seen. It could also be that Adam's term checking code doesn't quite catch all the cases where terms are split over block boundary markers. Sleep time. Randall