test(rendering): renderer-matrix browser suite — close drawable coverage gaps + fix first-flush text bug#269
Merged
Conversation
added 10 commits
July 9, 2026 05:11
… renderer-matrix suite Establishes the paired WebGL2/WebGPU pixel-assertion pattern for the v0.16 Renderer-Matrix Browser Suite track: a single opaque Sprite over a solid-color texture, asserting interior color, out-of-bounds clear color, and tint, on both backends. Follows the existing per-file helper pattern used by webgl2/webgpu-repeating-sprite.test.ts verbatim — no new shared helper needed yet.
Covers @codexo/exojs-particles WebGl2ParticleRenderer/WebGpuParticleRenderer end-to-end: a deterministically-placed particle (SoA slot written directly, no spawn modules, no update() call) renders at a known pixel position with the expected texture/tint color, while a particle-free region shows the clear color. Particle renderer bindings are not part of wireCoreRenderers, so both files materialize them explicitly via particlesExtension.renderers.
… pixel tests BitmapText/BmFont: WebGPU already pixel-verifies the color-atlas path (webgpu-stencil-clip.test.ts's "BitmapText renders inside a Geometry stencil clip", using its createSolidBitmapText helper), but no WebGL2 browser test ever constructed a BitmapText, so the WebGL2 side of the shared WebGl2TextRenderer "color" shaderType path was unexercised. Add webgl2-bitmap-text.test.ts to close that gap with real pixel readback. While building it, found and worked around (with a documented warm-up render, per-file comment) a genuine WebGl2TextRenderer bug: _drawBatches() calls shader.sync() before setting that flush's u_projection/u_texture/ u_nodeData/u_pageSize uniforms, so ShaderUniform.setValue()'s upload is deferred to the *next* sync() of that shader object — every other WebGL2 renderer (e.g. WebGl2SpriteRenderer) sets uniforms first and syncs last. The very first flush of a text shaderType after connect therefore draws with a zero u_projection (degenerate, invisible). This self-heals from the second flush onward in continuous rendering, which is why no prior test caught it, but breaks any true single-shot render. Render-texture float formats (rgba16f/rgba32f, the 0.15.3 feature) were not addable: this branch predates commit a3c7d69 ("feat(rendering): float color formats (rgba16f/rgba32f) for RenderTexture", merged to main after this branch's fork point) — RenderTexture has no `format` option, and ColorTextureFormat/rgba16f/rgba32f do not exist anywhere in src on matrix/verify. There is no float RenderTexture API here to test.
…t parity pixel tests
…rix-browser-suite
… flush renders WebGl2TextRenderer._drawBatches() called shader.sync() before writing that flush's u_projection/u_texture/u_nodeData/u_pageSize uniforms. Since ShaderUniform.setValue() only marks a value dirty for the NEXT sync(), the first flush of each text shaderType drew with a stale zero u_projection — degenerate, so nothing rasterized. It self-healed from the second frame on (values are frame-constant), so no continuous-rendering test caught it, but any genuine single-shot render (screenshot, render-to-texture pre-bake, first frame) of Text/BitmapText drew nothing. Move sync() after the uniform writes, matching every other WebGL2 renderer (uniforms first, sync() last). Surfaced by the new WebGL2 BitmapText pixel test, whose warm-up workaround is now removed so it renders once and guards the order.
Bundle ReportChanges will increase total bundle size by 512 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: exo-esm-modules-esmAssets Changed:
Files in
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renderer-Matrix Browser Suite (v0.16 quality track)
Completes the pixel-assertion matrix: every drawable type rendered on both GPU backends (WebGL2 + WebGPU) in a real headless browser, reading back actual pixels — catching shader (GLSL/WGSL) and backend-divergence bugs that jsdom unit tests (which stub shaders to
"") cannot see.The matrix was already broad (Sprite, RepeatingSprite, Mesh, Graphics gradient/stencil, Text/SDF, TileMap, RenderTexture, blend, DPR, pixel-snap). This closes the remaining gaps.
New coverage (15 test files, both backends unless noted)
WebGl2/WebGpuParticleRenderer) — deterministic placement by writing the SoA arrays directly (no RNG inParticleSystem); highest priority, matched the ~12%/~5% renderer-coverage note.ScaleModes.Nearestfixtures to avoid linear-filter seam bleed.update()/play().captureStream()<video>. Static-decode only; a dynamic mid-stream repaint scenario proved unreliable headless and was deliberately excluded rather than committed flaky.webgpu-split-viewport, isolated solid-fillGraphics,webgl2-mesh-tint.Engine bug found and fixed
The BitmapText work surfaced a real bug:
WebGl2TextRenderer._drawBatches()calledshader.sync()before writing that flush'su_projection/u_texture/u_nodeData/u_pageSizeuniforms. SinceShaderUniform.setValue()only marks a value dirty for the nextsync(), the first flush of each text shaderType drew with a stale zerou_projection— degenerate, so nothing rasterized. It self-heals from the second frame on (values are frame-constant), so no continuous-rendering test caught it, but any genuine single-shot render (screenshot, render-to-texture pre-bake, first frame) of Text/BitmapText drew nothing. Fixed by movingsync()after the uniform writes, matching every other WebGL2 renderer. The new BitmapText test renders exactly once (no warm-up) so it guards the ordering.Notes
rgba16f/rgba32f) is already covered on both backends by feat(rendering): float RenderTexture color formats (both backends) — forward-port of v0.15.3 #266 — no new test needed here.main(includes feat(rendering): float RenderTexture color formats (both backends) — forward-port of v0.15.3 #266 float-RT and feat(resources)!: asset-access redesign — Asset.kind, kind discriminator, idle/awaitBackground, Assets.one/group + lifecycle merge #267 loader redesign).Verification
verify:quick(typecheck + lint + prettier + api-docs) greenFollow-ups (separate PRs)
_pixelAssertions.ts(WebGL2readPixels+ WebGPUreadCanvas) — duplication is now well past the factor-on-third-use threshold.