Submissions / #1 / scripts/build_tables.py

scripts/build_tables.py

Submission
#1 · What frontier AI developers disclose about compute allocation: a baseline for Verified Compute Allocation Disclosures
Contributor
@jz
Published
2026-11-30 00:46 UTC
Type
text/x-python
Size
2.2 kB
SHA-256
455d752d81240fa9079656c3a1345ea2caa089f838fa612221a2a7aadfbc7af7
DownloadBack to submission

Preview

"""Build the derived tables from data/disclosures.json and the transcribed filing figures.

usage: python3 -I scripts/build_tables.py <dir with raw source files>
"""
import csv, hashlib, json, os, sys
raw = sys.argv[1]
data = json.load(open("data/disclosures.json", encoding="utf-8"))

# 1. Rubric score matrix
keys = list(data["rubric"])
with open("data/scores.csv", "w", newline="", encoding="utf-8") as f:
    w = csv.writer(f)
    w.writerow(["id", "entity", "date", "type"] + keys + ["yes", "partial", "no"])
    for d in data["disclosures"]:
        s = [d["scores"][k] for k in keys]
        w.writerow([d["id"], d["entity"], d["date"], d["type"]] + s + [s.count("Y"), s.count("P"), s.count("N")])

# 2. Customer-serving share of compute expense, Anthropic Form S-1/A (USD millions).
# Transcribed from the statements of operations (compute and infrastructure) and the
# "Supplemental Operating Expense Information" note (cost of revenue, R&D, S&M).
periods = ["FY2023", "FY2024", "FY2025", "9M2025", "9M2026"]
compute = [433, 2522, 7326, 4381, 18808]
cost_of_revenue = [26, 752, 2773, 1796, 4812]
rnd = [422, 2275, 6338, 3594, 19240]
sales_marketing = [76, 163, 911, 530, 6619]
with open("data/anthropic_s1a_derived.csv", "w", newline="", encoding="utf-8") as f:
    w = csv.writer(f)
    w.writerow(["period", "compute_and_infrastructure_usd_m", "cost_of_revenue_usd_m", "research_and_development_usd_m",
                "sales_and_marketing_usd_m", "cost_of_revenue_as_pct_of_compute_expense"])
    for p, c, cr, r, sm in zip(periods, compute, cost_of_revenue, rnd, sales_marketing):
        w.writerow([p, c, cr, r, sm, f"{100 * cr / c:.1f}"])

# 3. Source manifest with hashes of the bytes fetched
urls = {r["file"]: r for r in csv.DictReader(open("sources/urls.csv", encoding="utf-8"))}
with open("sources/manifest.csv", "w", newline="", encoding="utf-8") as f:
    w = csv.writer(f)
    w.writerow(["file", "url", "retrieved", "bytes", "sha256", "used_for"])
    for name, r in urls.items():
        b = open(os.path.join(raw, name), "rb").read()
        w.writerow([name, r["url"], "2026-11-30", len(b), hashlib.sha256(b).hexdigest(), r["used_for"]])