Repository navigation
Conversation
stage_of cached the first index.json it read in process-global _STAGES and reused it for every later shader. A process that translates programs from two carve roots can therefore pick the first root's stage for a shader in the second root, changing stage-dependent codegen. Keep the process-local cache, but key it by the resolved index.json path. The synthetic two-root regression test fails on main with the second root reported as the first root's stage and passes with the fix. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
A carve root without index.json cached an empty stage table for the rest of the process, so creating the index later still left every shader at its fallback stage. Cache only successful index reads; a missing file is probed again on the next lookup. Add a synthetic missing-then-created regression test on top of the per-root cache coverage. Depends on: ProjectLeonida#2154 AI-assisted.
Contributor
Author
|
Additional focused verification on the stacked head c5c367a: tests/test_rdna2spirv_stage_cache.py 3/3 OK; tests/test_bvh_shaders_stage.py 13/13 OK; tests/test_exe_shaders_stage.py 11/11 OK; tests/test_shader_library.py 22 run, 21 passed + 1 skipped. compileall PASS. No game data. |
Contributor
|
Verified on main a73a57e (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_rdna2spirv_stage_cache.py: 3 tests OK. The same test file against main's tools/rdna2spirv.py: 2 failures, so it fails on main and passes with the fix. compileall clean. AI-assisted: yes (Claude Code) |
Contributor
|
Tested
AI-assisted (Claude Code). No game data. |
Contributor
Author
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.
Depends on: #2154
Claimed in the coordination issue as
SHADER-STAGE-CACHE-MISSING-INDEX(comment 7182872123).What
qhukz13's #2154 review noted a remaining edge case: even with the stage cache keyed by carve root, a missing
index.jsonis cached as that root's empty table for the rest of the process. If the index is created later,stage_of()keeps using the fallback stage until_STAGESis reset.This follow-up caches only successful index reads. A missing file is probed again on the next lookup; a root whose index did load is still cached exactly as #2154 intends.
Test
Adds a synthetic missing-then-created regression case to
tests/test_rdna2spirv_stage_cache.py.python -I tests/test_rdna2spirv_stage_cache.py— 3 tests OKpython -I tests/test_bvh_shaders_stage.py— 13 tests OKpython -I tests/test_exe_shaders_stage.py— 11 tests OKpython -I tests/test_shader_library.py— 22 run, 21 passed + 1 skippedpython -m compileall -q tools/rdna2spirv.py tests/test_rdna2spirv_stage_cache.py— PASSNo game data.
AI-assisted.