Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ jobs:
# CHANGELOG.md is generated from the git history by `cargo xtask
# changelog`, so a released section that disagrees with the tags is a
# mistake, not a style choice. The icon PNGs and THIRD_PARTY.md (D491)
# are generated too, and the `generated` lane checks all three.
# are generated too, as is docs/DECISIONS_BY_AREA.md (D539), and the
# `generated` lane checks all four.
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down
21 changes: 11 additions & 10 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,25 @@ cargo xtask credits [--check] # THIRD_PARTY.md (Abou
cargo xtask decisions [--check] # docs/DECISIONS_BY_AREA.md, the decisions by crate (D539)
cargo xtask rc --zip <zip> --symbols <symbols.zip> # release-candidate harness on a real Windows machine (D537)
cargo run --profile release-fast -p strobe-app # optimised and incremental: iterate with this, not --release (D487)
cargo test --workspace # everything
cargo test --workspace --all-features # everything
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo fmt --all -- --check
cargo clippy -p strobe-io --no-default-features --all-targets -- -D warnings # Linux; the build with MIDI off
cargo clippy -p strobe-forge --no-default-features --all-targets -- -D warnings # the forge without its LLM client
cargo clippy -p strobe-web --target wasm32-unknown-unknown -- -D warnings # Linux; the browser engine (D544)
cargo clippy --workspace --exclude strobe-script --exclude strobe-app --exclude strobe-shadertoy --all-targets --all-features --target x86_64-pc-windows-msvc -- -D warnings
cargo clippy -p strobe-shadertoy --no-default-features --all-targets --target x86_64-pc-windows-msvc -- -D warnings
cargo clippy -p strobe-web -p strobe-gfx --no-default-features --target wasm32-unknown-unknown -- -D warnings # Linux; the browser engine (D544, D552)
cargo clippy --workspace --exclude strobe-script --exclude strobe-app --exclude strobe-shadertoy --exclude strobe-forge --all-targets --all-features --target x86_64-pc-windows-msvc -- -D warnings
cargo clippy -p strobe-shadertoy -p strobe-forge --no-default-features --all-targets --target x86_64-pc-windows-msvc -- -D warnings
cargo run --release -p strobe-bench -- --size 1280x720 # benchmark + frames
```

All of these are clean on the branch, and CI enforces them. A warning is
a build failure. CI's jobs run `cargo --locked xtask ci --strict <lanes>`,
so `cargo xtask ci` runs the same commands: the lanes `fmt`, `lint`
(actionlint and shellcheck on Linux, PSScriptAnalyzer on Windows, D541),
`check` (clippy; on Linux also `strobe-io`, `strobe-audio` and
`strobe-shadertoy` without their default features, `strobe-web` for
wasm32, rustdoc and the Windows cross-check), `test`, `deny`, `generated`
`check` (clippy; on Linux also `strobe-io`, `strobe-audio`,
`strobe-shadertoy` and `strobe-forge` without their default features,
`strobe-web` and `strobe-gfx` for wasm32, rustdoc and the Windows
cross-check), `test`, `deny`, `generated`
(changelog, brand, credits, decisions), `render` (Linux: Xvfb, the scene
library and the corpus gate, D534), `build` (Windows: the optimised
binaries), `package` (Windows: the release zip, unpacked and checked,
Expand All @@ -75,9 +76,9 @@ edited by hand. Releases follow the order in `CONTRIBUTING.md`: write the
section with `--release` first, tag after, never move a tag.

The Windows cross-check excludes `strobe-script`, and `strobe-app` with
it because the app depends on the script crate. `strobe-shadertoy` is checked
separately without its `net` feature, whose TLS (`ring`) also compiles C
for MSVC (D110); `cargo xtask ci` runs both steps. QuickJS is C, and
it because the app depends on the script crate. `strobe-shadertoy` and `strobe-forge` are
checked separately without their `net` and `llm` features, whose TLS
(`ring`) also compiles C for MSVC (D110); `cargo xtask ci` runs both steps. QuickJS is C, and
compiling it for MSVC needs the Windows SDK, so only a real Windows build
checks those two for Windows: CI's `windows` job, or the T480. The app has
no `#[cfg(windows)]` code of its own (its Windows branches are `cfg!`
Expand Down
31 changes: 21 additions & 10 deletions crates/strobe-bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Every flag is defined in the clap `Cli`:
| Flag | Default | Meaning |
|---|---|---|
| `--library <dir>` | `scenes` | Folder of scene folders. |
| `--size WxH` | `640x360` | Render resolution. |
| `--frames <n>` | `60` | Timed frames per scene. |
| `--size WxH` | `640x360` | Render resolution, each edge 1 to 16384. |
| `--frames <n>` | `60` | Timed frames per scene, at least 1. |
| `--warmup <n>` | `90` | Untimed frames first, so feedback scenes have history. |
| `--scales <list>` | `1` | Render scales to time every scene at, comma-separated fractions of `--size` (`1,0.75,0.5`). The first gives the frames, the contact sheet and the main table; with more than one, `results.md` adds each scene's mean frame time per scale (D496). |
| `--start <seconds>` | `2.0` | Scene time at the first frame. |
Expand All @@ -56,11 +56,15 @@ Every flag is defined in the clap `Cli`:
| `--probe` | off | Instead of benchmarking, clear, draw into and read back targets at a ladder of sizes plus `--size`, and print the viewport the driver keeps. Writes `probe.md` (D296). |
| `--share` | off | Instead of benchmarking, time preparing a `--size` picture for Spout and NDI (a fixed-size draw, blackout, the UYVY pack and its asynchronous readback) against the first cut's synchronous readback, and check the NDI ring's pacing at 60 Hz. Writes `share.md` (D573). |
| `--readback` | off | Instead of benchmarking, check the `textureFinalPass` readback on this context (latency, cost, a busy GPU, a resize, a lost context). Writes `readback.md` (D245). |
| `--post` | off | Instead of benchmarking, time the output post stage (the meta controls) at `--size`: skipped at neutral, invert alone, every pixel control at once. Writes `post.md` (C-01). |
| `--meta <pairs>` | none | Meta control values each saved frame is drawn through, `name=value` pairs joined by commas, a colour as three values joined by `:` (`hue=0.75,low_color=1:0:0`), in the stored `0..1` range (D578). Only the PNG goes through the meta stage; the timings and the all-black check use the scene's own frame. |
| `--api desktop\|gles` | unset | Dialect for headless (desktop by default). In window mode the backend decides, and a contradiction with `--gl` is an error (D72). |
| `--full` | off | RGBA32F instead of the default RGBA16F for `FLOAT` passes. |
| `--shared` | off | One shared program per scene with a `PASSINDEX` uniform, instead of one specialised program per pass. |
| `--filter <text>` | none | Only scenes whose folder name contains the text. |
| `--out <dir>` | `target/bench` | Output folder: `<scene>.png`, `contact-sheet.png`, `results.md`. |
| `--out <dir>` | `target/bench` | Output folder: `<scene>.png`, `contact-sheet.png`, `results.md`; or the one report a mode writes (`probe.md`, `post.md`, `share.md`, `readback.md`). |

