Open
Description
Priority: P1 (proposed, to be triaged)
Area: performance
Status: triage
Outcome
Optimize measurable bottlenecks in the Rust graphics/runtime code without speculative rewrites. Preserve semantics and avoid changing platform features without a decision.
Acceptance criteria
- Record a reproducible baseline for Rust/WASM release output: raw, gzip and brotli bytes plus runtime/startup measures.
- Use wasm-opt and release profile experiments in isolated branches; compare size and frame-time effects, not just uncompressed bytes.
- Profile dominant CPU, allocation and GL submission paths on a fixed demo/fixture; document sampling environment and uncertainty.
- Investigate buffer upload behavior imported from upstream gl: give a buffer a new store each time it's updated not-fl3/miniquad#682 and texture cache behavior graphics/gl: forget deleted textures in the binding cache not-fl3/miniquad#691 with reproducible benchmarks.
- Promote only experiments with matching functional output, no regressions over defined tolerances, and stated trade-offs.
- Keep discarded experiments and their measured outcomes as brief source-linked evidence.
Dependencies / prior work
#10 (Rust checks), #11 (browser harness), #12 (SLOs)
Related source references
- gl: give a buffer a new store each time it's updated not-fl3/miniquad#682
- graphics/gl: forget deleted textures in the binding cache not-fl3/miniquad#691
Evidence policy
Record exact source revision, environment, commands/check IDs, outcome and limitations. A passing syntax/compilation check is not a passing browser runtime test. Do not merge changes solely because an upstream patch applies cleanly.
Metadata
Metadata
Assignees
Labels
No labels
Activity
perf(rust): measure isolated -Oz candidate against release baseline i…
Tigon32 commentedon Nov 10, 2026
Exact-source Rust/WASM codegen comparison — 2026-11-10
PR #109 merged as
ae766c023fb4dff79ec0786d9e87a2e4fecc3c0afrom exact tested headdc2bf589c04eabac6649539f97c6420a56cbf844. Integration 42902304291, terminology 42902303954 and the isolated optimization experiment 42902304253 all succeeded. The candidate passed 20/20 Playwright tests in each of Chromium, Firefox and WebKit against its exact compiled output.Source-identical build comparison on Rust
1.99.1(Linux, gzip-9, Brotli-11): quad baseline 114,018 raw / 44,906 gzip / 37,427 Brotli bytes versusRUSTFLAGS=-C opt-level=zcandidate 105,403 / 43,714 / 36,863 bytes (-7.556% raw, -2.654% gzip, -1.507% Brotli). Offscreen baseline 117,381 / 45,585 / 38,025 versus candidate 108,596 / 44,358 / 37,350 bytes (-7.484% raw, -2.692% gzip, -1.775% Brotli). Artifacts include SHA-256, exact revision and browser candidate validation. No release profile was changed.Remaining #14 work: Benchmark pinned Binaryen/wasm-opt as a separate isolated candidate, compare repeated matched frame timing and CPU/GL submission/allocations with uncertainty, and decide promotion only if net savings outweigh any runtime regressions. Single-run size savings do not prove faster frames or lower memory. Keep #14 open pending those independent measurements.
perf(rust): pinned Binaryen wasm-opt -Oz size A/B and three-engine pa…
Tigon32 commentedon Nov 10, 2026
Pinned Binaryen wasm-opt A/B measurement — merged 2026-11-10
PR #112 merged as
aac0d9ce5b7d09d48f9770a6dee60f3617426b80, from exact tested head67dd8d029f7ff21041f003dfe2784a1967c9bcd7. The workflow downloads the official Binaryenversion_133Linux x86_64 archive and checks the fixed release digestsha256:2dc9c7813f5375db93d96ead4b78222fcc3e2677bbb832297af4797782a37489before runningwasm-opt. The Rust 1.99.1 output uses bulk-memory/copy/fill and nontrapping saturating float conversion; the first two optimizer runs rejected these features (CI 42904122957 and 42904551203). Correctedwasm-opt -Ozretains validator checks and explicitly enables the source-required features.Exact-head proof: Binaryen experiment run 42904713586 passed, including 21/21 real browser tests each in Chromium, Firefox and WebKit against the actual optimized candidates. Integration 42904713425, terminology 42904713345 and independent Rust opt-level experiment 42904713687 also passed on this head.
Source-identical measured bytes (release baseline →
wasm-opt -Oz, gzip-9/Brotli-11): quad raw 114,018 → 94,493 (-17.124%); gzip 44,906 → 42,234 (-5.950%); Brotli 37,427 → 35,385 (-5.456%). Offscreen raw 117,381 → 100,299 (-14.553%); gzip 45,585 → 44,057 (-3.352%); Brotli 38,025 → 36,550 (-3.879%). The output SHA-256 values and candidate browser timing receipts are retained in experiment logs/artifacts. Compared with the separate Rust-C opt-level=ztest from #109, the Binaryen candidate produced larger measured compressed-size savings for both fixtures under these builds; the pipelines were measured independently, not run as a statistically matched timing trial.Decision: Keep the default release build pipeline and Cargo profile unchanged. This establishes reproducible, validated candidate byte-size savings, not a frame-time speedup, lower allocation count, reduced GPU memory or production browser release qualification. #14 remains open pending repeated matched CPU/GL submission and allocation profiling, before/after uncertainty, buffer-upload regression review (not-fl3#682), texture-cache lifecycle benchmarking (not-fl3#691), and an explicit separate promotion decision.
Tigon32 commentedon Nov 10, 2026
Progress receipt (not closure): PR #118 merged as
6584315b84e0c0232722914f67fdfa20efb17460. Measured Chromium/WASM baseline is source-linked to PR #116 head8706f6fand integration CI run 42920947828: WASM/JS artifact hashes, raw/gzip/Brotli bytes, 21 passing Chromium tests, 79 warm frame samples, p95 16.8 ms and p99 33.3 ms. This is not a candidate-versus-baseline performance improvement. Remains open for repeated/profiled comparisons, WASM optimization experiments, Firefox/WebKit/mobile evidence and runtime-memory measurements.Tigon32 commentedon Nov 10, 2026
Executable progress on source
7e5d60a6ba3c8ea9bec30c8a929bb0a7a341f58f: PR #119 merged tomasterasa3cf08394622b9d87f2aa53c57dc17cade12a78c. CI integration 42921970943 passed 21 Chromium scenarios; the fixed probe captured first WebGL draw at 39.9 ms (prior baselinenull). Independent three-engine run 42921971166 passed 21/21 each for Chromium, Firefox, WebKit, with first draw recorded in all engines. Rust opt-level experiment 42921970898 passed;-C opt-level=zreducedquad.wasmBrotli 37,427 -> 36,863 bytes (-1.507%) andoffscreen.wasmBrotli 38,025 -> 37,350 bytes (-1.775%). Do not treat run-to-run timing changes as optimization evidence; no production opt-level change promoted. PR #120 adds a fail-closed first-draw assertion and is under CI. #14 remains open for repeated performance comparisons, profiling and tradeoff review.Tigon32 commentedon Nov 11, 2026
Measured follow-up in #126. Five paired Chromium/SwiftShader runs compare source-identical release profiles on a fixed upload/texture workload. All pairs have equal WebGL counts and byte-identical frozen pixels. Raw/gzip/Brotli candidate bytes decrease, but all six timing results are INCONCLUSIVE on the shared host. No optimization is promoted. The committed receipt pins source inputs, hashes, tools, uncertainty, and raw-report identity. Allocation topology, additional engines/devices, and reliable timing remain open. STE-aligned draft.
test: measure paired browser CPU and WebGL workloads (#126)
Tigon32 commentedon Nov 11, 2026
#126 is merged and verified on master at
e09dd5471212177bd259e35ea04acb7c5497c748. The profiling fixture builds for WASM. The combined JS suite passes 169 tests. The measurement receipt remains historical evidence for the pinned measured source, not a fresh timing claim for later formatting or integration. The remaining allocation and device conditions keep #14 open. STE-aligned draft.test(perf): measure allocation windows and validate profiling evidence (
Tigon32 commentedon Nov 11, 2026
Allocation evidence merged; optimization remains unpromoted
PR #140 merged through protected
masteras3ec7e26b814bd9e7943e848e80475971943bc33c.The delivered tree matches source
76e4ba39d0e77610127acc91d7390ba12fe97e7a.Use section 9 of the allocation receipt for the corrected measurement.
The measured source is
022ca9049cd6fc3422fa7ab5360c226053f9c9e5.The retained raw receipt is
browser-profile-1794399365011.json, SHA-256e638b35b1004550c4b5b09c88f5f2394785a8b8a5ea5741be52078f4850d8709.The five baseline/candidate pixel comparisons have equal sizes,
maxChannelDiff: 0, andmismatchedPixelRatio: 0.The adjacent allocation windows cover frames 60-90 and 90-120.
Each window records 90 allocations, 0 reallocations, 90 deallocations, and a live-byte delta of 0.
These are bounded observations, not proof of general leak freedom.
The native allocation tests passed with
--test-threads=1(5 tests).The local integration gate passed before the push.
It covered 10 root Rust tests, 41 drawing tests and 1 drawing documentation test, 88 voxel tests, 21 documentation checks, 219 Node regression tests, and 56 root plus 2 generated-drawing Chromium tests.
Required hosted checks passed before the protected merge.
The receipt also records the source review of upstream not-fl3#682 and not-fl3#691.
The texture deletion-cache rule is distinct from within-pass bind deduplication.
Still open: representative CPU hotspot evidence, timing above the shared-host noise floor, additional engines and reference devices, and a separate promotion decision.
No release-profile change or production optimization was promoted.
The existing paired timing results remain INCONCLUSIVE.
Writing review state: STE-aligned draft. Full dictionary review not done.
Tigon32 commentedon Nov 11, 2026
Platform scope is tracked in #156. It defines the supported OS, CPU, browser, and GPU matrix, plus staged removal of obsolete source, backends, dependencies, configuration, CI jobs, and guides. It does not merely label legacy paths as unsupported.
Use the approved matrix for platform claims and qualification in this issue. Pure geometry, protocol, editorial, and safety fixes can proceed without waiting. Existing acceptance conditions still apply. Do not close this issue only because its platform might be removed: first verify the policy decision and the actual removal.
Writing review state: STE-aligned draft. Full dictionary review not done.