[PR #1216] [MERGED] feature_scan: ask report_paths for the report-path guard (FEATURE-SCAN-SHARED-REPORT-PATH) #1248

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

📋 Pull Request Information

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

Base: main ← Head: feature-scan-shared-report-path


📝 Commits (2)

  • 772efbb feature_scan: ask report_paths for the report-path guard
  • 495ff9e tests: cover feature_scan refusing an --out that names the optional SPIR-V index

📊 Changes

2 files changed (+35 additions, -13 deletions)

View changed files

📝 tests/test_feature_scan.py (+33 -0)
📝 tools/feature_scan.py (+2 -13)

📄 Description

Claimed in the coordination issue as: FEATURE-SCAN-SHARED-REPORT-PATH (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143542431)

Depends on: none

Fixes: none

What and why

tools/feature_scan.py carried its own same_path (:532, abspath + normcase + samefile) for the --out
guard at :573, which refuses a report written over dxbc/index.json or spirv/index.json: files the scan
reads on the next run. That is the answer tools/report_paths.same_report_path exists to give, and
CONTRIBUTING.md asks a report writer to call it rather than derive it again.

The private copy also missed that helper's folding-volume probe, so on a Linux mount that ignores case (vfat,
exFAT, CIFS) --out INDEX.json passed as another path and replaced the index the scan reads.

The duplicated logic goes (2 insertions, 13 deletions). The tool already puts its own folder on sys.path for
shader_carve, so the import is one line; nothing else in the repository imports feature_scan.same_path, so
the name goes with the duplication. inside_dir keeps its own check: containment in a folder is a different
question from two paths naming one file, and report_paths does not answer it.

Tested

  • tests/test_feature_scan.py, tests/test_feature_scan_bad_index.py, tests/test_feature_scan_code_base.py,
    tests/test_feature_scan_order.py and tests/test_cpu_feature_scan.py: 42 passed, 10 subtests passed.
  • python -I tools/feature_scan.py --help: prints its usage (the import works under -I).
  • python -m compileall -q tools/feature_scan.py: clean.
  • Not tested: the folding-volume case this fixes, which needs a case-folding mount (vfat/exFAT/CIFS); this
    machine is NTFS, where normcase already folds case. tests/test_report_paths.py covers the helper's own
    folding-volume answer.
  • No game files, no GPU; nothing was built.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🔄 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/1216 **Author:** [@breachato](https://github.com/breachato) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `feature-scan-shared-report-path` --- ### 📝 Commits (2) - [`772efbb`](https://github.com/ubiquitarianism/leonida/commit/772efbb17a90619e8135b2dda91875df9ec30593) feature_scan: ask report_paths for the report-path guard - [`495ff9e`](https://github.com/ubiquitarianism/leonida/commit/495ff9e3eca1d1a64fcd51c9542afcad1d452d53) tests: cover feature_scan refusing an --out that names the optional SPIR-V index ### 📊 Changes **2 files changed** (+35 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_feature_scan.py` (+33 -0) 📝 `tools/feature_scan.py` (+2 -13) </details> ### 📄 Description Claimed in the coordination issue as: FEATURE-SCAN-SHARED-REPORT-PATH (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143542431) Depends on: none Fixes: none ### What and why `tools/feature_scan.py` carried its own `same_path` (`:532`, abspath + normcase + samefile) for the `--out` guard at `:573`, which refuses a report written over `dxbc/index.json` or `spirv/index.json`: files the scan reads on the next run. That is the answer `tools/report_paths.same_report_path` exists to give, and CONTRIBUTING.md asks a report writer to call it rather than derive it again. The private copy also missed that helper's folding-volume probe, so on a Linux mount that ignores case (vfat, exFAT, CIFS) `--out INDEX.json` passed as another path and replaced the index the scan reads. The duplicated logic goes (2 insertions, 13 deletions). The tool already puts its own folder on `sys.path` for `shader_carve`, so the import is one line; nothing else in the repository imports `feature_scan.same_path`, so the name goes with the duplication. `inside_dir` keeps its own check: containment in a folder is a different question from two paths naming one file, and `report_paths` does not answer it. ### Tested - `tests/test_feature_scan.py`, `tests/test_feature_scan_bad_index.py`, `tests/test_feature_scan_code_base.py`, `tests/test_feature_scan_order.py` and `tests/test_cpu_feature_scan.py`: **42 passed**, 10 subtests passed. - `python -I tools/feature_scan.py --help`: prints its usage (the import works under `-I`). - `python -m compileall -q tools/feature_scan.py`: clean. - **Not tested:** the folding-volume case this fixes, which needs a case-folding mount (vfat/exFAT/CIFS); this machine is NTFS, where `normcase` already folds case. `tests/test_report_paths.py` covers the helper's own folding-volume answer. - No game files, no GPU; nothing was built. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:35 +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#1248
No description provided.