Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
533 commits
Select commit Hold shift + click to select a range
45ec7a7
textgen: more printable chars. rand256
rurban Mar 24, 2024
6962082
add tsa-q2 asserts
rurban Mar 24, 2024
5bb7385
test: default m=16 with data
rurban Mar 24, 2024
672ea98
gg fails
rurban Mar 24, 2024
af0be5a
test: loop over pattern sizes without m arg
rurban Mar 24, 2024
8ef2b56
fix ffs, lfs crashes, same cause as hor
rurban Mar 24, 2024
2834cf3
unified defines, check illegal m
rurban Mar 25, 2024
a32c305
sanitizer.log: new sbndm-w6 errors
rurban Mar 25, 2024
ffbf3b8
tsa-q2: fix uninit B[] stack-buffer-overflows
rurban Mar 25, 2024
8e97d11
tso5: fix wrong B[] init, add asserts
rurban Mar 26, 2024
ca945e4
tso5: fixed most out-of bounds accesses
rurban Mar 26, 2024
af57a13
tsa: fix wrong B[] init, add asserts
rurban Mar 26, 2024
99fea2c
sanitizer.sh: use all m, not just 2
rurban Mar 26, 2024
64e64d4
asan: re-test bsdm, only bsdm4 fails
rurban Mar 26, 2024
f6b5131
fix bxs* overflows
rurban Mar 26, 2024
7b4d819
asan: enable various stable algos
rurban Mar 26, 2024
99ddc72
WIP fsbndm-w1 fix overflows
rurban Mar 26, 2024
95a0db1
fix fsbndm-w1 tests
rurban Mar 27, 2024
34ed42d
fix DEBUG support
rurban Mar 29, 2024
0d78a22
ensure zero-termination on P and T
rurban Mar 29, 2024
f7012e7
fix out-of-bounds in sbndm-w2,4 and add asserts
rurban Mar 29, 2024
8870ef5
improve cbmc verify
rurban Mar 29, 2024
0969ad7
verify: announce MIN_M minlen limits for CBMC
rurban Mar 29, 2024
0af219f
gh verify only 6 randomly
rurban Mar 29, 2024
6053757
add verify.log
rurban Mar 29, 2024
6aa93d3
raiti verif
rurban Mar 30, 2024
704e8c4
fix raita constraints m>=2
rurban Mar 30, 2024
44161cd
libc: improve buffer-overflows
rurban Mar 30, 2024
2c814cb
test: fix leaks
rurban Mar 30, 2024
8e20c3c
gh: extend to 10 tests,
rurban Mar 30, 2024
be9e85c
add algocfg helper
rurban Mar 30, 2024
2357b9d
verify: bsdm7 times out in the CI
rurban Mar 31, 2024
5c5781d
~0; => ~0U;
rurban Mar 31, 2024
c9cfe72
add afl-plus fuzzing
rurban Mar 30, 2024
d30398c
add afl-plus fuzzing
rurban Mar 30, 2024
41aa87e
split verify in extra targets
rurban Mar 31, 2024
4b060bf
verify: improve bf depth UNSATISFIABLE
rurban Mar 31, 2024
015a2d9
vfy tuning: find mp cbmc args
rurban Mar 31, 2024
3f29334
verify: find smoa violations
rurban Mar 31, 2024
dbb34bb
asan: fix tso5 overflows + assertions
rurban Mar 31, 2024
e724819
asan: bndmq6 fails
rurban Mar 31, 2024
2df75ce
results: fix 2 missing html js includes
rurban Mar 31, 2024
5e8baad
asan: tvsbs-w2 RNDCRASH
rurban Mar 31, 2024
347d187
verify: ildm2 timeout
rurban Mar 31, 2024
9ff7f70
asan: musl fails very long rand tests (m=1024)
rurban Mar 31, 2024
cb59a8a
add new paragraphs to the README
rurban Mar 31, 2024
ffa42bc
fix faoso*: wrong log2 for 64bit
rurban Mar 23, 2024
92a79ee
bxs*: fix overflows and add assertions
rurban Mar 23, 2024
c969708
new vfy fails
rurban Mar 31, 2024
807197c
bndm: fix search_large, use OUTPUT
rurban Apr 1, 2024
e4799df
bxs: fix overflows
rurban Apr 1, 2024
b8cc207
add missing MIN_M for cbmc
rurban Apr 1, 2024
a6ec3fb
add new qf53,qf72,qf82 from the ostafen fork
rurban Apr 1, 2024
02e8b63
verify: update some results
rurban Apr 1, 2024
0f982d5
add new bram3,5,7 from the ostafen fork
rurban Apr 1, 2024
91f5ce0
remove duplicate and broken TunBM
rurban Apr 1, 2024
ebd474f
verify: bww times out in the GH CI
rurban Apr 1, 2024
ef33f78
re-enable now passing algos
rurban Apr 1, 2024
6536c73
READNE: add Benchmarks links
rurban Apr 2, 2024
13c91b5
smart: add option -all
rurban Apr 2, 2024
76e83ca
make fmt (clang-format)
rurban Apr 2, 2024
14cce0f
hash3-8: search_small fallbacks
rurban Apr 2, 2024
90fcbfb
reorder best algos
rurban Apr 2, 2024
6947886
SHMDEBUG to find the shm error
rurban Apr 2, 2024
a07e50d
fix shmalloc
rurban Apr 2, 2024
fc99022
add istty check via CI env var
rurban Apr 2, 2024
68bd195
add istty check to compilesm also
rurban Apr 2, 2024
ff0d14a
add istty check to textgen also
rurban Apr 2, 2024
e905f93
update lint results
rurban Apr 3, 2024
a3ed635
use lint results
rurban Apr 3, 2024
15e94e2
html2: prepend   to -
rurban Apr 3, 2024
06f61eb
remove unused results/prova
rurban Apr 3, 2024
b62dba3
remove alert([LINE] You have negative values...
rurban Apr 3, 2024
c763fda
rgraph: switch from local to cdnjs
rurban Apr 3, 2024
103035e
select: implement -backup -restore
rurban Apr 3, 2024
7e5d7af
add all.sh best.sh scripts
rurban Apr 3, 2024
2805e6a
select: implement numbered backups
rurban Apr 3, 2024
fa871f5
output whitespace only
rurban Apr 3, 2024
4fc50f3
more output whitespace
rurban Apr 3, 2024
126d783
search_large for twfrq2,4 m>512
rurban Apr 3, 2024
1382991
verify: skip failing algos
rurban Apr 3, 2024
94f5e8f
more algocfg usage
rurban Apr 3, 2024
2741c44
select: silence unchecked system calls
rurban Apr 4, 2024
c6f5ff8
update sanitizer.log
rurban Apr 4, 2024
d546078
smart: implement -plen 2:4:64 support
rurban Apr 3, 2024
b700f14
adjust good, asan
rurban Apr 4, 2024
6de2a6b
verify: skip unwind for all TIMEOUT, UNSAT
rurban Apr 1, 2024
9738210
more verify args
rurban Apr 1, 2024
5809415
update verify.log
rurban Apr 4, 2024
03667d3
verify results
rurban Apr 4, 2024
cc45b43
output: index.html
rurban Apr 4, 2024
e338164
better best20 candidates
rurban Apr 4, 2024
fed2160
all/best minor script improvements
rurban Apr 5, 2024
46cb0a6
html: 18k smaller size
rurban Apr 5, 2024
049a43a
output: fix bound (best-worst) mixups
rurban Apr 5, 2024
7964b0e
smart: ISO 8601 date formatting
rurban Apr 5, 2024
bd93bf0
fix fsbndm-w2 asserts
rurban Apr 5, 2024
90eab5f
macos: 15m timeout
rurban Apr 5, 2024
323149c
some sbndm-w fixes
rurban Apr 5, 2024
456ff5c
verify: add goto-analyzer cross-analyzation step
rurban Apr 5, 2024
3ee2ca5
fuzz: create testcases from the crashes
rurban Apr 5, 2024
a8dd4e5
select: -Wunused-result
rurban Apr 5, 2024
ee13fd7
select: one more -Wunused-result missing
rurban Apr 6, 2024
76c576c
test: add one of the fuzzer testcases for NUL-safety
rurban Apr 5, 2024
b476536
more algocfg deps
rurban Apr 6, 2024
2ddb1ea
asan tests runs too long now
rurban Apr 5, 2024
2a50792
goto-analyzer: -DCMBC for the constraints
rurban Apr 6, 2024
66189f1
fixed fs-w4 overflows
rurban Apr 6, 2024
e12555a
fix fs-w2 overflows and logic
rurban Apr 7, 2024
83c91b3
fix fs-w1 overflows
rurban Apr 8, 2024
14bb595
fs-w6,8: WIP asan
rurban Apr 8, 2024
acf18ac
make: darwin BINDIR fixes
rurban Apr 7, 2024
585edfb
add musl2, variant with horspool skip
rurban Apr 8, 2024
48de73a
more -DDEBUG support
rurban Apr 12, 2024
b3c370f
sbndmq8: add asserts
rurban Apr 12, 2024
f4a82ba
fix algocfg crash with algo arg only
rurban Oct 31, 2024
f7805a0
vfy: cbmcargs
rurban Oct 31, 2024
a390903
vfy: implement solver flags
rurban Oct 31, 2024
1e8fd3e
vfy: try full proof with no depth bounds
rurban Oct 31, 2024
38a65be
deps
rurban Nov 1, 2024
0e69a6c
cbmc: pass --verbosity 7 for older cmbc 5.12
rurban Nov 1, 2024
438fa4b
vfy: more cmbc opts in my github
rurban Nov 2, 2024
277bc9c
vfy: fix by inlining all sizes
rurban Nov 2, 2024
1bdec08
add more MIN_M,MAX_M boundaries
rurban Nov 3, 2024
fe11a51
fuzz: extend fuzz repro
rurban Nov 4, 2024
3d61241
test: support --files
Nov 4, 2024
42ad7b7
fix fuzz YSIZE
Nov 4, 2024
1b1df2d
fuzz: minor improvements
Nov 4, 2024
b465060
support emacs flymake-mode
Nov 5, 2024
d669d0c
fuzz: extend fuzz repro
rurban Nov 4, 2024
7a07a30
more fsbndm-w4 nonsense
rurban Nov 5, 2024
f2681da
more verifications
rurban Nov 5, 2024
4b8bc5c
improve fuzzing, not being killed
rurban Nov 7, 2024
d086f32
fuzz: better repro. -DNOSHM, hexquote
rurban Nov 9, 2024
62bc5f1
fix test for NUL in strings
rurban Nov 9, 2024
05d75a9
fuzz-repro.sh: support -nv
rurban Nov 9, 2024
922aa90
lint results
rurban Nov 9, 2024
15dd6e6
asan: fs-w6 and fs-w8 fail now asan
rurban Nov 10, 2024
4664d77
verify: start esbmc support
rurban Nov 10, 2024
7df0699
msys has no shmdt anymore
rurban Nov 10, 2024
a87d160
make check: less verbose
rurban Nov 10, 2024
08cedfc
rcolussi hangs with rand2
rurban Nov 10, 2024
cdf04bc
better printable helper
rurban Nov 10, 2024
07229d7
add smart -nv flag, non-verbose
rurban Nov 10, 2024
78c5163
more esbmc solver fixes
rurban Nov 10, 2024
e9d897a
found esbmc failing verifications
rurban Nov 10, 2024
ee35aec
add fuzz-repro target
rurban Nov 10, 2024
23debed
fuzz with asan
rurban Nov 10, 2024
78af259
fix fuzz-repro.sh syntax error
rurban Nov 11, 2024
ff8d446
more tsa-q2 asserts
rurban Nov 12, 2024
34d46c0
fixed asan errors
rurban Nov 12, 2024
7b05c11
fix asan.lst and good.lst
rurban Nov 13, 2024
3091c49
work on fs-w4
rurban Nov 13, 2024
c42b81c
smart: fix for mingw/msys
rurban Nov 14, 2024
6626b4c
add tvsbs-w6 asserts
rurban Nov 14, 2024
38b5e12
ci: extend aarch64 timeout
rurban Nov 16, 2024
3588097
tvsbs-w6.vfy with goto-analyzer
rurban Nov 16, 2024
62f29fb
verify: fix wrong bf_search_large MAX_M asserts
rurban Nov 18, 2024
c026cac
fuzz: special indir
rurban Nov 19, 2024
a44955b
extend fuzz, check against bf
rurban Nov 19, 2024
83ab486
sbndm-w6: fix illegal search_small
rurban Nov 19, 2024
f6cac20
jom: found crashes and try to fix em
rurban Nov 24, 2024
3a620ed
fix ufndmq* algos heap-overflows
rurban Nov 24, 2024
d4b1944
sbndmq8 asan failures are not repro anymore
rurban Nov 24, 2024
743ec9a
fuzz: fix crash with missing data/fuzz/index.txt
rurban Nov 24, 2024
3103fe3
test: fix error return code
rurban Nov 26, 2024
a8ea63e
test --files: nul terminate the input strings
rurban Nov 26, 2024
1ef360f
mark sbndm-w6 and sbndm-w4 as still crashing
rurban Nov 26, 2024
538300f
simdkr: fix neon_strstr_generic
rurban Nov 26, 2024
626d773
ssecp, ssef: simde support for other archs
rurban Nov 26, 2024
6161369
fix MIN_M 2 for lbndm and sbndm2
rurban Nov 26, 2024
310fe3a
realloc y with tvsbs-w*
rurban Nov 26, 2024
db18bba
ubsan: exit 1 on ubsan errors
rurban Nov 30, 2024
bff0a0c
make fuzz-repro cleanup false fuzz errors
rurban Nov 30, 2024
513c564
sbndm minlen 2
rurban Dec 2, 2024
d53f6f2
tsa: fix wrong asserts
rurban Dec 6, 2024
fbd562f
musl: fix timers
rurban Mar 13, 2025
d53f5e3
add hashchain algos
rurban Mar 12, 2025
f78fe84
add lhc* variants: Wors-case linear
rurban Mar 12, 2025
54a8f80
add flhc* variants: Fast
rurban Mar 12, 2025
b39ea11
add unsafe shc* variants
rurban Mar 12, 2025
cc7e843
musl1: seperate prep step
rurban Mar 14, 2025
ee3a737
gh: pinact run -u
rurban Jul 3, 2025
75373c7
fix best.sh and all.sh
Mar 18, 2026
ee809f8
new best25 ranking
Mar 19, 2026
e5ef93e
hashchain: fix -Wmaybe-uninitialized
rurban Mar 17, 2025
814c217
ms,om: fix qsort comparator pointer type mismatch
rurban Sep 21, 2026
9e351a4
minor fixes: no wrong algocfg deps and ununsed-arg warnings
rurban Sep 21, 2026
c3f5fc6
fix some wrong algo constraints and crashes
rurban Sep 21, 2026
5430298
Fix multi-sliding windows algorithms classification and search_large …
rurban Sep 21, 2026
56b2a3c
fix many lint warnings
rurban Sep 21, 2026
14e5b9f
epsm: fix 4 distinct OOB reads found by differential fuzzing
rurban Sep 21, 2026
ed279fc
README: drop duplicated multi-sliding-windows doc pointer
rurban Sep 21, 2026
be54dd2
test: fix printable() display bug, guard case 21 by minlen; reclassif…
rurban Sep 21, 2026
4b4b5ec
simon,ssecp: fix heap corruption, miscounts, infinite loop, OOB reads
rurban Sep 21, 2026
f659c78
window family leftovers: route through search_safe; simon: fix signed…
rurban Sep 21, 2026
c22861e
blim: document known bugs and historical context
rurban Sep 21, 2026
b56dffc
tsa-q2: fix three bugs (mask overflow, coverage gap, unverified m=Q c…
rurban Sep 21, 2026
3c3be12
add BSD support: BSDmakefile
rurban Sep 22, 2026
7fdbc9e
bmh-sbndm: fix two bugs in the post-match shift computation
rurban Sep 21, 2026
c132d0b
graspm: fix candidate-list traversal bug and its already-seen band-aid
rurban Sep 21, 2026
20fdcca
ldm: fix stale-R bug causing phantom occurrences past a match
rurban Sep 21, 2026
3a3cfb1
README: update stale 'unsafe' EPSM note
rurban Sep 21, 2026
e239f9b
simdkr: fix SIMD block overread and m=1 heap-buffer-overflow
rurban Sep 21, 2026
08a7294
musl2: fix broken post-match Horspool shift (was skipping overlaps)
rurban Sep 21, 2026
301f87e
faoso4: fix verify_large missing bounds check and lost match count
rurban Sep 21, 2026
4048ffa
faoso6: fix bit-register overflow (q=6 layout needs more than 32 bits)
rurban Sep 21, 2026
9e0e17b
Added OUTPUT support for epsm,ssecp,tsa,tsa-q2,tso5
rurban Sep 22, 2026
25e3a0a
Fix tsa-q2 incorrect assert causing deterministic abort
rurban Sep 22, 2026
cecb967
Fix fhc1-8 fuzzing failures by adding fallback search for short patterns
rurban Sep 22, 2026
372fc53
Fix tvsbs-w2 heap buffer overflow on short patterns
rurban Sep 22, 2026
819ef6b
Makefile: generate rand*.txt test data as a proper dependency
rurban Sep 22, 2026
d321696
GNUmakefile: fix algocfg not found on fresh make after clean
rurban Sep 22, 2026
8324d56
ci: no aarch64 on qemu check, macos is aarch64 now
rurban Sep 22, 2026
15df990
update best.sh selection
rurban Sep 23, 2026
8888528
fix fuzzing problems
rurban Sep 23, 2026
edbebf6
Update tests.lst and other lists
rurban Sep 21, 2026
7c38224
Update README and best.sh recommendations
rurban Sep 21, 2026
98eb239
still failing: rcolussi graspm blim
rurban Sep 21, 2026
56843e9
blim: handle single-byte patterns
rurban Sep 24, 2026
33c4ce3
blim: fix mask scan and fallbacks
rurban Sep 24, 2026
624eb93
fuzz: disable benchmark timers
rurban Sep 24, 2026
a5d0f46
add bql algo: good
rurban Sep 24, 2026
dc4fab7
add hpbm algo
rurban Sep 24, 2026
f37816f
fix epsm warning with clang
rurban Sep 24, 2026
13b54a4
fix the project links
rurban Sep 24, 2026
22d359a
add scut and 2block sustik-moore algos
rurban Sep 24, 2026
13bb403
add BMH q-gram algorithms
rurban Sep 24, 2026
6d45255
add sbdm algo, succinct backward DAWG matching
rurban Sep 24, 2026
e5dc394
add backward set oracle matching
rurban Sep 24, 2026
5c4587b
add sm - Wu Manber matcher
rurban Sep 24, 2026
cc894fa
add swm simplified Wu Manber matcher
rurban Sep 24, 2026
5474ff7
add krsimd, a better polynomial AVX2 rabin-karp
rurban Sep 24, 2026
33939fd
support ./algocfg fail
rurban Sep 24, 2026
87b780e
add BM BNDM matcher
rurban Sep 25, 2026
825f97f
add Turbo BNDM matcher
rurban Sep 25, 2026
90d88f7
add SMART result merger
rurban Sep 25, 2026
d95a08c
Update tests
rurban Sep 25, 2026
29bc3cc
Update README.md
rurban Sep 25, 2026
7203cbd
smart: implement timeout, default 300ms
rurban Mar 21, 2024
1677c24
libc and musl fail with \0 in the text
rurban Sep 25, 2026
a9f0052
make verify-trace
rurban Sep 25, 2026
a155c60
smart: add ARM NEON support for ssecp and epsm
rurban Sep 25, 2026
180fff9
fix fndm, random gs fails with m=32
rurban Sep 25, 2026
5a211b5
add epsm AVX2 support
rurban Sep 25, 2026
b088243
updated clang-tidy.log
rurban Sep 25, 2026
8a21895
Support cross-compiling to AVR (CC=avr-gcc)
rurban Sep 26, 2026
ec9140d
Support cross-compiling to ARMv6 (bare-metal Cortex-M0 + Linux userland)
rurban Sep 26, 2026
a1329f9
Support cross-compiling to STM8 (sdcc), and mips32/riscv32 (algos only)
rurban Sep 26, 2026
6a8e335
Fix clock_gettime portability bug found via real mips32/riscv32 sysroots
rurban Sep 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
Language: Cpp
# BasedOnStyle: LLVM
ReflowComments: false
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
SortIncludes: false
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
results/
.git/
bin/
95 changes: 95 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: CI

on:
push:
paths-ignore:
- 'data/*'
- 'results/*'
pull_request:
paths-ignore:
- 'data/*'
- 'results/*'

jobs:
linux:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: ./build.sh dotest && make check
sanitizer:
runs-on: ubuntu-26.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: sudo apt install -y --no-install-recommends libomp5 libomp-21-dev
- name: Fix kernel mmap rnd bits for -fsanitize=address
run: |
# https://github.com/actions/runner-images/issues/9491
sudo sysctl vm.mmap_rnd_bits=28
- name: make SANITIZE=1 && test-asan `./algocfg asan`
# all asan's that are also good
run: |
make CC=clang SANITIZE=1 &&
for t in `cat asan.lst`
do
./test-asan "$t" -nv
done
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
sudo apt-get -y install cppcheck clang-tidy bear
- run: make algocfg lint
verify:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
sudo apt-get -y install cbmc
- run: make algocfg check-verify
windows:
runs-on: windows-latest
timeout-minutes: 10
env:
MSYS2_DIR: msys64
MSYS2_ARCH: x86_64
MSYSTEM: MINGW64
ARCH: win64
PLATFORM: x64
steps:
# see https://github.com/msys2/setup-msys2
- name: setup-msys2
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
with:
path-type: minimal
update: true
install: >-
git
base-devel
mingw-w64-x86_64-toolchain
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
- shell: msys2 {0}
run: ./build.sh
macOS:
runs-on: macos-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
sudo sysctl -w kern.sysv.shmmax=16777216
sudo sysctl -w kern.sysv.shmmni=128
sudo sysctl -w kern.sysv.shmseg=32
sudo sysctl -w kern.sysv.shmall=4096
- name: ./build.sh dotest && make check
run: |
./build.sh dotest
./free_shm
make check
./free_shm
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/TAGS
/compilesm
/select
/show
/smart
/test
/textgen
/algocfg
/compilesm-asan
/select-asan
/smart-asan
/test-asan
/compilesm-fuzz
/smart-fuzz
/test-fuzz
/fuzz.sh
algorithms.lst
/data/rand128/rand128.txt
/data/rand16/rand16.txt
/data/rand2/rand2.txt
/data/rand256/rand256.txt
/data/rand32/rand32.txt
/data/rand4/rand4.txt
/data/rand64/rand64.txt
/data/rand8/rand8.txt
/data/.textgen-stamp
/data/fuzz
/docs/*.pdf
/results/
/bin/
compile_commands.json
compile_commands.events.json
/sanitizer.log
/rb.sh
/lb.sh
/source/3rd/
/source/algos/new/
/fuzz/
/verify/*.vfy-trace
/verify/*.c
/verify/*.log
.cache
103 changes: 103 additions & 0 deletions BSDmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# nmake guard: \
# https://stackoverflow.com/questions/8270391/use-the-same-makefile-for-make-linux-and-nmake-windows \
.ifndef 0 # \
.else
# bmake starts here
CC ?= gcc
# FIXME: detect mingw
ARCH != (${CC} -dumpmachine | cut -f1 -d-)
BINDIR = bin
.if ${ARCH} != x86_64
CFLAGS ?= -O3 -Wall
.if ${ARCH} == aarch64 || ${ARCH} == arm64
NON_SSE = "source/algos/ssef.c"
.else
NON_SSE = "source/algos/epsm.c|source/algos/ssecp.c|source/algos/ssef.c"
.endif
ALGOSRC = (grep -E -v "^(${NON_SSE})$$" source/algos/*.c)
.else
CFLAGS ?= -O3 -march=native -mtune=native -Wall -Wfatal-errors
.ifdef SANITIZE
BINDIR = bin/asan
CFLAGS += -g -Wextra -fsanitize=address,undefined -DBINDIR=\"${BINDIR}\"
.endif
ALGOSRC = ${wildcard source/algos/*.c}
.endif
.if ${ARCH} != ${_HOST_ARCH}
BINDIR = bin/${ARCH}
CFLAGS += -DBINDIR=\"${BINDIR}\"
DRV = qemu-${ARCH}
.else
DRV =
.endif
ALLSRC = ${ALGOSRC} ${wildcard source/*.c} ${wildcard source/*.h} ${wildcard source/algos/include/*.h}
BINS = ${patsubst source/algos/%,${BINDIR}/%,${patsubst %.c,%,${ALGOSRC}}}
HELPERS = smart show select test textgen compilesm
TESTS != (shuf -n 6 good.lst)
.if ${TESTS} == ""
TESTS = bm mp kmp tbm bom so
.endif

all: ${BINS} ${HELPERS}

${BINDIR}/hpbm: CFLAGS += -fopenmp

${BINDIR}/%: source/algos/%.c $(wildcard source/algos/include/*.h)
@test -d ${BINDIR} || mkdir ${BINDIR}
${CC} ${CFLAGS} $< -o $@
./%: source/%.c $(wildcard source/*.h)
${CC} ${CFLAGS} $< -std=gnu99 -o $@ -lm
select: source/selectAlgo.c
${CC} ${CFLAGS} $< -o $@

.PHONY: all check clean lint verify fmt cppcheck clang-tidy ALWAYS
check: all
-cp source/algorithms.lst source/algorithms.lst.bak
${DRV} ./select -all
${DRV} ./select -which | grep br
-cp ${BINDIR}/br ${BINDIR}/br1
${DRV} ./select -add br1
-rm ${BINDIR}/br1
${DRV} ./select -none ${TESTS}
${DRV} ./smart -text rand32 -plen 2 4
${DRV} ./smart -simple abab chbjhxsscsjndwkjnjdnwelabakdlkewdkklewlkdewlkdnewknabdewab
for t in ${TESTS}; do echo $$t; ./test $$t; done
${DRV} ./select -all block bmh2 bmh4 dfdm sbdm faoso2 blim ssecp
-mv source/algorithms.lst.bak source/algorithms.lst
sanitizer.log: ${ALLSRC}
-rm -f sanitizer.log 2>/dev/null
./sanitizer.sh 2>sanitizer.log
lint: cppcheck clang-tidy
# --check-level=exhaustive for newer cppcheck
cppcheck:
cppcheck -j4 --enable=warning,portability --inline-suppr \
source/*.c source/algos/*.c
compile_commands.json: makefile
-+${MAKE} clean
bear -- ${MAKE}
clang-tidy.log: compile_commands.json ${ALLSRC}
clang-tidy source/*.c source/algos/*.c | sed -e"s,$$PWD/,," | tee clang-tidy.log
clang-tidy: clang-tidy.log

CBMC_CHECKS=--bounds-check --pointer-check --memory-leak-check \
--div-by-zero-check --signed-overflow-check --unsigned-overflow-check \
--pointer-overflow-check --conversion-check --undefined-shift-check \
--float-overflow-check --nan-check --enum-range-check
# cbmc 5.12.1: --pointer-primitive-check
verify:
for c in ${ALGOSRC}; do \
echo cbmc -DCBMC --depth 1024 ${CBMC_CHECKS} $$c; \
cbmc -DCBMC --depth 1024 ${CBMC_CHECKS} $$c; \
done
fmt:
clang-format -i `find source -name \*.c -o -name \*.h`
clean:
-rm -f ${BINS} ${HELPERS} 2>/dev/null
TAGS: ${ALLSRC}
-rm -f TAGS 2>/dev/null
find . \( -name \*.c -o -name \*.h \) -exec etags -a --language=c \{\} \;

ALWAYS:

# \
.endif
20 changes: 20 additions & 0 deletions Dockerfile.cross-aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- Dockerfile -*-
# podman/docker build -t smart-aarch64 . -f Dockerfile.cross-aarch64

FROM docker.io/library/debian:11-slim as aarch64
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
ENV TZ=UTC

RUN apt-get update
RUN apt-get install -y --no-install-recommends build-essential git \
qemu-system-aarch64 binfmt-support qemu-user qemu-user-binfmt \
gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-dev-arm64-cross
WORKDIR /app
COPY . .
RUN aarch64-linux-gnu-gcc --version
RUN make CC=aarch64-linux-gnu-gcc
RUN ln -s /usr/aarch64-linux-gnu/sys-root/usr/bin/ld.so /lib/ld-linux-aarch64.so.1
ENV LD_LIBRARY_PATH=LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/sys-root/lib64
RUN make CC=aarch64-linux-gnu-gcc check
CMD [ "bash --login -i" ]
33 changes: 33 additions & 0 deletions Dockerfile.fedora-aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- Dockerfile -*-
# podman build -t smart-fc-aarch64 . -f Dockerfile.fedora-aarch64
# podman run -it smart-fc-aarch64 bash --login -i
ARG BASE_IMAGE=fedora
#FROM ${BASE_IMAGE}
FROM fedora:39-aarch64

# Test with non-root user.
ENV TEST_USER tester
ENV WORK_DIR "/work"

#RUN uname -a
#RUN echo -e "deltarpm=0\ninstall_weak_deps=0\ntsflags=nodocs" >> /etc/dnf/dnf.conf
# Disable modular repositories to save a running time of "dnf update"
#RUN ls /etc/yum.repos.d/*.repo
#RUN sed -i '/^enabled=1$/ s/1/0/' /etc/yum.repos.d/*-modular.repo || true
#RUN dnf -y update
RUN dnf -y --allowerasing --repo fedora install \
file gcc make redhat-rpm-config sudo
#RUN dnf -y --repo fedora install m4 libtool perl-Text-Diff pkgconf-pkg-config strace gdb
#RUN dnf -y --repo fedora install strace gdb

# Create test user and the environment
RUN useradd "${TEST_USER}"
WORKDIR "${WORK_DIR}"
COPY . .
RUN chown -R "${TEST_USER}:${TEST_USER}" "${WORK_DIR}"

# Enable sudo without password for convenience.
RUN echo "${TEST_USER} ALL = NOPASSWD: ALL" >> /etc/sudoers
#RUN ln -s /usr/aarch64-linux-gnu/sys-root/usr/bin/ld.so /lib/ld-linux-aarch64.so.1

USER "${TEST_USER}"
Loading
Loading