Hello, all,

I've got 95% of an implementation of the mechanism (see
<https://snowdrift.coop/p/snowdrift/w/en/mechanism> if you don't know
what I'm talking about). You can clone the git repository from
<https://gitlab.com/pharpend/sd-mech.git>. To build/run it, follow the
instructions in the README.

To be perfectly honest, I copied most of it from Bryan's implementation:
<https://git.gnu.io/chreekat/sd-mechanism.git>. However, my
implementation is far more complete and thoroughly tested. It still has
a few rough edges, and a few of the test suite tests fail (although I
can't figure out why, I'll get to that in a minute).

The test suite runs a randomly-generated list of events, and then runs
checks to make sure the events were processed correctly. You can vary
the number of months the test simulates by editing spec/MarkovSpec, line
31:

    iterations <- runIO $ generate (generateIterations 1200)

1200 = 100 years. So, it generates a month of 'events', then runs the
move-money-from-patron-to-project thing. It does that 1200 times. On my
computer, it takes usually about 5-10 seconds to run. You can edit that
line to make it go faster.

There are, on average, 145 000 test cases per run. On average, maybe 100
of them fail. This is why I wrote an overkilling test suite, to flush
out weird errors that occur very rarely and in odd circumstances. Here's
the last 500 lines of `stack test` output:
<http://lpaste.net/154545>. There's some odd error somewhere, and I
can't figure out what it is. Essentially, either the mechanism library
is withdrawing incorrect sums from people's accounts, or the test suite
is miscalculating the correct sum. I can't figure out which.

Any help would be appreciated. I'm not going to be able to work on the
mechanism in any real capacity for at least the next few days, and my
availability will be spotty. If you would like to contact me,

* I go by 'pharpend' in the IRC channel. I have a persistent connection,
  so you can send me messages at any time, and I'll get back to you when
  I can.
* Of course, you can email me at <[email protected]>.

Thank you,

Peter Harpending
_______________________________________________
Dev mailing list
[email protected]
https://lists.snowdrift.coop/mailman/listinfo/dev

Reply via email to