From 544ca13ea72d36f2576157d3b468fa00f225e0fc Mon Sep 17 00:00:00 2001 From: tignear Date: Thu, 29 Oct 2026 01:09:06 +0900 Subject: [PATCH] fix(bench): compare tiered simulators by total completion time Publish only total workload time for tiered circuit and Heliodor comparisons. Keep startup and execution intervals in diagnostic reports, and hide historical phase-only tiered charts. Background compilation is part of the measured run, so a phase boundary must not determine the performance ranking. Circuit totals cover process launch through exit, including compilation, stimulus, resets and assertions. Heliodor totals cover analysis through the fixed Linux completion marker. Synchronous backend measurements retain their separate compilation and execution charts. Validation: publication and runner tests, Heliodor conversion fixtures, and VitePress production build. No large Heliodor workload was run. Change-Id: I94c190fb3c6e7dfd3a06a821826f90037451365a --- .../components/BenchmarkDashboard.vue | 26 ++++++++----------- docs/benchmarks/collection.md | 10 ++++--- docs/benchmarks/heliodor.md | 9 +++---- docs/benchmarks/index.md | 4 +-- scripts/convert-heliodor-bench.mjs | 7 +---- scripts/publish-collection-bench.mjs | 2 +- scripts/publish-collection-bench.test.mjs | 5 ++-- scripts/publish-heliodor-bench.test.mjs | 24 ++++++++++++----- scripts/tests/convert-heliodor-bench.sh | 13 +++------- 9 files changed, 48 insertions(+), 52 deletions(-) diff --git a/docs/.vitepress/components/BenchmarkDashboard.vue b/docs/.vitepress/components/BenchmarkDashboard.vue index 0159ba32fa7..3f11e9db7c3 100644 --- a/docs/.vitepress/components/BenchmarkDashboard.vue +++ b/docs/.vitepress/components/BenchmarkDashboard.vue @@ -485,15 +485,11 @@ const allSeries = computed(() => { if (isRetiredBenchmark(b.name)) continue; const seriesRuntime = runtime(b.name); if (!seriesRuntime) continue; - let benchName = normalizeBenchName(stripPrefix(b.name)); - // Historical Celox tiered points also include background compilation. - // Keep their history, but do not mix them with post-compile throughput. - if ( - seriesRuntime.includes("tiered") && - /^heliodor_(?:linux_boot|suite_.+)_execution$/.test(benchName) - ) { - benchName = benchName.replace(/_execution$/, "_tiered_execution"); - } + const benchName = normalizeBenchName(stripPrefix(b.name)); + // Keep historical phase samples in the archive, but compare tiered + // implementations only by complete workload time. + if (seriesRuntime.includes("tiered") && + !benchName.endsWith("_total") && !benchName.endsWith("_end_to_end")) continue; // Hosted runners hand out different CPU models between runs, so one // backend is one series per CPU. Merging them would read as a // regression whenever the runner happens to change model. @@ -824,17 +820,17 @@ onBeforeUnmount(() => {

Synchronous runs finish compilation before simulation begins. Tiered runs start on the interpreter (Celox) or Cranelift (Veryl-CC), then switch to - compiled code when it is ready. Startup measures time until simulation - begins; end-to-end measures time through Linux boot completion. Both - start before design analysis. Each Veryl-CC run uses an empty C compilation + compiled code when it is ready. Tiered charts show the complete interval + from before design analysis through Linux boot completion, including + compilation while simulation is running. Each Veryl-CC run uses an empty C compilation cache. Building the benchmark executables is excluded. Execution time includes the testbench for both simulators.

- Fixed self-checking workloads, with compilation, execution and total time - shown separately. Each point is the median of three fresh processes. - Execution includes resets, stimulus and assertions. Different workload + Fixed self-checking workloads, compared by total process time including + compilation, resets, stimulus and assertions. Each point is the median + of three fresh processes. Different workload contracts and host architectures have separate charts. No SV frontend comparison is implied by the Veryl results.

diff --git a/docs/benchmarks/collection.md b/docs/benchmarks/collection.md index f6ca6090b50..0f59df1700e 100644 --- a/docs/benchmarks/collection.md +++ b/docs/benchmarks/collection.md @@ -63,8 +63,9 @@ Resets, stimulus and assertions are included in execution time. Every measured process must complete the entire fixed workload and print its completion marker. Each simulator runs three fresh processes sequentially on the same host. The primary comparison is **Celox tiered versus Veryl simulator tiered**, with the -same DUT and TB bytes. Celox starts in its interpreter and promotes to native -code (O2); Veryl starts in Cranelift with asynchronous C compilation enabled. +same DUT and TB bytes. Celox lowers both DUT and TB to the shared SIR pipeline, +starts execution in its interpreter and promotes to native code (O2). Veryl +starts in Cranelift with asynchronous C compilation enabled. Completing before promotion is valid; dispatch/promotion statistics are retained. Both use one simulation thread; compiler parallelism follows each implementation's defaults within the same host CPU allocation. @@ -72,8 +73,9 @@ defaults within the same host CPU allocation. The dashboard's **total** is the median process wall time, from launching the runner through its exit, including startup and shutdown. CLI binary builds and source preparation happen before measurement. The internal compilation/startup -and execution intervals are supplementary: background compilation overlaps -execution, so those intervals do not represent isolated compiler cost or warmed +and execution intervals remain in diagnostic logs and are not published as +comparison charts: background compilation overlaps execution, so those intervals +do not represent isolated compiler cost or warmed throughput. Every process gets a new empty Veryl AOT cache; Celox's build cache and waveform output are disabled. This `cold-tiered-process-v1` contract starts new charts, separate from the old native-only internal-timing series. diff --git a/docs/benchmarks/heliodor.md b/docs/benchmarks/heliodor.md index bacadc571ec..0eb6591f846 100644 --- a/docs/benchmarks/heliodor.md +++ b/docs/benchmarks/heliodor.md @@ -24,10 +24,9 @@ The benchmark separates three questions: while compilation overlaps simulation? Execution time includes the testbench for both simulators. -Tiered results have separate charts for startup until simulation begins, execution -with background compilation, and total time through Linux completion. The tiered -execution interval includes time on the initial backend and must not be read as -compiled-code throughput. Veryl-CC may finish on Cranelift before C compilation +Tiered charts compare only total time through Linux completion, including +startup and background compilation. Startup and execution intervals remain in +the diagnostic logs; neither is a separate tiered performance score. Veryl-CC may finish on Cranelift before C compilation completes; these runs remain valid tiered measurements. Startup and total time begin before design analysis; source-file loading and building the benchmark executables with Cargo are excluded. @@ -43,7 +42,7 @@ A run is accepted only when it: - uses the pinned Heliodor and workload revisions; - reaches the configured Linux completion marker; -- records compilation and execution separately; +- records total completion time, retaining timing details for diagnosis; - compares runners built from the intended Celox and Veryl revisions; - preserves the logs needed to diagnose a timeout or semantic mismatch; - proves that Celox tiered promoted and executed at least one generated-code diff --git a/docs/benchmarks/index.md b/docs/benchmarks/index.md index a1fefb0b614..4480f802180 100644 --- a/docs/benchmarks/index.md +++ b/docs/benchmarks/index.md @@ -53,8 +53,8 @@ publication preserves both sets of results. Only `master` publishes history. Heliodor uses an additional fixed-input acceptance workload. Its methodology is described in [Heliodor Linux Benchmark](./heliodor.md). The dashboard compares -the native backend with synchronous Veryl-CC, and shows startup and end-to-end -time separately for Celox and Veryl-CC tiered execution. Standalone Cranelift boot +the native backend with synchronous Veryl-CC, and compares Celox and Veryl-CC +tiered execution by total time through completion, including compilation. Standalone Cranelift boot results are excluded because their much longer runtime makes this chart ineffective for that comparison. Heliodor charts are separated by CPU architecture because results from different diff --git a/scripts/convert-heliodor-bench.mjs b/scripts/convert-heliodor-bench.mjs index de04ee720de..9a4de319a7c 100644 --- a/scripts/convert-heliodor-bench.mjs +++ b/scripts/convert-heliodor-bench.mjs @@ -118,7 +118,7 @@ function convertPartial() { if (row.runner.endsWith("-tiered")) { const total = ns(row, "reported_elapsed_ns"); if (compile + execute > total) throw new Error(`${key}: startup and execution exceed total`); - return [milliseconds(`${base}_startup`, compile), milliseconds(`${base}_execution`, execute), milliseconds(`${base}_end_to_end`, total)]; + return [milliseconds(`${base}_end_to_end`, total)]; } const metrics = [milliseconds(`${base}_compilation`, compile), milliseconds(`${base}_execution`, execute)]; if (row.runner === "celox" && arch === "x86_64") { @@ -216,11 +216,6 @@ function convertResults(rows, arm64Rows) { } results.push( milliseconds(`heliodor-${platform}/heliodor_linux_boot_end_to_end`, total), - milliseconds(`heliodor-${platform}/heliodor_linux_boot_startup`, startup), - milliseconds( - `heliodor-${platform}/heliodor_linux_boot_execution`, - execution, - ), ); } diff --git a/scripts/publish-collection-bench.mjs b/scripts/publish-collection-bench.mjs index b397a4294ce..63f867658cd 100644 --- a/scripts/publish-collection-bench.mjs +++ b/scripts/publish-collection-bench.mjs @@ -48,7 +48,7 @@ export function metrics(report) { testbench: result.testbench, testbenchSha256: result.testbenchSha256, workUnits: result.workUnits, stateModel: result.stateModel, optimization: result.optimization, threads: result.threads }; const id = createHash("sha256").update(JSON.stringify(contract)).digest("hex").slice(0, 12); - return [["compilation", "compileNs"], ["execution", "executeNs"], ["total", "processNs"]].map(([phase, field]) => { + return [["total", "processNs"]].map(([phase, field]) => { const values = result.samples.map(s => s[field]).sort((a, b) => a - b); return { name: `collection-${result.runner}/collection_${result.circuit}_${id}_${report.host.arch}_${phase}`, unit: "ns", value: values[1], range: `${values[0]}–${values[2]}`, diff --git a/scripts/publish-collection-bench.test.mjs b/scripts/publish-collection-bench.test.mjs index d6b3ceaf40a..6b1985906ee 100644 --- a/scripts/publish-collection-bench.test.mjs +++ b/scripts/publish-collection-bench.test.mjs @@ -19,13 +19,14 @@ function report() { test("publish medians only and separate every measurement contract", () => { const input = report(); const benches = metrics(input); - assert.deepEqual(benches.map(b => b.value), [20, 40, 80, 20, 40, 80]); + assert.deepEqual(benches.map(b => b.value), [80, 80]); assert.equal(benches[0].unit, "ns"); + assert.ok(benches.every(b => b.name.endsWith("_total"))); assert.equal(JSON.parse(benches[0].extra).frontend, "veryl"); input.results.forEach(r => r.testbenchSha256 = "c".repeat(64)); assert.notEqual(metrics(input)[0].name, benches[0].name); input.host.arch = "arm64"; - assert.match(metrics(input)[0].name, /_arm64_compilation$/); + assert.match(metrics(input)[0].name, /_arm64_total$/); }); test("qualification, failures, partial samples and altered runner contracts cannot publish", () => { diff --git a/scripts/publish-heliodor-bench.test.mjs b/scripts/publish-heliodor-bench.test.mjs index 48eab51d1d7..c690b01a858 100644 --- a/scripts/publish-heliodor-bench.test.mjs +++ b/scripts/publish-heliodor-bench.test.mjs @@ -45,17 +45,27 @@ test("publishes each successful backend without requiring comparison partners", for (const [runner, platform, count] of [ ["celox", `native-${arch}`, arch === "x86_64" ? 3 : 2], ["veryl-cc-sync", `veryl-cc-${arch}`, 2], - ["celox-tiered", arch === "x86_64" ? "celox-tiered" : "celox-tiered-aarch64", 3], - ["veryl-cc-tiered", `veryl-tiered-${arch}`, 3], + ["celox-tiered", arch === "x86_64" ? "celox-tiered" : "celox-tiered-aarch64", 1], + ["veryl-cc-tiered", `veryl-tiered-${arch}`, 1], ["celox-parallel", `native-parallel-${arch}`, 2], ]) { const result = convert(row(runner), arch); assert.equal(result.length, count); - assert.equal( - result.find((x) => x.name === `heliodor-${platform}/heliodor_suite_linux_boot_execution`) - .value, - 2, - ); + if (runner.endsWith("-tiered")) { + assert.equal(result[0].name, `heliodor-${platform}/heliodor_suite_linux_boot_end_to_end`); + assert.equal(result[0].value, 4); + } else { + assert.equal( + result.find((x) => x.name === `heliodor-${platform}/heliodor_suite_linux_boot_execution`) + .value, + 2, + ); + assert.equal( + result.find((x) => x.name === `heliodor-${platform}/heliodor_suite_linux_boot_compilation`) + .value, + 1, + ); + } assert.deepEqual(convert(row(runner, { success: false }), arch), []); } } diff --git a/scripts/tests/convert-heliodor-bench.sh b/scripts/tests/convert-heliodor-bench.sh index cd2752af790..9843e277217 100644 --- a/scripts/tests/convert-heliodor-bench.sh +++ b/scripts/tests/convert-heliodor-bench.sh @@ -41,8 +41,6 @@ if (values["heliodor-celox-jit/heliodor_suite_linux_boot_execution"] !== 2) proc if (values["heliodor-celox-total/heliodor_suite_linux_boot_execution"] !== 2.5) process.exit(1); if (values["heliodor-veryl/heliodor_suite_linux_boot_execution"] !== 4) process.exit(1); if (values["heliodor-celox-tiered/heliodor_suite_linux_boot_end_to_end"] !== 5.5) process.exit(1); -if (values["heliodor-celox-tiered/heliodor_suite_linux_boot_startup"] !== 0.5) process.exit(1); -if (values["heliodor-celox-tiered/heliodor_suite_linux_boot_execution"] !== 5) process.exit(1); ' "$TMP/results.json" node -e ' @@ -61,16 +59,11 @@ if (values.some((entry) => entry.name.includes("celox-tiered"))) process.exit(1) node -e ' const fs = require("fs"); const values = Object.fromEntries(JSON.parse(fs.readFileSync(process.argv[1], "utf8")).map((x) => [x.name, x.value])); -if (Object.keys(values).length !== 25) process.exit(1); +if (Object.keys(values).length !== 17) process.exit(1); +if (Object.keys(values).some(name => name.includes("tiered") && !name.endsWith("_end_to_end"))) process.exit(1); const expected = { - "heliodor-veryl-tiered-x86_64/heliodor_suite_linux_boot_startup": 1.5, - "heliodor-veryl-tiered-x86_64/heliodor_suite_linux_boot_execution": 8, "heliodor-veryl-tiered-x86_64/heliodor_suite_linux_boot_end_to_end": 9.5, - "heliodor-celox-tiered-aarch64/heliodor_suite_linux_boot_startup": 3.5, - "heliodor-celox-tiered-aarch64/heliodor_suite_linux_boot_execution": 13, "heliodor-celox-tiered-aarch64/heliodor_suite_linux_boot_end_to_end": 16.5, - "heliodor-veryl-tiered-aarch64/heliodor_suite_linux_boot_startup": 4.5, - "heliodor-veryl-tiered-aarch64/heliodor_suite_linux_boot_execution": 16, "heliodor-veryl-tiered-aarch64/heliodor_suite_linux_boot_end_to_end": 20.5, "heliodor-native-x86_64/heliodor_suite_linux_boot_compilation": 1, "heliodor-native-x86_64/heliodor_suite_linux_boot_execution": 2.5, @@ -130,7 +123,7 @@ node "$ROOT/scripts/convert-heliodor-bench.mjs" "$TMP/suite-results.tsv" "$TMP/s node - "$TMP/suite.json" <<'JS' const assert = require("node:assert/strict"); const rows = require(process.argv[2]); -assert.equal(rows.length, 25 * 4); +assert.equal(rows.length, 17 * 4); assert.equal(new Set(rows.map(row => row.name)).size, rows.length); assert.equal(rows.find(row => row.name === "heliodor-native-aarch64/heliodor_suite_71_smp_linux_boot_4hart_execution").value, 8); JS