[PR #2194] [CLOSED] rdna2spirv: do not cache a missing stage index #2197

Closed
opened 2026-11-26 21:20:22 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2194
Author: @whoalin1
Created: 11/26/2026
Status: ❌ Closed

Base: main ← Head: shader-stage-cache-missing-index


📝 Commits (2)

  • c3ec925 rdna2spirv: cache shader stages per carve root
  • c5c367a rdna2spirv: 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

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.json is 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 _STAGES is 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 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 run, 21 passed + 1 skipped
  • python -m compileall -q tools/rdna2spirv.py tests/test_rdna2spirv_stage_cache.py — PASS

No game data.

AI-assisted.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2194 **Author:** [@whoalin1](https://github.com/whoalin1) **Created:** 11/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `shader-stage-cache-missing-index` --- ### 📝 Commits (2) - [`c3ec925`](https://github.com/ubiquitarianism/leonida/commit/c3ec925623345b5ee2e923e2e83e887fbb68505b) rdna2spirv: cache shader stages per carve root - [`c5c367a`](https://github.com/ubiquitarianism/leonida/commit/c5c367a2a85e25e514a99107e66443d002257938) rdna2spirv: do not cache a missing stage index ### 📊 Changes **2 files changed** (+76 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_rdna2spirv_stage_cache.py` (+67 -0) 📝 `tools/rdna2spirv.py` (+9 -4) </details> ### 📄 Description 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.json` is 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 `_STAGES` is 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 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 run, 21 passed + 1 skipped - `python -m compileall -q tools/rdna2spirv.py tests/test_rdna2spirv_stage_cache.py` — PASS No game data. AI-assisted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:22 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2197
No description provided.