Skip to content

Commit bd16219

Browse files
Merge pull request #104 from conp-solutions/more-testing
More testing
2 parents 6ceb688 + 8c26418 commit bd16219

File tree

14 files changed

+209
-210
lines changed

14 files changed

+209
-210
lines changed

.github/workflows/build-and-test-parallel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
Linux:
1414

15-
runs-on: ubuntu-18.04
15+
runs-on: ubuntu-20.04
1616

1717
steps:
1818
- name: Install Packages

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
CrossARM:
1010

11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-20.04
1212

1313
steps:
1414
- name: Install Packages

.github/workflows/build-werror.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
Linux:
1010

11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-20.04
1212

1313
steps:
1414
- name: Install Packages

.github/workflows/check-style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
Linux:
1010

11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-20.04
1212

1313
steps:
1414
- name: Install Packages

.github/workflows/compare-upstream.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
Linux:
1010

11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-20.04
1212

1313
steps:
1414
- name: Install Packages

.github/workflows/mini-competition.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
Linux:
1010

11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-20.04
1212

1313
steps:
1414
- name: Install Packages

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
Linux:
1111

12-
runs-on: ubuntu-18.04
12+
runs-on: ubuntu-20.04
1313

1414
steps:
1515
- name: Install Packages

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
* testing: use modgen generator during fuzzing runs
1011
* fix FPU control to compile on ARM
1112

1213
## [v3.2.1] - 2021-12-20

tools/checker/check-drat.sh

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,38 @@ shift
1111
# check for file
1212
[ -f "$f" ] || exit 2
1313

14+
SCRIPT_DIR="$(cd $(dirname "$0") && pwd)"
15+
1416
# static variables
1517
p=p.proof
1618
o=drat-minimize-output.txt
1719
t=$(readlink -e ../../build/release/bin/mergesat)
1820
# allow to override the solver location via environment variable
19-
if [ -n "${FUZZ_SOLVER:-}" ]
20-
then
21-
t=$(readlink -e "${FUZZ_SOLVER:-}")
21+
if [ -n "${FUZZ_SOLVER:-}" ]; then
22+
t=$(readlink -e "${FUZZ_SOLVER:-}")
2223
fi
23-
d=$(readlink -e drat-trim)
24+
d=$(readlink -e "$SCRIPT_DIR"/drat-trim)
2425

2526
# run solver
2627
STATUS=0
27-
"$t" "$f" -drup-file=$p $@ || STATUS=$?
28+
$t "$f" -drup-file="$p" $@ || STATUS=$?
2829

29-
if [ "$STATUS" -ne 0 ] && [ "$STATUS" -ne 10 ] && [ "$STATUS" -ne 20 ]
30-
then
31-
echo "unexpected status code $STATUS"
32-
exit $STATUS
30+
if [ "$STATUS" -ne 0 ] && [ "$STATUS" -ne 10 ] && [ "$STATUS" -ne 20 ]; then
31+
echo "unexpected status code $STATUS"
32+
exit $STATUS
3333
fi
3434

3535
# exclude trivial unsat
3636
grep "^0$" $f && exit 0
3737

3838
# run the check
39-
if [ "$STATUS" -ne 20 ]
40-
then
39+
if [ "$STATUS" -ne 20 ]; then
4140
exit $STATUS
4241
fi
4342

4443
# verify binary proof format
4544
VERIFY_STATUS=0
46-
$d $f $p -v -v -n &> $o || exit $VERIFY_STATUS
45+
$d $f $p -v -v -n &>$o || exit $VERIFY_STATUS
4746
echo "verify status: $VERIFY_STATUS"
4847
# for now, don't be too strict
4948
# grep " does not occur: " $o && exit 3
@@ -52,24 +51,22 @@ exit 20
5251
# re-run with plain proof format
5352
"$t" "$f" -drup-file=$p -no-binary-proof $@ || STATUS=$?
5453

55-
if [ "$STATUS" -ne 0 ] && [ "$STATUS" -ne 10 ] && [ "$STATUS" -ne 20 ]
56-
then
57-
echo "unexpected status code $STATUS"
58-
exit $STATUS
54+
if [ "$STATUS" -ne 0 ] && [ "$STATUS" -ne 10 ] && [ "$STATUS" -ne 20 ]; then
55+
echo "unexpected status code $STATUS"
56+
exit $STATUS
5957
fi
6058

