BuildRiot
Sign in

Article · Frontend

Test WebGPU’s unaligned compressed textures and linear canvas color spaces

Chrome’s WebGPU 155–156 update adds unaligned compressed textures and linear canvas color spaces. This guide outlines a testbed for checking capabilities, texture borders, color conversion, presentation, and fallback behavior.

A sunlit miniature coastal testbed displays offset texture sheets, banded and smooth coral-blue gradients, and matching canvas and paper dune images.
Illustration: BuildRiot (AI-generated)

Key takeaway

Feature detection establishes which rendering path can run; visual tests establish whether it preserves the application’s output. Separating those checks helps developers distinguish unsupported configurations from upload errors, numeric differences, and display problems.

Start with separate capability checks

Chrome’s WebGPU 155–156 update adds compressed textures with unaligned base dimensions and two linear canvas color spaces: srgb-linear and display-p3-linear. For a testbed, treat compressed-asset support and canvas output as separate decisions. Sources: Chrome for Developers, Chromium blink-dev

Chrome demonstrates checking adapter features and requesting unaligned compression when creating a device. The specification separately requires the compression-family feature that matches the asset. Choose that family from the application’s assets or transcoder output. Then use the helper below to request the supported features. Its result gives the application a basis for selecting a rendering path. Both helpers in this guide are untested examples. Their cross-platform behavior and any performance benefit remain unestablished. Sources: Chrome for Developers, W3C

async function createTestDevice(compressionFeature) {
  if (!navigator.gpu) return { fallback: "webgpu-unavailable" };

  const adapter = await navigator.gpu.requestAdapter();
  if (!adapter) return { fallback: "adapter-unavailable" };

  const requiredFeatures = [];
  const compressed = adapter.features.has(compressionFeature);
  const unaligned =
    compressed &&
    adapter.features.has("texture-compression-unaligned");

  if (compressed) requiredFeatures.push(compressionFeature);
  if (unaligned) requiredFeatures.push("texture-compression-unaligned");

  const device = await adapter.requestDevice({ requiredFeatures });

  return {
    device,
    compressed,
    unaligned,
    enabledFeatures: [...device.features],
  };
}

Make texture fallbacks explicit

Unaligned compression relaxes texture dimensions without introducing a new codec. Chromium’s shipping intent describes compression blocks ranging from 4×4 to 12×12. Derive fixture dimensions from the selected format. Smaller mip levels already supported partial blocks, according to GPUWeb’s July discussion. Copies still operate on whole compressed blocks. Sources: W3C, Chromium blink-dev, GPUWeb

For command-encoder copyBufferToTexture() and copyTextureToBuffer() operations, bytesPerRow must be a multiple of 256 bytes when specified. queue.writeTexture() does not impose that 256-byte requirement. For these APIs, bytesPerRow is required when a copy spans multiple rows of blocks or multiple images. It can be omitted for a single block row in a single image; no row stride then needs alignment. Keep upload-layout checks separate from texture-creation checks. Sources: W3C

Treat padding and rescaling as separate fallback experiments. Padding preserves the interior sample grid but complicates boundary sampling. Rescaling changes the image and can discard high-frequency detail. The table below proposes application paths and their validation targets. Add controls that force each applicable fallback even when the preferred capability is present. Compare each path using the same logical image so fallback selection does not hide a change in output. Sources: Chromium blink-dev

Table

Proposed rendering paths by detected capability

Available capabilityCandidate application pathWhat to validate
Required compression family and unaligned dimensionsUse original logical dimensionsBorder samples, mip transitions, uploads
Compression family onlyPad to supported dimensions and adjust samplingPadding leakage, wrapping, mip generation
No usable compressed asset formatDecode or transcode to an available representationStartup cost, memory, visual error
No WebGPU adapterExisting alternate renderer or processing pathOutput equivalence and reduced functionality
Force each applicable path to exercise fallback behavior on capable hardware.

Test texture borders separately

