Repository navigation
t27f token_floor: a per-frame row index, so each raster row visits only the splats that touch it (Closes #10391) - #10402
Merged
Conversation
…ly the splats that touch it (Closes #10391) After the splat pass, a counting sort lists under each row the splats that can touch it, in splat order. The raster walks that list and keeps its own check (touches_row), so the index only skips rows a splat cannot light and the bytes are those of the full scan. Two new tests: the index lists every row the check accepts (1200 centres, five splat kinds, mirrors), and the u16 buffer fits the largest index any frame can build. Lab, -O ReleaseSafe -lc: one process 51.0/54.8 s -> 33.0/35.5 s; 48 shards 3.88 s -> 2.82 s; frames sha256 7e0c6662... unchanged in all six runs. test-report 26/26, 0 vacuous. Resealed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
October 18, 2026 11:04
Contributor
This was referenced Oct 18, 2026
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.
Closes #10391
What changes
specs/t27f/token_floor.t27builds a row index once per frame, right after the splat pass. It is a counting sort into a fixed[524288]u16buffer that lists, for each of the 1920 rows, the splats that can touch that row, in splat order. The raster then walks only its own row's list instead of all ~42k splats.touches_row. The index only skips rows that a splat cannot light. Within a row the splats stay in their original order, so the alpha-over of a ball and every float sum see the same operands in the same order, and the frames come out byte-identical.splat_top,splat_bot,row_lo,row_hi,span_max,index_bound. They give a conservative row range per splat, with one row of margin on each side, clipped to the frame.touches_rowaccepts is inrow_lo..row_hi, and no splat gets more thanspan_maxrows. The test also covers edge cases: a splat above the frame, the last row, mirror images and the ends of a vline.index_bound() <= INDEX_CAP, so the largest index any frame can build fits the buffer.MAX_SPLATS <= 65536, so a u16 names every splat.Measurements
Railway lab,
-O ReleaseSafe -lc, same machine and build flags for both sides:7e0c6662…391e07(both)7e0c6662…391e07(both)TF_SHARD/TF_SHARDS), concatenated7e0c6662…391e07(both)The expected sha
7e0c6662ddbf84a0a424c0aa119420eb34f90b0decec6e0c05753b2d37391e07holds in all six runs. The Zig generated from the committed spec is byte-identical to the build that was timed.The rest of the per-frame time is now mostly the per-pixel exposure and back light, which run for every pixel whether or not any splat lit it.
Verification
t27c test-report specs/t27f/token_floor.t27on the lab: 26 tests, 26 pass, 0 vacuous.t27c seal --save.seal --verifyreports that all hashes match (spec073d8dfb…, tests 26/26, vacuous 0).🤖 Generated with Claude Code