SHADER-DISASM-PER-RUN-FAILED: shader_disasm: use a per-run failed list in main() and handle read OSError #908

Merged
markankamaransheogarat-sys merged 1 commit from upstream-pr/908 into main 2026-11-30 08:14:40 +00:00
markankamaransheogarat-sys commented 2026-11-24 15:09:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by markankamaransheogarat-sys on 2026-11-24T15:09:33Z.


Summary

  • Pass a per-run failed list into one() from main(argv=None) instead of mutating module-level FAILED across calls.
  • Catch OSError when reading .fssm inputs in one() and record (path, reason) cleanly rather than crashing the thread pool.

Verification

  • python3 -I tests/test_shader_disasm.py: 32/32 passed.

AI-assisted: yes (synthetic tests only, no game files).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5474818677 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/908). Originally posted by [markankamaransheogarat-sys](https://github.com/markankamaransheogarat-sys) on 2026-11-24T15:09:33Z. --- ### Summary - Pass a per-run `failed` list into `one()` from `main(argv=None)` instead of mutating module-level `FAILED` across calls. - Catch `OSError` when reading `.fssm` inputs in `one()` and record `(path, reason)` cleanly rather than crashing the thread pool. ### Verification - `python3 -I tests/test_shader_disasm.py`: 32/32 passed. AI-assisted: yes (synthetic tests only, no game files).
PierreEbele commented 2026-11-24 19:34:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-24T19:34:39Z.


Reviewed f82cee5: ran tests/test_shader_disasm.py (32 OK here, 30 on main) plus in-process probes on both main and this head. On main a stale FAILED entry made a perfectly clean run exit 1 ("1 shader(s) produced no disassembly, first stale.fssm: old failure"); this head returns 0 and leaves FAILED untouched. An unreadable .fssm escaped one() on main as an uncaught FileNotFoundError traceback that aborted the run; this head prints a one-line "N shader(s) produced no disassembly, first : " and exits 1, and a 4-thread run with two unreadable files counts both and names the first. No regressions found; FAILED stays as one()'s default target for back-compat, but nothing in-repo reads it anymore. gh is disabled for me, so I could not check the coordination-issue claim. AI-assisted review.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142296371 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/908#issuecomment-7142296371). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-24T19:34:39Z. --- Reviewed f82cee5: ran tests/test_shader_disasm.py (32 OK here, 30 on main) plus in-process probes on both main and this head. On main a stale FAILED entry made a perfectly clean run exit 1 ("1 shader(s) produced no disassembly, first stale.fssm: old failure"); this head returns 0 and leaves FAILED untouched. An unreadable .fssm escaped one() on main as an uncaught FileNotFoundError traceback that aborted the run; this head prints a one-line "N shader(s) produced no disassembly, first <path>: <reason>" and exits 1, and a 4-thread run with two unreadable files counts both and names the first. No regressions found; FAILED stays as one()'s default target for back-compat, but nothing in-repo reads it anymore. gh is disabled for me, so I could not check the coordination-issue claim. AI-assisted review.
TheGeogeo commented 2026-11-29 15:24:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T15:24:50Z.


Tested 18e0304d5 merged (no commit) with main c22a0a732: Python 3.12.4, Windows 11 10.0.26300, CPU only.

  • Green: python -I tests/test_shader_disasm.py gives 36 tests OK.
  • Red: with tools/shader_disasm.py back to main, 2 tests error with TypeError: main() takes 0 positional arguments but 1 was given: test_main_ignores_module_failed_state_between_calls and test_unreadable_fssm_reports_clean_error_without_leaking_failed.
  • Base: main's own tests/test_shader_disasm.py gives 34 tests OK, so there is no regression. check_no_game_data.py is clean.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258069661 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/908#issuecomment-7258069661). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T15:24:50Z. --- Tested `18e0304d5` merged (no commit) with `main` `c22a0a732`: Python 3.12.4, Windows 11 10.0.26300, CPU only. - Green: `python -I tests/test_shader_disasm.py` gives 36 tests OK. - Red: with `tools/shader_disasm.py` back to `main`, 2 tests error with `TypeError: main() takes 0 positional arguments but 1 was given`: `test_main_ignores_module_failed_state_between_calls` and `test_unreadable_fssm_reports_clean_error_without_leaking_failed`. - Base: `main`'s own `tests/test_shader_disasm.py` gives 34 tests OK, so there is no regression. `check_no_game_data.py` is clean. AI-assisted (Claude Code).
OreoFR commented 2026-11-29 19:17:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T19:17:46Z.


Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, spirv-tools + llvm-mc, main 7c330c76d (also merges cleanly on current main dd87aa405; does not force a rebase of #2566), PR head 18e0304d5 : red 2 errors / green 36 OK, 0 skipped

python3.12 -I tests/test_shader_disasm.py:

  • Red (main + this PR's test file): 34/36, 2 errors TypeError: main() takes 0 positional arguments — a signature red, so I also checked behaviour with a copy of the test passing args via sys.argv: on main both cases fail for the intended reasons (the FAILED state leaks between calls; PermissionError is not caught); on the merge the copy passes.
  • Green: 36/36, 0 skipped. Reviews: none.
  • Diff: main(argv=None), a per-run failed list passed to one(), read OSError reported cleanly. Nit: one() still appends to the global FAILED when no failed is passed. No game data.

Verdict: READY

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7261166147 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/908#issuecomment-7261166147). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T19:17:46Z. --- Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, spirv-tools + llvm-mc, main 7c330c76d (also merges cleanly on current main dd87aa405; does not force a rebase of #2566), PR head 18e0304d5 : red 2 errors / green 36 OK, 0 skipped `python3.12 -I tests/test_shader_disasm.py`: - **Red** (main + this PR's test file): 34/36, 2 errors `TypeError: main() takes 0 positional arguments` — a signature red, so I also checked behaviour with a copy of the test passing args via `sys.argv`: on main both cases fail for the intended reasons (the `FAILED` state leaks between calls; `PermissionError` is not caught); on the merge the copy passes. - **Green**: 36/36, 0 skipped. Reviews: none. - Diff: `main(argv=None)`, a per-run `failed` list passed to `one()`, read `OSError` reported cleanly. Nit: `one()` still appends to the global `FAILED` when no `failed` is passed. No game data. **Verdict: READY** AI-assisted: Claude Code
MoonEyes commented 2026-11-30 08:14:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T08:14:48Z.


Merged. Tested by @TheGeogeo on head 18e0304d5 (CPU only (Windows 11)): test_shader_disasm.py: red with tool reverted 2 TypeError errors, green 36 OK. The CI jobs that are red on this head were also red on main at the time of the run. Thanks @markankamaransheogarat-sys!

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7272663522 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/908#issuecomment-7272663522). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T08:14:48Z. --- Merged. Tested by @TheGeogeo on head 18e0304d5 (CPU only (Windows 11)): test_shader_disasm.py: red with tool reverted 2 TypeError errors, green 36 OK. The CI jobs that are red on this head were also red on main at the time of the run. Thanks @markankamaransheogarat-sys! AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!908
No description provided.