Opened up rbyd testing for all geometries, and fixed related bugs
- Caching is still presenting issues with the new requirements for rbyd trees, in this case the default bd, with 64 byte progs, revealed and issue where rcache could become outdated when reading from disk while ignoring what's in the pcache. It assumes the pcache will always override the rcache, but this is not true after pcache is flushed. This didn't happen before as the rcache and pcache don't interact while writing in the previous implementation. Because of these new requirements the caching system probably deserves a rework... - The quick tests for sublinear space utilization don't work when prog_size is > a byte, fortunately we should always have NOR-like geometry under test, so we can limit these asserts to NOR-like geometry. - Lots of problems fitting these tests into 512-byte block_size geometries, which is a bit concerning. This may be a larger change from the previous implementation than expected. This may deserve more scrutiny at small block sizes to see how things fit, since the sublinear space utilization doesn't really kick in at this scale... On the other hand it may just be that these tests are too aggressive for 512-byte block sizes, since they don't yet do compaction, which should help with padding/crc overhead...
This commit is contained in:
+90
-17
@@ -45,6 +45,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_multi_commit]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -69,7 +70,6 @@ code = '''
|
||||
// commit with one attribute
|
||||
rbyd = init_rbyd;
|
||||
lfs_bd_erase(&lfs, rbyd.block) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &rbyd, NULL) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &rbyd,
|
||||
LFSR_ATTR2(UATTR, 1, -1, "\xaa\xaa\xaa\xaa", 4, NULL)) => 0;
|
||||
lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, NULL) => 0;
|
||||
@@ -86,6 +86,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_commit_fetch_commit]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -192,6 +193,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_multi_lookup]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -336,6 +338,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_multi_get]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -431,7 +434,6 @@ code = '''
|
||||
// so that lookups return strictly the tag greater than or equal to
|
||||
// the tag requested
|
||||
rbyd = init_rbyd;
|
||||
rbyd = init_rbyd;
|
||||
lfs_bd_erase(&lfs, rbyd.block) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &rbyd,
|
||||
LFSR_ATTR2(UATTR, 1, -1, "\xaa\xaa\xaa\xaa", 4,
|
||||
@@ -455,6 +457,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_multi_traverse]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -477,7 +480,6 @@ code = '''
|
||||
// so that lookups return strictly the tag greater than or equal to
|
||||
// the tag requested
|
||||
rbyd = init_rbyd;
|
||||
rbyd = init_rbyd;
|
||||
lfs_bd_erase(&lfs, rbyd.block) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &rbyd,
|
||||
LFSR_ATTR2(UATTR, 1, -1, "\xaa\xaa\xaa\xaa", 4, NULL)) => 0;
|
||||
@@ -1650,12 +1652,16 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_multi_permutations]
|
||||
defines.N = 'range(1, 8)'
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= N'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -1742,7 +1748,10 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_large]
|
||||
@@ -1816,6 +1825,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_remove]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -1904,6 +1914,7 @@ code = '''
|
||||
[cases.test_rbyd_remove_permutations]
|
||||
defines.N = 'range(1, 7)'
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= N+1'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -2019,11 +2030,15 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_remove_missing]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 4'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -2115,6 +2130,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_remove_again]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 8'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -2256,6 +2272,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_remove_all]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -2338,6 +2355,7 @@ code = '''
|
||||
[cases.test_rbyd_remove_all_permutations]
|
||||
defines.N = 'range(1, 7)'
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2*N+1'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -2459,12 +2477,16 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_remove_append_permutations]
|
||||
defines.N = 'range(1, 6)'
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= N+2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -2594,7 +2616,10 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
|
||||
@@ -2753,6 +2778,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_multi_create]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 3'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -3019,12 +3045,16 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_multi_create_permutations]
|
||||
defines.N = 'range(1, 8)'
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= N'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -3127,7 +3157,10 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_create_large]
|
||||
@@ -3204,6 +3237,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_delete]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -3364,6 +3398,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_delete_range]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -3606,6 +3641,7 @@ code = '''
|
||||
[cases.test_rbyd_delete_permutations]
|
||||
defines.N = 'range(1, 7)'
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= N+1'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -3737,13 +3773,20 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_delete_range_permutations]
|
||||
defines.N = 'range(1, 7)'
|
||||
defines.M = 'range(1, 4)'
|
||||
in = 'lfs.c'
|
||||
if = '''
|
||||
BLOCK_SIZE/PROG_SIZE >= N+N*M+1
|
||||
&& BLOCK_SIZE >= 4096
|
||||
'''
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -3894,11 +3937,15 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_delete_all]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -4015,6 +4062,7 @@ code = '''
|
||||
|
||||
[cases.test_rbyd_delete_all_range]
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= 2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -4143,6 +4191,10 @@ code = '''
|
||||
[cases.test_rbyd_delete_all_permutations]
|
||||
defines.N = 'range(1, 7)'
|
||||
in = 'lfs.c'
|
||||
if = '''
|
||||
BLOCK_SIZE/PROG_SIZE >= 2*N+1
|
||||
&& BLOCK_SIZE >= 1024
|
||||
'''
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -4282,13 +4334,20 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_delete_all_range_permutations]
|
||||
defines.N = 'range(1, 7)'
|
||||
defines.M = 'range(1, 4)'
|
||||
in = 'lfs.c'
|
||||
if = '''
|
||||
BLOCK_SIZE/PROG_SIZE >= N+N*M + N + 1+M
|
||||
&& BLOCK_SIZE >= 4096
|
||||
'''
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -4448,12 +4507,16 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_delete_create_permutations]
|
||||
defines.N = 'range(1, 6)'
|
||||
in = 'lfs.c'
|
||||
if = 'BLOCK_SIZE/PROG_SIZE >= N+2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -4602,13 +4665,20 @@ code = '''
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
[cases.test_rbyd_delete_create_range_permutations]
|
||||
defines.N = 'range(1, 6)'
|
||||
defines.M = 'range(1, 4)'
|
||||
in = 'lfs.c'
|
||||
if = '''
|
||||
BLOCK_SIZE/PROG_SIZE >= N+N*M + 1 + 1+M
|
||||
&& BLOCK_SIZE >= 4096
|
||||
'''
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_init(&lfs, cfg) => 0;
|
||||
@@ -4782,10 +4852,13 @@ code = '''
|
||||
|
||||
// test that tree is self-balancing, we should be strictly bounded
|
||||
// by height <= 2*log(n)+1, assume tags are roughly ~8 bytes
|
||||
lfs_size_t n = 1 + N+N*M + 2 + 1+M;
|
||||
lfs_size_t n = 1 + N+N*M + 1 + 1+M;
|
||||
printf("worst size: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size, n, 8*n*(2*lfs_nlog2(n)+1));
|
||||
printf("avg height: %u B (N=%u, estimate=%u)\n",
|
||||
worst_size / n, n, 8*(2*lfs_nlog2(n)+1));
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
// note this only holds true with byte-level progs
|
||||
if (PROG_SIZE == 1) {
|
||||
assert(worst_size / n <= 8*(2*lfs_nlog2(n)+1));
|
||||
}
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user