mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:10:53 +01:00
[PR #1970] runtime: preamble-only flat scan, safe type lookups, and portable CPU test for rect_list_geometry #1976
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1976
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1970
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:perf/rt-rect-list-geometry-preamble-and-tests📝 Commits (1)
57b853aruntime: preamble-only flat scan, safe lookups, and portable unit test for rect_list_geometry📊 Changes
3 files changed (+286 additions, -32 deletions)
View changed files
📝
runtime/CMakeLists.txt(+3 -0)📝
runtime/src/rect_list_geometry.h(+65 -32)➕
runtime/test/rect_list_geometry_test.cpp(+218 -0)📄 Description
Claim:
RT-RECT-LIST-GEOMETRY-PREAMBLE-AND-TESTS(claim comment#7168816576on #1608).Fixes & Optimizations (
runtime/src/rect_list_geometry.h)OpFunction(preamble-only):OpType*,OpDecorate, and globalOutputOpVariabledeclarations all precede the firstOpFunction(SPIR-V logical layout §2.4), so scanning tens of thousands of body instructions during graphics PSO creation was wasted work.i + n > vertex_words.size()withn > vertex_words.size() - i.std::map/std::setRB-trees and silentoperator[]lookups:types,variable_type,location,builtin, andoutputswith 4 flat sorted vectors (stable_sort+upper_boundpreserving exact last-wins semantics) and explicitfind_type()/find_kv()checks instead oftypes[...]silent default-insertion on missing IDs.headvector and pre-reserve output buffers: pre-reservesannotations,globals,body,vars,io_vars,corners,emitted, andout, and emitsOpEntryPointdirectly intooutwithout a temporaryentryvector.rect_list_geometry(runtime/test/rect_list_geometry_test.cpp): previously only the GPU testd3d12_rect_list_test.cppexercisedrect_list_geometry.h.Verification
runtime/test/rect_list_geometry_test.cpp(8 test groups verifying generated SPIR-V header/bound/capability/memory-model/entry-point/all-4-execution-modes/decorations/6-EmitVertex/2-EndPrimitive, position-only shaders, PointSize allowed, unsorted/duplicate Locations, large body skipped identically, non-SPIR-V/short/zero-len/truncated refusal, missing Position refusal, ClipDistance/Layer refusal, vec3/uvec4/dangling-type-id refusal).rect_list_geometry_testcleanly under:clang++ -std=c++20 -O1 -g -fsanitize=address,undefined -Wall -Wextra -Werrorclang++ -std=c++20 -O1 -g -fsanitize=thread -Wall -Wextra -Werrorclang++ -std=c++20 -O2 -Wall -Wextra -Werror-O2vsmain(best of 5 runs, Apple Silicon):python3 -I scripts/check_no_game_data.pyon all 3 changed files andpython3 -I tests/test_text_write_line_endings.py: all passed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.