mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1542] spirv_interface: validate outer array length, initializer ID, struct/member and stage decorations (SPIRV-INTERFACE-DECORATION-VALIDATION) #1571
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#1571
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/1542
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/spirv-interface-decoration-validation📝 Commits (1)
a0996d0spirv_interface: validate outer array length, initializer ID, struct/member and stage decorations📊 Changes
2 files changed (+195 additions, -9 deletions)
View changed files
📝
tests/test_spirv_interface.py(+138 -0)📝
tools/spirv_interface.py(+57 -9)📄 Description
What changed
tools/spirv_interface.py:varying_type): callarray_count(args[1])before unwrapping the outerOpTypeArrayon GS inputs, MS outputs, and PSPerVertexKHRinputs so zero, negative, non-integer, or undefined length constants raiseInterfaceErrorinstead of passing silently.OpVariableinitializer ID validation (tools/spirv_interface.py:read_instruction): validate the optional 4th operand (Initializer) withrequire_id()when present.tools/spirv_interface.py:apply_decoration_groups): rejectOpMemberDecoratetargeting aDecorationGroupID.tools/spirv_interface.py:shape,declaration):InterfaceErrorif any member decoration index is>= len(members)on a top-level or nested interface struct.Patch/PassthroughNVon top-level and nested struct types themselves (not only on variables and members), and propagatePerPrimitiveEXTfrom a top-level interface struct type to its members.Index,PerPrimitiveEXT, andPerVertexKHR(tools/spirv_interface.py:address,declaration):Indexon variables/members outside fragment (ps) outputs.PerPrimitiveEXToutside mesh (ms) outputs and fragment (ps) inputs.PerVertexKHRcombined withPerPrimitiveEXTon the same varying, and rejectPerVertexKHRon struct types or members.tests/test_spirv_interface.py): added 5 synthetic binary SPIR-V regression tests (23 assertions) covering every check above.Claimed in the coordination issue as:
SPIRV-INTERFACE-DECORATION-VALIDATION(#14 reached GitHub's 2,500-comment cap with no successor coordination issue open yet; checked #14 and open PRs — 0 claims and 0 open PRs touchtools/spirv_interface.py)How it was tested
python3 -I -W error tests/test_spirv_interface.py: 48/48 passed (0 warnings).python3 -I tests/test_spirv_interface_extra.py: 3/3 passed.python3 -I tests/test_shader_link_check.py: 51/51 passed.python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/spirv_interface.py tests/test_spirv_interface.py: passed.python3 -m compileall -q tools/spirv_interface.py tests/test_spirv_interface.py: passed.main:tools/spirv_interface.py: all 5 new tests fail (FAILED (failures=23)), all 43 baseline tests pass.Metadata
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.