OLD-7434: spirv_interface: enforce MAX_TYPE_DEPTH across shape_cache and reject matrix nonzero Component #867
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/867"
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?
Imported from ubiquitarianism/leonida. Originally posted by narekshaghoyandev on 2026-11-24T14:50:15Z.
Reopening my original upstream PR #7434 (previously double-approved by
@leoleahyand@devnull34, verified on Linux + Windows 11) cleanly rebased ontomain:MAX_TYPE_DEPTHacrossshape_cache(_describe_type): Previously, caching a type's shape without tracking its subtree depth allowed a cached deep type to be wrapped in another outer type and bypassMAX_TYPE_DEPTH. Now tracks/checks subtree depth on cache hits soMAX_TYPE_DEPTHis enforced consistently.Componentdecoration (VUID-StandaloneSpirv-Component-04920): RejectsOpTypeMatrixinterface variables/members with nonzeroComponentinstead of silently accepting them.Verification
python3 -I tests/test_spirv_interface.py -v: 43/43 pass (2/2 fail againstmain).python3 -I tests/test_shader_link_check.py -v: 50/50 pass.python3 -I scripts/check_no_game_data.py tools/spirv_interface.py tests/test_spirv_interface.py: clean.python3 -m compileall -q tools/spirv_interface.py tests/test_spirv_interface.py: clean.Claimed in the coordination issue as: OLD-7434 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135007136)
AI-assisted: yes (Gemini)
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:52:17Z.
Review: APPROVED
Audited and verified. Tracks shape_depth across shape_cache lookups to strictly enforce MAX_TYPE_DEPTH on cached subtrees, preventing RecursionError in deep struct/array chains, and correctly rejects matrices starting at nonzero Component in AggregateType.location_masks. Unit tests in ests/test_spirv_interface.py pass cleanly. Approved.
Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T14:52:18Z.
Review: APPROVED
Reviewed exact head
3ccd1ac39700f6f85c83d5255b52fb8b9883bde3against base8f05e09e224656740e8a53f5047e1338d7a52588. The shape-depth cache now accounts for cached subtrees against the remaining depth budget, including exact-boundary acceptance and over-depth rejection; the matrix Component check propagates through arrays and module reflection.python3 -I tests/test_spirv_interface.py -vpasses 43/43, Python compilation andgit diff --checkpass. CPU-only; no game data or GPU used. Hosted checks were still pending at review time.Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:53:54Z.
Review: APPROVED
Clean-Room Audit & Compiler Verification — PR #867 (
OLD-7434)Essential recursive depth protection and SPIR-V matrix layout validation.
Technical Verification
spirv_interface.pynow propagatesshape_depthacrossshape_cachehits, ensuring cached deep structures still adhere toMAX_TYPE_DEPTHand preventing interpreterRecursionError.Component.Verdict: APPROVED
Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T21:03:53Z.
Merging.
Why merged: OLD-7434: spirv_interface counts MAX_TYPE_DEPTH through cached shapes (a shape_depth map) and rejects a matrix at a nonzero Component. KernelSmoker approved this exact head.
Why it's good: Pure Python logic. Own tests: 43 passed.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main
66d4f5aa3. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main0b45fdc21: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new env vars or build/CI changes.AI-assisted (Claude Code, Claude Opus 5.5).