A GPUWeb conformance issue identified a concrete regression target. Sampling at texture coordinates of 1.0 could expose texels outside the texture’s logical dimensions. Chromium contributor Corentin Wallez raised the missing coverage in September. The issue closed on October 7, 2026, after a test contribution. The merged contribution added 600 cases and 1,800 subcases. Those counts describe coverage, not performance or proof that every shipping configuration passes. Sources: GPUWeb

Use a decoded reference for the same compressed payload when isolating sampling behavior. Comparing only with the original uncompressed image mixes codec loss with rendering differences. Report the interior, final row, final column, and corner separately. A whole-image average can conceal a narrow border defect. Run the following fixture sequence for each usable compression format, retaining both validation results and difference images.

  1. Create dimensions just below, at, and above each block boundary; record creation and upload failures.
  2. Encode a distinct final row and column with contrasting padding; sample the last texel center, texture coordinates of 1.0, and nearby coordinates.
  3. Compare nearest and linear filtering with edge-strip difference images.
  4. Select mip levels explicitly and compare each level’s output.
  5. Exercise clamp and repeat addressing to expose edge and seam changes.
  6. Force the padded fallback and compare it with the native unaligned path. Sources: GPUWeb

Probe linear canvas configuration separately

The linear-color shipping intent adds srgb-linear and display-p3-linear for processing such as lighting, interpolation, anti-aliasing, and decimation. Chrome’s announcement demonstrates a linear Display-P3 canvas using rgba16float. The specification treats textures as numeric data. Color interpretation occurs at interfaces such as image copying, external-texture import, and canvas configuration. An sRGB texture format supplies transfer-function behavior without attaching color-space metadata to the texture. Sources: Chrome for Developers, W3C, Chromium blink-dev

Expose separate controls for input interpretation, working texture format, processing space, and output color space with tone mapping. The helper below checks configuration acceptance and records exceptions, validation errors, and the returned configuration. Run probes sequentially on a healthy device. Classify device loss separately from an unsupported configuration. Follow acceptance with rendering tests. The shipping intent distinguishes API-setting checks, draw-and-readback checks, and image-export round trips. Sources: Chromium blink-dev

async function probeCanvasColorSpace(device, colorSpace) {
  const canvas = document.createElement("canvas");
  canvas.width = canvas.height = 2;
  const context = canvas.getContext("webgpu");
  if (!context) return { supported: false };

  let exception;
  let configuration;

  device.pushErrorScope("validation");
  try {
    context.configure({
      device,
      format: "rgba16float",
      colorSpace,
      alphaMode: "opaque",
    });
    context.getCurrentTexture();
    configuration = context.getConfiguration();
  } catch (error) {
    exception = String(error);
  }

  const validationError = await device.popErrorScope();
  context.unconfigure();

  return {
    supported:
      !exception &&
      !validationError &&
      configuration?.colorSpace === colorSpace,
    exception,
    validationError: validationError?.message,
    configuration,
  };
}

Compare numeric output with visible presentation

The particles-sample change linked by Chrome modifies image import alongside canvas configuration. It selects rgba16float to avoid banding in linear spaces. Reviewers explain that correctly converting an ordinary sRGB image through different working spaces should preserve its appearance. The discussion also reports unexpected output differences. On October 7, 2026, Christopher Cameron acknowledged that macOS sometimes presents this output as high dynamic range, or HDR, unexpectedly. That report describes particular presentation behavior, not a universal defect. Sources: WebGPU samples

Save raw numeric readback and screenshots as separate artifacts. Use numeric output to investigate processing errors and screenshots to assess visible presentation. The table below proposes fixtures for separating conversion, precision, gamut, and compositing problems. Where linear canvas spaces are unsupported, test linear intermediate processing with an explicit final conversion. Make gamut mapping and HDR reduction deliberate fallback policies. Then force those paths on capable machines.

Table

Proposed color fixtures and diagnostic comparisons

