Precision

How scene data keeps precision from authoring to the GPU. This specifies rendering data, not authored assets or gameplay arithmetic. Index.

Rules

  1. Keep mesh positions local. Build each instance's authoritative rendering affine placement and each view origin on the CPU in double precision, promoting stored floats/packet integers before composition. For placement R*p+t and view origin C, upload float R and float t-C computed in double, then rotate into the view in shader. Do not upload absolute float world translations and subtract them on the GPU. Promoting an already rounded world result cannot recover its lost bits.
  2. Each nested view (water reflection, portal, sky or UI world view) supplies its own origin and basis. Current and previous instance transforms use their respective current and previous view origins; motion vectors must include that origin change. A camera-relative origin update alone is not object motion.
  3. Skin positions in model-local space, then apply the camera-relative instance transform. Retain previous bones/deformation where temporal reconstruction needs them. RT uses local BLAS geometry and an explicit camera-relative acceleration-structure origin shared with rays; no absolute float world TLAS. Rebase/update policy and refit versus rebuild remain measured choices, not a claim that TLAS updates disappear.
  4. Positions, UVs, depth/reconstruction, motion and temporal inputs stay float in shaders. Long-running time and UV phase are evaluated/reduced on the CPU in double where the authored function permits reduction; do not wrap a nonperiodic animation. half needs an error-tested bounded colour/post case. Per-mesh 16-bit position quantization is permitted only after a mesh-error check; never quantize the whole world, BSP or terrain. Heavily tiled UVs stay float.
  5. GPU object identities are uint32_t/uint/u32, never pointers, size_t, float-encoded IDs or 64-bit integers. WGSL's concrete integer types are i32 and u32.
  6. Use infinite-far reverse-Z float depth for new scene passes: positive camera Z, clip Z = near, clip W = Z, depth = near/Z, clear 0, compare greater-or-equal. Keep the current near distance 10 initially; changing it needs near-geometry/clipping fixtures and explicit acceptance. Use depth32float, or depth32float-stencil8 where stencil is needed (the latter is a required feature in the plan). Clear depth 0 is background and must not be divided by to reconstruct a finite point. Streaming and culling retain finite distances.
  7. Change projection, depth reconstruction, bias signs, shadow comparisons, HiZ reduction, reflection clipping, picking, RT and temporal consumers together per migrated pass family. For reverse-Z, a conservative occlusion hierarchy stores the minimum depth over its covered samples, including clear pixels; compare a candidate's nearest possible depth against that bound. Preserve depth-equal terrain layer ordering. A pass family may keep the finite projection while its consumers migrate; a new scene path uses one documented convention throughout.

Shared shader ABI

The binding Slang findings apply to all new records: pack shared host/shader structs from 16-byte float4/uint4 vectors and arrays, with size/offset assertions and reflection checks on both targets. SceneUniform is 128 bytes: projection, row0..row2, clipPlane, worldReflection, jitter and rasterLightCount, one float4 each. worldReflection starts at byte 80 and its reflection flag occupies byte 88; draws submit the first 96 bytes and the material scene appends the jitter and raster light count. The material shader build checks the eight reflected fields on both targets (verifySceneUniform in build/device-materials.ts). The spike proved 432-byte uniform and 560-byte storage layouts, not arbitrary host matrix/float3 packing. Its group-0 bindings follow declaration order; freeze and verify that order, and verify any explicitly assigned additional groups. Supply explicit element counts: Metal structured buffers cannot use this spike's GetDimensions. Take derivatives before varying branches and use SampleGrad when sampling under them; Slang emitting WGSL is not evidence of browser validation.