`--probe`, `--post`, `--share` and `--readback` are modes: at most one at a time.

Environment: `STROBE_LOG` filters the renderer's log lines on stderr;
`STROBE_GL_DEBUG=1` shows the driver's own messages; `STROBE_GL_TRACE=1` records
Expand All @@ -84,7 +88,7 @@ folders as artifacts (D56). Numbers and method are in

## Testing

The crate has no tests of its own. Running it is the test:
Running it is the main test:

```bash
apt-get install -y libegl1 libegl-mesa0 mesa-utils # headless Mesa llvmpipe
Expand All @@ -95,7 +99,12 @@ cargo run --release -p strobe-bench -- --size 640x360 --frames 10 --warmup 60 --
Open `target/bench/contact-sheet.png` to check the visuals. On a machine with
no GPU the context is llvmpipe: the timings are CPU rasterisation, but the
ranking between scenes and the before/after delta of a change are meaningful.
It has no `#[test]` functions, so `cargo test -p strobe-bench` only compiles it.
`cargo test -p strobe-bench` runs the unit tests: the argument parsing, the
p95, the exit verdict (a scene failing at any `--scales` scale, no scene at
all, a context that drew nothing) and the readback checks' verdicts, plus two
on a headless context (an earlier scene's GL error does not fail the next; the
probe's start state is read before its rows). Those skip without EGL unless
`STROBE_REQUIRE_HEADLESS_GL` is set.

## Design notes

Expand Down Expand Up @@ -125,11 +134,13 @@ IDs given here; a gap with no ID is by design, with its decision named.
desktop's RX 580, TORNADO's GTX 1080 Ti (ANGLE's backends included) and
the venue mini-PC's Vega 3. The other baseline is llvmpipe in a cloud
container. `--scales 1,0.75,0.5` adds a render-scale sweep table (D496).
- **A failed scene fails the run.** A scene that fails to compile is printed
as `FAILED`, recorded in `results.md` and left out of the contact sheet.
After every frame and the report are written, the process exits non-zero
with `N of M scenes failed: <names>`, which is what fails CI's bench step
(D56).
- **A failed scene fails the run.** A scene that fails to compile, raises
a GL error or cannot save its frame, at the first scale or any other
`--scales` scale, is printed as `FAILED`, recorded in `results.md` and
left out of the contact sheet. After every frame and the report are
written, the process exits non-zero with `N of M scenes failed: <names>`,
which is what fails CI's bench step (D56). A run that benchmarks no scene
fails too.
- No scripts run, by design (D239): `11-script-orbits` renders as a still
with default controls, and `results.md` says so and marks such scenes
`*`; `cargo xtask corpus` runs scripts. The audio textures come from the
Expand Down
Loading
Loading