#12243·pixijs

GpuProgram entry-point concatenation aliases distinct WebGPU pipelines

Author: mf3493297-pngCreated Sep 27, 2026Updated Sep 27, 2026

GpuProgram entry-point concatenation aliases distinct WebGPU pipelines

Current behavior

Two valid GpuProgram instances built from the same WGSL module can receive the same internal _layoutKey when their vertex and fragment entry-point names concatenate to the same string.

For example:

  • Program A: vertex ab, fragment c
  • Program B: vertex a, fragment bc

Both become abc. The pipeline cache then returns Program A's pipeline for Program B. Program B executes the wrong vertex and fragment entry points.

Expected behavior

Distinct vertex/fragment entry-point pairs must receive distinct program and pipeline identities.

Public runnable reproduction

Run:

bash
npm ci
npm start

Open http://127.0.0.1:4173/gpu-entrypoint-key-collision/ in Firefox. It prints:

REPRODUCED: {"firstKey":1,"secondKey":1,"created":["ab/c"],"firstMarker":"ab/c","secondMarker":"ab/c","samePipeline":true}

Verified in headed Camoufox with no page errors.

Neighboring controls

  • Both entry-point pairs exist in one valid WGSL module.
  • GpuProgram.from() returns two distinct program instances because its outer cache key contains separators.
  • A non-colliding pair creates a second pipeline as expected.
  • With the colliding pair, _createPipeline() runs only for ab/c; requesting a/bc returns that exact same pipeline object.

Root cause

GpuProgram.from() safely separates fields in its object cache key, but each constructed program computes _layoutKey differently:

typescript
const bigKey = vertex.source + fragment.source + vertex.entryPoint + fragment.entryPoint;
this._layoutKey = createIdFromString(bigKey, 'program');

There are no length prefixes or delimiters between the four values. Distinct tuples can therefore produce identical strings.

PipelineSystem uses program._layoutKey directly in its pipeline key. The second tuple hits the first tuple's cache entry and bypasses pipeline creation, preserving the wrong entry points baked into the descriptor.

Impact

This is deterministic WebGPU rendering integrity failure. Valid custom shaders can render with another program's vertex and fragment entry points based solely on creation order. The result can be incorrect geometry, colors, clipping, or blank output across every draw using the aliased cache entry until renderer/cache recreation.

Environment

  • PixiJS dev commit: 27071aa0096d8749bfdb189857c58178c30cd153
  • npm package: [email protected]
  • Browser: headed Camoufox / Firefox
  • OS: Linux x86_64

Duplicate search

I searched open and closed issues/PRs for GpuProgram entry-point collisions, pipeline-cache wrong entry points, _layoutKey concatenation, and entry-point cache keys. I found no matching issue. #12213/#12235 concern WebGL shader-name preprocessing and program cleanup, not WebGPU tuple serialization.

If this fits the bounty program, please consider assigning a bounty label and amount before implementation work begins.