OpenTPW

PTCL-905: Complete particle render-state mapping#

Bounded runtime update (October 20, 2026)#

A bounded runtime follow-up now implements only untextured non-additive world alpha0/>=F0 opaque/depth state after interpreter and AOT both measured the same five failures across 17 cases. Strict acceptance remains unchanged and fresh execution is required. Textured/fractional/additive/screen behavior remains outside that correction; PTCL-905 stays open.

The synthetic particle framebuffer diagnostic uses the real ParticleRenderer and strict presented-pixel assertions across 17 cases. Its harness-only baseline was compiled and measured before this correction; fresh exact-head validation of the correction remains pending. Local Node acceptance-rule checks are not GPU execution. The original plan below is retained as historical evidence, not current implementation claims.

Status and classification#

Current residual#

OpenTPW draws the quads in the original's order (slots ascending, newest particle first, world and screen-space particles together) as runs of one blend ([EXT:particle-blend-runs]); the original submits one batch per particle (0x565F90 -> 0x565240) with its own state word, which the decoder 0x567620 turns into: 0x1256 opaque (no blend, no alpha test), 0x556 alpha blend with an alpha test at 0x10/255, 0x200522 one-plus-one and 0x200552 source-alpha-over-one with that alpha test, 0x2756 alpha blend with an alpha test at 0xF0/255, all with depth writes unless flags 0x4000 add 0x800; an untextured particle is opaque (0x1256) when its alpha byte is 0 or >= 0xF0, else 0x556 (0x57C6FA-0x57C71B), and flags bit 4 (0x200522, +0x30 for 0x2000) and 0x20000 (MAGFILTER point) modify it; a batch whose state lacks 0x1000 and 0x2000 (the renderer mask 0x3000, 0x5667D0) has its triangles depth-sorted within it (0x565590 -> 0x565490, only in renderer mode DAT_008BD524 = 1, or 4 without 0x1000), but a batch is one particle's two coplanar triangles, so the sort has no visible effect and is not a difference; the state words and their alpha tests and depth writes are not reproduced

Source inspection#

Bounded work#

Plan original state words, alpha thresholds, depth writes and point filtering after reconciling #425/#435.

Missing evidence#

Verify merged shader/material work and identify genuinely remaining state gaps; no stale blanket claim.

Acceptance cases#

  1. Exercise alpha bytes 0,15,16,239,240,255 under states 0x1256/0x556/0x2756.

  2. Overlap additive/alpha/opaque particles with geometry; assert depth-write flags and point sampling while preserving slot order.

  3. Add a reproducible synthetic fixture or reference trace identifying input, expected output, and affected function; a passing build alone is insufficient.

  4. Re-run focused regression tests for the listed source owner and document what remains unproven.

Dependencies and ownership#

Review boundary#

Source: docs/proposals/ptcl-905-complete-particle-render-state-mapping.md in the project repository.