FixtureExpected relationshipLikely diagnosis if it fails
Tagged sRGB chart through each supported output spaceApproximately invariant displayed colors after correct conversionsMissing or duplicate conversion
Linear-light black/white interpolationMatches an independently calculated referenceProcessing encoded values as linear
Dark smooth gradient in 8-bit and float working texturesQuantization differences remain visible in error plotsInsufficient working precision
Tagged wide-gamut patchesPreserved where the chosen pipeline supports themClipping or incorrect gamut interpretation
Values below zero and above oneOffscreen values and displayed result assessed separatelyPremature clamping or presentation behavior
Translucent colored edges over multiple backgroundsConsistent compositingAlpha-premultiplication mismatch
Export and re-importMatches the export format’s documented capabilitiesMetadata or conversion loss
Assess numeric processing and visible presentation separately for each relevant fixture.

Turn failures into routing decisions

Measure the complete workload before choosing a faster path. Record decode or transcode time, padding, upload, first use, steady-state frame time, and sustained throughput separately. Keep the logical image, workload, and output appearance equivalent across comparisons.

Save a capability manifest with the browser build, operating system, GPU and driver, enabled features, asset hashes, canvas dimensions, and display configuration. Include warm-up policy, repetitions, median and tail latency. Distinguish texture payload bytes from measured memory. Keep compression-family and unaligned-dimension checks separate. A proposal to enable unaligned dimensions automatically for certain compression families remains open. Package deterministic fixtures, forced-fallback controls, numeric reports, and saved images together. Use the labels below to route failures toward the next investigation. Sources: GPUWeb

  • Unsupported: select an alternate capability path.
  • Validation failure: inspect feature requests, dimensions, uploads, or canvas configuration.
  • Numeric mismatch: investigate sampling, conversion, precision, or processing against the chosen tolerance.
  • Presentation mismatch: inspect display behavior when numeric output meets expectations.

Attribution

Sources

  1. 1Chrome for DevelopersWhat's New in WebGPU (Chrome 155-156)Source published (UTC)
  2. 2Chrome for DevelopersYang Baru di Chrome
  3. 3W3CWebGPUSource published (UTC)
  4. 4Chromium blink-devIntent to Ship: WebGPU: Texture Compression Unaligned
  5. 5GPUWebAdd a sampling operation test for texture-compression-unaligned?
  6. 6GPUWebValidate sampling operations on unaligned block-compressed textures
  7. 7GPUWebGPU Web 2026-07-15Source published (UTC)
  8. 8WebGPU samplesAdd color space selection to particles sample
  9. 9Chromium blink-devIntent to Ship: PredefinedColorSpace srgb-linear and display-p3-linear
  10. 10GPUWebMake ETC2 and ASTC always allow unaligned sizes?

Read the original source for full details and context.

Report a problem

Links, dates or what you expected. Do not include passwords or private data.

More on Frontend

All Frontend stories

Article · Frontend

JPEG XL in Chrome 155: How it compares with AVIF and WebP

Chrome 155 adds JPEG XL decoding, giving developers another option for image delivery. Published comparisons differ on lossy efficiency against AVIF, while one measured study places both ahead of WebP. Encoding costs, display behavior and reversible compression shape where it fits.

Review · AI

Firefox DevTools MCP 0.10.6 adds PDF output and fixes tab targeting

Mozilla’s Firefox DevTools MCP connects agents to Firefox for browser inspection; its documentation says the developer preset adds debugging, network, console and profiler tools. The locally run server uses WebDriver BiDi via Selenium. Mozilla lists Node 20.19.0+, Firefox 100+ and clients including Claude Code, Claude Desktop, Cursor and Cline. The proposed evaluation configuration is npx -y @mozilla/firefox-devtools-mcp@0.10.6 --tool-preset developer --viewport 1280x720 --start-url http://localhost:3000. Mozilla announced 0.10.6 on October 16, 2026, documenting PDF output through print_page and profile reuse changes. According to Mozilla, select_page and close_page now target the tab identified in the last tab listing, even if tabs have since opened or closed.

Mozilla