Skip to content

Commit 77e80ff

Browse files
committed
feat(docs): Add marginal gas benchmark reports for SP1 and RISC0
This commit introduces new documentation files for marginal gas benchmark reports for both SP1 and RISC0 configurations, detailing performance metrics and regression results. Additionally, the configuration file has been updated to include a new section in the sidebar for easy navigation to these reports.
1 parent 4f53939 commit 77e80ff

File tree

657 files changed

+6997
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

657 files changed

+6997
-0
lines changed

www/docs/components/CsvTable.tsx

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
import {
2+
useEffect,
3+
useState,
4+
} from 'react';
5+
6+
interface CsvTableProps {
7+
src: string;
8+
columns?: string[]; // Optional: show only specific columns
9+
maxRows?: number; // Optional: limit number of rows
10+
}
11+
12+
export function CsvTable({ src, columns, maxRows }: CsvTableProps) {
13+
const [data, setData] = useState<string[][]>([]);
14+
const [headers, setHeaders] = useState<string[]>([]);
15+
const [loading, setLoading] = useState(true);
16+
const [error, setError] = useState<string | null>(null);
17+
18+
useEffect(() => {
19+
fetch(src)
20+
.then((res) => {
21+
if (!res.ok) throw new Error(`Failed to load CSV: ${res.status}`);
22+
return res.text();
23+
})
24+
.then((text) => {
25+
const lines = text.trim().split('\n');
26+
const allHeaders = lines[0].split(',');
27+
const rows = lines.slice(1).map((line) => line.split(','));
28+
29+
// Filter columns if specified
30+
if (columns && columns.length > 0) {
31+
const indices = columns.map((col) => allHeaders.indexOf(col)).filter((i) => i !== -1);
32+
setHeaders(indices.map((i) => allHeaders[i]));
33+
setData(rows.map((row) => indices.map((i) => row[i])));
34+
} else {
35+
setHeaders(allHeaders);
36+
setData(rows);
37+
}
38+
setLoading(false);
39+
})
40+
.catch((err) => {
41+
setError(err.message);
42+
setLoading(false);
43+
});
44+
}, [src, columns]);
45+
46+
if (loading) return <div style={{ padding: '1rem', color: '#888' }}>Loading CSV...</div>;
47+
if (error) return <div style={{ padding: '1rem', color: '#f44' }}>Error: {error}</div>;
48+
49+
const displayData = maxRows ? data.slice(0, maxRows) : data;
50+
51+
return (
52+
<div style={{ overflowX: 'auto', marginBlock: '1rem' }}>
53+
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '0.875rem' }}>
54+
<thead>
55+
<tr style={{ backgroundColor: 'var(--vocs-color_background2)' }}>
56+
{headers.map((header, i) => (
57+
<th
58+
key={i}
59+
style={{
60+
padding: '0.5rem 0.75rem',
61+
textAlign: 'left',
62+
borderBottom: '2px solid var(--vocs-color_border)',
63+
whiteSpace: 'nowrap',
64+
}}
65+
>
66+
{header}
67+
</th>
68+
))}
69+
</tr>
70+
</thead>
71+
<tbody>
72+
{displayData.map((row, rowIndex) => (
73+
<tr
74+
key={rowIndex}
75+
style={{
76+
backgroundColor: rowIndex % 2 === 0 ? 'transparent' : 'var(--vocs-color_background2)',
77+
}}
78+
>
79+
{row.map((cell, cellIndex) => (
80+
<td
81+
key={cellIndex}
82+
style={{
83+
padding: '0.5rem 0.75rem',
84+
borderBottom: '1px solid var(--vocs-color_border)',
85+
whiteSpace: 'nowrap',
86+
}}
87+
>
88+
{formatCell(cell)}
89+
</td>
90+
))}
91+
</tr>
92+
))}
93+
</tbody>
94+
</table>
95+
{maxRows && data.length > maxRows && (
96+
<p style={{ marginTop: '0.5rem', color: '#888', fontSize: '0.875rem' }}>
97+
Showing {maxRows} of {data.length} rows.{' '}
98+
<a href={src} download style={{ color: 'var(--vocs-color_textAccent)' }}>
99+
Download full CSV
100+
</a>
101+
</p>
102+
)}
103+
</div>
104+
);
105+
}
106+
107+
function formatCell(value: string): string {
108+
const num = parseFloat(value);
109+
if (isNaN(num)) return value;
110+
111+
// Format large numbers
112+
if (Math.abs(num) >= 1e9) return (num / 1e9).toFixed(2) + 'B';
113+
if (Math.abs(num) >= 1e6) return (num / 1e6).toFixed(2) + 'M';
114+
if (Math.abs(num) >= 1e3) return (num / 1e3).toFixed(2) + 'K';
115+
116+
// Format small decimals (like R² values)
117+
if (Math.abs(num) < 1 && Math.abs(num) > 0) return num.toFixed(4);
118+
119+
// Format scientific notation
120+
if (value.includes('e')) return num.toExponential(2);
121+
122+
return num.toFixed(2);
123+
}
124+
125+
export default CsvTable;
126+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Marginal Gas Benchmark Results
2+
3+
import { CsvTable } from '../../components/CsvTable';
4+
5+
This section contains the latest zkVM benchmark results from December 2025, comparing **SP1 v5.2.3** and **RISC0 v3.0.4** provers.
6+
7+
## Test Environment
8+
9+
| Parameter | Value |
10+
|-----------|-------|
11+
| **CPU** | AMD EPYC 7B13 64-Core Processor |
12+
| **RAM** | 371 GiB |
13+
| **GPUs** | 4x NVIDIA GeForce RTX 4090 |
14+
| **Date** | December 29, 2025 |
15+
16+
## Available Reports
17+
18+
### Individual Prover Reports
19+
20+
- [**SP1 v5.2.3 Report**](/marginal-gas-benchmark/sp1) - Comprehensive benchmark results for SP1 prover
21+
- [**RISC0 v3.0.4 Report**](/marginal-gas-benchmark/risc0) - Comprehensive benchmark results for RISC0 prover
22+
23+
### Combined Comparison
24+
25+
View the <a href="/marginal-gas-benchmark/combined-sp1-risc0.html" target="_blank" style={{color: 'var(--vocs-color_textAccent)', textDecoration: 'underline'}}>**Combined SP1 vs RISC0 Comparison**</a> (opens in new tab) for a side-by-side analysis.
26+
27+
## Report Contents
28+
29+
Each prover report includes:
30+
31+
1. **Regression Results** - Time/Gas, Cycles/Gas, and Time/Cycle metrics with R² values
32+
2. **Proving Time Analysis** - Correlation between ZK cycles and proving time
33+
3. **Gas vs ZK Cycles Charts** - Per-opcode and precompile analysis
34+
4. **Proving Time Charts** - Performance visualization for each operation
35+
36+
## SP1 Regression Summary
37+
38+
<CsvTable
39+
src="/marginal-gas-benchmark/sp1/regression-sp1-both-20251229-210808.csv"
40+
columns={['opcode', 'max_gas', 'max_zkcycles', 'gas_zkcycles_slope', 'gas_zkcycles_r2', 'gas_proving_slope', 'gas_proving_r2']}
41+
maxRows={20}
42+
/>
43+
44+
## RISC0 Regression Summary
45+
46+
<CsvTable
47+
src="/marginal-gas-benchmark/risc0/regression-risc0-both-20251229-211052.csv"
48+
columns={['opcode', 'max_gas', 'max_zkcycles', 'gas_zkcycles_slope', 'gas_zkcycles_r2', 'gas_proving_slope', 'gas_proving_r2']}
49+
maxRows={20}
50+
/>
51+
52+
## Raw Data Downloads
53+
54+
- <a href="/marginal-gas-benchmark/sp1/raw-data-sp1-both-20251229-210808.csv" download style={{color: 'var(--vocs-color_textAccent)', textDecoration: 'underline'}}>SP1 Raw Data</a>
55+
- <a href="/marginal-gas-benchmark/sp1/regression-sp1-both-20251229-210808.csv" download style={{color: 'var(--vocs-color_textAccent)', textDecoration: 'underline'}}>SP1 Regression Data</a>
56+
- <a href="/marginal-gas-benchmark/risc0/raw-data-risc0-both-20251229-211052.csv" download style={{color: 'var(--vocs-color_textAccent)', textDecoration: 'underline'}}>RISC0 Raw Data</a>
57+
- <a href="/marginal-gas-benchmark/risc0/regression-risc0-both-20251229-211052.csv" download style={{color: 'var(--vocs-color_textAccent)', textDecoration: 'underline'}}>RISC0 Regression Data</a>
58+

0 commit comments

Comments
 (0)