p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

[p5.js 2.0+ Bug Report]: Benchmark cleanup passes p5.model to freeGeometry

Open Danyccsf opened this issue 3 months ago • 0 comments

Most appropriate sub-area of p5.js?

  • [ ] Accessibility
  • [ ] Color
  • [ ] Core/Environment/Rendering
  • [ ] Data
  • [ ] DOM
  • [ ] Events
  • [ ] Image
  • [ ] IO
  • [ ] Math
  • [ ] Typography
  • [ ] Utilities
  • [x] WebGL
  • [x] WebGPU
  • [ ] p5.strands
  • [ ] Build process
  • [x] Unit testing
  • [ ] Internationalization
  • [ ] Friendly errors
  • [ ] Other (specify if possible)

p5.js version

main branch (commit 92763e5bf)

Web browser and version

Google Chrome 150.0.7871.187 (Official Build, arm64)

Operating system

macOS 15.7.3 (Build 24G419)

Steps to reproduce this

Steps:

  1. Clone the p5.js repository and check out main at commit 92763e5bf.
  2. Install dependencies with npm install.
  3. Run: npx vitest bench test/bench/cpu_transforms.bench.js.
  4. Observe the FES validation message in the terminal output.

Snippet:

In test/bench/cpu_transforms.bench.js:

const shape = myp5.buildGeometry(drawCircles);
myp5.model(shape);
myp5.freeGeometry(myp5.model);

Observation:

The freeGeometry() function should receive the geometry instance created by buildGeometry(). Correcting the call to myp5.freeGeometry(shape) eliminates the validation messages and ensures a clean benchmark run.

Additional Context:

I discussed the finding with @davepagurek in the p5.js Discord. He confirmed that shape is the correct argument and asked that I create an issue before submitting a PR.

Danyccsf avatar Aug 05 '26 20:08 Danyccsf