mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:45:53 +01:00
[PR #2154] rdna2spirv: cache shader stages per carve root #2158
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#2158
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/2154
Author: @whoalin1
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:shader-stage-cache-crossroot📝 Commits (2)
c3ec925rdna2spirv: cache shader stages per carve rootc5c367ardna2spirv: do not cache a missing stage index📊 Changes
2 files changed (+76 additions, -4 deletions)
View changed files
➕
tests/test_rdna2spirv_stage_cache.py(+67 -0)📝
tools/rdna2spirv.py(+9 -4)📄 Description
Claimed in the coordination issue as: SHADER-STAGE-CACHE-CROSS-ROOT (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7178575111)
What and why
rdna2spirv.stage_ofcached the first carveindex.jsonit read in process-global_STAGESand reused that one mapping for every later shader in the process. When one process translates listings from multiple carve roots, a shader in the second root can inherit the first root's stage, changing stage-dependent translation decisions. This is a concrete cross-shader mutable-state hazard in the area of jean-melikian's shard-only invalid-OpSelectreport.The process-local cache is kept, but is now keyed by the resolved
index.jsonpath. Existing tests that reset_STAGES = Noneremain compatible.Regression test
tests/test_rdna2spirv_stage_cache.pybuilds two synthetic roots with the same shader stem but different stages. Before the fix it failed with:After the fix the second root resolves to its own
csstage. It also checks that repeated lookups in one root still use the cache.Tested
Windows 11, Python 3.14, under the machine coordination lock:
python -m compileall -q tools/rdna2spirv.py tests/test_rdna2spirv_stage_cache.py— pass.python -I tests/test_rdna2spirv_stage_cache.py— 3 tests, OK.python -I tests/test_bvh_shaders_stage.py— 13 tests, OK.python -I tests/test_exe_shaders_stage.py— 11 tests, OK.python -I tests/test_shader_library.py— 22 tests, OK (1 skipped).No GPU or game data used. AI-assisted with Devin.
Consolidated follow-up
This branch now also contains the missing-index follow-up formerly opened as #2194: only successful
index.jsonreads are cached, so an index created later in the same process is probed again instead of being hidden by a cached empty table. The added regression covers missing-then-createdindex.json; the branch head is exactly the previously reviewed #2194 head (c5c367a2a).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.