wave32_pixel_scan: use shared same_report_path and catch --out write OSError (DRAFT-301) #932

Closed
fin-github wants to merge 1 commit from upstream-pr/932 into main
fin-github commented 2026-11-24 15:17:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fin-github on 2026-11-24T15:17:14Z.


Claimed in the coordination issue as: DRAFT-301 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135362620)

Supersedes draft #301, carried over from the original repository. This is the same commit rebased onto current main, with the original author (EspadaHD) kept and git cherry-pick -x recording where it came from. The change and its explanation are theirs; see #301 for the original description.

Tested

  • python -I tests/test_wave32_pixel_scan.py: OK
  • python -I scripts/check_no_game_data.py on the changed files: clean.

Windows 11 (10.0.26200), Python 3.14.4. No game files, nothing online.

AI-assisted (Claude Code): rebasing, conflict resolution and test runs.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5474956839 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/932). Originally posted by [fin-github](https://github.com/fin-github) on 2026-11-24T15:17:14Z. --- Claimed in the coordination issue as: `DRAFT-301` (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135362620) Supersedes draft #301, carried over from the original repository. This is the same commit rebased onto current `main`, with the original author (EspadaHD) kept and `git cherry-pick -x` recording where it came from. The change and its explanation are theirs; see #301 for the original description. ### Tested - `python -I tests/test_wave32_pixel_scan.py`: OK - `python -I scripts/check_no_game_data.py` on the changed files: clean. Windows 11 (10.0.26200), Python 3.14.4. No game files, nothing online. AI-assisted (Claude Code): rebasing, conflict resolution and test runs.
PierreEbele commented 2026-11-25 21:37:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T21:37:57Z.


Reviewed d1dc202: wave32_pixel_scan refuses a --out that names a scanned listing through any spelling and reports a failed report write with exit 2 instead of a traceback; two tests added. I ran tests/test_wave32_pixel_scan.py (15/15 on the PR; both new tests error on main) and a CLI probe with a hand-built disasm: the write-failure fix and the listing-alias refusal behave as intended. Finding: the scan also reads the carve index.json (stage_of) and fssm/<name>.fssm (wave size), but the new guard protects only the listings - --out <root>/index.json and --out <root>/fssm/ps_lane.fssm still exit 0 and overwrite those inputs, here and on main, while wave64_graphics_scan refuses the same invocations (metadata_paths). Suggest extending the guard to those inputs in this PR. Measured guard cost: ~0.75s over 20k listings, same profile as the merged wave64 guard. AI-assisted review.

Recommendation: Fix first

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7175335985 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/932#issuecomment-7175335985). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T21:37:57Z. --- Reviewed d1dc202: wave32_pixel_scan refuses a `--out` that names a scanned listing through any spelling and reports a failed report write with exit 2 instead of a traceback; two tests added. I ran `tests/test_wave32_pixel_scan.py` (15/15 on the PR; both new tests error on main) and a CLI probe with a hand-built disasm: the write-failure fix and the listing-alias refusal behave as intended. Finding: the scan also reads the carve `index.json` (stage_of) and `fssm/<name>.fssm` (wave size), but the new guard protects only the listings - `--out <root>/index.json` and `--out <root>/fssm/ps_lane.fssm` still exit 0 and overwrite those inputs, here and on main, while wave64_graphics_scan refuses the same invocations (metadata_paths). Suggest extending the guard to those inputs in this PR. Measured guard cost: ~0.75s over 20k listings, same profile as the merged wave64 guard. AI-assisted review. **Recommendation:** Fix first
MoonEyes commented 2026-11-27 19:44:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T19:44:20Z.


Thanks a lot for this, @fin-github. The same change is in #898: it carries the same commit by EspadaHD (from draft #301) with the same diff to tools/wave32_pixel_scan.py and tests/test_wave32_pixel_scan.py. It was claimed first in #14 as OLD-10033 (a few seconds before the DRAFT-301 line of your batch claim) and opened before this one.

I am closing this one so the review happens in one place. Please continue the discussion on #898, or reopen this one if you see something it misses.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226822719 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/932#issuecomment-7226822719). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T19:44:20Z. --- Thanks a lot for this, @fin-github. The same change is in #898: it carries the same commit by EspadaHD (from draft #301) with the same diff to `tools/wave32_pixel_scan.py` and `tests/test_wave32_pixel_scan.py`. It was claimed first in #14 as OLD-10033 (a few seconds before the DRAFT-301 line of your batch claim) and opened before this one. I am closing this one so the review happens in one place. Please continue the discussion on #898, or reopen this one if you see something it misses. AI-assisted (Claude Code, Claude Opus 5.5)

Pull request closed

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!932
No description provided.