[PR #465] [MERGED] shader_library: reject --save paths that overlap extraction outputs #515

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/465
Author: @EdenBendheim
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: ubiq/shader-library-save-overlap


📝 Commits (1)

  • 0db11de Reject shader library save paths that overlap extraction outputs

📊 Changes

2 files changed (+187 additions, -24 deletions)

View changed files

📝 tests/test_shader_library.py (+130 -4)
📝 tools/shader_library.py (+57 -20)

📄 Description

Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123317138

What changed

  • tools/shader_library.py: Validate --save with same_report_path against all requested --out outputs (index.json, library.json, selected fspx/ .code/.json/.state including stale-state cleanup paths, matched .dxbc, eligible disasm/ .s, output directories, and ancestors of --out) before creating directories or writing either output. Overlapping paths exit 2 leaving existing files untouched; non-overlapping --save inside a fresh --out tree succeeds because extraction directories are created before opening --save.
  • tests/test_shader_library.py: Synthetic tests covering fresh/existing outputs, path aliases (relative, case-only, symlink, hardlink), ancestor-directory collisions, nested fresh-tree saves, and separate destinations.

Testing & Disclosure

  • AI-assisted: Implemented with Codex (gpt-6.2-sol) and reviewed with Codex (gpt-6.2-astra).
  • Environment: macOS 27.3, Apple M1 Max, Python 3.14.3 (CPU-only, synthetic fixtures, zero game data).
  • Verified on ubiquitarianism/leonida main (8f481cf16): all test_shader_library*.py and test_*report_paths.py suites (76/76), compileall, check_no_game_data.py, LF check — all passed.

🔄 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/465 **Author:** [@EdenBendheim](https://github.com/EdenBendheim) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `ubiq/shader-library-save-overlap` --- ### 📝 Commits (1) - [`0db11de`](https://github.com/ubiquitarianism/leonida/commit/0db11decd03df3941e89f0536a52eeeab1e852f3) Reject shader library save paths that overlap extraction outputs ### 📊 Changes **2 files changed** (+187 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_shader_library.py` (+130 -4) 📝 `tools/shader_library.py` (+57 -20) </details> ### 📄 Description Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123317138 ### What changed - **`tools/shader_library.py`**: Validate `--save` with `same_report_path` against all requested `--out` outputs (`index.json`, `library.json`, selected `fspx/` `.code`/`.json`/`.state` including stale-state cleanup paths, matched `.dxbc`, eligible `disasm/` `.s`, output directories, and ancestors of `--out`) before creating directories or writing either output. Overlapping paths exit `2` leaving existing files untouched; non-overlapping `--save` inside a fresh `--out` tree succeeds because extraction directories are created before opening `--save`. - **`tests/test_shader_library.py`**: Synthetic tests covering fresh/existing outputs, path aliases (relative, case-only, symlink, hardlink), ancestor-directory collisions, nested fresh-tree saves, and separate destinations. ### Testing & Disclosure - **AI-assisted:** Implemented with Codex (`gpt-6.2-sol`) and reviewed with Codex (`gpt-6.2-astra`). - **Environment:** macOS 27.3, Apple M1 Max, Python 3.14.3 (CPU-only, synthetic fixtures, zero game data). - **Verified on `ubiquitarianism/leonida` `main` (`8f481cf16`):** all `test_shader_library*.py` and `test_*report_paths.py` suites (76/76), `compileall`, `check_no_game_data.py`, LF check — all passed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:08 +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#515
No description provided.