Skip to content

Path2D: keep half-circle SVG arcs from turning into straight lines (#1910, conflict resolved) - #1912

Merged
obiot merged 56 commits into
masterfrom
claude/hopeful-hypatia-jl2ouu
Nov 21, 2026
Merged

obiot merged 56 commits into
masterfrom
claude/hopeful-hypatia-jl2ouu

Conversation

@obiot

@obiot obiot commented Nov 21, 2026

Copy link
Copy Markdown
Member

Description

This carries the commit of #1910 by @SwastikTripathi, unchanged and under their authorship, merged with master to resolve its conflict in the changelog (both sets of Fixed entries are kept). #1910 could not be merged as it stood once #1911 landed, and its branch is on a fork.

The change: vec2Angle() in toarccanvas.ts clamps the cosine to [-1, 1] before Math.acos. For an SVG A arc that is exactly half a circle, rounding could put that cosine just past -1, Math.acos returned NaN, and the arc was drawn as the straight line between its ends.

Checked here:

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Checklist

Related issues

Closes #1910.


Generated by Claude Code

On a machine with a WebGPU adapter, 14 tests of mask-effect-image.spec.js
failed: the pixel helper's WebGPU branch called a method the renderer does
not have, and the WebGPU application made in the same file took the place
of the Canvas one the later tests use.

- helpers/pixels.js: grabFrame() reads a whole frame on any backend (a
  texture-to-buffer copy on WebGPU), and drawOffscreen() has a WebGPU
  renderer draw into a texture of its own, which reads back the same on a
  headless software adapter, where a canvas texture cannot be presented
- the drawing checks move to helpers/mask-effect-checks.js, and take each
  frame once, as it is drawn: an application's loop draws over it while a
  test awaits
- the WebGPU checks get a spec file of their own, with a projection set

Verified with a software WebGPU adapter: the 12 WebGPU checks pass, and
skip as before where there is no adapter.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
An isometric tile layer can take the "shader" render mode, on WebGL 2 and
on WebGPU: one quad for the view, the fragment shader finding each pixel's
tile. For a pixel it walks the cells whose tile image could cover it, front
to back (the reverse of the order TMXIsometricRenderer draws in), and keeps
the first texel that is not transparent, so tall tiles overlap the rows
behind them as on the CPU path.

- shaders: the part every orientation shares (index and animation lookups,
  flips, atlas sampling) is split from the orthogonal part, in GLSL and in
  WGSL; the isometric part adds only its cell maths
- renderers: a TMXLayerGPURenderer base per backend, with the orthogonal
  and isometric ones on top; the part of a layer a view shows is computed
  in one module both backends read (gpu/tmxlayer_region.js)
- TMXLayer: an isometric layer is eligible when its tiles come from one
  tileset (they overlap, and a pass draws one tileset), an image one, with
  tiles within the shader's bounds; a tileoffset is supported. A tile of
  another tileset set at run time moves the layer back to the CPU path
- tests: helpers/tile-layer-compare.js draws a layer through the CPU and
  the GPU path, with the whole engine in between, and compares the frames

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…rence (#1897)

The GPU path took the first texel that was not transparent, front to
back. With drawn art that is wrong wherever tiles overlap, which on an
isometric map is everywhere: the soft edge of a tile showed the
background in place of the tile behind it. Each texel now goes behind the
ones before it until the fragment is opaque, which is what drawing the
tiles one over the other comes to. The orthogonal shader shares it, for
tiles larger than the grid.

Found by a scenario suite that draws every case through the CPU renderer
and the GPU one, on WebGL and on WebGPU, and compares both with a
reference painted with no engine at all. It also found, and this fixes:

- the isometric CPU renderer left out tiles by the first tileset's size,
  and by no tileset's `tileoffset`
- the orthogonal CPU renderer widened the wrong side of the view for
  tiles taller than the grid
- the orthogonal GPU quad cut tiles larger than the grid above the first
  row and right of the last column
- a tile that is not square, flipped diagonally, is wrong on the GPU
  path: such a layer is left to the CPU renderer

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…1897)

From an independent review of the isometric GPU path:

- a grid of odd size, and a blend mode other than the normal one, are
  left to the CPU renderer: the first stands half the tiles half a pixel
  off, the second shows where tiles overlap
- a tileset image with no margin after its last tiles was counted a
  column short (the orthogonal path too)
- a layer asked for "shader" by hand after it was found unfit for it is
  drawn tile by tile, where an isometric one drew nothing
- the tile shader declares full precision itself, and finds a tile's
  place in the atlas in whole numbers

Faster per fragment: what sampling needs of a fragment is taken once
instead of for every cell tried, a cell whose tile cannot reach the
fragment is dropped before its index is fetched, and the isometric walk
skips the rows outside the map.

What differs with a map's orientation is in one module for both
backends (`gpu/tmxlayer_orientation.js`: the region, the tilesets, the
shader's limits, which the layer's checks read too), so each backend has
one renderer class and the shader text.

`tests/tmxlayer_bench.spec.js` measures the main thread's share of a
frame tile by tile and on the GPU path, orthogonal and isometric.

Changelog, API docs and the tilemaps skill.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…ir tiles reach

Two gaps the reference picture of the tile layer tests had to work
around (#1897), on every renderer and render mode.

A tile layer ignored its offset in Tiled (`offsetx`, `offsety`) and its
own `pos`: it was always drawn at the map's origin, where image layers
followed theirs. The offset now goes into `pos`, and the layer draws its
tiles, and `getTile()` finds them, where `pos` says.

A layer was skipped once its grid left the view, though tiles larger
than a cell, or moved by a `tileoffset`, still reached in: the tops of
tall tiles vanished above the map. The layer's bounds now cover how far
its tiles reach; its `width` and `height` stay the grid's.

Tests written first and seen to fail: both paths against the reference
on WebGL and WebGPU (offset layers, several layers, an infinite map, a
layer moved at run time, views that hold only the reach), and on the
Canvas renderer tile by tile and baked, with `getTile`, the bounds, and
staggered and hexagonal maps. The reference no longer leaves out a
layer whose grid is out of view.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
Both are one geometry, on the base the isometric path shares: lines of
cells a row height apart, every other one shifted by a column width,
along the map's rows or its columns. One shader chunk (GLSL and WGSL)
and one region function draw both; a hexagonal map's cells are longer by
its side length, which is in the two lengths the shader is given (in
what was the padding of the WGSL uniform block). The layer's checks are
those of an isometric layer: one tileset, tiles up to 4 cells wide and 8
tall, a grid of even size.

The CPU renderer of these maps is fixed first, as the reference of the
tests showed it away from Tiled: its drawing loop hung a tile larger
than its cell from the top of the cell and ignored the tileset's
`tileoffset`, where its own `drawTile` (and Tiled) stand the tile on
the cell and move it by the offset; and it left out tiles of a large
tileset along the edges of the view.

Tests: the reference paints staggered and hexagonal maps; 24 scenes
(both orientations, either axis, either index, three kinds of tiles) on
the Canvas renderer tile by tile and baked, and 38 scenarios on WebGL
and WebGPU through both paths, with soft edges, flips, animation, layer
offsets, infinite maps, setTile and the fallbacks. The comparison of
the two paths moves to the shared test helper.

Changelog, API docs and the tilemaps skill.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
A layer reads the camera's view in its own coordinates. It is handed the
view in the world's, and is drawn where its ancestors put it: a map
centred in the view by moving the world (`level.load`) lost the tiles
reaching above or left of its grid on the GPU and baked paths, and a
layer in a moved container lost tiles tile by tile.

A layer keeps track of whether the shader path can still draw it
whichever way it is drawn: a tile of a second tileset set while the
layer was switched to "perTile" by hand was left undrawn once it was
switched back.

A tile layer's bounds are its grid's again. What its tiles reach past
the grid is asked for separately (`getDrawBounds`, read by
`Camera2d#isVisible`): growing `getBounds()` moved what read it as the
map's area.

Pathfinding plugin: a grid from a tile layer stands where the layer was
moved to (its offset in Tiled, its `pos`), as the layer is now drawn.

One helper cuts the view to a layer's tiles for the isometric and the
staggered regions; stale comments and the docs corrected.

Tests: a layer in a centred map and in a moved container, on Canvas,
WebGL and WebGPU, in every render mode and orientation, against the
reference; render modes switched by hand with tiles set in between.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
Probes written to break the tile layer code, each against the reference
picture, and what they found:

- An orthogonal layer whose tiles are larger than the grid lay them over
  each other in the wrong order on the GPU when they came from more than
  one tileset (a pass per tileset) or the map's render order was not
  "right-down": such a layer is drawn tile by tile.
- A layer with more columns or rows than the largest texture drew
  nothing on the GPU: drawn tile by tile.
- A hexagonal map whose side leaves an odd number of pixels of a cell is
  laid out on whole pixels, as Tiled's own numbers are; and so drawn by
  the GPU too. The baked canvas of a staggered or hexagonal map of odd
  tile size was a pixel short.
- The isometric CPU renderer left out tiles narrower than half a cell at
  the right edge of the view.
- A camera with an offset over a moved world: the layer asked a plain
  rectangle, in place of the camera, whether it was the default one.
- A container with a size of its own (a level loaded into one) is in
  view by its bounds before its layers are asked: it is told how far
  their tiles reach.
- A layer taken out of its container and added again threw; a tile its
  tileset's image does not hold threw every frame tile by tile, and is
  now left undrawn on both paths.

The probes are kept as tests (`tile-layer-edge-cases.js`, on WebGL and
WebGPU), with the reference taught the orthogonal render orders and
Tiled's whole numbers for hexagons.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
Staggered and hexagonal maps are laid out with Tiled 1.10's own numbers:
what a side leaves of a tile is halved in whole numbers, and the cell a
tile stands on is made of those halves, a pixel smaller than a tile of
odd size. A map of odd sizes is on whole pixels, so the GPU path takes
it; the shader's pixels are measured from as much lower as the cell is
shorter. A painter written apart from the tests' reference, from Tiled's
source, agrees with both paths.

A container holds the tile layers that can draw outside its bounds, and
is in view as far as they do: their tiles' reach, a layer's offset, an
infinite map's first chunks. (A level loaded into a container gives it
the map's size, and the camera asks the container before its layers.)

A tile its tileset's image does not hold is left undrawn by `drawTile`
too: setting one on a baked layer threw.

Tests, from the gaps the audit listed: pictures for the grids of odd
sizes, where only the render mode was looked at; flips on hexagons; an
infinite map with chunks at odd coordinates; a layer offset and an
infinite map in a container; a sliver of 1, 2 and 5 pixels of each
orientation at each edge of the view, and a pixel out of sight;
`getTile` at the middle of every cell of every kind of map, the layer
moved; and two assertions that could not fail made to.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
GPU rendering of isometric, staggered and hexagonal maps under Added;
its gain in percent under Performance, with the orthogonal figures for
reference; the opacity change under Fixed; the tile layer fixes merged
into six entries, those a game cannot see left out.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…maps

The Tiled feature line said orthogonal maps only, and that the others
fell back to the CPU renderer.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
state.transition("mask", …, sprite), state.change(), then the usual
transition set back on the next line: that change hides and reveals with
the sprite's silhouette, and the next change is the usual fade.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…nsition

state.transition("mask", …, sprite) let go of any sprite after one
transition, because a level's player is destroyed by the change. A sprite
that is in no level (atlas.createSpriteFromName(), kept by the game) or a
persistent one is not, and was dropped all the same: the first change
wore it, every later one was a plain iris, with nothing said.

A sprite shape, and a renderable center, are now let go only when the
change takes them: in the world, and not under a persistent child of it.
Anything else is kept with the transition and read again at each change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
An offset given to a layer in Tiled moved a tile layer (since this
release) and an image layer, and nothing else. An object layer's objects
are now created that far from where they were drawn, collision shapes
with them, and a group layer's offset moves the tile layers inside it, on
top of their own.

The objects are moved once they stand where their map puts them, so an
isometric map's are moved on the screen, as Tiled does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…cond level

The object layer carried an offset of (35, 1), one tile and a pixel, from a
drag in the editor. The engine ignored object layer offsets until now, so
the level was always played without it: cleared, the flies stay where they
have always been.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…es of the second level

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
A ParticleEmitter in world space follows each slime and drops flat blobs of
its own purple along the base of the sprite, behind it. They stay where they
fell, shrink and fade; under the slime they fill the strip between its body
and the tile it walks on.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
The drops of the trail land where chance puts them, so the strip between
the slime's body and the tile stayed open under its front. A bar of slime,
as wide as the sprite and drawn behind it, now fills that strip from one
end to the other; the drops are the trail it leaves behind.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…e a trail

The same as the built-in physics platformer: a bar of the slime's own purple
under the whole sprite, filling the strip above the tile, and drops left
behind that shrink and fade.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
A shader is bundled as text, and no minifier reads inside a string: every
comment of every .vert, .frag and .wgsl file was in the published build and
in every game made with it. They were two thirds of the shader text.

stripShaderComments takes them out, keeping every line break so that a line
of the result is the same line of the source file. The build uses it in an
esbuild plugin, and the tests through vite-plugin-glsl's onComplete, so the
tests compile the text that ships.

The engine minifies to 1,073 kB from 1,159 kB, and to 323 kB gzipped from
350 kB.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
The Sprite and TextureAtlas docs said a normal map was "silently ignored" by
the Canvas renderer and used by "the WebGL renderer". It is lit on WebGL and
WebGPU, and Canvas draws the sprite unlit with a console warning, once, when
lights are on. A video is refused with a TypeError; an animated sprite takes
its normals from one static sheet laid out like its colour sheet.

The alpha of a normal map masks the sprite's shininess, and a matte texel is
still shaded by the direction under that alpha. Tests now draw it: from an
image file, and from an ImageBitmap made with premultiplyAlpha "none", the
highlight follows the alpha and the direction is kept at an alpha of 0. The
lighting skill says which sources lose it (a canvas, an ImageBitmap made with
the default options, a file whose transparent pixels a tool has cleared).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
pnpm audit reported 46 known vulnerabilities (1 critical, 24 high), all in
development tools or in the private examples app; none in a dependency of
a published package. It now reports none.

Raised: vite 8.1.5 to 8.3.8, vitest and @vitest/browser 4.1.11 to 4.1.12,
serve to 14.2.8, react-router-dom to 7.18.6. Overrides raised for
shell-quote (the critical one, through concurrently), markdown-it and
react-router, and added for minimatch, brace-expansion and fast-uri, which
their parents have not picked up yet.

eslint and typescript-eslint stay where they were: their newer versions add
rules that flag 25 places in the engine, which is a change of its own. Only
their minimatch is moved, by override.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…linter points at

Six places told TypeScript what a value was with a cast. They now find out,
or no longer need to:

- the built-in adapter looks for its own Body through one helper, and says
  so when a renderable has none; its 3D queries and the raycast check for
  the octree and for the body they walk, and pass over anything else
- the audio listener asks its target whether it can say which way it faces
- a mesh reverses its winding in one helper, on a copy the index array
  makes of itself, so of the same kind
- the keyboard handlers take the key, and the browser's event when there is
  one: the browser's keyCode is read in one place
- the particle setting that does nothing has no default any more

These pass the current linter and the next one (typescript-eslint 8.73),
which is not installed by this change. 55 tests added: 22 pin what is new,
33 guard what must not move.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
The engine's build script began with its own lint, and the workspace lint
builds first, then lints every package: the engine was linted twice by
pnpm lint, and a third time in CI by the test job's build.

The build now only builds. The lint stays where it guards something: pnpm
lint, and the release scripts and the publish workflow, which call it by
name.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
pnpm lint ran ESLint once over the whole workspace, in one process that
loads every package's types together. Each package now has a lint script
(eslint .) and turbo runs them: a package that has not changed, and whose
dependencies have not, is skipped, and a change to the lint configuration
re-lints them all. The files at the root and the scaffolder, which have no
package script, are linted by lint:root.

The same 1003 files are linted as before, with the same result. Unchanged,
the ESLint part of pnpm lint takes no time at all where it took about a
minute; after editing one plugin it takes 6 seconds. It also keeps each
process small: the next typescript-eslint needs about 3 GB to lint the whole
workspace in one process, and no more than the engine alone needs today
when each package has its own.

Changelog: a Chore section for this and for the dependency update.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
claude and others added 22 commits November 20, 2026 08:38
The lint job ran pnpm lint, which ends with biome check, and then biome
check again as a step of its own.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
The cache action compresses with zstd where it is installed and with gzip
where it is not, and looks only for caches saved the same way. The test job
runs in the Playwright image, which has no zstd, so it kept caches of its
own and never found what the lint job had saved: it built every package
again. With zstd installed there, it restores the lint job's cache.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
Vite serves every source module as no-cache, and Vitest does the same for
its own, so in every spec file the browser asked again for each of them:
some 450 requests a file, all answered "not modified".

Chromium keeps a 2 MiB shared-memory buffer, a file in the temporary
folder, and an open handle on it for every module script re-validated
that way, until its garbage collector next runs. Vitest runs every spec
file in an iframe of one long-lived page and nothing makes the collector
run, so they pile up: a page reached 11,467 handles and 22.6 GB of
temporary files in an ordinary passing run. A page limited to 8,192
handles stops loading modules when it gets there and the run hangs; a
full temporary folder fails the module loads instead. A page that loads
400 modules in an iframe twice shows the same buffers with no engine and
no Vitest involved, and none once the modules are served with max-age.

In a one-shot run nothing changes on disk, so the test server now answers
max-age and the browser does not ask. Measured over the 502 spec files:

- handles held by a page, at most: 11,467 -> 328
- temporary files at most: about 24 GB -> 143 MB
- the suite: 338 s -> 201 s

Watch mode is unchanged, since a module edited between two runs has to be
asked for again. A spec file that mocks a module still gets its mock, and
the next one the real module.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…eleases its buffers

The tile-layer benchmark ran in every run, twenty seconds of it, though
benchmarks are meant to run only with BENCH=1 as the mesh one does. It is
now skipped, visibly, unless asked for. It tests nothing the tile-layer
specs do not.

A one-shot run no longer makes the browser re-validate its modules, which
watch mode cannot do: an edited module has to be asked for again. So in
watch mode a page still gathered a 2 MiB buffer and a file handle per
module and per spec file, 11,467 handles at the most measured. It now
collects garbage at the end of every spec file, in watch mode only: a
page then held 468 handles at most over the whole suite. A one-shot run
is not given the collection, because it also empties the browser's own
store of modules and takes back what keeping them gained (344 s with
both, 201 s with the modules kept alone).

The whole suite, one-shot: 338 s before these changes, 177 s now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…hat keeps them

To be removed before this pull request is merged. The test job runs
twice, once as it is meant to and once with the test server making the
browser re-validate every module as it did before, and a sampler prints
what the test pages held in each: file handles, shared-memory buffers,
free space in the temporary folder, the limits, and any browser process
that went away, with what it held a second before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…e was doing

To be removed before this pull request is merged. The first comparison
showed the buffers pile up on CI as they do locally (12,739 handles and
25 GB in one page when re-validating, 200 handles when not) but with room
to spare there: a page may hold 65,536 handles and 85 GB were free. So it
does not explain the page lost on master. This runs six copies each way,
and has the test runner log a page that crashes, closes or loses its
websocket, with the close code, and the sampler the memory available.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
CI ran the engine's suite six times each way. Re-validating its modules,
five runs peaked between 9,733 and 16,295 handles in one page and passed;
the sixth lost every websocket of a page at once, with no process
crashing, as that page reached 16,448 handles and 32.5 GB of buffers,
81 seconds in. That is the lost page seen on master. Keeping its modules,
no page held more than 327 handles and none was lost; the suite took
115 to 194 s, against 182 to 287 s.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
It ran the engine's suite a second time when a run lost its browser page
with no test failing, and its comment put that down to the browser. The
cause is known and removed (the buffers a page gathered by re-validating
its modules), so a lost page is now a failure to look into, not one to
run past.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
GradientMapEffect recolors a sprite or a scene from its brightness,
through a list of two to eight colors: the darkest pixels take the first,
the brightest the last. With smooth off each color takes a band of its
own, a palette swap for art drawn in flat shades. A color's alpha is how
opaque the pixels that take it are drawn.

DitherEffect draws in a few colors with a 4 x 4 ordered dither between
them, in pixels several pixels wide. It is made for a whole scene, on the
camera: so many levels of each channel, so everything keeps its own hue,
or a palette of two to sixteen colors, each pixel taking one of its two
nearest. Only a color that falls between two allowed ones is patterned
(shading, soft shadows, gradients): one that is itself a level, or in the
palette, stays flat.

Both ship a GLSL and a WGSL body, and the same drawing checks run on
WebGL and on WebGPU (the latter skipped where there is no adapter).

Examples: a new Dithering example, a lit 3D scene of plain meshes with
the effect on the camera, and both effects in the Shader Effects one,
which now attaches its effects with addPostEffect in place of the
deprecated shader setter.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…kills

The Dithering example was a scene to look at the effect with, not one to
keep.

The README's list of built-in effects names the two new ones, the skills'
router says where palette swaps and a dithered look are covered, and the
sprite skill says what a tint cannot do (it multiplies, so it only
darkens) and what to use instead: a GradientMapEffect to recolor a
sprite, a FlashEffect to flash it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…xamples

- Package: publish CHANGELOG.md (the files entry matched nothing) and the
  license, copied in with the README; sideEffects names the published bundle
  instead of a source folder that is not shipped
- Transitions: a mask transition whose sprite went with its level says so
  once when a later change closes a plain iris instead; the 'requires a
  shape' warning is printed once rather than on every change
- README: the engine is about 320 KB minified and gzipped, not 250
- Claude plugin manifest: 20.17.0, as the release script requires
- Examples: addPostEffect in place of the deprecated shader setter (five
  examples), an explicit z for the two HUDs that set a z property that does
  not exist, and the WebGPU example's comment about video.AUTO
- Skills: the migration guide's list of stale example calls now matches the
  examples, and says why the platformer's overlapV is not the deprecated one

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
…ff deprecated APIs

Engine
- Sprite: an atlas frame the packer stored rotated was turned back about the
  world's origin rather than the frame's own corner, so it was drawn off
  screen unless the sprite stood at (0, 0), as the renderable of an Entity
  does. NineSliceSprite had the same fault and also stretched a rotated
  frame along the wrong axes. Both are drawn as the same art stored plainly
  is, on WebGL and Canvas (32 new tests; one existing test pinned the old
  nine-slice layout and is corrected)
- WebGL: a frame that captured an anti-aliased canvas and then drew over it
  was sometimes shown black by Chromium, more often on a slow frame. The
  renderer now closes such a frame with one more read of the canvas, a
  single pixel, which is what was measured to cure it (Aquarium example,
  recorded on the software renderer: 114 black frames in 125 before, none
  in 375 after; flush and finish after the capture do not help)
- package.json: sideEffects keeps the source polyfill entry, which the
  engine's own build reads, beside the published bundle. With the bundle
  alone the build dropped the polyfills

Examples
- Aseprite and Texture Packer draw a Sprite instead of the deprecated
  Entity; the benchmark uses the application's fullscreen methods
- README: ~300 KB

Skills and changelog updated to match.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
vec2Angle() passed the normalized dot product of the two radius vectors
straight to Math.acos. For a half circle the vectors are opposite and
rounding can put the cosine just below -1, so the sweep angle was NaN,
no arc points were generated and only the closing lineTo was drawn.
Clamp the cosine to [-1, 1].
Six shapes whose arcs are exactly half a circle with their ends on a slant,
or ask for a radius too small to reach between them: the cases in which an
SVG arc is drawn as the straight line between its ends (#1910).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
Path2D: keep half-circle SVG arcs from turning into straight lines, by
Swastik Tripathi (#1910), merged here to resolve its conflict
with master in the changelog: both sets of entries are kept.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
Copilot AI balanced review requested due to automatic review settings November 21, 2026 04:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI balanced review requested due to automatic review settings November 21, 2026 04:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@obiot
obiot merged commit 8d5d3e2 into master Nov 21, 2026
6 checks passed
@obiot
obiot deleted the claude/hopeful-hypatia-jl2ouu branch November 21, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants