[PR #2095] [CLOSED] shaders: fill fspx_state_sha256 from library sidecars (FSPX-LIBRARY-STATE-FILL) #2103

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2095
Author: @Undefined3301
Created: 11/25/2026
Status: ❌ Closed

Base: main ← Head: fspx-library-state-fill


📝 Commits (1)

  • 43125ab shaders: fill fspx_state_sha256 from library sidecars

📊 Changes

2 files changed (+166 additions, -0 deletions)

View changed files

➕ tests/test_fill_fspx_library_states.py (+84 -0)
➕ tools/fill_fspx_library_states.py (+82 -0)

📄 Description

Item: FSPX-LIBRARY-STATE-FILL

What

Adds tools/fill_fspx_library_states.py, which fills a missing fspx_state_sha256 in an existing pipeline-library translation index (<shaders>/library/index.json) from its <name>.state sidecars, plus tests/test_fill_fspx_library_states.py (standard library only, synthetic state files).

Why

An FSPX program that carries a kind-0 state is matched by both fspx_code_sha256 and fspx_state_sha256 (ShaderLibrary::program_candidates, runtime/src/shader_library.h). An index entry written before the sidecar key was recorded has the code hash but no state hash, so the incoming state filters every entry out and the pipeline is stubbed even though its translation exists.

Measured

Retail boot, RTX 4080, NVIDIA 621.24: 934 distinct FSPX compute programs reached slot 67 with a kind-0 state and were refused (no translated compute shader ... entries 1). 923 have a translation and a .state sidecar but no state key. After filling the index the count drops to 11 (the 29-program FidelityFX DLL has 27 translated here; 2 still fail the decoder) and those 923 pipelines are created for real. The boot then reaches the story transition instead of stalling one scene earlier.

The 923 entries are translations the current translator no longer reproduces (fall-through into undecodable words), so re-running library_shaders drops them rather than recording the key; the tool repairs an existing work folder in place and is idempotent (second run: 0 added).

Tests

python -I tests/test_fill_fspx_library_states.py     # 5 tests, OK
python -m compileall -q tools/fill_fspx_library_states.py tests/test_fill_fspx_library_states.py

AI-assisted: yes (DeepSeek V4.1 Flash via OpenCode/T3 Code). The tool writes LF and sorts keys atomically like the translator; no game data is in the test.


🔄 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/2095 **Author:** [@Undefined3301](https://github.com/Undefined3301) **Created:** 11/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fspx-library-state-fill` --- ### 📝 Commits (1) - [`43125ab`](https://github.com/ubiquitarianism/leonida/commit/43125ab2b640735873f592d7b4f75f6b801cef65) shaders: fill fspx_state_sha256 from library sidecars ### 📊 Changes **2 files changed** (+166 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_fill_fspx_library_states.py` (+84 -0) ➕ `tools/fill_fspx_library_states.py` (+82 -0) </details> ### 📄 Description Item: FSPX-LIBRARY-STATE-FILL ## What Adds `tools/fill_fspx_library_states.py`, which fills a missing `fspx_state_sha256` in an existing pipeline-library translation index (`<shaders>/library/index.json`) from its `<name>.state` sidecars, plus `tests/test_fill_fspx_library_states.py` (standard library only, synthetic state files). ## Why An FSPX program that carries a kind-0 state is matched by both `fspx_code_sha256` and `fspx_state_sha256` (`ShaderLibrary::program_candidates`, `runtime/src/shader_library.h`). An index entry written before the sidecar key was recorded has the code hash but no state hash, so the incoming state filters every entry out and the pipeline is stubbed even though its translation exists. ## Measured Retail boot, RTX 4080, NVIDIA 621.24: 934 distinct FSPX compute programs reached slot 67 with a kind-0 state and were refused (`no translated compute shader ... entries 1`). 923 have a translation and a `.state` sidecar but no state key. After filling the index the count drops to 11 (the 29-program FidelityFX DLL has 27 translated here; 2 still fail the decoder) and those 923 pipelines are created for real. The boot then reaches the story transition instead of stalling one scene earlier. The 923 entries are translations the current translator no longer reproduces (`fall-through into undecodable words`), so re-running `library_shaders` drops them rather than recording the key; the tool repairs an existing work folder in place and is idempotent (second run: 0 added). ## Tests ```` python -I tests/test_fill_fspx_library_states.py # 5 tests, OK python -m compileall -q tools/fill_fspx_library_states.py tests/test_fill_fspx_library_states.py ```` AI-assisted: yes (DeepSeek V4.1 Flash via OpenCode/T3 Code). The tool writes LF and sorts keys atomically like the translator; no game data is in the test. --- <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:02 +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#2103
No description provided.