Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Perf scoreboard: core-100m scene, 25/120/240 px strokes on the micro scenes, tools/perf_scoreboard.py, doc skeleton

islandmede30349eedaa6
diff --git a/docs/design/perf-scoreboard.md b/docs/design/perf-scoreboard.md
new file mode 100644
index 00000000..e3879229
--- /dev/null
+++ b/docs/design/perf-scoreboard.md
@@ -0,0 +1,59 @@
+# Perf scoreboard (0.11.0 beta.3)
+
+One table for every performance claim in the beta.3 push. A number goes here only if it was measured with the
+method below. Claims in notes, the site or the guide quote this table, and quote the floor first. Owner: core200m
+(it updates the table as branches land). Public text states our own numbers only, never another app's.
+
+## Targets
+
+| Measure | Target | Where it comes from |
+|---|---|---|
+| Committed lag p50, beyond the spacing floor | <= 16 ms | docs/design/core-200m.md, the two latencies |
+| Committed lag p99 | < 33 ms | two frames at 60 Hz |
+| Release (pen up to the stroke fully in the mesh) | < 100 ms | feels instant |
+| Orbit | >= 60 fps | the display |
+| 200M micro triangles on a 16 GB integrated-GPU laptop | opens, sculpts, orbits | perf-moonshots §0 |
+
+The spacing floor: a dab lands every 0.15 x radius of pointer travel, so at the scripted pointer speed the newest dab
+is on average ~18 ms old at 240 px before any work runs (perf-moonshots §0). Raw lag is reported; the adjusted
+figure is raw minus that floor.
+
+## Tiers, in the order a claim must pass them
+
+1. **Floor iGPU**: a real Windows laptop with integrated graphics (Intel UHD / Iris Xe class, or a small AMD APU).
+ No such machine yet; the tester request is drafted in research/micro-gpu-shade REPORT.md. Until it reports,
+ this tier is empty and nothing claims it.
+2. **E-core floor** (the gate today): `SF_HW_SIMULATE=floor SF_GOVERNOR=0 taskset -c 0,1` on this laptop (M1,
+ Asahi Linux): the floor's budgets, GL 3.3, on the two efficiency cores (about half a fast core each). This is the
+ pessimistic CPU bound; a CPU-bound claim counts only if it holds here (perf-moonshots §0 item 6).
+3. **Laptop**: the same machine, no simulation, all cores (Apple M1 Pro GPU through Asahi's GL driver).
+4. **Windows RTX 3060** (Ryzen 5600X, 32 GB): `~/Work/.sf/win.sh`, PC idle (win.sh holds the PC lock). A sanity
+ check: a result that holds only here hasn't hit its target.
+
+## Method
+
+- Scenes: `--benchmark standard-15m` (the 15M head, multires mesh path), `--benchmark core-100m` and
+ `--benchmark core-200m` (the same head at micro level 5 with procedural wrinkles and pores, 100M and 200M micro
+ triangles in memory). Each runs Clay at 25, 120 and 240 px, then orbits for 10 s (core) or 3 s (15M).
+- Committed lag: pointer sample to the swap of the frame whose mesh contains that sample's dab (`lag_ms`).
+ Release: pen up to the last dab in the mesh and shaded (`release_done_ms`). Orbit: frames per second over the
+ orbit phase. Memory: peak resident RAM plus GPU buffers.
+- Defaults of the build under test (no toggles), load < 2 on the laptop, two interleaved runs per cell; a cell shows
+ the range of the runs.
+- Rows from `python3 tools/perf_scoreboard.py TIER results/*.json`.
+
+## Shipping today: main 0.11.0-beta.2 defaults
+
+| Mesh | Brush | Tier | Committed lag p50 / p99 | Release | Orbit fps | Memory (peak RAM + GPU) | Commit |
+|---|---|---|---|---|---|---|---|
+| (filled below as runs complete) | | | | | | | |
+
+## Candidates for beta.3
+
+Each candidate is measured against the row above on the same tier, interleaved, before it can be turned on.
+
+| Branch (owner) | What | Status |
+|---|---|---|
+| perf/n2-wavelet (n2stroke) | N2 wavelet strokes on micro levels, default on; GPU shading (fragment shader) | in progress |
+| perf/beta-boost-2 (betaboost) | Fast Big Brushes with fused batches capped by time; NVIDIA first-dab stall | in progress |
+| research/core-200m (core200m) | N1 screen-space strokes under 1 ms a dab | in progress |
diff --git a/src/app/AsyncStroke.cpp b/src/app/AsyncStroke.cpp
index ae0bbbca..5aa75583 100644
--- a/src/app/AsyncStroke.cpp
+++ b/src/app/AsyncStroke.cpp
@@ -575,7 +575,7 @@ void App::buildGhost() {
const char* v = std::getenv("SF_SCREEN_STROKE");
return v && *v == '1';
}();
- if (screenStroke && ScreenStroke::supports(g) && renderSettings_.matcap >= 0 && !renderSettings_.pbr()) {
+ if (screenStroke && ScreenStroke::supports(g) && renderSettings_.litsphere >= 0 && !renderSettings_.pbr()) {
renderer_.setScreenStroke(g);
renderer_.setGhost(id, GhostStroke());
return;
diff --git a/src/app/OptimisticBench.cpp b/src/app/OptimisticBench.cpp
index 2e075f48..949659c0 100644
--- a/src/app/OptimisticBench.cpp
+++ b/src/app/OptimisticBench.cpp
@@ -47,7 +47,7 @@ void main() {
}
)";
const char* kFS = R"(#version 330 core
-uniform sampler2D uColor, uDepth, uMatcapTex;
+uniform sampler2D uColor, uDepth, uLitSphereTex;
uniform mat4 uInvProj, uProj;
uniform vec2 uProjScale, uSize;
uniform int uCount;
@@ -65,7 +65,7 @@ vec3 lit(vec3 n, vec3 v) {
vec3 bx = normalize(vec3(v.z, 0.0, -v.x));
vec3 by = cross(v, bx);
vec2 uv = vec2(dot(bx, n), dot(by, n)) * 0.495 + 0.5;
- return pow(texture(uMatcapTex, uv).rgb, vec3(2.2));
+ return pow(texture(uLitSphereTex, uv).rgb, vec3(2.2));
}
// The displacement of the surface point P by every dab (the Standard kernel along each area normal), and the
// tangential gradient that bends a normal n.
@@ -384,7 +384,7 @@ int runOptimisticBench(const OptimisticBenchOptions& o) {
gl::BindVertexArray(vao);
gl::Uniform1i(gl::GetUniformLocation(prog, "uColor"), 0);
gl::Uniform1i(gl::GetUniformLocation(prog, "uDepth"), 1);
- gl::Uniform1i(gl::GetUniformLocation(prog, "uMatcapTex"), 2);
+ gl::Uniform1i(gl::GetUniformLocation(prog, "uLitSphereTex"), 2);
gl::UniformMatrix4fv(gl::GetUniformLocation(prog, "uInvProj"), 1, GL_FALSE, glm::value_ptr(invProj));
gl::UniformMatrix4fv(gl::GetUniformLocation(prog, "uProj"), 1, GL_FALSE, glm::value_ptr(proj));
gl::Uniform2f(gl::GetUniformLocation(prog, "uProjScale"), proj[0][0], proj[1][1]);
@@ -392,7 +392,7 @@ int runOptimisticBench(const OptimisticBenchOptions& o) {
gl::ActiveTexture(GL_TEXTURE0 + 1);
gl::BindTexture(GL_TEXTURE_2D, canvas.depth);
gl::ActiveTexture(GL_TEXTURE0 + 2);
- gl::BindTexture(GL_TEXTURE_2D, renderer.matcapTexture(rs.matcap));
+ gl::BindTexture(GL_TEXTURE_2D, renderer.litsphereTexture(rs.litsphere));
gl::ActiveTexture(GL_TEXTURE0);
gl::BindTexture(GL_TEXTURE_2D, canvas.color); // (each pass re-shades its rectangle from the drawn canvas, all dabs so far)
gl::TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GLint(GL_LINEAR));
diff --git a/src/app/ProofMode.cpp b/src/app/ProofMode.cpp
index fe4c3093..599d7c4d 100644
--- a/src/app/ProofMode.cpp
+++ b/src/app/ProofMode.cpp
@@ -101,18 +101,19 @@ std::vector<ProofMeshSize> proofStandardScene(const std::string& name) {
}, 5};
return {s1b};
}
- if (name == "core-200m") { // research (docs/design/core-200m.md, phase 1): ~200M micro triangles in memory, opened from a project
- const ProofMeshSize s200{200, "200M micro", [](size_t) {
- std::string err;
- const std::string path = core200mScenePath(err); // (main wrote it first)
- Document d;
- if (path.empty() || !loadProject(path, d, err)) {
- std::fprintf(stderr, "core-200m: %s\n", err.c_str());
- return makeBenchHead(size_t(1) << 20);
- }
- return std::move(d.mesh);
- }, 8};
- return {s200};
+ if (name == "core-200m" || name == "core-100m") { // research (docs/design/core-200m.md): micro triangles in memory, opened from a project
+ const int millions = name == "core-100m" ? 100 : 200;
+ const ProofMeshSize s{double(millions), std::to_string(millions) + "M micro", [millions](size_t) {
+ std::string err;
+ const std::string path = core200mScenePath(err, {}, millions); // (main wrote it first)
+ Document d;
+ if (path.empty() || !loadProject(path, d, err)) {
+ std::fprintf(stderr, "core-%dm: %s\n", millions, err.c_str());
+ return makeBenchHead(size_t(1) << 20);
+ }
+ return std::move(d.mesh);
+ }, 8};
+ return {s};
}
return {};
}
@@ -519,7 +520,11 @@ void App::startProofMode() {
};
p->jsonPath = !options_.benchmarkOut.empty() ? options_.benchmarkOut : u8(dir / ("sculptforge-benchmark-" + stamp + ".json"));
p->videoPath = !options_.benchmarkVideo.empty() ? options_.benchmarkVideo : u8(dir / ("sculptforge-benchmark-" + stamp + ".mp4"));
- if (p->scene == "core-200m") p->phases = {{"orbit", 0.0f, 10.0}, {"orbit again", 0.0f, 10.0}}; // phase 1: loads and orbits
+ if (p->scene.rfind("core-", 0) == 0) // the perf scoreboard (docs/design/perf-scoreboard.md): its three brush sizes, then orbit
+ p->phases = {{"clay small", 25.0f, p->strokeSeconds, BrushType::Clay, 0.35f},
+ {"clay large", 120.0f, p->strokeSeconds, BrushType::Clay, 0.35f},
+ {"240 px brush", 240.0f, p->strokeSeconds, BrushType::Clay, 0.35f},
+ {"orbit", 0.0f, 10.0}};
else if (!p->scene.empty()) p->phases = standardPhases(p->strokeSeconds);
else p->phases = {{"stroke", 60.0f, p->strokeSeconds}, {"large brush stroke", 240.0f, p->strokeSeconds}, {"orbit", 0.0f, 3.0}};
p->stage = p->cli ? ProofState::Stage::Announce : ProofState::Stage::Intro;
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 72437140..6dcb8f46 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -74,7 +74,8 @@ void usage() {
" --benchmark standard-15m The standard scene: a 15M triangle head, Clay S/M/L, Move, Smooth and a 240 px\n"
" brush (standard-33m: 33M; standard: both). The numbers on sculptforge.app/benchmarks\n"
" --benchmark standard-1b Experimental Focus Detail: a billion micro triangle head streamed from disk\n"
- " --benchmark core-200m Research: a 200 million micro triangle head in memory (open and orbit)\n"
+ " --benchmark core-200m Research: a 200 million micro triangle head in memory (open, strokes, orbit)\n"
+ " --benchmark core-100m The same at 100 million micro triangles\n"
" --focus-detail FILE Experimental: open a Focus Detail file (.sfdetail)\n"
" --benchmark-sizes 5,20 Proof mode mesh sizes in millions of triangles\n"
" --benchmark-out FILE Where the JSON result goes (default: sculptforge-benchmark-<time>.json here)\n"
@@ -206,12 +207,12 @@ int main(int argc, char** argv) {
else if (a == "--benchmark") {
options.benchmark = true;
// An optional scene name: sculptforge --benchmark standard-15m
- if (i + 1 < argc && (std::string(argv[i + 1]).rfind("standard", 0) == 0 || std::string(argv[i + 1]) == "core-200m")) {
+ if (i + 1 < argc && (std::string(argv[i + 1]).rfind("standard", 0) == 0 || std::string(argv[i + 1]).rfind("core-", 0) == 0)) {
options.benchmarkScene = argv[++i];
if (options.benchmarkScene != "standard" && options.benchmarkScene != "standard-15m" &&
options.benchmarkScene != "standard-33m" && options.benchmarkScene != "standard-1b" &&
- options.benchmarkScene != "core-200m") {
- std::fprintf(stderr, "Unknown benchmark scene %s (standard-15m, standard-33m, standard, standard-1b or core-200m)\n", argv[i]);
+ options.benchmarkScene != "core-200m" && options.benchmarkScene != "core-100m") {
+ std::fprintf(stderr, "Unknown benchmark scene %s (standard-15m, standard-33m, standard, standard-1b, core-100m or core-200m)\n", argv[i]);
return 1;
}
}
@@ -252,10 +253,11 @@ int main(int argc, char** argv) {
return 1;
}
}
- if (options.benchmarkScene == "core-200m") { // research: 200M micro triangles in memory, the project written once
+ if (options.benchmarkScene == "core-200m" || options.benchmarkScene == "core-100m") { // research: micro triangles in memory, the project written once
std::string error;
- if (sf::core200mScenePath(error, [](const std::string& s) { std::fprintf(stderr, "%s\n", s.c_str()); }).empty()) {
- std::fprintf(stderr, "core-200m: %s\n", error.c_str());
+ if (sf::core200mScenePath(error, [](const std::string& s) { std::fprintf(stderr, "%s\n", s.c_str()); },
+ options.benchmarkScene == "core-100m" ? 100 : 200).empty()) {
+ std::fprintf(stderr, "%s: %s\n", options.benchmarkScene.c_str(), error.c_str());
return 1;
}
}
diff --git a/src/core/Benchmark.cpp b/src/core/Benchmark.cpp
index 952620f1..b42761f3 100644
--- a/src/core/Benchmark.cpp
+++ b/src/core/Benchmark.cpp
@@ -251,18 +251,19 @@ Mesh makeCore200mMesh(size_t baseTriangles, int level) {
return m;
}
-std::string core200mScenePath(std::string& error, const std::function<void(const std::string&)>& log) {
+std::string core200mScenePath(std::string& error, const std::function<void(const std::string&)>& log, int millions) {
namespace fs = std::filesystem;
const fs::path dir = MicroStore::swapFolder();
std::error_code ec;
fs::create_directories(dir, ec);
- const fs::path path = dir / "core-200m-v1.sfproj";
+ const std::string name = "core-" + std::to_string(millions) + "m";
+ const fs::path path = dir / (name + "-v1.sfproj");
if (fs::exists(path, ec)) return path.string(); // (renamed into place when whole)
- if (log) log("Writing the core-200m scene (once): " + path.string());
+ if (log) log("Writing the " + name + " scene (once): " + path.string());
Document doc;
- doc.mesh = makeCore200mMesh();
+ doc.mesh = makeCore200mMesh(size_t(millions) * 1000000 / 1024); // micro level 5: 1,024 micro triangles a base one
if (!doc.mesh.micro) {
- error = "core-200m: couldn't divide to micro level 5";
+ error = name + ": couldn't divide to micro level 5";
return {};
}
const fs::path tmp = fs::path(path.string() + ".tmp.sfproj");
diff --git a/src/core/Benchmark.h b/src/core/Benchmark.h
index 6c125763..c03ca078 100644
--- a/src/core/Benchmark.h
+++ b/src/core/Benchmark.h
@@ -84,8 +84,9 @@ Mesh makeBenchHead(size_t triangles);
// The core-200m research scene (docs/design/core-200m.md, phase 1; --benchmark core-200m, off by default): the
// bench head at micro level 5 with procedural detail, about 200 million micro triangles, held in memory. Written
// once as a project in the swap folder (a few seconds) so the benchmark measures opening it; returns its path,
-// or "" with `error`.
-std::string core200mScenePath(std::string& error, const std::function<void(const std::string&)>& log = {});
+// or "" with `error`. `millions` picks the size (core-100m: 100, the same head with half the base triangles).
+std::string core200mScenePath(std::string& error, const std::function<void(const std::string&)>& log = {},
+ int millions = 200);
// The scene itself, built in memory (what core200mScenePath saves): `baseTriangles` base triangles at `level`.
Mesh makeCore200mMesh(size_t baseTriangles = 195313, int level = 5);
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index e376f2a3..c6bc6e57 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -2648,7 +2648,7 @@ int Renderer::drawView(const Camera& camera, int width, int height, const Render
while (samples > 1 && !viewTarget(width, height, samples)) samples /= 2;
screenStrokeDrawn_ = false;
// A screen stroke needs the view in a target it can read back: through the single-sample one when no AA.
- const bool screen = !screenStroke_.dabs.empty() && settings.matcap >= 0 && !settings.pbr();
+ const bool screen = !screenStroke_.dabs.empty() && settings.litsphere >= 0 && !settings.pbr();
if (samples <= 1 && !(screen && viewTarget(width, height, 1))) {
gl::BindFramebuffer(GL_FRAMEBUFFER, 0);
draw(camera, width, height, settings, viewport);
@@ -2663,7 +2663,7 @@ int Renderer::drawView(const Camera& camera, int width, int height, const Render
gl::BlitFramebuffer(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
if (screen)
screenStrokeDrawn_ = screenPass_.apply(screenStroke_, viewFbo_, viewResolveFbo_, width, height, frameView_, frameProj_,
- frameViewport_, matcapTexture(settings.matcap),
+ frameViewport_, litsphereTexture(settings.litsphere),
lightRotation(settings.lightYaw, settings.lightPitch));
gl::BindFramebuffer(GL_READ_FRAMEBUFFER, viewResolveFbo_); // single-sample blit: may convert to the window's format
gl::BindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
diff --git a/src/render/ScreenStroke.cpp b/src/render/ScreenStroke.cpp
index eeb567d9..589fca9e 100644
--- a/src/render/ScreenStroke.cpp
+++ b/src/render/ScreenStroke.cpp
@@ -26,7 +26,7 @@ void main() {
// Keep the kernel in step with ghostMove (render/Ghost.cpp, Standard) and the shading with the mesh shader's Lit
// Sphere branch (Renderer.cpp); tools/optimistic bench: app/OptimisticBench.cpp.
const char* kFS = R"(#version 330 core
-uniform sampler2D uColor, uDepth, uMatcapTex;
+uniform sampler2D uColor, uDepth, uLitSphereTex;
uniform mat4 uInvProj, uProj;
uniform mat3 uLightRot;
uniform vec4 uViewport; // x, y, w, h in target pixels
@@ -103,7 +103,7 @@ vec3 lit(vec3 n, vec3 v) {
vec3 by = cross(v, bx);
vec3 ln = transpose(uLightRot) * n;
vec2 uv = vec2(dot(bx, ln), dot(by, ln)) * 0.495 + 0.5;
- return pow(texture(uMatcapTex, uv).rgb, vec3(2.2));
+ return pow(texture(uLitSphereTex, uv).rgb, vec3(2.2));
}
void main() {
vec2 p = gl_FragCoord.xy - 0.5;
@@ -217,8 +217,8 @@ bool ScreenStroke::ensure(int width, int height) {
}
bool ScreenStroke::apply(const GhostStroke& g, GLuint drawFbo, GLuint resolveFbo, int width, int height, const glm::mat4& view,
- const glm::mat4& proj, const glm::vec4& viewport, GLuint matcap, const glm::mat3& lightRot) {
- if (!supports(g) || !matcap || !ensure(width, height)) return false;
+ const glm::mat4& proj, const glm::vec4& viewport, GLuint litsphere, const glm::mat3& lightRot) {
+ if (!supports(g) || !litsphere || !ensure(width, height)) return false;
// The pass's inputs: the resolved colour and the view's depth (a multisample depth resolves by nearest sample).
gl::BindFramebuffer(GL_READ_FRAMEBUFFER, resolveFbo);
gl::BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo_);
@@ -253,7 +253,7 @@ bool ScreenStroke::apply(const GhostStroke& g, GLuint drawFbo, GLuint resolveFbo
auto at = [&](const char* name) { return gl::GetUniformLocation(prog_, name); };
gl::Uniform1i(at("uColor"), 0);
gl::Uniform1i(at("uDepth"), 1);
- gl::Uniform1i(at("uMatcapTex"), 2);
+ gl::Uniform1i(at("uLitSphereTex"), 2);
const glm::mat4 invProj = glm::inverse(proj);
gl::UniformMatrix4fv(at("uInvProj"), 1, GL_FALSE, glm::value_ptr(invProj));
gl::UniformMatrix4fv(at("uProj"), 1, GL_FALSE, glm::value_ptr(proj));
@@ -268,7 +268,7 @@ bool ScreenStroke::apply(const GhostStroke& g, GLuint drawFbo, GLuint resolveFbo
gl::Uniform4fv(at("uDabA"), GLsizei(a.size()), glm::value_ptr(a[0]));
gl::Uniform1i(at("uKind"), g.kind == GhostKind::Clay ? 2 : 1);
gl::ActiveTexture(GL_TEXTURE0 + 2);
- gl::BindTexture(GL_TEXTURE_2D, matcap);
+ gl::BindTexture(GL_TEXTURE_2D, litsphere);
gl::ActiveTexture(GL_TEXTURE0 + 1);
gl::BindTexture(GL_TEXTURE_2D, depth_);
gl::ActiveTexture(GL_TEXTURE0);
diff --git a/src/render/ScreenStroke.h b/src/render/ScreenStroke.h
index a5c90d44..36c0972e 100644
--- a/src/render/ScreenStroke.h
+++ b/src/render/ScreenStroke.h
@@ -29,9 +29,9 @@ public:
}
// Applies `g` to the resolved view `resolveFbo` (single-sample colour) using the depth of `drawFbo` (the view's
// target, any sample count), both `width` x `height`. `view`, `proj`, `viewport` as the frame drew them;
- // `matcap` the Lit Sphere texture, `lightRot` the shader's uLightRot. False when it couldn't (nothing drawn).
+ // `lit sphere` the Lit Sphere texture, `lightRot` the shader's uLightRot. False when it couldn't (nothing drawn).
bool apply(const GhostStroke& g, GLuint drawFbo, GLuint resolveFbo, int width, int height, const glm::mat4& view,
- const glm::mat4& proj, const glm::vec4& viewport, GLuint matcap, const glm::mat3& lightRot);
+ const glm::mat4& proj, const glm::vec4& viewport, GLuint litsphere, const glm::mat3& lightRot);
private:
bool ensure(int width, int height);
diff --git a/tools/perf_scoreboard.py b/tools/perf_scoreboard.py
new file mode 100644
index 00000000..79eb0b8d
--- /dev/null
+++ b/tools/perf_scoreboard.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python3
+# SculptForge - open source digital sculpting
+# SPDX-License-Identifier: GPL-3.0-or-later
+"""Scoreboard rows (docs/design/perf-scoreboard.md) from benchmark results.
+
+ python3 tools/perf_scoreboard.py TIER result.json [result.json ...]
+
+Each result is a `sculptforge --benchmark <scene> --benchmark-out <file>` JSON. Prints one markdown row per brush
+phase (committed lag p50 / p99, release, orbit fps, memory); with several results for the same scene and phase
+(interleaved repeats) the cells show the range."""
+import json
+import sys
+
+PHASES = [("clay small", "25 px"), ("clay large", "120 px"), ("240 px brush", "240 px")]
+
+
+def rng(values, fmt="{:.0f}"):
+ values = [v for v in values if v is not None]
+ if not values:
+ return "-"
+ lo, hi = min(values), max(values)
+ return fmt.format(lo) if fmt.format(lo) == fmt.format(hi) else fmt.format(lo) + "-" + fmt.format(hi)
+
+
+def main():
+ if len(sys.argv) < 3:
+ sys.exit(__doc__)
+ tier, rows = sys.argv[1], {}
+ for path in sys.argv[2:]:
+ with open(path) as f:
+ root = json.load(f)
+ scene = root.get("settings", {}).get("scene", "?")
+ commit = root.get("sculptforge", {}).get("commit", "?")
+ for run in root.get("runs", []):
+ phases = {p["name"]: p for p in run.get("phases", [])}
+ orbit = phases.get("orbit", {})
+ for name, label in PHASES:
+ p = phases.get(name)
+ if not p or "lag_ms" not in p:
+ continue
+ r = rows.setdefault((scene, run["label"], label), {"commit": set(), "p50": [], "p99": [], "rel": [],
+ "fps": [], "ram": [], "gpu": []})
+ r["commit"].add(commit)
+ r["p50"].append(p["lag_ms"]["p50"])
+ r["p99"].append(p["lag_ms"]["p99"])
+ r["rel"].append(p.get("release_done_ms"))
+ r["fps"].append(orbit.get("fps"))
+ r["ram"].append(run.get("peak_ram_mb"))
+ r["gpu"].append(run.get("gpu_buffers_mb"))
+ for (scene, label, brush), r in rows.items():
+ mem = rng([x / 1024 for x in r["ram"] if x], "{:.1f}") + " GB + " + rng(r["gpu"]) + " MB GPU"
+ print(f"| {label} | {brush} | {tier} | {rng(r['p50'])} / {rng(r['p99'])} ms | {rng(r['rel'])} ms | "
+ f"{rng(r['fps'])} | {mem} | {', '.join(sorted(r['commit']))} |")
+
+
+if __name__ == "__main__":
+ main()