---
title: "Streaming worlds: residency rings and GPU-built regions"
date: 2026-10-18
project: apockalypsis
card: L44
commit: 0bec572
summary: "A 400 m walk across a generated 16 km realm, with detail streaming in around the player and every region built into its tree on the GPU while the frame runs."
canonical: https://www.apocky.com/posts/2026-10-18-l44-streaming-worlds/
gates: [["Walk p99, native 1080p","< 16.6 ms","17.0 ms","FAIL"],["Walk p99, 67% + XeSS","< 16.6 ms","10.2 ms","PASS"],["Regen per FINE region (GPU)","< 5 ms","p99 3.0 ms","PASS"],["GPU tree equals CPU tree","xxh3-64 equal","260/260","PASS"],["Last frame equals CPU tracer","0 px","0 px","PASS"],["Never a hole","0","0 over 12,001 frames","PASS"],["XeSS upscaled output","non-black","black (regression)","FAIL"]]
---
# Streaming worlds: residency rings and GPU-built regions

A 400 m walk across a generated 16 km realm, with detail streaming in around the player and every region built into its tree on the GPU while the frame runs.

The Bit-Lattice engine stores the world as a tree of 64-bit occupancy masks. Card L44 makes that
world stream: around the player, terrain exists at 1 m out to 2 km, at 1/4 m within 256 m and at
1/16 m within 64 m. Regions are generated and built into their trees on the GPU's compute queue,
about 0.6 ms each, without blocking the frame.

The test is a scripted 12,001-frame walk at 2 m/s across a generated realm and through a tunnel in
a site tower. Every generated region's tree is read back and hashed against a CPU rebuild, and the
last frame is compared pixel by pixel with a CPU tracer. Both match exactly.

Two things still fail and are shown as failures. At native 1080p the walk's 99th percentile is
17.0 ms, just over the 16.6 ms budget, because grazing rays near the ground spend 80 percent of the
traversal steps in the finest level. And the XeSS upscaler started returning black frames after an
earlier change; a bisect was running when this sheet was made. At 67 percent render scale the walk
runs at a 10.2 ms 99th percentile.

## What you can take from this

If you are streaming a large voxel or sparse-tree world:

- **Rings of detail, not one level everywhere.** Terrain exists at 1 m out to 2 km, at 1/4 m within
  256 m and at 1/16 m within 64 m. The fine levels only cover a small area around the player, so the
  world can be 16 km across while the detail where you stand stays high.
- **Build regions on the GPU's compute queue, off the frame.** Each region is generated and built into
  its tree in about 0.6 ms on the compute queue (FINE regions 3.0 ms at the 99th percentile). The walk
  never showed a hole in 12,001 frames, because a region keeps its coarser parent on screen until it
  is ready; a control run with that fallback switched off showed 1,095 holes.
- **Check the GPU against a CPU reference, both ways.** Every region's tree is hashed against a CPU
  rebuild (260 of 260 equal) and the last frame is compared with a CPU tracer pixel by pixel (0 pixels
  different). A GPU build that is subtly wrong can look fine on screen; a hash cannot.
- **Grazing rays are the worst case.** Rays that skim the ground spend 80 percent of their traversal
  steps in the finest level, and that is what pushed the native 1080p walk over budget. Count steps
  per level before optimizing anything else.
- **Gate on the upscaler's picture, not only its timing.** XeSS returned black frames while the
  frame times looked fine. A "non-black output" check is what caught it.

Every number on the sheet is read from the run's own output files.