6159
# exclude trivial unsat
6260
grep "^0$" $f && exit 0
6361

6462
# run the check
65-
if [ "$STATUS" -ne 20 ]
66-
then
63+
if [ "$STATUS" -ne 20 ]; then
6764
exit $STATUS
6865
fi
6966

7067
# verify binary proof format
7168
VERIFY_STATUS=0
72-
$d $f $p -v -v -n &> $o || exit $VERIFY_STATUS
69+
$d $f $p -v -v -n &>$o || exit $VERIFY_STATUS
7370
echo "verify status: $VERIFY_STATUS"
7471
# for now, don't be too strict
7572
# grep " does not occur: " $o && exit 3

tools/checker/fuzz-drat.sh

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,43 @@ TIMEOUT=$2
88

99
[ -n "$TIMEOUT" ] || exit 2
1010

11-
c=$(readlink -e cnfuzz)
11+
SCRIPT_DIR="$(cd $(dirname "$0") && pwd)"
12+
13+
c="$SCRIPT_DIR/modgen"
1214

1315
I=0
14-
f=input.cnf
16+
f=fuzz_input.cnf
17+
declare -i found_sat=0
18+
declare -i found_unsat=0
1519

1620
FAILED=0
17-
while true
18-
do
19-
I=$((I+1))
20-
[ "$LIMIT" -ge "$I" ] || break
21-
# echo "[$SECONDS] run $I ..."
22-
$c > $f
23-
STATUS=0
24-
timeout "$TIMEOUT" ./check-drat.sh $f &> output.log || STATUS=$?
25-
# ignore time outs
26-
[ "$STATUS" -ne 124 ] || continue
21+
while true; do
22+
I=$((I + 1))
23+
[ "$LIMIT" -ge "$I" ] || break
24+
# echo "[$SECONDS] run $I ..."
25+
seed="$(echo $(($(date +%s%N) / 1000000)))"
26+
cls=""
27+
while [ -z "$cls" ]; do
28+
cls="$(bash -c 'echo $((9000 + $(date +%4N) ))' 2>/dev/null)"
29+
done
30+
modgen_cli_args="-s $seed -n 3500 -m $cls"
31+
$c $modgen_cli_args >$f
32+
STATUS=0
33+
timeout "$TIMEOUT" "$SCRIPT_DIR"/check-drat.sh $f &>output.log || STATUS=$?
34+
# ignore time outs
35+
[ "$STATUS" -ne 124 ] || continue
2736

28-
# make failures permanent
29-
if [ "$STATUS" -ne 0 ] && [ "$STATUS" -ne 10 ] && [ "$STATUS" -ne 20 ]
30-
then
31-
echo "[$SECONDS] failed for try $I with status $STATUS and header $(grep "p cnf" input.cnf) seed $(awk '/c seed/ {print $3}' input.cnf)"
32-
mv input.cnf input.$I.cnf
33-
mv output.log output.$I.log
34-
FAILED=$((FAILED+1))
35-
fi
37+
# make failures permanent
38+
if [ "$STATUS" -ne 0 ] && [ "$STATUS" -ne 10 ] && [ "$STATUS" -ne 20 ]; then
39+
echo "[$SECONDS] failed for try $I with status $STATUS and header $(grep "p cnf" $f) and generator: $c $modgen_cli_args"
40+
mv $f fuzz_input.$I.cnf
41+
mv output.log output.$I.log
42+
FAILED=$((FAILED + 1))
43+
fi
44+
[ "$STATUS" -eq 10 ] && found_sat=$((found_sat + 1))
45+
[ "$STATUS" -eq 20 ] && found_unsat=$((found_unsat + 1))
3646
done
3747
echo "failed $FAILED out of $LIMIT"
38-
48+
echo "($SECONDS s) sat: $found_sat unsat: $found_unsat"
3949
[ "$FAILED" -eq 0 ] || exit 1
4050
exit 0

0 commit comments

Comments
 (0)