Repository navigation
Streaming: tighter pages hold 41% more clusters in the same pool (file version 5) - #87
Merged
Merged
Conversation
…fuller pages A page pool of fixed slots holds as many clusters as fit in a slot. This makes a cluster smaller and the slots fuller, as scene file version 5: - A vertex is 12 bytes, not 16: the padding goes, and the normal is octahedral in sixteen bits, the nearest of the four codes around the exact point. Positions and UVs keep every bit. - A triangle is 3 bytes, end to end within its cluster. A mesh being built keeps a word for each; pages are packed when they are made. - A cluster's vertex offset counts words of the pool, as its triangle offset did. Shaders read both through common/pool.wgsl. - Skins lie end to end behind their cluster's vertices. - A page's vertices are filtered before it is deflated, each field as its difference from the vertex before and each byte in a run of its own. Hosts that read a file hand pages over with Renderer::deliver_fetched, which undoes it. - Room left in a page is filled from the next few sets of the same mesh and round. On a 31-million-triangle garden scene: pages 1,295 MiB to 971 unpacked and 787 to 500 stored, 47.9 clusters to a slot to 67.4, the same frame times. docs/streaming.md has the measurements, and what was tried and left out. `cargo run -p solstice-asset --example page_stats -- FILE` measures a bake. A version 4 file no longer opens: scenes must be baked again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A page pool of fixed slots holds as many clusters as fit in a slot, and a streamed view is as detailed as its pool lets it be. This makes a cluster take less of a slot and the slots fuller, as scene file version 5. On a 31-million-triangle garden scene the same pool holds 41% more clusters, pages are 36% less to download, and frame times do not move.
docs/performance-audit.mdleft for a format change.vertex_offsetcounts words of the pool, astriangle_offsetdid, so a slot need not be a whole number of vertices and a banded pool needs no special arithmetic. Shaders read both through a newcommon/pool.wgsl.file::filter_page): each field of a vertex as its difference from the vertex before, one byte of it to a run. Hosts that read a file hand pages over with the newRenderer::deliver_fetched, which undoes it;deliverstill takes a page as the GPU reads it.page_stats, a new example insolstice-asset, measures any bake:cargo run --release -p solstice-asset --example page_stats -- FILE.docs/streaming.mdhas the rest under "Tighter pages": what each of six views wants before and after, and two packing ideas that were measured and left out because they made views want more pages.Before merging
solstice-scene-*) must be baked again and published withpython scripts/publish-scenes.py --bakeat the same time, or the live site cannot open them in between. Zorah and any split.webfile need baking again too. I have not done any of that.Verified
bash scripts/check-changed.shpasses on this head (d2efb37), in a clean checkout holding nothing but this commit. It found 13 of the 17 packages affected, so that is fmt, clippy with-D warnings, 878 tests in release including the 93 GPU tests, the wasm32 builds of the viewer, the editor andbake-webwith clippy, andnode apps/viewer/web/editor/test.mjs.page_statsunpacks every 16th page of the test scene and checks each triangle of each cluster names a vertex its cluster has (34,009 clusters).--play).Not measured: a browser on a real network, and the sizes of a scene with skinned meshes or regions (their tests pass).
Authorship
Written by: Claude Fable 5.2 through Claude Code
Reviewed by: not yet reviewed.
🤖 Generated with Claude Code