Files
ziran/scripts/site_kernel_targets.py
waozi 884ef80bdb Publish the Targets cohort measured at 4f49aa9a
Every Targets table is regenerated from one clean pushed compiler
revision, 4f49aa9a, measured on Alpha's physical host with 11
host-gated samples and learning off: kernel tiers, the standard
diagnostic and compile suites, JSON/UTF-8 workloads, Kryon widgets
and the example matrix. The kernel receipt moves to its measurement
date, 2026-11-18.

Kryon widget medians, us per two-frame scenario, paint checked on
every batch (C / Go / ZX native / Wasm):

  Button  2.693 / 4.325 / 4.810 / 2.461
  Text    3.105 / 3.894 / 6.301 / 3.592
  Input   3.998 / 6.588 / 6.400 / 3.236

Wasm now runs every widget scenario faster than Go, and Button and
Input faster than C. The published cohort at 45b74b4e had Text at
4.153 us in Wasm against 3.837 us in Go.
2026-11-18 04:04:10 -03:00

55 lines
2.0 KiB
Python

#!/usr/bin/env python3
"""Validate and copy retained kernel tier receipts without measuring."""
import argparse
import json
import shutil
import site_targets as base
import site_benchmark_cohort as cohort
import site_target_platforms as platforms
OUTPUT = base.SITE / 'generated/kernel-targets'
RECEIPTS = ('wasm-tier-gated-2026-11-18.json',)
TARGETS = ('c', 'go', 'zx', 'native', 'wasm')
def receipts():
return [(name, json.loads((base.REPO / 'bench/results' / name).read_text()))
for name in RECEIPTS]
def validate(data):
assert data['schema_version'] == 1 and data['virtualization'] == 'none'
assert data['samples'] >= 3 and data['kernels']
assert data['host_gate'], 'Publish only host-gated kernel measurements'
assert data['runtimes']['native'] == 'ZX native · translated in process', 'Native must exclude process startup'
for row in data['kernels'].values():
assert set(row) == set(TARGETS)
for measured in row.values():
assert measured['stdout_verified']
assert measured['host_gate']['accepted'] and measured['host_gate']['attempts'][-1]['accepted']
assert len(measured['batch_samples_ms']) == data['samples']
assert platforms.summarize(measured, measured['result']) == measured
def generate(check=False):
for name, data in receipts():
validate(data)
assert data['engine_policy'] == 'explicit-engine'
cohort.validate(data)
source = base.REPO / 'bench/results' / name
destination = OUTPUT / name
if check:
assert destination.read_bytes() == source.read_bytes(), f'Stale kernel receipt: {name}'
else:
OUTPUT.mkdir(parents=True, exist_ok=True)
shutil.copyfile(source, destination)
if check:
print('Kernel receipt statistics, cohort and public copies verified')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--check', action='store_true')
generate(parser.parse_args().check)