Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Go SAIS suffix sorter #12

Merged
merged 41 commits into from
Jan 9, 2022
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6996564
Rename SS_ISQRT_LOOKUP to ISQRT_LOOKUP
jzebedee Jan 2, 2022
5635354
Add ILOG2_LOOKUP flag in DQ.SS.LDSS
jzebedee Jan 2, 2022
ae4232e
Disable ILOG2_LOOKUP
jzebedee Jan 2, 2022
cf242aa
Move ilog lookups into Utils
jzebedee Jan 2, 2022
94c47c4
Add intrinsic ilog2 for >= netcoreapp3.0 and non-lookup fallback
jzebedee Jan 2, 2022
0f7998d
Use bitop log2 where supported and ilog2_lookup for the rest
jzebedee Jan 2, 2022
bcd64a5
Target net6.0 and bump version to 2.1.0 in DQ.SS.LDSS
jzebedee Jan 2, 2022
0b54a5c
Add GO SAIS
jzebedee Jan 4, 2022
a01fe9f
Port GO SAIS
jzebedee Jan 5, 2022
c29655d
Add TA stub
jzebedee Jan 5, 2022
2e6e99e
Update TA
jzebedee Jan 5, 2022
df47606
Inline TA
jzebedee Jan 5, 2022
8df173a
Add Length and IsEmpty to TA
jzebedee Jan 5, 2022
8665932
Use TA instead of ROS<byte>
jzebedee Jan 5, 2022
ffeecd1
Use generic on GoSAIS class
jzebedee Jan 5, 2022
bb7adf6
Add Slice to TA
jzebedee Jan 5, 2022
7f61a1e
Bugfixes in Go SAIS
jzebedee Jan 5, 2022
d121286
Bugfixes in Go SAIS
jzebedee Jan 5, 2022
3c89a95
Bugfixes in TA
jzebedee Jan 5, 2022
333357b
Bugfixes in Go SAIS
jzebedee Jan 5, 2022
f1d1823
Bugfixes in Go SAIS
jzebedee Jan 7, 2022
cb86789
Rename length_8_32 to length_t_32
jzebedee Jan 7, 2022
f3eb792
Implement ISuffixSort in Go SAIS
jzebedee Jan 7, 2022
776536d
Clean up comments and whitespace in Go SAIS
jzebedee Jan 7, 2022
5a01c69
Use right shift instead of div/2
jzebedee Jan 7, 2022
adbf46c
Remove whitespace
jzebedee Jan 7, 2022
7f742b8
Inline decrement
jzebedee Jan 7, 2022
7fa87b5
Replace allocation in recurse_32
jzebedee Jan 7, 2022
b80bd0a
Update suffix sorting benchmarks to include Go SAIS
jzebedee Jan 8, 2022
0fdc664
Add force alloc test case for Go SAIS
jzebedee Jan 8, 2022
a66174e
Split out SAISTester and add GoSAISTests and SAISTests
jzebedee Jan 8, 2022
1fed00d
Update 3pn in DQ.SS.SAIS
jzebedee Jan 8, 2022
e207bb1
Remove whitespace
jzebedee Jan 8, 2022
15dd35e
Remove whitespace
jzebedee Jan 8, 2022
aecc10a
Add accessibility modifiers to Go SAIS
jzebedee Jan 8, 2022
a826ea5
Set up fuzzing for GoSAIS
jzebedee Jan 8, 2022
df440ed
Back out fuzzing from project
jzebedee Jan 8, 2022
5eb0e16
Bump DQ.SS.SAIS package version to 2.1.0
jzebedee Jan 8, 2022
083038c
Update .gitignore
jzebedee Jan 8, 2022
eb0640d
Fix SuffixSortingBenchmarks
jzebedee Jan 8, 2022
e2af7e4
Merge branch 'master' into zero_alloc_sais
jzebedee Jan 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove whitespace
  • Loading branch information
jzebedee committed Jan 8, 2022
commit e207bb174c1da87d172fdcce1030cda0c9f29697
16 changes: 0 additions & 16 deletions src/DeltaQ.SuffixSorting.SAIS/GoSAIS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -916,40 +916,26 @@ static void induceL_8_32(TextAccessor<T> text, Span<int> sa, Span<int> freq, Spa
// Process it before the left-to-right scan of sa proper.
// See body in loop for commentary.
var k = text.Length - 1;


int c0 = text[k - 1];
int c1 = text[k];

if (c0 < c1)
{
k = -k;

}

// Cache recently used bucket index.
var cB = c1;


var b = bucket[cB];


sa[b] = k;


b++;



for (int i = 0; i < sa.Length; i++)
{
var j = sa[i];

if (j <= 0)
{
// Skip empty or negated entry (including negated zero).
continue;

}

// Index j was on work queue, meaning k := j-1 is L-type,
Expand All @@ -962,9 +948,7 @@ static void induceL_8_32(TextAccessor<T> text, Span<int> sa, Span<int> freq, Spa
// to distinguish them anyway: the final suffix array will end up
// with one zero somewhere, and that will be a real zero.
k = j - 1;

c1 = text[k];

if (k > 0)
{
if (text[k - 1] < c1)
Expand Down