KenCloud-Tech / go-ipld-prolly-trees

golang implementation of probabilistic merkle search trees for IPLD
Apache License 2.0
13 stars 0 forks source link

Testcases we wish to support #6

Open RangerMauve opened 1 year ago

RangerMauve commented 1 year ago

This is an issue for tracking the sorts of tests we want to do (accross implementations) and test fixgures to load and generate.

This will also involve @sionois giving his insights from his work on fixutres for HAMT and his work on the Rust implementation

SionoiS commented 1 year ago

Hi,

Would be cool to have all the data online. I got an IPFS node at home if needed.

Since trees need rebalancing designing some tests so that they result in the absolute worst case possible is a good start.

MSTs worst case for a single change is one merge/split per layer for example.

SionoiS commented 1 year ago

Just added my first test for MSTs. Are batch write idempotent? Should be true.

sssion commented 1 year ago

The fixtures and related unit test are here https://github.com/kenlabs/go-ipld-prolly-trees/blob/82e272813aa77e423f22f7d19dc055c25a7ef525/pkg/tree/fixtures/fixtures_test.go#L1

SionoiS commented 1 year ago

@sssion The goal would be to have language agnostic test fixtures.

First step would be to make a list of the tests we want.

sssion commented 1 year ago

@SionoiS I replace the data file with car file, now the data is a map(ipld) node, the k/v pair in the map node is the raw data, (key should be converted from bytes to string). But the map node iter not keep the input pairs order, we should sort it before using

SionoiS commented 1 year ago

Just add my first test for MSTs. Are batch write idempotent? Should be true.

@sssion I made a mistake in my post. It sounded like I wanted someone to add the test in this repo. That's not the case. Sorry.

I want us to brainstorm all the test cases we can think of then keep the best ones.

Description of the tests and CIDs for initial/end states is the data we need.