plum

#treesitter#compiler#wasm

git clone https://git.pyrossh.dev/plum

A statically typed, imperative programming language inspired by rust, python


6c3176f — Peter John 2026-11-10T11:38:52+05:30
Benchmark harness: --no-fusion beside --no-fbip; BENCHMARK.md marked historical
compiler/game/web-test/BENCHMARK.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Web renderer benchmark: macroquad vs PixiJS vs our gpu renderer
2
2
 
3
+ > **Historical record.** The tables below were measured in November 2026 with tools
4
+ > that no longer exist: `plum game` (now `plum run`, which serves a game in the
5
+ > browser), `--web` and `--renderer`, the macroquad and PixiJS renderers, the
6
+ > command buffer and the native host with `PLUM_GAME_MEASURE` (the engine is
7
+ > browser-only now). Read the numbers as a record of those decisions, not as a
8
+ > baseline to compare with. To measure today, see *Reproduce* below.
9
+
3
10
  **Outcome:** browser-only engine on the gpu renderer (per-call); macroquad, Pixi and the command buffer were removed after this benchmark (see git history).
4
11
 
5
12
  Browser renderers for `plum game --web`: the default macroquad-on-wasm32, the
@@ -82,9 +89,9 @@ Headless is software rendering: the GPU work runs on the CPU and competes with t
82
89
  ## Reproduce
83
90
 
84
91
  cargo build --manifest-path compiler/game/web-test/Cargo.toml
85
- compiler/game/web-test/target/debug/plum-web-test compiler/game/web-test/fixtures/stress_cmd.plum --headed --uncapped --measure 10 --frames-wait 6 --json
92
+ compiler/game/web-test/target/debug/plum-web-test compiler/game/web-test/fixtures/stress.plum --headed --uncapped --measure 10 --frames-wait 6 --json
86
93
 
87
- Drop `--headed` for the software path. Native: `PLUM_GAME_MEASURE=10 target/release/plum game compiler/game/web-test/fixtures/stress.plum`.
94
+ Drop `--headed` for the software path. `--no-fbip` and `--no-fusion` build the game without in-place updates or without fusion, for an A/B against the default. The `stress_cmd` fixtures and the native measurement (`plum game` with `PLUM_GAME_MEASURE`) are gone.
88
95
 
89
96
  ## Multi-texture batching and SDF text (renderer features)
90
97
 
compiler/game/web-test/src/lib.rs CHANGED
@@ -64,6 +64,8 @@ pub struct Options {
64
64
  pub lose_device: bool,
65
65
  /// Pass `--no-fbip` to `plum build`.
66
66
  pub no_fbip: bool,
67
+ /// Pass `--no-fusion` to `plum build`.
68
+ pub no_fusion: bool,
67
69
  }
68
70
 
69
71
  impl Default for Options {
@@ -83,6 +85,7 @@ impl Default for Options {
83
85
  dpr: None,
84
86
  lose_device: false,
85
87
  no_fbip: false,
88
+ no_fusion: false,
86
89
  expect_pixels: Vec::new(),
87
90
  }
88
91
  }
@@ -236,8 +239,9 @@ pub fn repo_root() -> PathBuf {
236
239
  Path::new(env!("CARGO_MANIFEST_DIR")).join("../../..").canonicalize().expect("repo root")
237
240
  }
238
241
 
239
- /// Builds plum-cli and exports `file` as a static web build into `out`.
242
+ /// Builds plum-cli and exports `file` as a static web build into `out`, with
243
+ /// `--no-fbip` / `--no-fusion` when asked.
240
- pub fn build_web(file: &Path, out: &Path, assets: Option<&Path>, no_fbip: bool) -> Result<(), String> {
244
+ pub fn build_web(file: &Path, out: &Path, assets: Option<&Path>, no_fbip: bool, no_fusion: bool) -> Result<(), String> {
241
245
  let root = repo_root();
242
246
  let st = Command::new("cargo")
243
247
  .args(["build", "-p", "plum-cli"])
@@ -253,6 +257,9 @@ pub fn build_web(file: &Path, out: &Path, assets: Option<&Path>, no_fbip: bool)
253
257
  if no_fbip {
254
258
  cmd.arg("--no-fbip");
255
259
  }
260
+ if no_fusion {
261
+ cmd.arg("--no-fusion");
262
+ }
256
263
  if let Some(a) = assets {
257
264
  cmd.arg("--assets").arg(a.canonicalize().map_err(|e| format!("{}: {e}", a.display()))?);
258
265
  }
@@ -393,7 +400,7 @@ pub async fn run(file: &Path, opts: &Options) -> Result<String, String> {
393
400
  }
394
401
 
395
402
  async fn run_in(file: &Path, opts: &Options, dir: &Path) -> Result<String, String> {
396
- build_web(file, dir, opts.assets.as_deref(), opts.no_fbip)?;
403
+ build_web(file, dir, opts.assets.as_deref(), opts.no_fbip, opts.no_fusion)?;
397
404
  let stop = Arc::new(AtomicBool::new(false));
398
405
  let port = serve(dir.to_path_buf(), stop.clone());
399
406
  let res = check(port, opts).await;
@@ -695,7 +702,7 @@ pub async fn record_and_replay(file: &Path) -> Result<String, String> {
695
702
  let tmp = std::env::temp_dir().join(format!("plum-web-replay-{}", std::process::id()));
696
703
  let _ = std::fs::remove_dir_all(&tmp);
697
704
  std::fs::create_dir_all(&tmp).map_err(|e| e.to_string())?;
698
- build_web(file, &tmp, None, false)?;
705
+ build_web(file, &tmp, None, false, false)?;
699
706
  let stop = Arc::new(AtomicBool::new(false));
700
707
  let port = serve(tmp.clone(), stop.clone());
701
708
  let res = record_and_replay_at(port, &tmp).await;
compiler/game/web-test/src/main.rs CHANGED
@@ -1,7 +1,7 @@
1
1
  use plum_web_test::{browser_installed, run, Browser, ExpectPixel, Options};
2
2
  use std::path::PathBuf;
3
3
 
4
- const USAGE: &str = "usage: plum-web-test <file.plum> [--frames-wait SECS] [--screenshot OUT.png] [--require-audio]\n [--assets DIR] [--headed] [--measure SECS] [--uncapped] [--json] [--no-fbip]
4
+ const USAGE: &str = "usage: plum-web-test <file.plum> [--frames-wait SECS] [--screenshot OUT.png] [--require-audio]\n [--assets DIR] [--headed] [--measure SECS] [--uncapped] [--json] [--no-fbip] [--no-fusion]
5
5
  [--browser chromium|webkit] [--expect-unsupported-webgpu] [--no-module-introspection]
6
6
  [--dpr N] [--lose-device] [--expect-pixel x,y,r,g,b[,tol]]...";
7
7
 
@@ -19,6 +19,7 @@ async fn main() {
19
19
  "--require-audio" => opts.require_audio = true,
20
20
  "--headed" => opts.headed = true,
21
21
  "--no-fbip" => opts.no_fbip = true,
22
+ "--no-fusion" => opts.no_fusion = true,
22
23
  "--uncapped" => opts.uncapped = true,
23
24
  "--json" => opts.json = true,
24
25
  "--browser" => opts.browser = Browser::parse(&args.next().unwrap_or_else(|| fail("--browser needs chromium or webkit"))).unwrap_or_else(|e| fail(&e)),