-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdlctieraccuracy.sh
More file actions
executable file
·74 lines (62 loc) · 2.04 KB
/
Copy pathdlctieraccuracy.sh
File metadata and controls
executable file
·74 lines (62 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
usage(){
echo "
Written by Brian Bushnell and Eru
Last modified April 6, 2026
Description: Measures DLC per-tier absolute error as a function of tier occupancy.
Uses LogLog6 (no minZeros, no microIndex, no tier promotion) for clean measurement.
Tier occupancy = number of buckets with NLZ >= tier, an integer from 0 to B.
Multithreaded: distributes DDL instances across threads.
Usage: dlctieraccuracy.sh buckets=2048 ddls=100000 tier=3 threads=128
Parameters:
buckets=2048 Buckets per LL6 instance.
ddls=100000 Number of LL6 instances (distributed across threads).
maxmult=512 Stop when trueCard reaches buckets*maxmult.
tier=3 Which DLC tier to measure (0-63).
seed=1 Master seed for instance seed generation.
threads=1 Number of parallel simulation threads.
points=500 Number of log-spaced cardinality checkpoints.
type=ll6 Estimator type (usually ll6 for clean tier measurement).
Output columns (stdout, TSV):
Occupancy Integer tier occupancy (0..buckets).
Count Number of samples at this occupancy.
AvgAbsErr Mean |DLC_tier_est - trueCard| / trueCard.
AvgSignedErr Mean (DLC_tier_est - trueCard) / trueCard.
Java Parameters:
-Xmx Memory limit. -Xmx20g = 20 GB.
-eoom Exit on out-of-memory.
-da Disable assertions.
"
}
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
usage
exit
fi
resolveSymlinks(){
SCRIPT="$(cd "$(dirname "$0")" && pwd)/$(basename "$0")"
while [ -h "$SCRIPT" ]; do
DIR="$(dirname "$SCRIPT")"
SCRIPT="$(readlink "$SCRIPT")"
[ "${SCRIPT#/}" = "$SCRIPT" ] && SCRIPT="$DIR/$SCRIPT"
done
DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
if [ -f "$DIR/bbtools.jar" ]; then
CP="$DIR/bbtools.jar"
else
CP="$DIR/current/"
fi
}
setEnv(){
. "$DIR/javasetup.sh"
. "$DIR/memdetect.sh"
parseJavaArgs "--xmx=1g" "--xms=200m" "--mode=fixed" "$@"
setEnvironment
}
launch() {
CMD="java $EA $EOOM $SIMD $XMX $XMS -cp $CP cardinality.DLCTierAccuracy $@"
echo "$CMD" >&2
eval $CMD
}
resolveSymlinks
setEnv "$@"
launch "$@"