-
Notifications
You must be signed in to change notification settings - Fork 0
/
fata_pipeline.py
72 lines (64 loc) · 2.55 KB
/
fata_pipeline.py
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
import os
from proof import Proof
from smol_proof import make_smol
import subprocess
from stack_proof import Proof as StackProof
# get the names of all files in the smart_table_proofs directory
OPB_LOCATION = "../../ciaran/20230301-sip-proof-logs/"
files = os.listdir(OPB_LOCATION)
all_file_sizes = {}
for file in files:
all_file_sizes[file] = os.stat(OPB_LOCATION+file).st_size
# Sort the file names by size
files = sorted(all_file_sizes, key=all_file_sizes.get)
files = [f for f in files if f.endswith(".veripb")]
files = [f[:-7] for f in files]
avg_file_size = {f:((all_file_sizes[f+".opb"]+all_file_sizes[f+".veripb"])/2) for f in files}
files = sorted(avg_file_size, key=avg_file_size.get)
files = [f+".opb" for f in files]
files = [f for f in files if not f.startswith("all-meshes")]
SMOL_PROOF_LOCATION = "20230301-sip-proof-logs/"
for file in files:
file = file[:-4]
print(file)
if not os.path.exists("rup/"+file+".rup"):
proof = Proof(OPB_LOCATION+file)
print(" 1️⃣ rup file created")
else:
print(" 1️⃣ rup file already exists")
try:
i = make_smol(file,OPB_LOCATION, "20230301-sip-proof-logs/")
print(" 2️⃣ smol file created")
print(" 3️⃣ kept:", str(round(i[1]/i[0],4)*100)+"%")
except Exception as e:
print(" 🔴 failed, retrying")
try:
proof = Proof(OPB_LOCATION+file)
print(" 1️⃣ rup file created")
i = make_smol(file,OPB_LOCATION, "20230301-sip-proof-logs/")
print(" 2️⃣ smol file created")
print(" 3️⃣ kept:", str(round(i[1]/i[0],4)*100)+"%")
except:
pass
file = "stack_"+file
print(file)
if not os.path.exists("rup/"+file+".rup"):
proof = StackProof(OPB_LOCATION+file[6:], backwards=True)
print(" 1️⃣ rup file created")
else:
print(" 1️⃣ rup file already exists")
try:
i = make_smol(file,OPB_LOCATION, "20230301-sip-proof-logs/")
print(" 2️⃣ smol file created")
print(" 3️⃣ kept:", str(round(i[1]/i[0],4)*100)+"%")
except Exception as e:
# raise e
print(" 🔴 failed, retrying")
try:
proof = StackProof(OPB_LOCATION+file[6:])
print(" 1️⃣ rup file created")
i = make_smol(file,OPB_LOCATION, "20230301-sip-proof-logs/")
print(" 2️⃣ smol file created")
print(" 3️⃣ kept:", str(round(i[1]/i[0],4)*100)+"%")
except:
pass