Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2603,6 +2603,46 @@ scene's preparation. In the same walking frame the upper middle of the picture,
string of lights, has 0.67 of the offline light after the upscaler in both builds: small bright things lose light
there while the camera moves, and their glow with it. Not checked on Vulkan, nor in a browser.

**A mesh that does not deform is held compacted (2026-12-02, after it).** A BLAS is built into the worst case its
geometry could need, and a build that is done can say what it does need. The scene's upload built every BLAS and kept
it as built: Bistro's 2.8 million triangles held 293 MB of them, Tokyo's 23 million 2.4 GB.

- `Gpu::upload`. A mesh that does not deform is built once. Its BLAS is made to allow compaction (traced fast, as
before), and when its batch's build is done it is copied into a structure of the size the build reported; the one
it was built in is freed. The batches are as they were (4 million triangles at most, for the build's scratch room)
and a batch is compacted before the next is built: what is held at once is the compacted ones and one batch as
built. Deforming meshes (posed skinned models', particle systems') are rebuilt every pose and stay as built; so do
the meshes edits make, and the procedural boxes'.
- The TLAS was built with the last batch, in one call. A compacted copy is a write of the queue's own and goes out
with whatever is submitted next. Where several views share a device (the unit suite's tests, side by side) it went
out with another's submit, the TLAS was then built over a structure whose copy was not done, and on Metal a TLAS
built so loses the instance: five tests failed in one run of the suite, none of them when run alone.
The copies are now submitted and waited for and the TLAS built after them, by itself. With that the suite passed
five times running; with the wait taken out again it failed in two runs of two (one test, then two).
- Edits. wgpu builds no compacted structure again (a validation error). A mesh of the build whose geometry an edit
rewrites where it lies (the same sections: three.js's dynamic draw usage) takes a new BLAS of the same geometries
first, built fast as an edit's, and is built again in that one from then on (`Gpu::renew_mesh`). The objects that
draw it are placed again by that edit, as they are when its vertices outgrow their run and it takes a new one.
- Measured (an M4, Metal; each structure's size before and after as wgpu-core has them, printed for this). Tokyo's
1,248 structures 2,401 MB → 1,129; Bistro's one 293.1 → 137.1; a small scene's 6.4 → 2.8; Zero-Day's 608.2 →
488.7 (one mesh has nearly all of its 5.9 million triangles). A plaza of skinned mannequins: none to compact.
Bistro's offline render with and without is the same in every pixel. Five clips alternated (without, with, with,
without), a frame's GPU time: the city's 17.80 → 17.72 ms, the others within 1 % and none slower by more than 0.1 %; their
pictures' measures the same to the last digit, and their loading within its own spread. Twelve clips against
offline, this build beside main's (main, this, this, main): ΔE the same on every clip to 0.01, which is what two
runs of one build differ by; the frame within 0.5 % on eleven, and on the twelfth main's first run was the slow
one.
- `tri_blas_mb` is what the builds allocate, as it was. wgpu does not hand out a structure's size; a function for it
in the vendored wgpu was written and taken out again: the browser's module is built against the released wgpu
(`renderer/web`), and the renderer's source is kept to what that one has.
- `THREERT_BLAS_COMPACT=0` leaves every BLAS as built.
- Unit suite 297 (one new: a compacted mesh's geometry changed where it lies, twice, each against a build; without
the new BLAS it fails with wgpu's error), render suite 276.

Not done. A mesh that comes by an edit (a streamed city's cells are those) is held as built: its copy would have to
come some frames after its build, its instances be placed again, and a mesh that is rebuilt every frame left alone.
wgpu has no refit (`PreferUpdate` builds): a deforming mesh is rebuilt. Not checked on Vulkan.

**The live passes from one place (2026-11-14, after it).** A buffer and a pass more (the locks' carry, above) took
seven edits that had to agree: the declaration in live.wgsl, the bind group layout's entries, the pass list, the
buffers' sizes and order, the bind group's entries, the dispatch grid (in two copies), and the merged layout's table.
Expand Down
11 changes: 11 additions & 0 deletions docs/RUNTIME.md
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,17 @@ Vertices and indices, one layout for hardware and software traversal (`renderer/
Tokyo 1.17, Zero Day 1.03, a crowd of skinned walkers 0.98, small scenes of smooth models 0.5 to 0.7, a voxel
level's meshes 1.88 (a face's four corners are no other face's). With the BLASes, on the GPU: Tokyo 6.4 GB ->
3.9, Zero Day 1.6 -> 0.95.
- **The BLASes are compacted** (2026-12-02; `Gpu::upload`). A build allocates a structure's worst case. A mesh that
does not deform is built once: its BLAS, traced fast as before, is copied when it is built into a structure of
the size the build then reports, and the one it was built in is freed. A city of 1,248 meshes and 23 million
triangles 2,401 MB -> 1,129, a street of one mesh and 2.8 million 293 -> 137, a small scene 6.4 -> 2.8; one mesh
of 5.9 million triangles 608 -> 489 (an M4, Metal). The builds go in batches as before and a batch is compacted
before the next is built: what is held at once is the compacted ones and one batch as built. A deforming mesh's
(a posed skinned model's, a particle system's) is rebuilt every pose and stays as built; so does a mesh an edit
makes. wgpu builds no compacted structure again: a mesh of the build whose geometry an edit rewrites where it lies
takes a new BLAS first, built fast as an edit's (`Gpu::renew_mesh`). The frame's time and the scene's loading are
what they were. `tri_blas_mb` is still what the builds allocate: wgpu does not say what a structure was compacted
to. `THREERT_BLAS_COMPACT=0` leaves every BLAS as built.
- The build still flattens a file's indexed geometry and finds the sharing again (1.2 s on Tokyo's 23 M
triangles): carrying a file's indices through is a later step.
- Under hardware traversal the kernel binds one buffer fewer than it did (a triangle's attributes were a second
Expand Down
5 changes: 3 additions & 2 deletions docs/VOXEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ today, built from CC0 `.vox` content and procedural generation. Its lines:
leaks light, every voxel shows its own colour (below).
- **Memory:** ≤ 2 GB per level, the BLASes, triangle data and procedural data together (`tri_blas_mb`, `tri_data_mb`,
`proc_blas_mb`, `proc_data_mb`); the benchmark level is accepted against it. Today: as meshes 516 MB (BLASes 256.4,
data 259.6), as region boxes 267 MB. If destruction's pieces or more content bring it near, compressed attributes,
BLAS compaction and LOD come forward.
data 259.6), as region boxes 267 MB. (The BLASes at what their builds allocate: since 2026-12-02 the build's meshes
are held compacted, docs/RUNTIME.md "The scene's triangles", which this level has not been measured with.) If
destruction's pieces or more content bring it near, compressed attributes and LOD come forward.
- **Features:** fire, smoke, water, vehicles, joints, ropes; a game API over voxel edits, bodies, joints, lights,
scene queries and effects.

Expand Down
Loading