Monte Carlo Benchmarking Engine
High-performance SIMD Monte Carlo engine (AVX2/NEON) with custom memory allocators and perf logging.
 
Loading...
Searching...
No Matches
schema.py
Go to the documentation of this file.
1# ===========================================
2# schema.py
3# ===========================================
4
5
27
28
29import polars as pl
30
31
32"""!Canonical schema used throughout the pipeline.
33
34Each key represents a column name, and the value is a tuple:
35(dtype: pl.DataType, nullable: bool). This schema is used to:
36- Cast raw CSV data safely
37- Generate ClickHouse-compatible SQL
38- Validate data consistency during preprocessing
39
40@note Nullable fields typically represent optional CPU-level metrics (e.g., L2/L3).
41@note Timestamps are expected to be in millisecond resolution.
42"""
43SCHEMA = {
44 # Non-nullable fields
45 "Timestamp": (pl.Datetime("ms"), False),
46 "BatchID": (pl.Utf8(), False),
47 "Method": (pl.Utf8(), False),
48 "Trials": (pl.Int64(), False),
49 "Cycles": (pl.Int64(), False),
50 "Instructions": (pl.Int64(), False),
51 "IPC": (pl.Float64(), False),
52 "Wall Time (s)": (pl.Float64(), False),
53 "Wall Time (ns)": (pl.Int64(), False),
54 "Cache Loads": (pl.Int64(), False),
55 "Cache Misses": (pl.Int64(), False),
56 "Cache Miss %": (pl.Float64(), False),
57 "L1 Loads": (pl.Int64(), False),
58 "L1 Misses": (pl.Int64(), False),
59 "L1 Miss %": (pl.Float64(), False),
60
61 # Nullable fields
62 "L2 Loads": (pl.Int64(), True),
63 "L2 Misses": (pl.Int64(), True),
64 "L2 Miss %": (pl.Float64(), True),
65 "L3 Loads": (pl.Int64(), True),
66 "L3 Misses": (pl.Int64(), True),
67 "L3 Miss %": (pl.Float64(), True),
68
69 "TLB Loads": (pl.Int64(), False),
70 "TLB Misses": (pl.Int64(), False),
71 "TLB Miss %": (pl.Float64(), False),
72 "Branch Instructions": (pl.Int64(), False),
73 "Branch Misses": (pl.Int64(), False),
74 "Branch Miss %": (pl.Float64(), False),
75 "Misses/Trial": (pl.Float64(), False),
76 "Cycles/Trial": (pl.Float64(), False),
77}