Skip to content

fix(core): Fp32 array provided to a 64-bit attribute - #10570

Merged
Pessimistress merged 3 commits into
masterfrom
x/constant-attr-2
Aug 20, 2026
Merged

Pessimistress merged 3 commits into
masterfrom
x/constant-attr-2

Conversation

@Pessimistress

Copy link
Copy Markdown
Collaborator

Follow up of #10567

In WebGL, when a fp32 array is provided to a 64-bit attribute (e.g. instancePositions), the low part is specified as {value: Float32Array([0, 0, 0]), constant: true}. WebGPU does not allow different strides in the same buffer slot, so one instance's low part ends up being resolved to the next instance's high part. See bug evidence in #10476 (comment)

This fix interleaves 0,0,0 with the incoming fp32 value when using WebGPU.

Change List

  • Force buffer update of all value types to the interleaving branch if device is WebGPU
  • Unit test
  • Drop webgpu golden image override for offset coordinate system test cases

@Pessimistress
Pessimistress requested a review from ibgreen August 20, 2026 21:34
@greptile-apps

greptile-apps Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR interleaves zero low components for WebGPU Float32-backed 64-bit attributes and propagates the split layout through GPU transition buffers.

  • Centralizes detection of interleaved double-precision buffers.
  • Updates allocation, partial writes, transition sizing, padding, and interpolation layouts.
  • Adds WebGPU attribute and transition-layout coverage and removes obsolete golden-image overrides.

Confidence Score: 4/5

The PR is not yet safe to merge because WebGPU Float32-backed 64-bit attributes still use an incompatible buffer layout during spring transitions.

The fix correctly repairs interpolation transitions, but spring transitions now receive double-width buffers while retaining single-width transform bindings and vertex-count calculations, causing low tuples to be processed as separate vertices.

Files Needing Attention: modules/core/src/transitions/gpu-transition-utils.ts and modules/core/src/transitions/gpu-spring-transition.ts

Important Files Changed

Filename Overview
modules/core/src/lib/attribute/data-column.ts Centralizes split-buffer detection and applies interleaving consistently to allocation, writes, accessors, and shader attribute bindings.
modules/core/src/transitions/gpu-transition-utils.ts Extends transition sizing and padding to WebGPU Float32-backed fp64 buffers, exposing the spring transform's remaining single-width assumptions.
modules/core/src/transitions/gpu-interpolation-transition.ts Correctly selects the existing fp64 interpolation transform for every interleaved double-precision buffer.
modules/core/src/transitions/gpu-transition.ts Preserves the cloned attribute's interleaved stride when attaching a transition buffer.
test/modules/core/transitions/gpu-transition-utils.spec.ts Verifies cloned and attached transition-buffer layouts but does not exercise an actual spring transform.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Float32-backed fp64 attribute] --> B[Interleaved high/low WebGPU buffer]
  B --> C{Transition type}
  C -->|Interpolation| D[Double-width layout and adjusted vertex count]
  C -->|Spring| E[Double-width sizing and padding]
  E --> F[Single-width transform layout]
  F --> G[Low tuples processed as separate vertices]
Loading

Reviews (3): Last reviewed commit: "address comments" | Re-trigger Greptile

@coveralls

coveralls commented Aug 20, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.184% (+0.05%) from 82.131% — x/constant-attr-2 into master

@Pessimistress
Pessimistress merged commit 10695b5 into master Aug 20, 2026
7 checks passed
@Pessimistress
Pessimistress deleted the x/constant-attr-2 branch August 20, 2026 22:13
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.

3 participants